AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Maya Helpers

Modules

 Profiler
 A series of classes and macros that provide a very simple in-code profiler to get some high level timings of the various processes during import / export operations.
 
 Maya GUI
 These are a series of classes and functions to help automate a lot of the boiler plate GUI code that is often needed for a Maya plug-in. The classes fall into two main categories

  1. code generators that automate the construction of MEL script UI (e.g. AETemplates, menus, file export dialogs, etc).
  2. wrappers around core Maya MPx functionality to enforce error checking, and minimize potential errors.
  3. SIMD optimized methods for extracting data from core Maya API classes.

 

Classes

struct  AL::maya::DgNodeHelper
 Utility class that provides support for setting/getting attributes. More...
 

Macros

#define AL_MAYA_CHECK_ERROR(status, ErrorString)
 Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, the status is returned. More...
 
#define AL_MAYA_CHECK_ERROR2(status, ErrorString)
 Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, the program execution continues. More...
 
#define AL_MAYA_CHECK_ERROR_RETURN_NULL_MOBJECT(status, ErrorString)
 Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, a null MObject is returned. More...
 
#define LAYER_HANDLE_CHECK(X)
 utility macro to check that an SdfLayerHandle is actually valid. More...
 
#define AL_REGISTER_COMMAND(plugin, X)
 
#define AL_REGISTER_TRANSLATOR(plugin, X)
 
#define AL_REGISTER_DEPEND_NODE(plugin, X)
 
#define AL_REGISTER_SHAPE_NODE(plugin, X, UI, DRAW)
 
#define AL_REGISTER_TRANSFORM_NODE(plugin, NODE, MATRIX)
 
#define AL_REGISTER_DATA(plugin, X)
 
#define AL_REGISTER_DRAW_OVERRIDE(plugin, X)
 
#define AL_UNREGISTER_COMMAND(plugin, X)
 
#define AL_UNREGISTER_NODE(plugin, X)
 
#define AL_UNREGISTER_DATA(plugin, X)
 
#define AL_UNREGISTER_TRANSLATOR(plugin, X)
 
#define AL_UNREGISTER_DRAW_OVERRIDE(plugin, X)
 

Detailed Description

Macro Definition Documentation

#define AL_MAYA_CHECK_ERROR (   status,
  ErrorString 
)
Value:
{ \
MStatus _status_##__LINE__ = status; \
if (!_status_##__LINE__) \
{ \
MString maya_error_string = __FILE__ ":"; \
maya_error_string += __LINE__; \
maya_error_string += " "; \
maya_error_string += _status_##__LINE__.errorString(); \
maya_error_string += " : "; \
maya_error_string += ErrorString; \
MGlobal::displayError(maya_error_string); \
return status; \
} }

Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, the status is returned.

#define AL_MAYA_CHECK_ERROR2 (   status,
  ErrorString 
)
Value:
{ \
MStatus _status_##__LINE__ = status; \
if ((_status_##__LINE__) != MS::kSuccess) \
{ \
MString maya_error_string = __FILE__ ":"; \
maya_error_string += __LINE__; \
maya_error_string += " "; \
maya_error_string += _status_##__LINE__.errorString(); \
maya_error_string += " : "; \
maya_error_string += ErrorString; \
MGlobal::displayError(maya_error_string); \
} }

Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, the program execution continues.

#define AL_MAYA_CHECK_ERROR_RETURN_NULL_MOBJECT (   status,
  ErrorString 
)
Value:
{ \
MStatus _status_##__LINE__ = status; \
if (!_status_##__LINE__) \
{ \
MString maya_error_string = __FILE__ ":"; \
maya_error_string += __LINE__; \
maya_error_string += " "; \
maya_error_string += _status_##__LINE__.errorString(); \
maya_error_string += " : "; \
maya_error_string += ErrorString; \
MGlobal::displayError(maya_error_string); \
return MObject::kNullObj; \
} }

Given the status, validates that the status is ok. If not, an error is logged using the specified error message. If an error occurs, a null MObject is returned.

#define AL_REGISTER_COMMAND (   plugin,
 
)
Value:
{ \
MStatus status = plugin.registerCommand( \
X ::kName, \
X ::creator, \
X ::createSyntax); \
if(!status) { \
status.perror("unable to register command " #X); \
return status; \
}}

a macro to register an MPxCommand derived command with maya

#define AL_REGISTER_DATA (   plugin,
 
)
Value:
{ \
MStatus status = plugin.registerData( \
X ::kName, \
X ::kTypeId, \
X ::creator); \
if(!status) { \
status.perror("unable to register data " #X); \
return status; \
}}

a macro to register an MPxData derived object with maya

#define AL_REGISTER_DEPEND_NODE (   plugin,
 
)
Value:
{ \
MStatus status = plugin.registerNode( \
X ::kTypeName, \
X ::kTypeId, \
X ::creator, \
X ::initialise); \
if(!status) { \
status.perror("unable to register depend node " #X); \
return status; \
}}

a macro to register an MPxNode derived node with maya

#define AL_REGISTER_DRAW_OVERRIDE (   plugin,
 
)
Value:
{ \
MStatus status = MHWRender::MDrawRegistry::registerDrawOverrideCreator( \
X ::kDrawDbClassification, \
X ::kDrawRegistrantId, \
X ::creator); \
if (!status) { \
status.perror("unable to register draw override " #X); \
return status; \
}}

a macro to register a custom draw override with maya

#define AL_REGISTER_SHAPE_NODE (   plugin,
  X,
  UI,
  DRAW 
)
Value:
{ \
MStatus status = plugin.registerShape( \
X ::kTypeName, \
X ::kTypeId, \
X ::creator, \
X ::initialise, \
UI ::creator, \
&DRAW ::kDrawDbClassification); \
if(!status) { \
status.perror("unable to register shape node " #X); \
return status; \
}}

a macro to register an MPxShape derived node with maya

#define AL_REGISTER_TRANSFORM_NODE (   plugin,
  NODE,
  MATRIX 
)
Value:
{ \
MStatus status = plugin.registerTransform( \
NODE ::kTypeName, \
NODE ::kTypeId, \
NODE ::creator, \
NODE ::initialise, \
MATRIX ::creator, \
MATRIX ::kTypeId); \
if(!status) { \
status.perror("unable to register transform node " #NODE); \
return status; \
}}

a macro to register an MPxTransform derived node with maya

#define AL_REGISTER_TRANSLATOR (   plugin,
 
)
Value:
{ \
MStatus status = X ::registerTranslator(plugin); \
if(!status) { \
status.perror("unable to register file translator " #X); \
return status; \
}}

a macro to register an MPxFileTranslator derived command with maya

#define AL_UNREGISTER_COMMAND (   plugin,
 
)
Value:
{ \
MStatus status = plugin.deregisterCommand(X ::kName); \
if (!status) { \
status.perror("deregisterCommand AL::usdmaya::" #X); \
return status; \
}}

a macro to unregister a MEL command from maya

#define AL_UNREGISTER_DATA (   plugin,
 
)
Value:
{\
MStatus status = plugin.deregisterData(X ::kTypeId); \
if (!status) { \
status.perror("deregisterData AL::usdmaya::" #X); \
return status; \
}}

a macro to unregister a custom MPxData derived object from maya

#define AL_UNREGISTER_DRAW_OVERRIDE (   plugin,
 
)
Value:
{ \
MStatus status = MHWRender::MDrawRegistry::deregisterDrawOverrideCreator( \
X ::kDrawDbClassification, \
X ::kDrawRegistrantId); \
if (!status) { \
status.perror("deregisterDrawOverrideCreator " #X); \
return status; \
}}

a macro to unregister a custom draw override from Maya

#define AL_UNREGISTER_NODE (   plugin,
 
)
Value:
{ \
MStatus status = plugin.deregisterNode(X ::kTypeId); \
if (!status) { \
status.perror("deregisterNode AL::usdmaya::" #X); \
return status; \
}}

a macro to unregister a custom node from maya

#define AL_UNREGISTER_TRANSLATOR (   plugin,
 
)
Value:
{\
MStatus status = X ::deregisterTranslator(plugin); \
if(!status) { \
status.perror("deregisterTranslator AL::usdmaya::" #X); \
return status; \
}}

a macro to unregister a custom MPxFileTranslator derived object from maya

#define LAYER_HANDLE_CHECK (   X)
Value:
if(!X) \
std::cout << "Layer is invalid " << __FILE__ << " " << __LINE__ << std::endl;

utility macro to check that an SdfLayerHandle is actually valid.