ScriptSpot

Forum topic · General Scripting

pluginManager.loadClass Problems in MAXScript

By lightcube · 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)

lightcube · 2011-03-01

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!

Anubis · 2011-03-01

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

pluginManager.loadClass

twice.

lightcube · 2011-03-01

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

Thanks, though. Any other ideas?

lightcube · 2011-03-01

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.