6 #if !defined(AL_MAYA_PRINT_UI_CODE)
7 # define AL_MAYA_PRINT_UI_CODE 0
26 class MFnDependencyNode;
45 class CommandGuiHelper;
46 class CommandGuiHelperTestCMD;
51 class NodeHelperUnitTest;
62 #if !defined(AL_MAYA_ENABLE_SIMD)
63 # define AL_MAYA_ENABLE_SIMD 1
67 #if !defined(__SSE3__) && !defined(__AVX2__)
68 # undef AL_MAYA_ENABLE_SIMD
69 # define AL_MAYA_ENABLE_SIMD 0
75 #define AL_MAYA_CHECK_ERROR(status, ErrorString) { \
76 MStatus _status_##__LINE__ = status; \
77 if (!_status_##__LINE__) \
79 MString maya_error_string = __FILE__ ":"; \
80 maya_error_string += __LINE__; \
81 maya_error_string += " "; \
82 maya_error_string += _status_##__LINE__.errorString(); \
83 maya_error_string += " : "; \
84 maya_error_string += ErrorString; \
85 MGlobal::displayError(maya_error_string); \
92 #define AL_MAYA_CHECK_ERROR2(status, ErrorString) { \
93 MStatus _status_##__LINE__ = status; \
94 if ((_status_##__LINE__) != MS::kSuccess) \
96 MString maya_error_string = __FILE__ ":"; \
97 maya_error_string += __LINE__; \
98 maya_error_string += " "; \
99 maya_error_string += _status_##__LINE__.errorString(); \
100 maya_error_string += " : "; \
101 maya_error_string += ErrorString; \
102 MGlobal::displayError(maya_error_string); \
108 #define AL_MAYA_CHECK_ERROR_RETURN_NULL_MOBJECT(status, ErrorString) { \
109 MStatus _status_##__LINE__ = status; \
110 if (!_status_##__LINE__) \
112 MString maya_error_string = __FILE__ ":"; \
113 maya_error_string += __LINE__; \
114 maya_error_string += " "; \
115 maya_error_string += _status_##__LINE__.errorString(); \
116 maya_error_string += " : "; \
117 maya_error_string += ErrorString; \
118 MGlobal::displayError(maya_error_string); \
119 return MObject::kNullObj; \
124 #define LAYER_HANDLE_CHECK(X) \
126 std::cout << "Layer is invalid " << __FILE__ << " " << __LINE__ << std::endl;
128 #if AL_GENERATING_DOCS
129 # define AL_MAYA_DECLARE_COMMAND()
138 # define AL_MAYA_DEFINE_COMMAND(COMMAND, NAMESPACE)
142 # define AL_MAYA_DECLARE_NODE()
149 # define AL_MAYA_DEFINE_NODE(NODE, TYPEID, NAMESPACE)
153 # define AL_MAYA_COMMAND_HELP(database, __helpText)
155 # define AL_MAYA_DECLARE_COMMAND() \
156 static const char* const g_helpText; \
157 static void* creator(); \
158 static MSyntax createSyntax(); \
159 static const MString kName;
161 # define AL_MAYA_DEFINE_COMMAND(COMMAND, NAMESPACE) \
162 void* COMMAND :: creator() { return new COMMAND; } \
163 const MString COMMAND :: kName(#NAMESPACE "_" #COMMAND);
165 # define AL_MAYA_DECLARE_NODE() \
166 static void* creator(); \
167 static MStatus initialise(); \
168 static const MString kTypeName; \
169 static const MTypeId kTypeId;
171 # define AL_MAYA_DEFINE_NODE(NODE, TYPEID, NAMESPACE) \
172 void* NODE :: creator() { return new NODE; } \
173 const MString NODE :: kTypeName(#NAMESPACE "_" #NODE); \
174 const MTypeId NODE :: kTypeId(TYPEID);
176 # define AL_MAYA_COMMAND_HELP(database, __helpText) \
177 if(database.isFlagSet("-h")) { \
178 MGlobal::displayInfo( __helpText ); \
179 return MS::kSuccess; \
185 #define AL_REGISTER_COMMAND(plugin, X) { \
186 MStatus status = plugin.registerCommand( \
191 status.perror("unable to register command " #X); \
197 #define AL_REGISTER_TRANSLATOR(plugin, X) { \
198 MStatus status = X ::registerTranslator(plugin); \
200 status.perror("unable to register file translator " #X); \
206 #define AL_REGISTER_DEPEND_NODE(plugin, X){ \
207 MStatus status = plugin.registerNode( \
213 status.perror("unable to register depend node " #X); \
219 #define AL_REGISTER_SHAPE_NODE(plugin, X, UI, DRAW){ \
220 MStatus status = plugin.registerShape( \
226 &DRAW ::kDrawDbClassification); \
228 status.perror("unable to register shape node " #X); \
234 #define AL_REGISTER_TRANSFORM_NODE(plugin, NODE, MATRIX){ \
235 MStatus status = plugin.registerTransform( \
243 status.perror("unable to register transform node " #NODE); \
249 #define AL_REGISTER_DATA(plugin, X){ \
250 MStatus status = plugin.registerData( \
255 status.perror("unable to register data " #X); \
261 #define AL_REGISTER_DRAW_OVERRIDE(plugin, X) { \
262 MStatus status = MHWRender::MDrawRegistry::registerDrawOverrideCreator( \
263 X ::kDrawDbClassification, \
264 X ::kDrawRegistrantId, \
267 status.perror("unable to register draw override " #X); \
273 #define AL_UNREGISTER_COMMAND(plugin, X) { \
274 MStatus status = plugin.deregisterCommand(X ::kName); \
276 status.perror("deregisterCommand AL::usdmaya::" #X); \
279 #define AL_UNREGISTER_NODE(plugin, X) { \
282 MStatus status = plugin.deregisterNode(X ::kTypeId); \
284 status.perror("deregisterNode AL::usdmaya::" #X); \
287 #define AL_UNREGISTER_DATA(plugin, X) {\
290 MStatus status = plugin.deregisterData(X ::kTypeId); \
292 status.perror("deregisterData AL::usdmaya::" #X); \
295 #define AL_UNREGISTER_TRANSLATOR(plugin, X) {\
298 MStatus status = X ::deregisterTranslator(plugin); \
300 status.perror("deregisterTranslator AL::usdmaya::" #X); \
303 #define AL_UNREGISTER_DRAW_OVERRIDE(plugin, X) { \
306 MStatus status = MHWRender::MDrawRegistry::deregisterDrawOverrideCreator( \
307 X ::kDrawDbClassification, \
308 X ::kDrawRegistrantId); \
310 status.perror("deregisterDrawOverrideCreator " #X); \
This class implements a very simple incode profiler. This profiler is NOT thread safe. It is mainly used to get some basic stats on the where the bottlenecks are during a file import/export operation. A simple example of usage:
Definition: CodeTimings.h:168
Utility class that constructs the file translator export GUI from the export options you want to supp...
Definition: FileTranslatorOptions.h:148
Utility class that parses the file translator options passed through by Maya.
Definition: FileTranslatorOptions.h:17
A utility class that provides a 'unique' base class to derive new translator from.
Definition: Common.h:47
This class provides a static hash that should be unique for a line within a specific function...
Definition: CodeTimings.h:22
This class represents a path made up of ProfilerSectionTag's. It is used so that we can distinguish b...
Definition: CodeTimings.h:84
This is a little helper object designed to reduce the amount of boilerplate GUI code you need to jump...
Definition: NodeHelper.h:175