Set Roto Shape Attributes
You can access the attributes of shapes with Python script, for example to set a random opacity value per shape in a given roto node.
1 2 3 4 5 6 7 |
import nuke import random roto = nuke.selectedNode() knob = roto['curves'] for shp in knob.rootLayer: attrs = shp.getAttributes() attrs.set( 'opc', random.random() ) |
There’s more in-depth information on the Foundry forums:
http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=103073
http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=102867
http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=102009
Rotate World Normals to Camera Set Custom Attributes on All New Nodes with Python