Module _rotopaint :: Class RotoKnob
[hide private]
[frames] | no frames]

Class RotoKnob

object --+    
         |    
 nuke.Knob --+
             |
            RotoKnob

The knob which holds the tree of paint elements (Layers, Shapes and Strokes).

Most operations are performed on the tree itself, or its elements, rather than through the knob. You can get the root of the tree through the knob's rootLayer property, or you can get straight to a specific element using the toElement() method.

A common usage scenario is as follows:

>>> knob = nuke.toNode('RotoPaint1')['curves']
>>> root = knob.rootLayer
>>> # perform operations on the root layer.

Creating any new shapes, strokes or layers will require you to pass in a reference to the knob, so it's worth storing the reference in a variable.

Instance Methods [hide private]
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
None
changed(self)
Call this after performing updates on the tree, to tell it that it's been updated.
Element
toElement(self, path)
Takes a path which identifies a particular element in the curve tree and returns the corresponding Layer, Stroke or Shape object.

Inherited from nuke.Knob: Class, __init__, __new__, clearAnimated, clearFlag, critical, debug, enabled, error, fromScript, getDerivative, getIntegral, getKeyIndex, getKeyTime, getNthDerivative, getNumKeys, getValue, getValueAt, hasExpression, isAnimated, isKey, isKeyAt, label, name, node, removeKey, removeKeyAt, setAnimated, setEnabled, setExpression, setFlag, setLabel, setName, setTooltip, setValue, setValueAt, setVisible, toScript, tooltip, value, visible, warning

Inherited from object: __format__, __hash__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  rootLayer
The root layer.

Inherited from object: __class__

Method Details [hide private]

__delattr__(...)

 

x.__delattr__('name') <==> del x.name

Overrides: object.__delattr__

__getattribute__(...)

 

x.__getattribute__('name') <==> x.name

Overrides: object.__getattribute__

__setattr__(...)

 

x.__setattr__('name', value) <==> x.name = value

Overrides: object.__setattr__

changed(self)

 

Call this after performing updates on the tree, to tell it that it's been updated. For many operations this is called automatically, but you can call it manually for those cases where it isn't.

Returns: None

toElement(self, path)

 

Takes a path which identifies a particular element in the curve tree and returns the corresponding Layer, Stroke or Shape object. The path is a slash separated string and is always resolved relative to the root layer. So if, for example, you have a RotoPaint node with a layer called 'Layer1' which contains a shape called 'Shape1', the path to the shape would be 'Layer1/Shape1'. >>> knob = nuke.toNode('RotoPaint1)['curves'] >>> shape = knob.toElement('Layer1/Shape1') >>> shape.name 'Shape1'

Returns: Element