Python scripting of MatchGrade?


#1

Trying to control MatchGrade node with Python.
sourceRefFrames is an editable text box but even interactively it ignores what you enter when you click the AddSourceRefFrame button and instrad the node uses the current frame. Control options list only no animation. No means to set keys other than special button.

  1. Is there a way to enter values and set as key reference frames?
  2. What’s the Python method to set the viewer to a specific frame? (if entering values doesn’t seem to work) I can get the current frame but even the Foundry example code to go to a frame is broken.

Thanks.


#2

now a little bit longer then my twitter answer:

i would use this:


list = [1,3,5,7,9] #define the frames as list
node = nuke.toNode("MatchGrade1") #select the right node
node['sourceRefFrames'].setAnimated() #make the reference frames animated, so we can set keyframes
for i in list:
 node['sourceRefFrames'].setValueAt(1,i) #for each frame in our list we set a keyframe


#3

Thanks, that did the trick.