Miscellaneous

validate Check if the commands are well-formed.
NULL_OBJ Constant denoting an invalid object.
Command Weighted command.
Primitive Primitive.
PrimitiveType Enumerator for the primitive types.
pickTransform Randomly pick a transform.

revl.validate(commands)[source]

Check if the commands are well-formed.

Parameters:commands (list of revl.Command or compatible tuple) – Commands.
Raises:TypeError – Some of the commands aren’t well-formed.

revl.NULL_OBJ = maya.OpenMaya.MObject().kNullObj

Constant denoting an invalid object.


class revl.Command(weight, function, args=None, kwargs=None)[source]

Weighted command.

It is not necessary to use this class to define a command as it can be done by directly using a tuple instead. But the tuple needs to be compatible with the structure defined here.

weight

float

Probability for this command to be evaluated. The value is relative to the other commands defined in the same set.

function

function

Function to evaluate. Its first argument needs to the command context Context.

args

tuple or None

Additional arguments to pass to the function. None is the equivalent of setting an empty tuple.

kwargs

dict or None

Keyword arguments to pass to the function. None is the equivalent of setting an empty dictionary.


class revl.Primitive(generator, transform, shapes)[source]

Primitive.

An instance of this class is returned by the createPrimitive() function.

generator

maya.OpenMaya.MObject

Node object generating the shapes.

transform

maya.OpenMaya.MObject

Transform object.

shapes

list of maya.OpenMaya.MObject

Shape objects.


class revl.PrimitiveType[source]

Enumerator for the primitive types.

This is used as a parameter for the createPrimitive() function.

NURBS_CIRCLE
NURBS_CONE
NURBS_CUBE
NURBS_CYLINDER
NURBS_PLANE
NURBS_SPHERE
NURBS_SQUARE
NURBS_TORUS
POLY_CONE
POLY_CUBE
POLY_CYLINDER
POLY_HELIX
POLY_MISC
POLY_PIPE
POLY_PLANE
POLY_PLATONIC_SOLID
POLY_PRISM
POLY_PYRAMID
POLY_SPHERE
POLY_TORUS

revl.pickTransform(context)[source]

Randomly pick a transform.

Pickable transforms are listed within the Context.transforms attribute.

Parameters:context (revl.Context) – Command context.
Returns:The picked transform or NULL_OBJ if the attribute Context.transforms is empty.
Return type:maya.OpenMaya.MObject