From a2a820709f12819c6bdb704709cff8249a1ccbce Mon Sep 17 00:00:00 2001 From: Pierre Baillargeon Date: Tue, 15 Oct 2024 15:57:45 -0400 Subject: [PATCH] EMSUSD-1504 add back missing MayaUSD localization The MEl version of localized strings for MayaUSdLib was lost. It is only used in the "Add Maya Reference" dialog and was not noticed during testing. --- lib/mayaUsd/resources/scripts/CMakeLists.txt | 1 + .../scripts/mayaUsdLibRegisterStrings.mel | 20 +++++++++++++++++++ .../scripts/mayaUsdLibRegisterStrings.py | 5 +---- .../adsk/scripts/mayaUSDRegisterStrings.mel | 1 + 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.mel diff --git a/lib/mayaUsd/resources/scripts/CMakeLists.txt b/lib/mayaUsd/resources/scripts/CMakeLists.txt index 62dd9df118..89d0905156 100644 --- a/lib/mayaUsd/resources/scripts/CMakeLists.txt +++ b/lib/mayaUsd/resources/scripts/CMakeLists.txt @@ -1,4 +1,5 @@ list(APPEND scripts_src + mayaUsdLibRegisterStrings.mel mayaUsdLibRegisterStrings.py mayaUsdAddMayaReference.mel mayaUsdAddMayaReference.py diff --git a/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.mel b/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.mel new file mode 100644 index 0000000000..a39afc8f7f --- /dev/null +++ b/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.mel @@ -0,0 +1,20 @@ +// Copyright 2022 Autodesk +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +global proc string getMayaUsdLibString(string $key) +{ + return getPluginResource("mayaUsdLib", $key); +} + diff --git a/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py b/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py index 657cbca14c..73487df1bd 100644 --- a/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py +++ b/lib/mayaUsd/resources/scripts/mayaUsdLibRegisterStrings.py @@ -197,10 +197,7 @@ def registerPluginResource(pluginId, stringId, resourceStr): '''See registerPluginResource.mel in Maya. Unfortunately there is no equivalent python version of this MEL proc - so we created our own version of it here. - - We also re-implement it here because we don't want warnings when registering - the same string again, which happens when re-loading the plugin.''' + so we created our own version of it here.''' fullId = 'p_%s.%s' % (pluginId, stringId) if cmds.displayString(fullId, exists=True): diff --git a/plugin/adsk/scripts/mayaUSDRegisterStrings.mel b/plugin/adsk/scripts/mayaUSDRegisterStrings.mel index 6ff000241b..8dd766858f 100644 --- a/plugin/adsk/scripts/mayaUSDRegisterStrings.mel +++ b/plugin/adsk/scripts/mayaUSDRegisterStrings.mel @@ -28,6 +28,7 @@ global proc mayaUSDRegisterStrings() python("import mayaUSDRegisterStrings; mayaUSDRegisterStrings.mayaUSDRegisterStrings()"); // Register the strings from the MayaUsd Lib. + source "mayaUSDLibRegisterStrings.mel"; python("import mayaUsdLibRegisterStrings; mayaUsdLibRegisterStrings.mayaUsdLibRegisterStrings()"); // load any localized resources