Getting correct format and frame range if QuickTime movie, added via Python
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
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')
Here's a little function that handles it:
def movieRead(nodeName,filePath):
mov=nuke.nodes.Read(name=nodeName)
mov['file'].fromUserText(filePath)
Cheers,
Jep
RSS feed for comments to this post