Jump to: Board index » General » Fusion

Bug: Expressions mangled when tools are renamed

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

Stefan Ihringer

  • Posts: 257
  • Joined: Mon Nov 10, 2014 10:40 pm

Bug: Expressions mangled when tools are renamed

PostWed Jan 14, 2015 3:29 pm

Here's a small comp where a tool is called "Background" and it has an expression that refers to some other tool's "Background" input via the expression "Merge1.Background.OriginalWidth"

Code: Select all
{
   Tools = ordered() {
      Background = Background {
         CtrlWZoom = false,
         NameSet = true,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 200, },
            Width = Input {
               Value = 1280,
               Expression = "Merge1.Background.OriginalWidth",
            },
            Height = Input {
               Value = 720,
               Expression = "Merge1.Background.OriginalHeight",
            },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
            Comments = Input { Value = "rename me", },
         },
         ViewInfo = OperatorInfo { Pos = { 388, 133, }, },
      },
      Background1 = Background {
         CtrlWZoom = false,
         Inputs = {
            GlobalIn = Input { Value = 1, },
            GlobalOut = Input { Value = 200, },
            Width = Input { Value = 1280, },
            Height = Input { Value = 720, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2", }, },
            Gradient = Input {
               Value = Gradient {
                  Colors = {
                     [0] = { 0, 0, 0, 1, },
                     [1] = { 1, 1, 1, 1, },
                  },
               },
            },
         },
         ViewInfo = OperatorInfo { Pos = { 264, 136, }, },
      },
      Merge1 = Merge {
         CtrlWZoom = false,
         Inputs = {
            Background = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 264, 249, }, },
      },
   },
}


Now, if the Background tool is renamed to, say, "Mytool", the automatic renaming inside expressions gets a bit too greedy. It will rename the expression to "Merge1.Mytool.OriginalWidth".
blog and Fusion stuff: http://comp-fu.com/2012/06/fusion-script-macro-collection/
Offline
User avatar

Rony Soussan

  • Posts: 727
  • Joined: Tue Nov 11, 2014 5:33 pm

Re: Bug: Expressions mangled when tools are renamed

PostWed Jan 14, 2015 5:39 pm

That is correct. It is doing what it should do. Essentially, you are making connection to a 'node' not the nodes name. On change, the expression reads the input tool and displays the tools name in the expression (of course it's probably more complex than that)

Curious, why is that behavior not working for you?
Offline

Stu Friedberg

  • Posts: 41
  • Joined: Tue Nov 11, 2014 11:35 pm

Re: Bug: Expressions mangled when tools are renamed

PostWed Jan 14, 2015 5:56 pm

Rony, I think his point is that there are two independent uses of the name "Background" in his example. Renaming the one tool changed both uses, but the 2nd, independent use should have been unaffected because it refers to an external tool that is not being renamed at the same time. In fact, it refers to a property/input of an external tool that probably should never be renamed.
Offline
User avatar

Rony Soussan

  • Posts: 727
  • Joined: Tue Nov 11, 2014 5:33 pm

Re: Bug: Expressions mangled when tools are renamed

PostWed Jan 14, 2015 6:23 pm

Quick reply.. will get new expression when I get into the office.

Use BGFromImage. This tool generates a background image from resolution of the node that is fed to it.
Pipe the merge to the BGFromImage and you will get a background with dynamic resolution based on the Merge background input resolution.

UPDATE

There does appear to be a problem, however if you name your Background first, then it won't be an issue.
Regardless, something like this should not happen. Thanks for reporting this!
Offline
User avatar

Stefan Ihringer

  • Posts: 257
  • Joined: Mon Nov 10, 2014 10:40 pm

Re: Bug: Expressions mangled when tools are renamed

PostThu Jan 15, 2015 12:22 pm

Thanks, I forgot about the BGFromImage fuse.
blog and Fusion stuff: http://comp-fu.com/2012/06/fusion-script-macro-collection/

Return to Fusion

Who is online

Users browsing this forum: No registered users and 12 guests