Python API 2.0 Reference
|
Public Member Functions | |
def | __init__ () |
def | addElement () |
def | copy () |
def | destinationSetName () |
def | dimension () |
def | elementSize () |
def | getElement () |
def | maximumStride () |
def | name () |
def | numElements () |
def | removeElements () |
def | semantic () |
def | semanticName () |
def | setSource () |
def | sourceSemantic () |
def | sourceSetName () |
def | type () |
def | updateId () |
Static Public Member Functions | |
def | __new__ () |
The MVaryingParameter class provides a high-level interface to hardware shader varying parameters. By defining your shader's varying data through this class, you allow Maya to handle the attributes, editing, serialisation, requirements setup, and cache management for you in a standard way that ensure you'll be able to leverage future performance and functionality improvements. To remove any ambiguity between constructors, the mandatory parameters of the third one have been swizzled: MVaryingParameter() MVaryingParameter( name, type, minDimension=1, maxDimension=1, semantic=kNoSemantic, invertTexCoords=False, semanticName=None) MVaryingParameter( dimension, minDimension, maxDimension, name, type, semantic=kNoSemantic, destinationSet=None, invertTexCoords=False, semanticName=None)
def OpenMayaRender.MVaryingParameter.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMayaRender.MVaryingParameter.addElement | ( | ) |
addElement(child) -> self Add a child element to this parameter. This operation is only valid for parameters of type kStructure. * child (MVaryingParameter) - the parameter to add to the structure.
def OpenMayaRender.MVaryingParameter.copy | ( | ) |
copy(source) -> self Copy data from source parameter. * source (MVaryingParameter) - The source parameter to copy from
def OpenMayaRender.MVaryingParameter.destinationSetName | ( | ) |
destinationSetName() -> string Get the destination Set of this parameter.
def OpenMayaRender.MVaryingParameter.dimension | ( | ) |
dimension() -> int Get the dimension of this parameter.
def OpenMayaRender.MVaryingParameter.elementSize | ( | ) |
elementSize() -> int Get the size in bytes of one element of this parameter.
def OpenMayaRender.MVaryingParameter.getElement | ( | ) |
getElement(index) -> MVaryingParameter Get an element within a structure. This operation is only valid for parameters of type kStructure. * index (int) - The index of the structure element to return.
def OpenMayaRender.MVaryingParameter.maximumStride | ( | ) |
maximumStride() -> int Get the maximum stride of this parameter in bytes. For parameter that accept a range of element counts, this corresponds to the maximum number of elements the parameter supports.
def OpenMayaRender.MVaryingParameter.name | ( | ) |
name() -> string Get the name of this parameter.
def OpenMayaRender.MVaryingParameter.numElements | ( | ) |
numElements() -> int Get the number of elements in this structure. This operation is only valid for parameters of type kStructure.
def OpenMayaRender.MVaryingParameter.removeElements | ( | ) |
removeElements() -> self Remove all child elements from a structure. This operation is only valid for parameters of type kStructure.
def OpenMayaRender.MVaryingParameter.semantic | ( | ) |
semantic() -> int Get the semantic of this parameter. Available values: kNoSemantic, kPosition, kNormal, kTexCoord, kColor, kWeight, kTangent, kBinormal
def OpenMayaRender.MVaryingParameter.semanticName | ( | ) |
semanticName() -> string Get the semantic name assigned to this parameter. The semanticName is used to identify a custom vertex stream request in order to fill the stream with the appropriate data requested by a shader override.
def OpenMayaRender.MVaryingParameter.setSource | ( | ) |
setSource(semantic, name) -> self While the source of geometry parameters is usually configured by the artist through Maya's user interface, this method allows you to programatically set the source of a geometry parameter, including both the data type (e.g. position, normal, etc) and an optional set name (e.g. UV set 'map1'). This is useful for implementing custom default values or shader operations. * type (int) - the type of data to populate this parameter with (see semantic()) * name (string) - the specific data set to use for parameter types which support data sets, such as UV and color.
def OpenMayaRender.MVaryingParameter.sourceSemantic | ( | ) |
sourceSemantic() -> int Get the type of data (e.g. position, normal, uv) currently populating this parameter. This method will only return a useful value when called on leaf-level parameters (e.g. structures do not have sources, only the elements of a structure have sources). See semantic() for the list of values.
def OpenMayaRender.MVaryingParameter.sourceSetName | ( | ) |
sourceSetName() -> string If the current data type supports data sets (e.g. uv sets, color sets), get the name of the data set populating this parameter. This method will only return a useful value when called on leaf-level parameters (e.g. structures do not have sources, only the elements of a structure have sources).
def OpenMayaRender.MVaryingParameter.type | ( | ) |
type() -> int Get the type of this parameter. Available values: kInvalidParameter, kStructure, kFloat, kDouble, kChar, kUnsignedChar, kInt16, kUnsignedInt16, kInt32, kUnsignedInt32
def OpenMayaRender.MVaryingParameter.updateId | ( | ) |
updateId() -> int Get the update id. The update id is increased every time the parameter sources or sourceSet are changed. A plugin can compare the update id value between subsequent calls to this function to know if the source has changed since the last call.