Notifications
Clear all

[Closed] Dynamically compiling an SDK plugin

 lo1

Hi

I know there is a way to compile C# code on the fly using the dotnet Microsoft.CSharp.CSharpCodeProvider class.

I was wondering if this could be done similarly for a C++ SDK plugin, to avoid having to restart max all the time during development.

Thanks

10 Replies

someone (scorpion???) here wrote a pluginUnloader plugin for max that could unload a plugin that was loaded in a session in max
you could possilby use this to unload the plugin and reload it when you compile

 lo1

yes I did try it and it worked but would cause the plugin to crash max when reloaded again

I didn’t try it myself but have read somewhere that it is possible to construct the plugin in a special “two part” manner – main, “loader” part is compiled one time and have LoadDll command to call the separate, working, part of a plugin which is compiled to separate dll file. You have to use some additional button in your plugin to load/unload the separate dll from the plugin.

Seems that this pluginUnloader makes it the same but in some general way.

i don’t want to disappoint anyone but there is no way to compile a max sdk plug-in on-fly. if you need recompile the plug-in you have to reload max. end of story.

Make your plugin be plugin based.And dynamicly load/unload the 2nd level plugins in your 1st level plugin.

2 Replies
(@denist)
Joined: 10 months ago

Posts: 0

probably we have to ask LO what kind of plug-in she is working on.

SONIC3D, you are right. there are some particular cases when a max plug-in might be unloadable. but in general case it doesn’t work. (at least for me; and i will be more than happy to be wrong.)

(@sonic3d)
Joined: 10 months ago

Posts: 0

Hi,denisT:
Maybe you have not understand what I mean.The structure of the unloadable plugin should be

…—[SubPlugin1 of MyPlugin]
…|
[3dsMax]<——[MyPlugin]<—-[SubPlugin2 of MyPlugin]
…|
…—[SubPlugin3 of MyPlugin]

Develop a plugin “MyPlugin” for 3dsmax via maxsdk.This Plugin contains function pointer slot for free and it can register/unregister the featured function of SubPlugins to these free slot.Then you can develop other SubPlugins for “MyPlugin”.If you implement it in good way.You can even make “MyPlugin” flexible and extensible that multiple SubPlugins can works together in the same time.

 lo1

The plugin is a controller
Thanks to everyone for their suggestions, will go on my ‘to test’ list

Maybe I will write a sample about 3dsmax plugin with plugin enabled in my free time.

1 Reply
(@sergo-pogosyan)
Joined: 10 months ago

Posts: 0

That would be great