Jump to: Board index » General » Fusion

How do I add an expression to a background node Color Input

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

callmedoug

  • Posts: 1
  • Joined: Fri May 09, 2025 11:33 pm
  • Real Name: Douglas Portz

How do I add an expression to a background node Color Input

PostFri May 09, 2025 11:38 pm

I have a background with a user control called T1_Hit_State. it is a slider with 3 states 1, 2, and 3.

I would like the following colors in each state
1 - Red 2 - White 3 - Green

I want to use the color input and not the individual colors. so basically for Red {1,0,0] for White [1,1,1] and Green [0,0,1]

but for the life of me i can figure out the syntax.

I tried right clicking on Type and selecting Expression, but no matter what I type in, my background is invisible.

even the basic syntax to make the color 1,0,0 make the background invisible. what am i doing wrong?
Offline

Sander de Regt

  • Posts: 4092
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: How do I add an expression to a background node Color In

PostSat May 10, 2025 7:38 am

This should do it:

Code: Select all
{
   Tools = ordered() {
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            Slder = Input {
               Value = Number {
                  Value = 3
               },
            },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Expression = "Slider == 2 and 0 or 1", },
            TopLeftGreen = Input {
               Value = 1,
               Expression = "Slider == 0 and 0 or 1",
            },
            TopLeftBlue = Input { Expression = "Slider == 1 and 1 or 0", },
            Slider = Input { Value = 2, }
         },
         ViewInfo = OperatorInfo { Pos = { 385, -16.5 } },
         UserControls = ordered() {
            Slider = {
               INP_Integer = true,
               INPID_InputControl = "SliderControl",
               IC_Steps = 2,
               INP_MaxScale = 2,
               INP_MinScale = 1,
               LINKID_DataType = "Number",
               ICS_ControlPage = "Color",
               ICD_Center = 2,
               INP_SplineType = "Default",
               LINKS_Name = "Slider",
            }
         }
      }
   },
   ActiveTool = "Background1"
}
Sander de Regt

ShadowMaker SdR
The Netherlands

Return to Fusion

Who is online

Users browsing this forum: KrunoSmithy and 25 guests