Page 1 of 1

Assign Text Value To R , G And B Channels

PostPosted: Wed Dec 06, 2017 12:43 am
by Chris Okyen
I have two background tools merged to a merge tool. The merge blends the foreground. I want to get the red , blue and green values at the location where they overlap and blend. I want to assign those values to text+ tools. How to I obtain the red blue and green values at a location of the merge where they overlap? I tried endlessly to use the getr1d(x,y) with the custom tool and googled for answers and saw nothing the attachment shows the comp and the overlap merge.

Re: Assign Text Value To R , G And B Channels

PostPosted: Thu Dec 07, 2017 3:26 pm
by Thomas Milde
I have no 100% solution, but do you know about the tool "probe"?
You can right-click any value and select "modify with -> probe". Maybe there is some way to read out the values of the probe and convert them to text.
YOu can connect the center of the probe to the center of the merge and use an offset to get the value at the border.
Or did I misunderstand and you just want to copy the color value to the text tool? This should be easy with probe. (works in free version)

Re: Assign Text Value To R , G And B Channels

PostPosted: Thu Dec 07, 2017 7:27 pm
by Bryan Ray
In this set-up, there's a User Control on the Text+ tool that is connected to a Probe Modifier that is sampling the Background tool. The Styled Text field gets an expression that simply reads from the User Control.

Code: Select all
{
   Tools = ordered() {
      Text1 = TextPlus {
         CtrlWZoom = false,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            Font = Input { Value = "Arial", },
            StyledText = Input {
               Value = "Red: 0.063402518630028",
               Expression = "Text(\"Red: \" .. red)",
            },
            Style = Input { Value = "Bold", },
            ManualFontKerningPlacement = Input {
               Value = StyledText {
                  Array = {
                  },
                  Value = "",
               },
            },
            ShadingGradient1 = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
            RenderToDPTFile = Input { Disabled = true, },
            DPTType = Input { Disabled = true, },
            DPTResolution = Input { Disabled = true, },
            red = Input {
               SourceOp = "Probe1",
               Source = "Result",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 115.5, }, },
         UserControls = ordered() {
            red = {
               LINKID_DataType = "Number",
               INP_Default = 0,
               INPID_InputControl = "SliderControl",
               IC_ControlPage = 1,
            },
         },
      },
      Probe1 = Probe {
         CtrlWZoom = false,
         Inputs = {
            ImageToProbe = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Position = Input { Value = { 0.318639798488665, 0.220357941834452, }, },
         },
      },
      Background1 = Background {
         Inputs = {
            GlobalIn = Input { Value = 1, },
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            TopLeftRed = Input { Value = 0.0634025153977537, },
            TopLeftGreen = Input { Value = 0.145385849593706, },
            TopLeftBlue = Input { Value = 0.05, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 605, 181.5, }, },
      },
      Merge1 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 181.5, }, },
      },
   },
}

Re: Assign Text Value To R , G And B Channels

PostPosted: Fri Dec 08, 2017 12:43 am
by Chris Okyen
Thank you both. Can't wait to try it out!! :D