Skip to content

Commit

Permalink
Do not use localized strings yet for error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Feb 22, 2024
1 parent 6c72b69 commit eff7ba8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ target_sources(${TARGET_NAME}

set(HEADERS
PRIVATE
mhFootPrintNodeStrings.h
)

# -----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
//
////////////////////////////////////////////////////////////////////////

//Local headers
#include "mhFootPrintNodeStrings.h"

//maya headers
#include <maya/MPxLocatorNode.h>
#include <maya/MString.h>
Expand Down Expand Up @@ -351,15 +348,8 @@ namespace
MFnNumericData fnData(oDouble3);
fnData.getData( outVal[0], outVal[1], outVal[2] );
}

// Register all strings used by the plugin C++ code
static MStatus registerMStringResources()
{
MStringResource::registerString(rMayaHydraNotLoadedStringError);
return MS::kSuccess;
}

}//end of anonymous namespace
}
//end of anonymous namespace

//Static variables init
std::atomic_int MhFootPrint::_counter {0};
Expand Down Expand Up @@ -552,17 +542,13 @@ MBoundingBox MhFootPrint::boundingBox() const

void* MhFootPrint::creator()
{
static const MString errorString("You need to load the mayaHydra plugin before creating this node.");

int isMayaHydraLoaded = false;
// Validate that the mayaHydra plugin is loaded.
MGlobal::executeCommand( "pluginInfo -query -loaded mayaHydra", isMayaHydraLoaded );
if( ! isMayaHydraLoaded){
MStatus status;
MString errorString = MStringResource::getString(rMayaHydraNotLoadedStringError, status);
if (! status){
status.perror("Cannot retrieve the rMayaHydraNotLoadedStringError string, but you need to load mayaHydra before creating this node");
}else{
MGlobal::displayError(errorString);
}
MGlobal::displayError(errorString);
return nullptr;
}

Expand Down Expand Up @@ -636,16 +622,8 @@ MStatus initializePlugin( MObject obj )
MFnPlugin plugin( obj, PLUGIN_COMPANY, "2025.0", "Any");

MStatus status;
// This is done first, so the strings are available.
status = plugin.registerUIStrings(registerMStringResources, "mayaHydraFootPrintNodeInitStrings");
if (status != MS::kSuccess)
{
status.perror("registerUIStrings");
return status;
}

status = plugin.registerNode(
kMhFootPrintNodePluginId,
"MhFootPrint",
MhFootPrint::id,
&MhFootPrint::creator,
&MhFootPrint::initialize,
Expand Down

This file was deleted.

0 comments on commit eff7ba8

Please sign in to comment.