Skip to content

Commit

Permalink
HYDRA 480 - add title to browser, make it stay in front of Maya main …
Browse files Browse the repository at this point in the history
…window, add error message when browser cannot be shown
  • Loading branch information
bduval2 committed Aug 16, 2023
1 parent f56ab48 commit 69a93f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/mayaHydraSceneBrowser/mayaHydraSceneBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <maya/MFnPlugin.h>
#include <maya/MArgList.h>
#include <maya/MGlobal.h>
#include <maya/MQtUtil.h>

PXR_NAMESPACE_USING_DIRECTIVE

Expand All @@ -18,12 +19,15 @@ MStatus mayaHydraSceneBrowserCmd::doIt( const MArgList& args )
{
const SceneIndicesVector& sceneIndices = GetMayaHydraLibInterface().GetTerminalSceneIndices();
if (sceneIndices.empty()) {
MGlobal::displayError("There are no registered terminal scene indices. The Hydra Scene Browser will not be shown.");
return MS::kFailure;
}
else {
if (!widget) {
widget = new HduiSceneIndexDebuggerWidget();
widget = new HduiSceneIndexDebuggerWidget(MQtUtil::mainWindow());
}
widget->setWindowTitle("Hydra Scene Browser");
widget->setWindowFlags(Qt::Tool); // Ensure the browser stays in front of the main Maya window
widget->SetSceneIndex("", sceneIndices.front(), true);
widget->show();
}
Expand Down

0 comments on commit 69a93f2

Please sign in to comment.