Jump to: Board index » General » Fusion

Can I change CCv curves using an expression?

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

Abdelrahman Magdy

  • Posts: 291
  • Joined: Fri Jan 23, 2015 10:08 pm

Can I change CCv curves using an expression?

PostFri Jun 22, 2018 8:39 pm

I am creating a macro that will include multiple CCv nodes. I want to have another CCv node in the macro that acts as a View Control. I will expose its curve to the user and I want it to change the value of either curve based on the user selection.

To understand what I want to do exactly, look at this image.

comp.PNG
comp.PNG (39.58 KiB) Viewed 382 times

As you see I have two curves controlled with a Dissolve. As the note says, if the Dissolve is set to 0, I want the ViewControl (which is another CCv node) to load the values of curve1, and to change it if the user changes the ViewControl curve. The same happens with curve2 if the Dissolve is set to 1.

Is there a way to do that with an expression, like what we do with any other node when we want to change one of its values using based on another one?

Here is the actual comp.
Code: Select all
{
   Tools = ordered() {
      curve2 = ColorCurves {
         PickColor = true,
         NameSet = true,
         Inputs = {
            Red = Input {
               SourceOp = "curve2Red",
               Source = "Value",
            },
            Green = Input {
               SourceOp = "curve2Green",
               Source = "Value",
            },
            Blue = Input {
               SourceOp = "curve2Blue",
               Source = "Value",
            },
            Alpha = Input {
               SourceOp = "curve2Alpha",
               Source = "Value",
            },
            NumberOfSamplesOnMatchCurve = Input { Value = 64, },
            IgnoreTransparent = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 378, 79 } },
         Tools = {
            curve2Red = LUTBezier {
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333333333333333, 0.666666666666667 }, Flags = { Linear = true } },
                     [1] = { 0, LH = { 0.666666666666667, 0.333333333333333 }, Flags = { Linear = true } }
                  }
               },
               SplineColor = { Red = 255, Green = 52, Blue = 52 },
               NameSet = true,
            },
            curve2Green = LUTBezier {
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333333333333333, 0.666666666666667 }, Flags = { Linear = true } },
                     [1] = { 0, LH = { 0.666666666666667, 0.333333333333333 }, Flags = { Linear = true } }
                  }
               },
               SplineColor = { Red = 0, Green = 255, Blue = 0 },
               NameSet = true,
            },
            curve2Blue = LUTBezier {
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333333333333333, 0.666666666666667 }, Flags = { Linear = true } },
                     [1] = { 0, LH = { 0.666666666666667, 0.333333333333333 }, Flags = { Linear = true } }
                  }
               },
               SplineColor = { Red = 68, Green = 68, Blue = 255 },
               NameSet = true,
            },
            curve2Alpha = LUTBezier {
               KeyColorSplines = {
                  [0] = {
                     [0] = { 1, RH = { 0.333333333333333, 0.666666666666667 }, Flags = { Linear = true } },
                     [1] = { 0, LH = { 0.666666666666667, 0.333333333333333 }, Flags = { Linear = true } }
                  }
               },
               SplineColor = { Red = 204, Green = 204, Blue = 204 },
               NameSet = true,
            }
         },
      },
      Note1 = Note {
         Inputs = {
            Comments = Input { Value = "I want the curve of this node to show the curve from one of the other two CCv nodes, based on the value of the Dissolve node.\n\nSo,\n\nIf Dissolve.Mix = 0 then\n   Show curve1\n\nIf Dissolve.Mix = 1 then\n   Show curve2", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 571.275, -24.9242 },
            Flags = {
               Expanded = true
            },
            Size = { 311.122, 153.218 }
         },
      },
      ViewControl = ColorCurves {
         PickColor = true,
         NameSet = true,
         Inputs = {
            Red = Input {
               SourceOp = "ViewControlRed",
               Source = "Value",
            },
            Green = Input {
               SourceOp = "ViewControlGreen",
               Source = "Value",
            },
            Blue = Input {
               SourceOp = "ViewControlBlue",
               Source = "Value",
            },
            Alpha = Input {
               SourceOp = "ViewControlAlpha",
               Source = "Value",
            },
            NumberOfSamplesOnMatchCurve = Input { Value = 64, },
            IgnoreTransparent = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 582, 146 } },
         Tools = {
            ViewControlRed = 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 = 255, Green = 52, Blue = 52 },
               NameSet = true,
            },
            ViewControlGreen = 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 = 255, Blue = 0 },
               NameSet = true,
            },
            ViewControlBlue = 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 = 68, Green = 68, Blue = 255 },
               NameSet = true,
            },
            ViewControlAlpha = 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,
            }
         },
      },
      Dissolve1 = Dissolve {
         Transitions = {
            [0] = "DFTDissolve"
         },
         CtrlWZoom = false,
         Inputs = {
            Background = Input {
               SourceOp = "curve1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "curve2",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 378, 147 } },
      },
      curve1 = ColorCurves {
         PickColor = true,
         NameSet = true,
         Inputs = {
            Red = Input {
               SourceOp = "ColorCurves1Red",
               Source = "Value",
            },
            Green = Input {
               SourceOp = "ColorCurves1Green",
               Source = "Value",
            },
            Blue = Input {
               SourceOp = "ColorCurves1Blue",
               Source = "Value",
            },
            Alpha = Input {
               SourceOp = "ColorCurves1Alpha",
               Source = "Value",
            },
            NumberOfSamplesOnMatchCurve = Input { Value = 64, },
            IgnoreTransparent = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 244, 147 } },
         Tools = {
            ColorCurves1Red = 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 = 255, Green = 52, Blue = 52 },
               NameSet = true,
            },
            ColorCurves1Green = 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 = 255, Blue = 0 },
               NameSet = true,
            },
            ColorCurves1Blue = 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 = 68, Green = 68, Blue = 255 },
               NameSet = true,
            },
            ColorCurves1Alpha = 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,
            }
         },
      }
   }
}
System specs:
Resolve Studio version: 16.1.0.055
Fusion Studio version: 9.0.2
OS: CentOS 7
CPU: Intel i7-4790k 4GHz Quad-Core
RAM: 32GB
GPU: NVIDIA GeForce 1080 Ti 11GB

Return to Fusion

Who is online

Users browsing this forum: No registered users and 58 guests