PDA

View Full Version : Dynamically compiling an SDK plugin


lo
01-06-2011, 08:43 AM
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

marktsang
01-09-2011, 07:42 PM
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

lo
01-09-2011, 09:00 PM
yes I did try it and it worked but would cause the plugin to crash max when reloaded again

sergo.pogosyan
01-10-2011, 06:24 PM
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.

denisT
01-10-2011, 11:49 PM
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.

SONIC3D
01-10-2011, 11:57 PM
Make your plugin be plugin based.And dynamicly load/unload the 2nd level plugins in your 1st level plugin.

denisT
01-11-2011, 12:39 AM
Make your plugin be plugin based.And dynamicly load/unload the 2nd level plugins in your 1st level plugin.

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
01-11-2011, 02:04 AM
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.)

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.

lo
01-11-2011, 04:55 AM
The plugin is a controller
Thanks to everyone for their suggestions, will go on my 'to test' list :)

SONIC3D
01-11-2011, 05:06 AM
Maybe I will write a sample about 3dsmax plugin with plugin enabled in my free time.

sergo.pogosyan
01-11-2011, 05:53 AM
Maybe I will write a sample about 3dsmax plugin with plugin enabled in my free time.
That would be great :)

CGTalk Moderation
01-11-2011, 05:53 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.