Command Functions¶
createDagNode |
Create a DAG node. |
createDgNode |
Create a DG node. |
createPrimitive |
Create a geometry primitive. |
createTransform |
Create a transform node. |
unparent |
Unparent a random transform node. |
-
revl.
createDagNode
(context, type, parent=False)[source]¶ Create a DAG node.
To create a transform node or a geometry primitive, respectively use the functions
createTransform()
orcreatePrimitive()
.Parameters: - context (revl.Context) – Command context.
- type (maya.OpenMaya.MTypeId or str) – Type of the node to create, for example: ‘mesh’, ‘parentConstraint’, ‘pointLight’, ‘renderSphere’, and so on.
- parent (bool) –
True
to parent the new DAG node under a transform randomly picked from the scene. IfTrue
but no transform could be found in the scene, then the DAG node isn’t created. IfFalse
, a new transform is always created at the world and is used as the parent for the new DAG node.
Returns: The new node object or
NULL_OBJ
if the parameter ‘parent’ was set toTrue
but no transform could be found.Return type: maya.OpenMaya.MObject
-
revl.
createDgNode
(context, type)[source]¶ Create a DG node.
To create a DAG node, use either one of the functions
createDagNode()
,createTransform()
, orcreatePrimitive()
.Parameters: - context (revl.Context) – Command context.
- type (maya.OpenMaya.MTypeId or str) – Type of the node to create, for example: ‘addDoubleLinear’, ‘bevel’, ‘clamp’, ‘lambert’, and so on.
Returns: The new node object.
Return type: maya.OpenMaya.MObject
-
revl.
createPrimitive
(context, type=None, name=None, parent=False, forceTransformCreation=True)[source]¶ Create a geometry primitive.
Parameters: - context (revl.Context) – Command context.
- type (int) – Primitive type. Available values are enumerated in the
PrimitiveType
class. IfNone
, a primitive type is randomly picked. - name (str) – Base name for the new transform node. If
None
, no name is explicitely set. - parent (bool) –
True
to parent the new transform under another transform randomly picked from the scene, if any. Otherwise it is parented under the world. - forceTransformCreation (bool) –
True
to always create a new transform with the shapes as child, otherwise a new transform is created only if the parameterparent
isFalse
or if no transform could be found in the scene to parent the shapes to.
Returns: The new primitive, that is its generator, its transform, and its shapes.
Return type:
-
revl.
createTransform
(context, name=None, parent=False)[source]¶ Create a transform node.
Parameters: - context (revl.Context) – Command context.
- name (str) – Name of the new transform node. If
None
, the default name is used. - parent (bool) –
True
to parent the new transform under another transform randomly picked from the scene, if any. Otherwise it is parented under the world.
Returns: The new transform object.
Return type: maya.OpenMaya.MObject
-
revl.
unparent
(context)[source]¶ Unparent a random transform node.
Parameters: context (revl.Context) – Command context.