Issues unloading plugin despite custom nodes being removed

49 views
Skip to first unread message

gera...@flyingbark.com.au

unread,
Jun 8, 2020, 11:28:26 PM6/8/20
to Python Programming for Autodesk Maya

Hello.  I posted this on the ngSkinTools forum but wanted to widen the net a little as I'm not sure if its a Maya issue or a problem with the 3rd party tool. 

I get this:
// Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/pluginWin.mel line 1429: Plug-in, "ngSkinTools", cannot be unloaded because it defines a MPxData derived type that is still in use. // 

I'm using Maya 2017 v5 and NG 1.7.9 in production and we are hitting a problem where the 'requires' line for NG in the maya ascii file header still exists ( requires -dataType "ngSkinLayerDataStorage" "ngSkinTools" "1.7.9" ) despite the custom nodes being removed from the scene.

This is causing problems with files failing to open as NG is not currently permitted as part of our studio environment (they are weary of 3rd Party tools - but a few of us absolutely love NG's workflow and can't go back to Maya's paleolithic solution)

Currently I have written something that saves out the file as ma then line by line removes the requires lines but it has to rewrite the entire file and they can be big, then the file needs to be reopened. I need another solution. Note that when the header is removed, the file reopens fine so to my mind it appears to be possibly an issue of something in memory. Also when the file has its custom nodes removed and is saved (with header intact), opening the file again and unplugging the tool is successful - again making me think its something stuck in the mayas memory for that session..?


Any advice appreciated.

Gerard.

Ravi Jagannadhan

unread,
Jun 8, 2020, 11:48:06 PM6/8/20
to python_in...@googlegroups.com
Have you looked at the Maya command unknownNodes and unknownPlugins? They might help you clean up the scene a little bit more thoroughly. Where else could that MPxData type get used?

Ravi

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4493fcbc-3b2f-46ae-9bc4-dfff0a2406a5o%40googlegroups.com.


--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Soham Parmar

unread,
Jun 9, 2020, 12:07:02 AM6/9/20
to python_in...@googlegroups.com
I use this below line of code for cleaning my file so that does not gives error in others pc if they don't have that plugin and this remove in ma file headers also.
# plugin cleanup
plugins = cmds.unknownPlugin(query=True, list=True)
if plugins != None:
for plugin in plugins:
print plugin
cmds.unknownPlugin(plugin, remove=True)
and if this doesn’t work for you then you can try to unload ngSkinTool with below lines. (it will force unload.)
cmds.unloadPlugin("ngSkinTools", force=True)
 If you want to check if ngSkinTool is used in your file or not then you can run below command.(this will return True/False, that plugin can be safely unload.)
cmds.pluginInfo("ngSkinTools", query=True, unloadOk=True)
I hope this helps.

Soham.

gera...@flyingbark.com.au

unread,
Jun 9, 2020, 1:35:03 AM6/9/20
to Python Programming for Autodesk Maya
Hi there. Thanks. These were the first things I tried, The unloadPlugin fails even using the force flag. I am looking for a way to clear the memory of the MPxData or some other way to truly force the plugin to unload. there are also no unknown nodes.


On Tuesday, 9 June 2020 14:07:02 UTC+10, Soham Parmar wrote:
I use this below line of code for cleaning my file so that does not gives error in others pc if they don't have that plugin and this remove in ma file headers also.
# plugin cleanup
plugins = cmds.unknownPlugin(query=True, list=True)
if plugins != None:
for plugin in plugins:
print plugin
cmds.unknownPlugin(plugin, remove=True)
and if this doesn’t work for you then you can try to unload ngSkinTool with below lines. (it will force unload.)
cmds.unloadPlugin("ngSkinTools", force=True)
 If you want to check if ngSkinTool is used in your file or not then you can run below command.(this will return True/False, that plugin can be safely unload.)
cmds.pluginInfo("ngSkinTools", query=True, unloadOk=True)
I hope this helps.

Soham.
On 09-Jun-2020, at 8:01 AM, ger...@flyingbark.com.au wrote:


Hello.  I posted this on the ngSkinTools forum but wanted to widen the net a little as I'm not sure if its a Maya issue or a problem with the 3rd party tool. 

I get this:
// Error: file: C:/Program Files/Autodesk/Maya2017/scripts/others/pluginWin.mel line 1429: Plug-in, "ngSkinTools", cannot be unloaded because it defines a MPxData derived type that is still in use. // 

I'm using Maya 2017 v5 and NG 1.7.9 in production and we are hitting a problem where the 'requires' line for NG in the maya ascii file header still exists ( requires -dataType "ngSkinLayerDataStorage" "ngSkinTools" "1.7.9" ) despite the custom nodes being removed from the scene.

This is causing problems with files failing to open as NG is not currently permitted as part of our studio environment (they are weary of 3rd Party tools - but a few of us absolutely love NG's workflow and can't go back to Maya's paleolithic solution)

Currently I have written something that saves out the file as ma then line by line removes the requires lines but it has to rewrite the entire file and they can be big, then the file needs to be reopened. I need another solution. Note that when the header is removed, the file reopens fine so to my mind it appears to be possibly an issue of something in memory. Also when the file has its custom nodes removed and is saved (with header intact), opening the file again and unplugging the tool is successful - again making me think its something stuck in the mayas memory for that session..?


Any advice appreciated.

Gerard.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Gerard Van Ommen Kloeke

unread,
Jun 9, 2020, 2:24:37 AM6/9/20
to python_in...@googlegroups.com
Djx helped me out and reminded me to check the undo queue. FlushUndo will clear the memory in this case and the plugin gets unloaded! SOLVED.
Cheers

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/vyew_9S7a00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/e45d64d8-a344-413b-9467-0f582b39c6b2o%40googlegroups.com.

owen burgess

unread,
Jun 9, 2020, 3:33:12 AM6/9/20
to python_in...@googlegroups.com
Hey Gerard,

Try using the MEL command unknownPlugin, which "allows querying of the unknown plug-ins used by the scene and provides a means to remove them."

Owen

--

Gerard Van Ommen Kloeke

unread,
Jun 9, 2020, 10:04:49 AM6/9/20
to python_in...@googlegroups.com
Thanks Owen. The issue seems to have been memory and data retained I’m Maya’s undo queue. Djx reminded me to check this. Flushing the queue allowed Maya to release the plugin. 
Kind regards. 
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/vyew_9S7a00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAGTPGOAiUVob9AGW%3DuHH-Hu%2B37ZW2G7RY8i9TTNMC-frCz81xQ%40mail.gmail.com.
Message has been deleted

Cedric Bazillou

unread,
Jun 9, 2020, 4:51:49 PM6/9/20
to Python Programming for Autodesk Maya
I think you might need as well toclear the undoStack and remove the custom data
you can procedurally discover what a plugin expose with pluginInfo ( dependNode, data etc)

Gerard Van Ommen Kloeke

unread,
Jun 9, 2020, 10:04:18 PM6/9/20
to python_in...@googlegroups.com
Thanks everyone for the assistance. Djx won the day with his recommendation to flush the undoQueue. (Cedric also).
This issue is resolved now

On Wed, 10 Jun 2020 at 06:51, Cedric Bazillou <cedricb...@gmail.com> wrote:
I think you might need as well toclear the undoStack and remove the custom data
you can procedurally discover what a plugin expose with pluginInfo ( dependNode, data etc)

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/vyew_9S7a00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages