MEL and PyMEL Reference 

Ornatrix exposes a great deal of its functionality through MEL and Python to make it very extensible and flexible during creation of tools that work alongside it. This page provides a reference for some of the useful functionality accessible through MEL.

Some MEL functions are defined through a set of MEL scripts and Attribute Editor templates which are installed with Ornatrix. These are located inside the installation's /scripts directory. For example, scripts/OxQuickHair.mel contains the OxQuickHair() command, and scripts/OxLoadPlugin.mel contains the OxLoadPlugin() command.

 

The functions 

 

Access to hair and guides 

Most of these functions work on either HairShape or GuidesShape instance. StrandShape refers to either one of these objects and needs to be passed in as the first argument.

// Gets the number of strands in a shape
int OxGetStrandCount( strandShape );

// Determines whether specified hair or guides supports different point counts per each strand, or if all strands have uniform point count
int OxUsesStrandTopology( strandShape );

// Determines whether hair has per-strand transforms, or if its vertices are in object space
int OxUsesPerStrandTransformations( strandShape );

// Determines whether hair has extra twist data for each strand which can be used to rotate the hairs around their axis
int OxIsUsingPerStrandRotationAngles( strandShape );

// Determines whether hair contains information about where it was planted on the mesh
int OxKeepsSurfaceDependency( strandShape );

// Determines whether hair contains information about which guides define its shape
int OxKeepsGuideDependency( strandShape );

// Determines whether hair will use the underlying distribution mesh to determine its orientation. When true, deformations to the surface will make hair stay "glued" to it
int OxUsesTopologyOrientation( strandShape );

// Determines whether hair has the same point count in all strands
int OxUsesGlobalPerStrandPointCount( strandShape );

// If OxUsesGlobalPerStrandPointCount(...) return true, this gets the number of points in each strand
int OxGetGlobalStrandPointCount( strandShape );

 

Editing guides 

OxEditGuides commands is used to make some changes to guides inside an EditGuidesShape instance. You can create, delete, modify guides, edit channel data, and perform other operations.

OxEditGuides()