ScriptSpot home

Forum topic · General Scripting

pluginManager.loadClass Problems in MAXScript

By Shawn Olson · 2011-02-28

Description

I am having problems with pluginManager.loadClass. The plugin is a deferred plugin. When Max loads, its in the list of plugins in the plugin manager... but it's got a yellow dot to denote it's deferred.

So I add:

pluginManager.loadClass MyPluginName

Now the plugin is green in the plugin manager. But my script that called it fails.

However... if I then re-run my script, it works.

Also... if I happen to call it manually (it's a file export plugin) it works. And if I then run my script, it works.

In other words, the MAXScript:

pluginManager.loadClass MyPluginName

fails when first called but not later. But I obviously don't want the users of my script to always have to open my tool, do a failed export, then reopen my tool to do the final export.

Any ideas?

I've also asked about this on the Area Forums.

Comments (4)
Shawn Olson

Actually it appears to work if I call it twice at the very beginning of my script. But if I call it twice at the point that it would be required... it fails.

In any event, thank you for the input Anubis!

Panayot Karabakalov

i know this may sounds as strange tip,
but did you try to call

pluginManager.loadClass

twice.

Reply to Panayot Karabakalov
Shawn Olson

Well I tried that just now... no luck. This really has me banging my head against the wall!

Thanks, though. Any other ideas?

Reply to Panayot Karabakalov
Shawn Olson

I did some experimenting and "sort of" got it working... by using your idea of calling twice. That didn't work directly, but calling it twice in a script that then calls my script does seem to work. I will need to test more to see if it solves it altogether... but it still seems like a bug in the pluginManager.loadClass function.