Skip to content

Commit

Permalink
Avoid Maya Hydra registration for mayaUsdPlugin if not loaded. (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppt-adsk authored Mar 26, 2024
1 parent f1c295d commit 7fd0fbc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/mayaHydra/hydraExtensions/sceneIndex/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include <maya/MItDag.h>
#include <maya/MMessage.h>
#include <maya/MNodeMessage.h>
#include <maya/MFnPlugin.h>
#include <maya/MGlobal.h>

#include <ufeExtensions/Global.h>

Expand Down Expand Up @@ -201,10 +203,16 @@ PXR_NAMESPACE_OPEN_SCOPE
// Remove this once the code has been moved to the MayaHydra namespace.
using namespace MayaHydra;

// MayaHydraSceneIndexRegistration is used to register a scene index for a given dag node type.
// MayaHydraSceneIndexRegistration is used to register a scene index for
// mayaUsdPlugin proxy shape nodes.
MayaHydraSceneIndexRegistry::MayaHydraSceneIndexRegistry(const std::shared_ptr<Fvp::RenderIndexProxy>& renderIndexProxy)
: _renderIndexProxy(renderIndexProxy)
{
if (!MFnPlugin::isNodeRegistered(kMayaUsdProxyShapeNode)) {
MGlobal::displayWarning("mayaUsdPlugin not loaded, cannot be registered to Maya Hydra. Please load mayaUsdPlugin, then switch back to a Maya Hydra viewport renderer.");
return;
}

MCallbackId id;
MStatus status;
id = MDGMessage::addNodeAddedCallback(
Expand Down

0 comments on commit 7fd0fbc

Please sign in to comment.