Module _curvelib :: Class AnimAttributes
[hide private]
[frames] | no frames]

Class AnimAttributes

object --+
         |
        AnimAttributes

A collection of named attributes.

Each attribute is represented as a curve, parameterised over time. Convenience methods for managing the curves (adding and removing keys, etc.) are provided, as well as methods for managing the list of available attributes.

Attributes can be accessed by index or by name. This class defines constants for standard names in use by Nuke.

Instance Methods [hide private]
 
__contains__(x, y)
y in x
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__len__(x)
len(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
None
add(self, name, value)
Add a new attribute.
None
addKey(self, time, name, value, view)
self.addKey(time, view) -> None When a name and value is specified, this method adds a new key to an existing attribute at the given time.
AnimCurve
getCurve(self, attr, view)
Gets the AnimCurve object for a particular attribute.
float
getKeyTime(self, index, keyIndexOrHash, view)
Gets the time a particular key is set at.
str
getName(self, index)
Get the name of an attribute when you know its index.
int
getNumberOfKeys(self, attr, view)
Returns the number of keys in the curve for a particular attribute.
float
getValue(self, time, indexOrName, view)
Evaluates the anim curve of an attribute at a particular time and returns the value.
None
remove(self, attributeIndexOrName)
Remove an attribute.
None
removeAll(self)
Remove all attributes.
None
removeKey(self, time, attributeIndex, view)
Remove a particular key from an attribute.
None
removeKeys(self, attributeIndex, view)
Remove all keys from an attribute.
None
reset(self)
Reset the object to have no attributes.
None
set(self, time, attributeIndexOrName, value, view)
Set the value of an attribute.
None
setCurve(self, index, curve)
Replace the current anim curve for an attribute with a new one.
None
setKey(self, time, attributeIndex, hash, value, view)
Set a key for an attribute.
None
setName(self, attributeIndex, newName)
Change the name of an existing attribute.

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

Class Variables [hide private]
  kAlphaAttribute = 'a'
  kAlphaOverlayAttribute = 'ao'
  kBlendingModeAttribute = 'bm'
  kBlueAttribute = 'b'
  kBlueOverlayAttribute = 'bo'
  kBrushSizeAttribute = 'bs'
  kBrushSpacingAttribute = 'bsp'
  kBrushTypeAttribute = 'bt'
  kBuildUpAttribute = 'bu'
  kDynamicHardnessAttribute = 'dh'
  kDynamicSizeAttribute = 'ds'
  kDynamicTransparencyAttribute = 'dt'
  kEffectParameter1Attribute = 'ep1'
  kEffectParameter2Attribute = 'ep2'
  kEffectParameter3Attribute = 'ep3'
  kFeatherFallOffAttribute = 'ff'
  kFeatherOnAttribute = 'fo'
  kFeatherTypeAttribute = 'ft'
  kFeatherXAttribute = 'fx'
  kFeatherYAttribute = 'fy'
  kGreenAttribute = 'g'
  kGreenOverlayAttribute = 'go'
  kHardnessAttribute = 'h'
  kInvertedAttribute = 'inv'
  kLifeTimeMAttribute = 'ltm'
  kLifeTimeNAttribute = 'ltn'
  kLifeTimeTypeAttribute = 'ltt'
  kMotionBlurAttribute = 'mb'
  kMotionBlurOnAttribute = 'mbo'
  kMotionBlurShutterAttribute = 'mbs'
  kMotionBlurShutterOffsetAttribute = 'mbso'
  kMotionBlurShutterOffsetTypeAttribute = 'mbsot'
  kNumberOfViewsAttribute = 'nv'
  kOpacityAttribute = 'opc'
  kPlanarTrackLayerAttribute = 'pt'
  kRedAttribute = 'r'
  kRedOverlayAttribute = 'ro'
  kSourceAttribute = 'src'
  kSourcePivotPointXAttribute = 'spx'
  kSourcePivotPointYAttribute = 'spy'
  kSourceRotateAttribute = 'sr'
  kSourceScaleXAttribute = 'ssx'
  kSourceScaleYAttribute = 'ssy'
  kSourceSkewOrderAttribute = 'sso'
  kSourceSkewXAttribute = 'sskx'
  kSourceSkewYAttribute = 'ssky'
  kSourceTimeOffsetAttribute = 'sto'
  kSourceTimeOffsetTypeAttribute = 'stot'
  kSourceTranslateRoundAttribute = 'str'
  kSourceTranslateXAttribute = 'stx'
  kSourceTranslateYAttribute = 'sty'
  kTensionAttribute = 't'
  kViewAttribute = 'view'
  kVisibleAttribute = 'vis'
  kWriteOnEndAttribute = 'we'
  kWriteOnStartAttribute = 'ws'
Properties [hide private]

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__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__setattr__(...)

 

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

Overrides: object.__setattr__

add(self, name, value)

 

Add a new attribute. The name parameter is the name for the attribute and value is the initial int or float value to assign to it.

Returns: None

addKey(self, time, name, value, view)

 

self.addKey(time, view) -> None When a name and value is specified, this method adds a new key to an existing attribute at the given time. When the name and value are omitted, a new key is added to all attributes at the specified time. The view parameter is optional in either case.

Returns: None

getCurve(self, attr, view)

 

Gets the AnimCurve object for a particular attribute. The attr parameter can be the index or name of the attribute. The view parameter is optional.

Returns: AnimCurve

getKeyTime(self, index, keyIndexOrHash, view)

 

Gets the time a particular key is set at. The index parameter is the index of the attribute; keyIndexOrHash is either the index of the key in the attributes AnimCurve, or its associated Hash; and view is the optional view name.

Returns: float

getNumberOfKeys(self, attr, view)

 

Returns the number of keys in the curve for a particular attribute. The attr parameter can be the index or name of the attribute. The view parameter is optional.

Returns: int

getValue(self, time, indexOrName, view)

 

Evaluates the anim curve of an attribute at a particular time and returns the value. time is the time for which to evaluate the attribute; indexOrName is either the index of the attribute to evaluate, or its name; and view is the optional view name.

Returns: float

remove(self, attributeIndexOrName)

 

Remove an attribute. You can give the name or index of the attribute.

Returns: None

removeKey(self, time, attributeIndex, view)

 

Remove a particular key from an attribute. The view parameter is optional.

Returns: None

removeKeys(self, attributeIndex, view)

 

Remove all keys from an attribute. The view parameter is optional.

Returns: None

set(self, time, attributeIndexOrName, value, view)

 

Set the value of an attribute. The time parameter is optional: if it's present, a new key is created at that time with the specified value; if it's not present, a constant value is set for the attribute. The attribute to set may be identified by its name or index. The view parameter is optional.

Returns: None

setCurve(self, index, curve)

 

Replace the current anim curve for an attribute with a new one. The index parameter is the index of the attribute; and curve is an AnimCurve instance.

Returns: None

setKey(self, time, attributeIndex, hash, value, view)

 

Set a key for an attribute. The time parameter is when the new key will be created for; the attributeIndex says which attribute to set the key for; the

Returns: None