18 #include "pxr/imaging/glf/glew.h"
19 #include "AL/maya/utils/CommandGuiHelper.h"
20 #include "AL/maya/utils/MenuBuilder.h"
21 #include "AL/usdmaya/Global.h"
22 #include "AL/usdmaya/StageData.h"
23 #include "AL/usdmaya/DrivenTransformsData.h"
24 #include "AL/usdmaya/cmds/CreateUsdPrim.h"
25 #include "AL/usdmaya/cmds/DebugCommands.h"
26 #include "AL/usdmaya/cmds/EventCommand.h"
27 #include "AL/usdmaya/cmds/LayerCommands.h"
28 #include "AL/usdmaya/cmds/ProxyShapeCommands.h"
29 #include "AL/usdmaya/cmds/ProxyShapeSelectCommands.h"
30 #include "AL/usdmaya/cmds/RendererCommands.h"
31 #include "AL/usdmaya/cmds/UnloadPrim.h"
32 #include "AL/usdmaya/fileio/Export.h"
33 #include "AL/usdmaya/fileio/ExportTranslator.h"
34 #include "AL/usdmaya/fileio/Import.h"
35 #include "AL/usdmaya/fileio/ImportTranslator.h"
36 #include "AL/usdmaya/nodes/Layer.h"
37 #include "AL/usdmaya/nodes/LayerManager.h"
38 #include "AL/usdmaya/nodes/ProxyDrawOverride.h"
39 #include "AL/usdmaya/nodes/ProxyShape.h"
40 #include "AL/usdmaya/nodes/ProxyShapeUI.h"
41 #include "AL/usdmaya/nodes/RendererManager.h"
42 #include "AL/usdmaya/nodes/Transform.h"
43 #include "AL/usdmaya/nodes/TransformationMatrix.h"
45 #include "maya/MDrawRegistry.h"
46 #include "maya/MGlobal.h"
47 #include "maya/MStatus.h"
49 PXR_NAMESPACE_USING_DIRECTIVE
61 template<
typename AFnPlugin>
66 if(!MGlobal::optionVarExists(
"AL_usdmaya_selectMode"))
68 MGlobal::setOptionVarValue(
"AL_usdmaya_selectMode", 0);
71 if(!MGlobal::optionVarExists(
"AL_usdmaya_selectResolution"))
73 MGlobal::setOptionVarValue(
"AL_usdmaya_selectResolution", 10);
76 if(!MGlobal::optionVarExists(
"AL_usdmaya_pickMode"))
84 if (MGlobal::kInteractive == MGlobal::mayaState()) {
85 const auto otherPriority = MSelectionMask::getSelectionTypePriority(
"polymesh");
86 if (!MSelectionMask::registerSelectionType(AL::usdmaya::nodes::ProxyShape::s_selectionMaskName, otherPriority)) {
87 status.perror(
"Error registering selection mask!");
91 MString cmd =
"addSelectTypeItem(\"Surface\",\"";
92 cmd += AL::usdmaya::nodes::ProxyShape::s_selectionMaskName;
94 cmd +=
"AL Proxy Shape";
97 status = MGlobal::executeCommand(cmd);
99 status.perror(
"Error adding al_ProxyShape selection type!");
106 AL_REGISTER_COMMAND(plugin, AL::maya::utils::CommandGuiListGen);
140 AL_REGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ImportTranslator);
141 AL_REGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ExportTranslator);
153 MStatus status = plugin.registerNode(
154 AL::usdmaya::nodes::LayerManager::kTypeName,
155 AL::usdmaya::nodes::LayerManager::kTypeId,
157 AL::usdmaya::nodes::LayerManager::initialise);
159 status.perror(
"unable to register depend node LayerManager");
167 AL::usdmaya::cmds::constructDebugCommandGuis();
171 CHECK_MSTATUS(AL::maya::utils::MenuBuilder::generatePluginUI(plugin,
"AL_usdmaya"));
183 template<
typename AFnPlugin>
189 if (MGlobal::kInteractive == MGlobal::mayaState()) {
190 MString cmd =
"deleteSelectTypeItem(\"Surface\",\"";
191 cmd += AL::usdmaya::nodes::ProxyShape::s_selectionMaskName;
194 status = MGlobal::executeCommand(cmd);
196 status.perror(
"Error removing al_ProxyShape selection type!");
200 if (!MSelectionMask::deregisterSelectionType(AL::usdmaya::nodes::ProxyShape::s_selectionMaskName)) {
201 status.perror(
"Error deregistering selection mask!");
206 AL_UNREGISTER_COMMAND(plugin, AL::maya::utils::CommandGuiListGen);
240 AL_UNREGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ImportTranslator);
241 AL_UNREGISTER_TRANSLATOR(plugin, AL::usdmaya::fileio::ExportTranslator);
static AL_USDMAYA_PUBLIC void * conditionalCreator()
Creates the node, but only if there is not a non-referenced one in the scene already.
Given some selected proxy shape node, return the layer names.
Definition: LayerCommands.h:75
ProxyShapeResync.
Definition: ProxyShapeCommands.h:200
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:244
A command that lists the events available on either a particular node, or the global set of events...
Definition: EventCommand.h:117
static AL_USDMAYA_PUBLIC void onPluginLoad()
initialise the global state
A command that allows you to register and unregister new Event types from script. ...
Definition: EventCommand.h:54
ProxyShapeSelect.
Definition: ProxyShapeCommands.h:240
ProxyShapeSelect.
Definition: ProxyShapeCommands.h:220
Get / Set renderer plugin settings.
Definition: RendererCommands.h:39
MStatus registerPlugin(AFnPlugin &plugin)
This method is basically the main initializePlugin routine. The reason for it being a template is sim...
Definition: PluginRegister.h:62
TranslatePrim.
Definition: ProxyShapeCommands.h:278
A command that allows you to query information about a specific event.
Definition: EventCommand.h:74
AL_USDMAYA_PUBLIC void constructProxyShapeCommandGuis()
This function will generate all of the MEL script menus, and the option boxes, for all of the proxy s...
The layer manager node handles serialization and deserialization of all layers used by all ProxyShape...
Definition: RendererManager.h:43
InternalProxyShapeSelect.
Definition: ProxyShapeCommands.h:258
The UI component of the proxy shape node.
Definition: ProxyShapeUI.h:31
Get / Set whether the layer is currently muted.
Definition: LayerCommands.h:168
A command that allows you to register and unregister new Event types from script. ...
Definition: CreateUsdPrim.h:34
This code is effectively copied from the pixar plugin. It's just used to pass the usd stage through t...
Definition: StageData.h:36
This class provides the draw override for the USD proxy shape node.
Definition: ProxyDrawOverride.h:44
A command to activate / deactivate a prim - just a maya convenience wrapper around USD functionality...
Definition: UnloadPrim.h:56
A thin MEL command layer that just wraps the AL::usdmaya::fileio::Export process. ...
Definition: Export.h:96
A command that lists the events available on either a particular node, or the global set of events...
Definition: EventCommand.h:176
ProxyShapeFindLoadable.
Definition: ProxyShapeCommands.h:101
Given some selected or passed in proxy shape node, create a layer in maya parented to the layer match...
Definition: LayerCommands.h:91
A command that allows you to create / delete callbacks assigned to a specific event within AL_usdmaya...
Definition: EventCommand.h:100
The layer manager node handles serialization and deserialization of all layers used by all ProxyShape...
Definition: LayerManager.h:232
A command to import a USD file into Maya (partially supporting Animal Logic specific things) ...
Definition: Import.h:70
Imports a proxy shape into maya.
Definition: ProxyShapeCommands.h:79
Command to introspect and pull out data from the layer manager.
Definition: LayerCommands.h:186
ProxyShapePrintRefCountState.
Definition: ProxyShapeCommands.h:186
A command that lists the events available on either a particular node, or the global set of events...
Definition: EventCommand.h:162
MStatus unregisterPlugin(AFnPlugin &plugin)
This method is basically the main uninitializePlugin routine. The reason for it being a template is s...
Definition: PluginRegister.h:184
A command that allows you to query information about an event.
Definition: EventCommand.h:87
Save the specified layer.
Definition: LayerCommands.h:115
A command that will trigger all callbacks on an event.
Definition: EventCommand.h:131
The layer node stores a reference to an SdfLayer. Obsolete. LayerManager now used instead...
Definition: Layer.h:39
AL_USDMAYA_PUBLIC void constructRendererCommandGuis()
function called on startup to generate the menu & option boxes for the layer commands ...
A command to force a variant switch - just a maya convenience wrapper around USD functionality.
Definition: UnloadPrim.h:42
A command that allows you to query and modify the current status of the TfDebug symbols.
Definition: DebugCommands.h:37
ProxyShapeImportPrimPathAsMaya A command that will import a portion of a proxyNode as Maya geometry/t...
Definition: ProxyShapeCommands.h:153
AL_USDMAYA_PUBLIC void constructLayerCommandGuis()
function called on startup to generate the menu & option boxes for the layer commands ...
Get / Set the current edit target for the stage.
Definition: LayerCommands.h:143
static AL_USDMAYA_PUBLIC void onPluginUnload()
uninitialise the global state
A command that will delete all callback ids specified as an argument.
Definition: EventCommand.h:145
AL_USDMAYA_PUBLIC void constructPickModeCommandGuis()
Construct menu and commands for setting pick modes.