OpenMaya.MRampAttribute Class Reference

Class Description

Functionset for creating and working with ramp attributes.

Constructors

SignatureParametersDescription
MRampAttribute()  

Default constructor. Returns a new, empty MRampAttribute object.

MRampAttribute(src) src - MRampAttribute

Copy constructor. Returns a new MRampAttribute referencing the same attribute as src.

MRampAttribute(plug) plug - MPlug

Returns a new MRampAttribute referencing the same attribute as plug. Raises a TypeError if plug's attribute is not a ramp.

MRampAttribute(node, attribute) node - MObject
attribute - MObject
Returns a new MRampAttribute referencing the specified attribute of the given node. Raises a TypeError if attribute is not a ramp.

 


+ Inheritance diagram for OpenMaya.MRampAttribute:

Public Member Functions

__init__ ()
 
addEntries ()
 
deleteEntries ()
 
getEntries ()
 
getValueAtPosition ()
 
hasIndex ()
 
numEntries ()
 
pack ()
 
setInterpolationAtIndex ()
 
setPositionAtIndex ()
 
setRamp ()
 
setValueAtIndex ()
 
sort ()
 
__init__ ()
 
addEntries ()
 
deleteEntries ()
 
getEntries ()
 
getValueAtPosition ()
 
hasIndex ()
 
numEntries ()
 
pack ()
 
setInterpolationAtIndex ()
 
setPositionAtIndex ()
 
setRamp ()
 
setValueAtIndex ()
 
sort ()
 

Static Public Member Functions

createColorRamp ()
 
createCurveRamp ()
 
createRamp ()
 
createColorRamp ()
 
createCurveRamp ()
 
createRamp ()
 

Static Public Attributes

Interpolation Types
int kLinear = 1
 
int kNone = 0
 
int kSmooth = 2
 
int kSpline = 3
 

Properties

 isColorRamp
 
 isCurveRamp
 

Constructor & Destructor Documentation

OpenMaya.MRampAttribute.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature
OpenMaya.MRampAttribute.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMaya.MRampAttribute.addEntries ( )
Adds entries to the ramp.
Signature: addEntries(positions, values, interps)
Parameters: positions - sequence of floats
values - sequence of floats or MColors
interps - sequence of Interpolation Type constants
Returns: Reference to self.
Description: Adds entries to the ramp. For a curve ramp values must be a sequence of floats, for color ramps it must be a sequence of MColors. A TypeError will be raised if the wrong type of values are supplied.
OpenMaya.MRampAttribute.addEntries ( )
Adds entries to the ramp.
OpenMaya.MRampAttribute.createColorRamp ( )
static
Creates and returns a new color ramp attribute.
Name: createColorRamp(longName, shortName)
Parameters: longName - string
shortName - string
Returns: MObject
Description: Creates and returns a new color ramp attribute.
OpenMaya.MRampAttribute.createColorRamp ( )
static
Creates and returns a new color ramp attribute.
OpenMaya.MRampAttribute.createCurveRamp ( )
static
Creates and returns a new curve ramp attribute.
Name: createCurveRamp(longName, shortName)
Parameters: longName - string
shortName - string
Returns: MObject
Description: Creates and returns a new curve ramp attribute.
OpenMaya.MRampAttribute.createCurveRamp ( )
static
Creates and returns a new curve ramp attribute.
OpenMaya.MRampAttribute.createRamp ( )
static
Creates and returns a new color or curve ramp attribute initialized with values.
OpenMaya.MRampAttribute.createRamp ( )
static
Creates and returns a new color or curve ramp attribute initialized with values.
OpenMaya.MRampAttribute.deleteEntries ( )
Removes from the ramp those entries with the specified indices.
Signature: deleteEntries(indices)
Parameters: indices - sequence of ints
Returns: Reference to self.
Description: Removes from the ramp those entries with the specified indices. Raises a ValueError if an attempt is made to remove the last remaining entry from the ramp.
OpenMaya.MRampAttribute.deleteEntries ( )
Removes from the ramp those entries with the specified indices.
OpenMaya.MRampAttribute.getEntries ( )
Returns a tuple containing all of the entries in the ramp.
Signature: getEntries()
Parameters:  
Returns: (indices, positions, values, interps)
Description: Returns a tuple containing all of the entries in the ramp. The first element of the tuple is an MIntArray containing the indices. The second element is an MFloatArray containing the positions. The third element is the values, which is an MFloatArray for a curve ramp or an MColorArray for a color ramp. The fourth and final element of the tuple is an MIntArray containing the interps, which are Interpolation Type constants.
OpenMaya.MRampAttribute.getEntries ( )
Returns a tuple containing all of the entries in the ramp.
OpenMaya.MRampAttribute.getValueAtPosition ( )
Returns the value of the entry at the given position.
Signature: getValueAtPosition(position)
Parameters: position - float
Returns: float or MColor
Description: Returns the value of the entry at the given position. The value will be a float for a curve ramp or an MColor for a color ramp.
OpenMaya.MRampAttribute.getValueAtPosition ( )
Returns the value of the entry at the given position.
OpenMaya.MRampAttribute.hasIndex ( )
Return true if an entry is defined at this index.
OpenMaya.MRampAttribute.hasIndex ( )
Return true if an entry is defined at this index.
OpenMaya.MRampAttribute.numEntries ( )
Returns the number of entries in the ramp.
Signature: numEntries()
Parameters:  
Returns: int
Description: Returns the number of entries in the ramp.
OpenMaya.MRampAttribute.numEntries ( )
Returns the number of entries in the ramp.
OpenMaya.MRampAttribute.pack ( )
Change the indices numbering by re-ordering them from 0.
OpenMaya.MRampAttribute.pack ( )
Change the indices numbering by re-ordering them from 0.
OpenMaya.MRampAttribute.setInterpolationAtIndex ( )
Sets the interpolation of the entry at the given index.
Signature: setInterpolationAtIndex(interp, index)
Parameters: interp - Interpolation Type constant
index - int
Returns: Reference to self.
Description: Sets the interpolation of the entry at the given index.
OpenMaya.MRampAttribute.setInterpolationAtIndex ( )
Sets the interpolation of the entry at the given index.
OpenMaya.MRampAttribute.setPositionAtIndex ( )
Sets the position of the entry at the given index.
Signature: setPositionAtIndex(position, index)
Parameters: position - float
index - int
Returns: Reference to self.
Description: Sets the position of the entry at the given index.
OpenMaya.MRampAttribute.setPositionAtIndex ( )
Sets the position of the entry at the given index.
OpenMaya.MRampAttribute.setRamp ( )
Set this ramp with one or multiple entries. Current entries are removed before adding the new one(s).
OpenMaya.MRampAttribute.setRamp ( )
Set this ramp with one or multiple entries. Current entries are removed before adding the new one(s).
OpenMaya.MRampAttribute.setValueAtIndex ( )
Sets the value of the entry at the given index.
Signature: setValueAtIndex(value, index)
Parameters: value - float or MColor
index - int
Returns: Reference to self.
Description: Sets the value of the entry at the given index. The value must be a float for a curve ramp or an MColor for a color ramp. A TypeError will be raised if the wrong type of value is supplied.
OpenMaya.MRampAttribute.setValueAtIndex ( )
Sets the value of the entry at the given index.
OpenMaya.MRampAttribute.sort ( )
Sort the ramp by position. Indices are also re-ordered during sort.
OpenMaya.MRampAttribute.sort ( )
Sort the ramp by position. Indices are also re-ordered during sort.

Member Data Documentation

int OpenMaya.MRampAttribute.kLinear = 1
static
Name: kLinear
Type: int
Description:  
int OpenMaya.MRampAttribute.kNone = 0
static
Name: kNone
Type: int
Description:  
int OpenMaya.MRampAttribute.kSmooth = 2
static
Name: kSmooth
Type: int
Description:  
int OpenMaya.MRampAttribute.kSpline = 3
static
Name: kSpline
Type: int
Description:  

Property Documentation

OpenMaya.MRampAttribute.isColorRamp
static
 True if the attribute is a color ramp.
Name: isColorRamp
Type: bool
Access: R
Description: True if the attribute is a color ramp.
OpenMaya.MRampAttribute.isCurveRamp
static
 True if the attribute is a curve ramp.
Name: isCurveRamp
Type: bool
Access: R
Description: True if the attribute is a curve ramp.