Support custom layout with dialogPlugin

On 17/06/2015 at 05:57, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R16 
Platform:      Mac OSX  ; 
Language(s) :     C++  ;

---------
Hi,

I'm currently working on a commandData/dialog plugin.
I want to support creating layouts with my plugin in the layouts.
How should I go about this?

If I dock my plugin, save the layout and then load it again, my dialog is still showing, but only the docking icon, nothing else from my GUI.
If I then execute the plugin again, another dialog comes up, which isn't what I want.

Should it be inside my main.cpp file inside PluginMessage inside C4DPL_BUILDMENU?
If so, how should I implement something like this?

Thanks in advance for your help and time!
Greetings,
Casimir Smets

On 17/06/2015 at 06:57, xxxxxxxx wrote:

Hello,

to support reloading layouts you must implement RestoreLayout(). You find an example on GitHub.

Best wishes,
Sebastian

On 17/06/2015 at 06:58, xxxxxxxx wrote:

Hi,

Thanks for your answer!
I will definately look into that!

Greetings,
Casimir Smets

On 18/06/2015 at 01:20, xxxxxxxx wrote:

Hi Sebastian,

Well, that was easy! 😄
Is there also a way to first look if there is still an instance of the plugin, and if so, load the instance?

Thanks for your answer!!!
With kind regards,
Casimir Smets

On 18/06/2015 at 05:19, xxxxxxxx wrote:

Hello,

I'm not exactly sure what you mean. Your CommandData plugin should own your dialog so of course you should be able to check if an instance of your dialog exists.

Best wishes,
Sebastian

On 25/06/2015 at 06:48, xxxxxxxx wrote:

Hi Sebastian!

I meant that, if the user loads his layout with the plugin in it, then loads another layout, and loads the first layout again, it should use the instance that is still active (the values shouldn't be resetting).
How should I go about this?

Thanks for your help and time!
Greetings,
Casimir Smets