Jump to: Board index » General » Fusion

Value Input/Output for nodes

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

Jeff Kee

  • Posts: 4
  • Joined: Fri Nov 03, 2017 5:00 pm

Value Input/Output for nodes

PostFri Nov 03, 2017 5:13 pm

I've been looking for a way to pipe values between nodes without expressions. I'm a motion graphic artist, and the type of animations I want to do will require the ability to pipe such values as: position, rotation, delay, etc.
Is this currently possible, or is there a way to access this with a script or plugin?

So you know, I have tried to use expressions, but there are too many values to pipe in my animations, but I've figured out how to simplify the process with nodes. I just need to access the value input/output of any node value.
Offline

Sander de Regt

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

Re: Value Input/Output for nodes

PostMon Nov 06, 2017 11:07 pm

I think what you want is possible with modifiers. Almost all animated values in Fusion can be accessed by right-clicking a compatible value and selecting 'connect to' and then the value you're looking for.
You can off-set these in time, scale them or whatever.
Maybe if you can provide us with a very basic example of what you're after, I - or someone else on the forum - can help you started.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Jeff Kee

  • Posts: 4
  • Joined: Fri Nov 03, 2017 5:00 pm

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 12:39 am

This is what I envision (hope the image link works).
If not, I hope to access the values of a node in the flow, to make connecting values faster and easier to swap.
Image
Offline
User avatar

michael vorberg

  • Posts: 943
  • Joined: Wed Nov 12, 2014 8:47 pm
  • Location: stuttgart, germany

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 11:23 am

You can also use the expressions and use the "+" to pick the value
Offline
User avatar

Andrew Hazelden

  • Posts: 536
  • Joined: Sat Dec 06, 2014 12:10 pm
  • Location: West Dover, Nova Scotia, Canada

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 2:26 pm

Jeff Kee wrote:Is this currently possible, or is there a way to access this with a script or plugin?

So you know, I have tried to use expressions, but there are too many values to pipe in my animations, but I've figured out how to simplify the process with nodes. I just need to access the value input/output of any node value.


Short Answer:

Adding a Fusion "Modifier" to the animated attributes on your nodes might be just what you are looking for. Check out the Fusion 9 Tool Manual.pdf topics on Modifiers from page 753 - 789 for more details.

Longer Answer:

If that isn't what you are after, a far more complex of an answer to the question would be:

Your challenging mo-graph work might benefit from what are known as "wireless" connections in Fusion. This works by mapping certain types of attributes by drag and drop placement/connection from the node based flow area in Fusion into an "Attribute" slot on the individual node. The wireless connection linkage is then visible/accessible when you select the node and look at its attributes in the Tool view.

This wireless approach can be preferable in some very specific unique circumstances vs making a spider's web of unmanageable node connection lines, or having a lot of really cryptic expressions that connect randomly to nodes strewn throughout your composite in a really counter intuitive fashion.

The wireless linking nodes that could be used with a Fusion composites are called:

  • Wirelsss Link (wire) = Built-in
  • Wireless Link 3D (Wi3D) = Free Fuse module downloadable from WSL Forum
  • Wireless Link 3DMaterial (Wi3DMAT) = Free Fuse module downloadable from WSL Forum

(All of these wireless node based approaches work perfectly well in Fusion (Free) and Fusion Studio so there is no reason a user at any budget level couldn't take advantage of this technique.)

It is very project/artist skill level dependent though on which attribute linking approach is truly the most suitable + efficient for the Fusion composite you are working on. You'd only approach the wireless connection concept for certain important attribute style connections in a composite as ideally you want to keep as much of a Fusion composite as visually inspectable node connections. :)

Basically, you could add a wireless input node to the comp that would make an invisible connection link between the source object in the flow area that comes before the object you are animating/controlling or an output node like a Renderer3D node or a Saver node. TBH the options are only limited by your creativity.

Code: Select all
{
   Tools = ordered() {
      Saver1 = Saver {
         CtrlWZoom = false,
         Inputs = {
            ProcessWhenBlendIs00 = Input { Value = 0, },
            Clip = Input {
               Value = Clip {
                  Filename = "Previews:/Fusion/WirelessBackroundNodeRender.0.png",
                  FormatID = "PNGFormat",
                  Length = 0,
                  Saving = true,
                  TrimIn = 0,
                  ExtendFirst = 0,
                  ExtendLast = 0,
                  Loop = 1,
                  AspectMode = 0,
                  Depth = 0,
                  GlobalStart = -2000000000,
                  GlobalEnd = 0
               },
            },
            CreateDir = Input { Value = 1, },
            OutputFormat = Input { Value = FuID { "PNGFormat" }, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Input = Input {
               SourceOp = "WirelessLink1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 825, 49.5 } },
      },
      WirelessLink1 = Fuse.Wireless {
         Inputs = {
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 715, 49.5 } },
      },
      Note1 = Note {
         Inputs = {
            Comments = Input { Value = "This composite shows how a wirelessLink node can be used to connect a Background node to a Saver node.\n\n", }
         },
         ViewInfo = StickyNoteInfo {
            Pos = { 440, -115.5 },
            Flags = {
               Expanded = true
            },
            Size = { 496.558, 125.998 }
         },
      },
      Background1 = Background {
         Inputs = {
            GlobalOut = Input { Value = 0, },
            Width = Input { Value = 3840, },
            Height = Input { Value = 1920, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Type = Input { Value = FuID { "Corner" }, },
            TopLeftRed = Input { Value = 1, },
            TopRightRed = Input { Value = 0.206, },
            BottomLeftRed = Input { Value = 0.675, },
            BottomRightRed = Input { Value = 0.106, },
         },
         ViewInfo = OperatorInfo { Pos = { 440, 49.5 } },
      }
   }
}


An extra option for advanced Fusion users, is you could copy the node you want to make a wireless connection slot on from the flow area in Fusion into your clipboard copy buffer. Then you would paste that node data as a block of text into a programmer's text editor like BBedit (Mac) or Notepad++ (Windows) and start customizing things.

To be fully honest, this is a pretty demanding task the first few times you do this, so it is only suggested for a technically minded artists who want to go deep and have really fine control over their composites.

With the node's block of text copied into your text editor, you can then insert a custom paragraph of text near the bottom of the node called a UserControl that looks a bit like this:

Code: Select all
UserControls = ordered() {
  DataSource = {
    LINKID_DataType = "Image",
    INP_Default = 0,
    IC_ControlPage = 1,
    INPID_InputControl = "ImageControl",
    LINKS_Name = "DataSource",
  }
}


With wireless connections you are able to drag and drop a "parent" node onto the wireless connection slot you create on another node in your comp.

Then inside the "receiving" node the internal expressions you add will link to that wireless input slot and whatever is connected to the wireless input will automatically drive all the expressions in a nice and tidy fashion. This means you can have the expressions "containerized" inside the node and not have them get out of control and really messy.

This is a screenshot of a text+ node that had a custom wireless input connection added using the UserControls based approach I mentioned above. This screenshot shows the text content in the text+ field being driven by the node that is connected to the wireless input.

(The input connection slot on the node in this screenshot is called "MetadataSource" and it has a loader node as the input.)

TextFromMetadata-drag-and-drop-connection.png
TextFromMetadata-drag-and-drop-connection.png (96.14 KiB) Viewed 7534 times


If you copy tons of versions of a node with a wireless connection slot on it into your composite, each node will work independently with the internal expressions you add and you only need to relink the single wireless input connection slot on a node to change the driver for all expressions. This can be a massively powerful technique in the hands of a power user.

With regular expressions (on a normal node) when you link to attributes between nodes using the + symbol things can get messy over time when you start building a "mega comp" over several days.

If you go the wireless route, you can have 2D wireless connections, and you can also add a Fusion 3D system based based wireless3D connections for objects, and materials too if you needed to do that in your motion graphics work.

Several example articles that show what a Fusion wireless connection approach looks like & how they work can be found here:

(As additional warning, this is a complex topic that is best explored only if you really enjoy exploring technical challenges like scripting and expressions.)

Rendering Text From Metadata Tags
https://www.steakunderwater.com/wesuckless/viewtopic.php?f=6&t=1488

Bryan Ray's excellent MultiMerge.fuse uses a Wireless Connection approach in the fuse to load the footage in a layer like stack
http://www.bryanray.name/wordpress/mult ... ic-fusion/

The Ancient but still relevant in this case User Controls reference notes from the Eyeon VFXPedia Archive
https://www.steakunderwater.com/VFXPedia/96.0.243.189/indexd11b.html?title=User:Gringo/User_Controls

Kristof on the We Suck Less forums made a very interesting Custom MainInput Thread as well on wireless inputs
https://www.steakunderwater.com/viewtopic.php?f=16&t=1083&p=8173

Kristof on the We Suck Less forums also created an interesting Fusion Macro called "im_fitFrustum" that uses a wireless input style of connection to allow you to attach an image to a camera as an image plane.

Kristof's example macro is one of the best Fusion demos out there for learning about how the wireless input connection approach functions on nodes that operate inside of Fusion's 3D workspace which would be what you'd likely want to do when creating advanced motion graphics (in 3D) inside of Fusion.

im_fitFrustum Macro Usage:

The im_fitFrustum macro creates a custom type of imageplane that allows you to connect a camera to the node using a drag and dropable "source" textfield on the node. This saves you from having to use or edit lots of expressions when switching camera views once you have animated the image plane.

Then add a Camera3D node to the comp. Leave the camera at its initial position in the 3D workspace and do not translate or rotate it.

Add a im_fitFrustum node to the comp. Select the node so you can edit the node's attributes in the Tool tab.

It might be a bit hard the first time you try this but you need to drag the Camera3D node from your flow area into the im_fitFrustum node's Source textfield in the Tool's tab. This will cause an editable image plane to appear in Fusion's 3D workspace.

Now you can map a texture map to the image plane by connecting the imagery to the im_fitFrustum node's green colored MaterialInput connection.

* * *

I hope this reply helps you discover some extra options you have to take control of how you build a node based composite in Fusion.

Regards,
Andrew Hazelden

P.S. As an extra tip, when you go to make expression based node connections in a stock copy of Fusion, don't forget to open up Fusion's Preferences window and adjust the Global and Default Settings> User Interface controls.

By default Fusion will collapse one node's attributes in the Tool view when you go to select another node to cut down on sprawl and visual clutter. If you turn off the "Auto control close tools" option in this preference window both nodes will stay visible in the Tools view when you expand them.

Auto control close tools.png
Auto control close tools.png (86.07 KiB) Viewed 7534 times


Having both node's Tool sections open at the same time makes it easier to map regular expressions when you click the [+] icon and use the line dragging technique to "pick whip" an attribute name.

pick whip dragging expression attribute names.png
pick whip dragging expression attribute names.png (95.83 KiB) Viewed 7534 times
Mac Studio M2 Ultra / Threadripper 3990X | Fusion Studio 18.6.4 | Kartaverse 6
Offline

Jeff Kee

  • Posts: 4
  • Joined: Fri Nov 03, 2017 5:00 pm

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 6:08 pm

Here is an illustration of what I'm trying to accomplish:
https://ibb.co/iFPE8G
Offline

Jeff Kee

  • Posts: 4
  • Joined: Fri Nov 03, 2017 5:00 pm

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 6:32 pm

I understand the "pick whip" concept of linking properties with expressions. What I'm trying to do is to use nodes to solve a complex issue that takes forever with expressions. The values I use will change from project to project, and (so to speak) I need fusion's nodes to be a form of calculator, node parent, constraint, etc. I just need the values to be accessible in the flow. The uses I see are numerous and I'll need it for my current and future projects. If nothing else, it helps me see how the expressions and properties are connected.

If it doesn't exist I would be very surprised, because this seems to be one of the best features of any node based system. If it doesn't exist, I think this would be one of the best updates the software could experience.

Is there anyone who could help make this a reality?
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Value Input/Output for nodes

PostTue Nov 07, 2017 8:27 pm

Trouble is, a Flow input arrow can't take just any data type. Images, 3d Scenes, and Materials are the only inputs I've ever seen that appear as arrows on the Flow.

You can, however, publish any control to make it available to the Connect To dialogue:

Untitled.png
Untitled.png (60.03 KiB) Viewed 7501 times


You could combine that with the Expression Modifier to get what you're after, but you wouldn't have a drag-and-drop solution.

I'm actually intrigued with Andrew's suggestion of the wireless connection, though. I think a Fuse could be constructed that, upon detecting a node connection, would get a list of the connection's inputs and populate a combo box with them, allowing the user to select the desired input from a list and use that as the input on a calculation field. Sort of a combination of Multi-Merge and the Expression Modifier.

In terms of hypothetical features Fusion might have in the future, yours is a pretty good suggestion, and one that I think would be very useful. Though I think there might need to be some thought about how a non-raster output should be displayed in the flow.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Ivan Ivanov

  • Posts: 86
  • Joined: Tue Nov 11, 2014 11:16 am

Re: Value Input/Output for nodes

PostWed Nov 08, 2017 2:10 pm

You da man, Andrew :)
There may be some shorter cuts sometimes to some of the issues you elaborate on (known to some long time Fu users by way of "cheating" the obvious ways of using the Fu features), but the level of commitment you demonstrate in your posts and the depths and thorough explanations you go into, especially regarding coding/scripting are unparalleled, exhausting and enlightening. Keep it Up!
Offline
User avatar

Andrew Hazelden

  • Posts: 536
  • Joined: Sat Dec 06, 2014 12:10 pm
  • Location: West Dover, Nova Scotia, Canada

Re: Value Input/Output for nodes

PostWed Nov 08, 2017 7:08 pm

Ivan Ivanov wrote:You da man, Andrew :)
There may be some shorter cuts sometimes to some of the issues you elaborate on (known to some long time Fu users by way of "cheating" the obvious ways of using the Fu features), but the level of commitment you demonstrate in your posts and the depths and thorough explanations you go into, especially regarding coding/scripting are unparalleled, exhausting and enlightening. Keep it Up!


Thanks Ivan! :)

I started using Fusion in a post Eyeon world at the Fu 7.7 (on Windows) to Fu 8.2 (on Mac) crossover period.

This was a point where long time Fusion users were left without access to the classic VFXPedia resource, the Pigsfly user forum wasn't accepting new users, and the current Fusion Scripting PDF guides didn't exist yet.

So for most of my initial learning time of Fusion I didn't get the benefit of learning from the original longtime Fusion users + reference material sources. As a result of this mostly self taught learning process it means Lua scripting and macros have been the the technique I most often turn to when I need to get something done now and just want to get results in the same day.

Not always the approach of fewest clicks but it means you can literally get Fusion to do any task imaginable. So at the end of the day it all works out pretty well. I like results and Fusion gives them. :D

Cheers,
Andrew
Mac Studio M2 Ultra / Threadripper 3990X | Fusion Studio 18.6.4 | Kartaverse 6
Offline
User avatar

Chad Capeland

  • Posts: 3017
  • Joined: Mon Nov 10, 2014 9:40 pm

Re: Value Input/Output for nodes

PostWed Jan 31, 2018 3:02 am

Jeff Kee wrote:Is there anyone who could help make this a reality?


It's there if you're willing to write Fuses.

Code: Select all
--[[

NumberOp.Fuse

Fuse that performs operations on scalar number inputs.

--]]

version = "version .11 (Aug 28, 2016)"

--[[

 Written by Chad Capeland (chad[REMOVE-ME]@indicated.com)
 Copyright (c) 2016 Indicated, LLC


 The authors hereby grant permission to use, copy, and distribute this
 software and its documentation for any purpose, provided that existing
 copyright notices are retained in all copies and that this notice is
 included verbatim in any distributions. Additionally, the authors grant
 permission to modify this software and its documentation for any
 purpose, provided that such modifications are not distributed without
 the explicit consent of the authors and that existing copyright notices
 are retained in all copies.

 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
 OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES
 THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND
 DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
 UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

--]]


FuRegisterClass("NumberOperator", CT_Tool, { 
   REGS_Category = "Fuses",
   REGS_OpIconString = "fNOp",
   REGS_OpDescription = "Number Operator Fuse",
   REG_NoMotionBlurCtrls = true,
   REG_OpNoMask = true,
   REGID_DataType      = "Number",
   REGID_InputDataType = "Number",
   REG_NoBlendCtrls = true,
   REG_NoObjMatCtrls = true,
   REG_NoCommonCtrls = true,
    --REG_Fuse_NoEdit = true,
    --REG_Fuse_NoReload = true,
   --REG_Fuse_TilePic = NumberOperatorFusepic
   })

function Create()

   InOp= self:AddInput("Operation ", "Operation", {
      LINKID_DataType = "Number",
      INPID_InputControl = "ComboControl",
      INP_Default = 0.0,
      INP_Integer = true,
      { CCS_AddString = "Add", },                --0
      { CCS_AddString = "Subtract A-B", },   
      { CCS_AddString = "Multiply", },
      { CCS_AddString = "Divide A/B", },         
      { CCS_AddString = "Min", },
      { CCS_AddString = "Max", },                --5 
      { CCS_AddString = "Average", },
      { CCS_AddString = "Difference", },
      { CCS_AddString = "Modulo A/B", },   
      { CCS_AddString = "Power A^B", },
      { CCS_AddString = "Arc Tangent A/B", },    --10
      { CCS_AddString = "----------", }, 
      { CCS_AddString = "Sine", },   
      { CCS_AddString = "Cosine", },
      { CCS_AddString = "Tangent", },   
      { CCS_AddString = "Arc Sine", },           --15
      { CCS_AddString = "Arc Cosine", },
      { CCS_AddString = "Arc Tangent", },
      { CCS_AddString = "Log", },
      { CCS_AddString = "Log 10", },
      { CCS_AddString = "Exponential", },        --20
      { CCS_AddString = "Degrees to Radians", },
      { CCS_AddString = "Radians to Degrees", },
      { CCS_AddString = "Absolute Value", },
      { CCS_AddString = "Ceiling", },
      { CCS_AddString = "Floor", },              --25
      { CCS_AddString = "Square Root", },
      { CCS_AddString = "Reciprocal", },
      { CCS_AddString = "Negate", },
      { CCS_AddString = "Clamp 0-1", },
      })

   
   InNumA = self:AddInput("Number A", "NumberA", {
      LINKID_DataType = "Number",
      LINK_Main = 1,
      INP_Required = true,
      })   
      
   InNumB = self:AddInput("Number B", "NumberB", {
      LINKID_DataType = "Number",
      LINK_Main = 2,
      INP_Required = false,
      })

--[[      
   InNumC = self:AddInput("Number C", "NumberC", {
      LINKID_DataType = "Number",
      LINK_Main = 3,
      INP_Required = false,
      IC_Visible = false,
      })
--]]

   OutN = self:AddOutput("Output", "Output", {
      LINKID_DataType = "Number",
      LINK_Main = 1,
      })      
      
   InLabel = self:AddInput(version, "version", {
      LINKID_DataType = "Text",
      INPID_InputControl = "LabelControl",
      INP_External = false,
      INP_Passive = true,
      })
end

--[[
function PreCalcProcess(req)
   Process(req)
end
--]]

function Process(req)
   local Op = InOp:GetValue(req).Value
   
   local inA = InNumA:GetValue(req).Value
   local inB = InNumB:GetValue(req).Value

   --print (inA)
   --print (inB)
   
   if Op == 0 then              --Add
      out = inA + inB
   elseif Op == 1 then          --Subtract
      out = inA - inB   
   elseif Op == 2 then          --Multiply
      out = inA * inB
   elseif Op == 3 then          --Divide
      out = inA / inB   
   elseif Op == 4 then          --Min
      out = math.min(inA, inB)
   elseif Op == 5 then          --Max
      out = math.max(inA, inB)
   elseif Op == 6 then          --Average
      out = (inA + inB)/2
   elseif Op == 7 then          --Difference
      out = math.abs(inA - inB)   
   elseif Op == 8 then          --Mod
      out = math.mod(inA, inB)
   elseif Op == 9 then          --Power
      out = math.pow(inA, inB)   
   elseif Op == 10 then          --atan2
      out = math.atan2(inA, inB)
   elseif Op == 11 then          -- (----------) easter egg: divider returns pi
      out = math.pi
   elseif Op == 12 then          --Sin
      out = math.sin(inA)
   elseif Op == 13 then          --Cos
      out = math.cos(inA)
   elseif Op == 14 then          --Tan
      out = math.tan(inA)
   elseif Op == 15 then          --ASin
      out = math.asin(inA)   
   elseif Op == 16 then          --ACos
      out = math.acos(inA)      
   elseif Op == 17 then          --ATan
      out = math.atan(inA)
   elseif Op == 18 then          --Log
      out = math.log(inA)
   elseif Op == 19 then          --Log10
      out = math.log10(inA)   
   elseif Op == 20 then          --Exp
      out = math.exp(inA)
   elseif Op == 21 then          --Rad
      out = math.rad(inA)
   elseif Op == 22 then          --Deg
      out = math.deg(inA)
   elseif Op == 23 then          --Abs
      out = math.abs(inA)
   elseif Op == 24 then          --Ceil
      out = math.ceil(inA)
   elseif Op == 25 then          --Floor
      out = math.floor(inA)   
   elseif Op == 26 then          --Sqrt
      out = math.sqrt(inA)   
   elseif Op == 27 then          --Reciprocal
      out = 1/inA         
   elseif Op == 28 then          --Negate
      out = 1-inA            
   elseif Op == 29 then          --Clamp
      if inA > 1 then
         out = 1
      elseif inA < 0 then
         out = 0
      else
         out = inA
      end
   end   
   
   OutN:Set(req, out)

end   
Chad Capeland
Indicated, LLC
www.floweffects.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 25 guests