Jump to: Board index » General » Fusion

Using expressions inside CustomTool?

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Lucas Pfaff

  • Posts: 296
  • Joined: Mon Dec 03, 2012 3:35 pm

Using expressions inside CustomTool?

PostWed Oct 14, 2015 4:44 pm

Hi friends,

I have an issue with creating a tool, to be more precise with setting up a proper link.

Inside the channel expression of the CustomTool Node, I want to link to the slider of the Macro. What I tried was just writing down the knob-name as usual, but that doesn't link at all and gives an "error", so basically a pure black image. I build an example to show you what I mean:

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            TopLeftRed = Input { Value = 0.5, },
            TopLeftGreen = Input { Value = 0.5, },
            TopLeftBlue = Input { Value = 0.5, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1045, 82.5, }, },
      },
      MacroJack = GroupOperator {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = ordered() {
            Input1 = InstanceInput {
               SourceOp = "PipeRouter1",
               Source = "Input",
            },
            Newcontrol = Input { Value = 0.5, },
         },
         Outputs = {
            Output1 = InstanceOutput {
               SourceOp = "PipeRouter2",
               Source = "Output",
            },
         },
         ViewInfo = GroupInfo {
            Pos = { 1045, 247.5, },
            Flags = {
               Expanded = true,
               AllowPan = false,
               ForceSource = true,
               GridSnap = true,
               ConnectedSnap = true,
               AutoSnap = true,
               RemoveRouters = true,
            },
            Size = { 126, 197, },
            Direction = "Vertical",
            PipeStyle = "Direct",
            Scale = 1,
            Offset = { -1045, -270, },
         },
         Tools = ordered() {
            CustomTool1 = Custom {
               Inputs = {
                  LUTIn1 = Input {
                     SourceOp = "CustomTool1LUTIn11",
                     Source = "Value",
                  },
                  LUTIn2 = Input {
                     SourceOp = "CustomTool1LUTIn21",
                     Source = "Value",
                  },
                  LUTIn3 = Input {
                     SourceOp = "CustomTool1LUTIn31",
                     Source = "Value",
                  },
                  LUTIn4 = Input {
                     SourceOp = "CustomTool1LUTIn41",
                     Source = "Value",
                  },
                  RedExpression = Input { Value = "MacroJack.Newcontrol", },
                  BlueExpression = Input { Value = "1-MacroJack.Newcontrol", },
                  Image1 = Input {
                     SourceOp = "PipeRouter1",
                     Source = "Output",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 1045, 346.5, }, },
            },
            PipeRouter1 = PipeRouter {
               Inputs = {
                  Input = Input {
                     SourceOp = "Background1",
                     Source = "Output",
                  },
               },
               ViewInfo = PipeRouterInfo { Pos = { 1045, 280.5, }, },
            },
            PipeRouter2 = PipeRouter {
               Inputs = {
                  Input = Input {
                     SourceOp = "CustomTool1",
                     Source = "Output",
                  },
               },
               ViewInfo = PipeRouterInfo { Pos = { 1045, 412.5, }, },
            },
         },
         Colors = {
            TileColor = { R = 0.501960784313725, G = 0, B = 0.501960784313725, },
            TextColor = { R = 0, G = 0, B = 0, },
         },
         UserControls = ordered() {
            Newcontrol = {
               LINKS_Name = "New control",
               INP_MaxAllowed = 1,
               INP_MinAllowed = 0,
               LINKID_DataType = "Number",
               INP_Default = 0,
               INPID_InputControl = "SliderControl",
            },
         },
      },
      CustomTool1LUTIn11 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
            },
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0, },
         NameSet = true,
      },
      CustomTool1LUTIn21 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
            },
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0, },
         NameSet = true,
      },
      CustomTool1LUTIn31 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
            },
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204, },
         NameSet = true,
      },
      CustomTool1LUTIn41 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333, }, Flags = { Linear = true, }, },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667, }, Flags = { Linear = true, }, },
            },
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204, },
         NameSet = true,
      },
   },
}



What can I do to make this work? :)
Offline
User avatar

Chad Capeland

  • Posts: 3025
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: Using expressions inside CustomTool?

PostWed Oct 14, 2015 7:34 pm

Use the Number In controls on the Controls tab.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Lucas Pfaff

  • Posts: 296
  • Joined: Mon Dec 03, 2012 3:35 pm

Re: Using expressions inside CustomTool?

PostThu Oct 15, 2015 10:05 am

Hey there Chad,

I tried it by typing "g1+NumberIn1" into the green channel, that blacks out the channel too :(

NumberIn1 should be the name used in expressions, right? Or do I have to set this up differently?

Best,
Rick
Offline
User avatar

michael vorberg

  • Posts: 943
  • Joined: Wed Nov 12, 2014 8:47 pm
  • Location: stuttgart, germany

Re: Using expressions inside CustomTool?

PostThu Oct 15, 2015 12:25 pm

n1 is the correct name

Alot of this is covered in the tool reference manual
Offline

Lucas Pfaff

  • Posts: 296
  • Joined: Mon Dec 03, 2012 3:35 pm

Re: Using expressions inside CustomTool?

PostThu Oct 15, 2015 2:38 pm

Hi Michael,

that would be the next question, where I can find additional input on that. Because I find it really confusing at times :(
I now found the tool ref guide on the BMD site, unfortunately not directly linked in Fusion through the help menu where I looked for such a thing. Thanks a bunch for the heads up!

Thank you so much for the help with the n1-parameter too, that did the trick :)

Return to Fusion

Who is online

Users browsing this forum: No registered users and 26 guests