Jump to: Board index » General » Fusion

Setup page of Custom Tool node

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

febros

  • Posts: 23
  • Joined: Thu Aug 13, 2020 6:50 am
  • Real Name: Aniol Marin

Setup page of Custom Tool node

PostSun Sep 13, 2020 1:30 pm

Hello there!

I am trying to program a very simple Custom Tool. I haven't found anything like this in the forum nor in the tool manual, but please feel free to provide a link instead of an explanation.


This is the main idea of what I want to do:
Code: Select all
if( (time<Comp.Length/2), input1, input2)


So far, I managed to make this expression work in a Text+ node:
Code: Select all
iif(time<((comp.RenderEnd-comp.RenderStart)/2),1,0)


Also, I can run the time variable and conditional code in the Setup tab of the Custom node, no problems after replacing "iif" by "if":
Code: Select all
if((time>30),0,1) 


This Setup is used in the Channel tab to run the switch without evaluating the condition for every pixel:

Code: Select all
c1*s1+c2*(1-s1)


However, I don't know how to retrieve the value of the most critical variable for my tool, that is, comp.RenderEnd. The same applies to comp.renderStart, even though it's less important for what I need and I guess it's pretty much part of the same answer.

Does anybody know if it is possible to get the length value in a custom tool?
I actually found a fuse that does what I need and even more, so it's not a rush, but after a few hours trying I can't shake it off my mind...

Thanks!
Resolve 16.2.7 (or newer), Fusion 9
Windows 10 / Ubuntu Studio 20.04
Ryzen 3900X, GTX 1080Ti, 64Gb RAM @ 3200MHz
Audio: Echo FireWire 12 + Presonus Octopre MkII
Offline

febros

  • Posts: 23
  • Joined: Thu Aug 13, 2020 6:50 am
  • Real Name: Aniol Marin

Re: Setup page of Custom Tool node

PostSun Sep 13, 2020 1:35 pm

I swear, I've been trying for hours. I found a solution seconds after I sent the previous message.

The exact same code works perfectly if I use it as an EXPRESSION for Setup1:
Code: Select all
iif(time<((comp.RenderEnd-comp.RenderStart)/2),1,0)


If possible, though, I'm still interested in a more elegant solution :lol:
Resolve 16.2.7 (or newer), Fusion 9
Windows 10 / Ubuntu Studio 20.04
Ryzen 3900X, GTX 1080Ti, 64Gb RAM @ 3200MHz
Audio: Echo FireWire 12 + Presonus Octopre MkII

Return to Fusion

Who is online

Users browsing this forum: No registered users and 9 guests