AL_USDMaya  0.16.6
USD to Maya Bridge
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PluginRegister.h
1 #pragma once
2 #include "pxr/imaging/glf/glew.h"
3 #include "AL/maya/CommandGuiHelper.h"
4 #include "AL/maya/MenuBuilder.h"
5 #include "AL/usdmaya/Global.h"
6 #include "AL/usdmaya/StageData.h"
7 #include "AL/usdmaya/cmds/LayerCommands.h"
8 #include "AL/usdmaya/cmds/ProxyShapeCommands.h"
9 #include "AL/usdmaya/cmds/UnloadPrim.h"
10 #include "AL/usdmaya/fileio/Export.h"
11 #include "AL/usdmaya/fileio/ExportTranslator.h"
12 #include "AL/usdmaya/fileio/Import.h"
13 #include "AL/usdmaya/fileio/ImportTranslator.h"
14 #include "AL/usdmaya/nodes/Layer.h"
15 #include "AL/usdmaya/nodes/ProxyDrawOverride.h"
16 #include "AL/usdmaya/nodes/ProxyShape.h"
17 #include "AL/usdmaya/nodes/ProxyShapeUI.h"
18 #include "AL/usdmaya/nodes/Transform.h"
19 #include "AL/usdmaya/nodes/TransformationMatrix.h"
20 
21 #include "maya/MDrawRegistry.h"
22 #include "maya/MGlobal.h"
23 #include "maya/MStatus.h"
24 
25 namespace AL {
26 namespace usdmaya {
27 
28 //----------------------------------------------------------------------------------------------------------------------
34 //----------------------------------------------------------------------------------------------------------------------
35 template<typename AFnPlugin>
36 MStatus registerPlugin(AFnPlugin& plugin)
37 {
38  GlfGlewInit();
39 
40  MStatus status;
57  AL_REGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ImportTranslator);
58  AL_REGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ExportTranslator);
63 
64  // generate the menu GUI + option boxes
67 
68  CHECK_MSTATUS(AL::maya::MenuBuilder::generatePluginUI(plugin, "AL_usdmaya"));
69 
71  return status;
72 }
73 
74 //----------------------------------------------------------------------------------------------------------------------
80 //----------------------------------------------------------------------------------------------------------------------
81 template<typename AFnPlugin>
82 MStatus unregisterPlugin(AFnPlugin& plugin)
83 {
84  MStatus status;
100  AL_UNREGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ImportTranslator);
101  AL_UNREGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ExportTranslator);
107 
109  return status;
110 }
111 
112 #undef AL_RUN_TESTS
113 
114 //----------------------------------------------------------------------------------------------------------------------
115 } // usdmaya
116 } // AL
117 //----------------------------------------------------------------------------------------------------------------------
Given some selected proxy shape node, return the layer names.
Definition: LayerCommands.h:53
#define AL_REGISTER_SHAPE_NODE(plugin, X, UI, DRAW)
Definition: Common.h:219
A method used by the generated command GUI code to retrieve a list of items from C++.
Definition: CommandGuiHelper.h:21
A custom proxy shape node that attaches itself to a USD file, and then renders it. The stage is held internally as a member variable, and it will be composed based on a change to the "filePath" attribute.
Definition: ProxyShape.h:33
#define AL_REGISTER_DRAW_OVERRIDE(plugin, X)
Definition: Common.h:261
void constructProxyShapeCommandGuis()
This function will generate all of the MEL script menus, and the option boxes, for all of the proxy s...
void constructLayerCommandGuis()
function called on startup to generate the menu & option boxes for the layer commands ...
MStatus registerPlugin(AFnPlugin &plugin)
This method is basically the main initializePlugin routine. The reason for it being a template is sim...
Definition: PluginRegister.h:36
#define AL_UNREGISTER_DATA(plugin, X)
Definition: Common.h:289
#define AL_UNREGISTER_COMMAND(plugin, X)
Definition: Common.h:273
The UI component of the proxy shape node.
Definition: ProxyShapeUI.h:15
Get / Set whether the layer is currently muted.
Definition: LayerCommands.h:145
This code is effectively copied from the pixar plugin. It's just used to pass the usd stage through t...
Definition: StageData.h:16
This class provides the draw override for the USD proxy shape node.
Definition: ProxyDrawOverride.h:20
A thin MEL command layer that just wraps the AL::usdmaya::fileio::Export process. ...
Definition: Export.h:46
ProxyShapeFindLoadable.
Definition: ProxyShapeCommands.h:76
#define AL_REGISTER_DATA(plugin, X)
Definition: Common.h:249
static void onPluginLoad()
initialise the global state
This class provides a transformation matrix that allows you to apply tweaks over some read only trans...
Definition: TransformationMatrix.h:19
#define AL_REGISTER_TRANSFORM_NODE(plugin, NODE, MATRIX)
Definition: Common.h:234
The AL::usdmaya::nodes::Transform node is a custom transform node that allows you to manipulate a USD...
Definition: Transform.h:62
A command to import a USD file into Maya (supporting A20 specific requirements)
Definition: Import.h:44
static MStatus generatePluginUI(FnPlugin &fnPlugin, const MString &prefix, const MString &extraOnInit="", const MString &extraOnExit="")
generates an init and exit script that intialises the GUI on plugin load/unload (via MFnPlugin::regis...
Definition: MenuBuilder.h:119
Imports a proxy shape into maya.
Definition: ProxyShapeCommands.h:56
#define AL_UNREGISTER_NODE(plugin, X)
Definition: Common.h:281
ProxyShapePrintRefCountState.
Definition: ProxyShapeCommands.h:161
MStatus unregisterPlugin(AFnPlugin &plugin)
This method is basically the main uninitializePlugin routine. The reason for it being a template is s...
Definition: PluginRegister.h:82
static void onPluginUnload()
uninitialise the global state
ProxyShapeImportAllTransforms From a proxy shape, this will import all usdPrims in the stage as AL_us...
Definition: ProxyShapeCommands.h:91
#define AL_REGISTER_DEPEND_NODE(plugin, X)
Definition: Common.h:206
#define AL_REGISTER_COMMAND(plugin, X)
Definition: Common.h:185
Save the specified layer.
Definition: LayerCommands.h:93
The layer node stores a reference to an SdfLayer.
Definition: Layer.h:20
Given some selected proxy shape node, create a new sub layer for the current edit target...
Definition: LayerCommands.h:67
A command to force a variant switch.
Definition: UnloadPrim.h:22
#define AL_UNREGISTER_DRAW_OVERRIDE(plugin, X)
Definition: Common.h:305
ProxyShapeImportPrimPathAsMaya A command that will import a portion of a proxyNode as Maya geometry/t...
Definition: ProxyShapeCommands.h:128
#define AL_UNREGISTER_TRANSLATOR(plugin, X)
Definition: Common.h:297
Get / Set the current edit target for the stage.
Definition: LayerCommands.h:121
#define AL_REGISTER_TRANSLATOR(plugin, X)
Definition: Common.h:197
ProxyShapeRemoveAllTransforms A command that will remove all AL::usdmaya::nodes::Transform nodes from...
Definition: ProxyShapeCommands.h:110