Shape¶
-
class
cgp_maya_utils.scene.Shape(name)¶ Bases:
cgp_maya_utils.scene.DagNodenode object that manipulates any kind of shape node
-
data(worldSpace=False)¶ data necessary to store the shape node on disk and/or recreate it from scratch
Parameters: worldSpace (bool) – True: shape position is in worldSpace -False: shape position is in localReturns: the data of the shape Return type: dict
-
duplicate(newTransform=False)¶ duplicate the shape
Parameters: newTransform (bool) – True: duplicated shape has a new transform -Falseduplicate shape has the same transformReturns: the duplicated shape Return type: cgp_maya_utils.Shape
-
export(name)¶ export the shape in the library
Parameters: name (str) – name of the shape in the library Returns: the exported file Return type: cgp_generic_utils.files.JsonFile
-
geometryFilters(geometryFilterTypes=None, geometryFilterTypesIncluded=True)¶ the geometryFilters bounded to the shape
Parameters: Returns: the geometryFilters bound to the shape
Return type:
-
classmethod
import_(style, parent=None, name=None)¶ import a shape
Parameters: - style (str) – style of the shape to import that exists in the shape library - ex :
cube-circle - parent (str or
cgp_maya_utils.scene.Transform) – transform to which the shape will be parented - new transform if nothing specified - name (str) – name of the shape
Returns: the imported shape
Return type: - style (str) – style of the shape to import that exists in the shape library - ex :
-
isDeformed()¶ check if the shape is deformed
Returns: True: the shape is deformed -False: the shape is not deformedReturn type: bool
-
match(targetShape, worldSpace=False)¶ match the shape to the target shape
Parameters: - targetShape (str or
cgp_maya_utils.scene.Shape) – shape to match the current shape to - worldSpace (bool) –
True: match is in worldSpace -False: match is in local
- targetShape (str or
-
mirror(mirrorPlane=None, worldSpace=False)¶ mirror the shape
Parameters:
-
mirroredPositions(mirrorPlane=None, worldSpace=False)¶ the mirror positions of the points of the shape
Parameters: Returns: the mirrored positions of the points
Return type:
-
positions(worldSpace=False)¶ the positions of the points of the shape
Parameters: worldSpace (bool) – True: positions are worldSpace -False: positions are localReturns: the positions of the points Return type: list[list[float]]
-
rotate(values, worldSpace=False, aroundBoundingBoxCenter=False)¶ rotate the shape
Parameters:
-
scale(values, aroundBoundingBoxCenter=False)¶ scale the shape
Parameters:
-
setColor(color=None)¶ set the color of the shape
Parameters: color (int or list[int]) – color channel values to set to the shape - indexValueor[r, g, b]
-
setPositions(positions, worldSpace=False)¶ set the positions of the points of the shape
Parameters:
-
setTransform(transform, worldSpace=False, deleteOriginalTransform=False)¶ set the transform of the shape
Parameters: - transform (str or
cgp_maya_utils.scene.Transform) – transform the shape will be parented to - worldSpace (bool) –
True: parenting occurs in worldSpace -False: parenting occurs in local - deleteOriginalTransform (bool) –
True: original transform is deleted -False: original transform remains
- transform (str or
-
transform()¶ the transform of the shape
Returns: the transform of the shape Return type: cgp_maya_utils.scene.Transformorcgp_maya_utils.scene.Joint
-