Jump to: Board index » General » Fusion

Assign Text Value To R , G And B Channels

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

Chris Okyen

  • Posts: 2
  • Joined: Wed Dec 06, 2017 12:16 am

Assign Text Value To R , G And B Channels

PostWed Dec 06, 2017 12:43 am

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.
Attachments
image.png
image.png (52.19 KiB) Viewed 141 times
Offline
User avatar

Thomas Milde

  • Posts: 102
  • Joined: Tue Aug 28, 2012 11:27 am
  • Location: Augsburg, Germany

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

PostThu Dec 07, 2017 3:26 pm

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)
Offline
User avatar

Bryan Ray

  • Posts: 249
  • Joined: Mon Nov 28, 2016 5:32 am

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

PostThu Dec 07, 2017 7:27 pm

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, }, },
      },
   },
}
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline

Chris Okyen

  • Posts: 2
  • Joined: Wed Dec 06, 2017 12:16 am

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

PostFri Dec 08, 2017 12:43 am

Thank you both. Can't wait to try it out!! :D

Return to Fusion

Who is online

Users browsing this forum: No registered users and 9 guests