pluginManager.loadClass Problems in MAXScript

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lightcube's picture

Actually it appears to work

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!

_______________________

Shawn Olson

Developer of Wall Worm

Anubis's picture

i know this may sounds as

i know this may sounds as strange tip,
but did you try to call pluginManager.loadClass twice.

my recent MAXScripts RSS (archive here)

lightcube's picture

I did some experimenting and

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.

_______________________

Shawn Olson

Developer of Wall Worm

lightcube's picture

Well I tried that just now...

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

Thanks, though. Any other ideas?

_______________________

Shawn Olson

Developer of Wall Worm

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.