Jump to: Board index » General » Fusion

Script to set a Loader's file path

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

jrkumorek

  • Posts: 4
  • Joined: Mon Mar 10, 2025 12:58 pm
  • Real Name: Jim Kumorek

Script to set a Loader's file path

PostMon Jun 23, 2025 7:22 pm

I'm pretty new to script-writing for Fusion Studio (NOT Fusion within Resolve), and could use some help on one specific function. let's say I have a Loader in my comp that loads a JPEG image, and I want to use a script to alter file path to a new location for that same image - let's say to "c:\temp\abc.jpg" . I have the tool located in my script - I just need to change the file path part of the tool. How does one do this?
Offline
User avatar

Bryan Ray

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

Re: Script to set a Loader's file path

PostTue Jun 24, 2025 4:01 am

Assuming the Loader is called Loader1:

Loader1.Clip = "c:/temp/abc.jpg" ought to do it.

Note that those have to either be forward slashes or double backslashes (c:\\temp\\abc.jpg) because \ is the escape character that indicates to Lua that the character that follows is a special control code.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

jrkumorek

  • Posts: 4
  • Joined: Mon Mar 10, 2025 12:58 pm
  • Real Name: Jim Kumorek

Re: Script to set a Loader's file path

PostWed Jun 25, 2025 9:17 am

Well, that was way simpler than what I was trying to do! Thank you.
So, where would I have found this information in the Fusion documentation? I was looking at the scripting reference, and from what I could see there, it looked to me like the only options were to use GetAttrs and SetAttrs to modify the Loader node. (I am iterating through all Loader nodes in the comp, changing where they find their source media clip.) I just searched through that entire document and didn't find a reference to a "Clip" field that you can access directly. When I select a loader node in the UI, the properties show a "Filename" attribute that does get updated when I run the script, so setting Clip changes the Filename field.
So, I am clearly missing something big. Any pointers on how one figures this out for oneself would be appreciated!
Offline
User avatar

Bryan Ray

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

Re: Script to set a Loader's file path

PostWed Jun 25, 2025 7:22 pm

If you mouseover any parameter on a node, it'll show its script name in the status bar in the lower left part of the interface.

Alternately, you can query a tool for all of its inputs with comp.[toolname].GetInputList(), as documented on page 163-164 of the Fusion 8 Scripting Guide (I believe there might be a more updated scripting reference, but that's the one I have bookmarked and always find in a search):
https://documents.blackmagicdesign.com/ ... _Guide.pdf
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 84 guests