Autodesk/maya-usd

(EMSUSD-1504) Warning Spam when re-loading mayaUsdPlugin

Opened this issue · 5 comments

Describe the bug
If the mayaUsdPlugin is re-loaded (either by unloading and loading the plugin or by opening additional maya files that will attempt to load the plugin implicitly), there are almost 400 lines of warning spewage issued to the script editor:

// Warning: file: /dist/sw/maya/2023.update3/scripts/others/registerPluginResource.mel line 81: Plug-in "mayaUsdPlugin" resource identifier "kButtonSave" already registered, it will be replaced
// Warning: file: /dist/sw/maya/2023.update3/scripts/others/registerPluginResource.mel line 81: Plug-in "mayaUsdPlugin" resource identifier "kButtonSet" already registered, it will be replaced
// Warning: file: /dist/sw/maya/2023.update3/scripts/others/registerPluginResource.mel line 81: Plug-in "mayaUsdPlugin" resource identifier "kButtonCancel" already registered, it will be replaced...

This is making it difficult for our users to identify warnings and errors that they may need to address

Steps to reproduce
Steps to reproduce the behavior:

  1. Open maya
  2. Load mayaUsdPlugin.so
  3. Unload mayaUsdPlugin.so
  4. Re-load mayaUsdPlugin.so
  5. Observe the script editor output

Expected behavior
No warnings are issued upon subsequent mayaUsdPlugin loads

Specs (if applicable):

  • Linux EL9
  • gcc 9.3.1
  • Maya 2023.3
  • Maya USD commit SHA dev at 15ce0537
  • Internal Dev USD build

Thanks for reporting. We'll look into it.

Answer from the devs is that unloading/reloading the plugin in a single session has never really been supported and may run into unexpected issues. Regardless, I'll ask if there is a way to minimize this message.

Yes, the load/unload/reload steps were for simplicity. In practice, we typically run into this when a user opens a Maya file in a running instance of Maya. If the file contains data that will trigger the plugin to load, the same spewage will occur when it is opened if the plugin is already loaded. Is there a way around that?

Thanks for more context. I'm bringing this back to the devs.

Yes, the load/unload/reload steps were for simplicity. In practice, we typically run into this when a user opens a Maya file in a running instance of Maya. If the file contains data that will trigger the plugin to load, the same spewage will occur when it is opened if the plugin is already loaded. Is there a way around that?

Hi @dj-mcg , I am attempting to repro this on my end but opening a Maya file that contains USD data into an instance of Maya that already has the plug-in loaded doesn't seem to attempt a reload of the plug-in. Are you running any startups scripts in these files that attempt to load the plug-in? If I attempt to load the plugin with an eval-deferred line, I get a message that the plugin is already loaded.
evalDeferred("loadPlugin(\"mayaUsdPlugin\", \"mayaUsdPlugin\")");
// Warning: line 1: Plug-in, "mayaUsdPlugin.mll", is already loaded. Skipped.
I plan on logging an issue for this, but wanted to understand the issue a bit better. I am able to repro the warnings if I unload/reload the scene file, but that has been the only way so far.