(0 votes, average 0 out of 5)

If you want to add a QuickTime movie to the DAG pythonically, here's a trick for making sure you get the correct format and frame range.
(setValue on the file knob after a node has been created does not work as expected)

1
2
filepath = myMov.mov
nuke.createNode("Read", "file {"+filePath+"}")

 

Comments (3)

Ivan Busquets said:

...
Hi Antony,

In case it helps in future coding, try the fromUserText() method on the file knob instead of setValue(). That should take care of the format and frame range.

Ex.

n = nuke.createNode('Read')
n['file'].fromUserText('/path/to/your/file.mov')


August 18, 2010

Jep Hill said:

...
Great tip Ivan — this holds true for RED files as well...

Here's a little function that handles it:
def movieRead(nodeName,filePath):
mov=nuke.nodes.Read(name=nodeName)
mov['file'].fromUserText(filePath)

Cheers,
Jep
October 20, 2010

a guest said:

...
Thanks for the tip, this is a lifesaver.
May 25, 2011

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy