Jump to: Board index » General » Fusion

function reference

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

MeesterP

  • Posts: 22
  • Joined: Mon Feb 05, 2024 8:01 am
  • Real Name: Paul Meesters

function reference

PostTue Feb 06, 2024 8:27 pm

Hi all,

So, in Fusion you can enter formulae in lots of fields.
Where can I find a list of which mathematical and logical functions are available?
There is no mention of it in the Davinci Resolve 18.x Reference (pdf) nor in the Fusion Reference Manual 18.6 (pdf)
Up till now I only found the immediate if [ iif(,,) ] statement because it was used in a youtube video..

When I tried to follow a tutorial they used a particle id [id] and they were visible as a column of dots. Not so in my version of Fusion. The tutorial was of 6 years ago :lol: so probably the format of the [id] field has been changed.

So, I wondered if I could divide the [id] by 100 and that worked almost. There was much variance in the x-axis and y-axis. Thus I wanted to make the result an integer, but none of the functions I tried proved successful (apparently non-existent functions). Like CInt() Integer() Round() Floor() Ceiling().. non of them worked.

so, what functions can be used in expressions ?
Thanks
Paul
Offline
User avatar

Igor Riđanović

  • Posts: 1601
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: function reference

PostThu Feb 08, 2024 12:38 am

Isn't it pretty much Lua syntax and built-in Lua functions?
www.metafide.com - DaVinci Resolve™ Apps
Offline

MeesterP

  • Posts: 22
  • Joined: Mon Feb 05, 2024 8:01 am
  • Real Name: Paul Meesters

Re: function reference

PostThu Feb 08, 2024 7:27 am

cool - I'll start looking at the LUA references then :geek:
Offline
User avatar

Bryan Ray

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

Re: function reference

PostThu Feb 08, 2024 3:50 pm

It's Lua, but with a few additions and little obnoxious caveats here and there. For instance, iif() isn't part of Lua proper—it was added to the simple expressions as a short cut to the full if-then structure, which requires multiple lines.

For expressions, most of the math library can be accessed without needing to preface with the library name. So instead of math.min(), you can just use min().

In the Tool Reference section of the manual, look up the Custom Tool. It has some documentation on features that work in both pCustom and CustomVertex3D, and also the Expression Modifier.

There are some helpful tips in the recovered VFXPedia available over at steakunderwater.com:
https://www.steakunderwater.com/VFXPedi ... xpressions

And I know there was someone who put together a nice expressions cookbook for Fusion, but I don't recall off the top of my head who it was. Enough searching will likely turn it up, though
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

Chad Capeland

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

Re: function reference

PostFri Feb 09, 2024 3:36 am

The user guide has a couple pages dedicated to sample simple expressions.
Chad Capeland
Indicated, LLC
www.floweffects.com
Offline

Dan Sherman

  • Posts: 1185
  • Joined: Fri Jul 01, 2016 11:07 pm

Re: function reference

PostFri Feb 09, 2024 3:43 am

you can find a lot of example son this page.

https://another-davinci-resolve-blog.bl ... sions.html
AMD 7950X | AMD 7900XTX (23.20.24) | DDR5-6000 CL30-40-40-96 2x32 GB | Multiple PCIe 4.0 X4 NVME | ASUS x670e HERO | Win 11 Pro 23H2 | Resolve Studio 18.6.5 B7

Return to Fusion

Who is online

Users browsing this forum: KrunoSmithy and 41 guests