Jump to: Board index » General » Fusion

Fusion 9 Studio startup Python script

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

Roy Nieterau

  • Posts: 50
  • Joined: Wed May 20, 2015 2:02 pm
  • Location: Utrecht, The Netherlands

Fusion 9 Studio startup Python script

PostSat Oct 28, 2017 9:32 am

I'd like to run some Python code directly when Fusion launches. In the scripting guide I found you can save a .scriptlib file with some custom Lua code to run at Fusion launch. This gets triggered nicely.

For example I can put in:
Code: Select all
print "a"


And the console will have the "a" printed directly after launch, but trying to Execute Python code raises errors. For example:

Code: Select all
Execute("!Py: print 'a'")


This will actually execute the code (and seemingly run fine) but Fusion will spam me two huge error popups that state: "1: attempt to call global 'Execute' (a nil value)"

Though, magically this works without errors:

Code: Select all
while composition == nil do
-- wait around until fusion is running
-- this is to avoid error pop-up: attempt to call global 'Execute' (a nil value)"
end
Execute("!Py: print 'a'")


But that doesn't look like the way it should be done and it looks a bit hacky.
In my case I'm looking for the easiest way to run Python code at Fusion launch - is this it?

Return to Fusion

Who is online

Users browsing this forum: No registered users and 70 guests