Python API 2.0 Reference
OpenMaya.MRampAttribute Class Reference
+ Inheritance diagram for OpenMaya.MRampAttribute:

Public Member Functions

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

Static Public Member Functions

def __new__ ()
 
def createColorRamp ()
 
def createCurveRamp ()
 
def createRamp ()
 

Static Public Attributes

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

Properties

 isColorRamp = property(...)
 
 isCurveRamp = property(...)
 

Detailed 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.

 


Constructor & Destructor Documentation

def OpenMaya.MRampAttribute.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMaya.MRampAttribute.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
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.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.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.
def 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.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.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.
def 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.
def 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.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.
def 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.
def OpenMaya.MRampAttribute.sort ( )
Sort the ramp by position. Indices are also re-ordered during sort.

Member Data Documentation

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

Property Documentation

OpenMaya.MRampAttribute.isColorRamp = property(...)
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 = property(...)
static
 True if the attribute is a curve ramp.
Name: isCurveRamp
Type: bool
Access: R
Description: True if the attribute is a curve ramp.