Send message from NodeData to iCustomGui.
-
On 11/09/2017 at 07:03, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;---------
Hello.I have an iCustomGui in a ShaderData plugin.
Pressing a button in the shader data causes the custom gui to add more parameters in its UI.
I do that in custom gui's SetData method between LayoutFlushGroup(...) and LayoutChanged(...).
Nevertheless, SetData doesn't seem the correct place for the "layout reset" code.
Everytime I add a parameter (E.g. AddStaticText), it appears duplicated.
I would add this code in the CreateLayout method, but it is called only once at initialization.Is there a way to send a message from a NodeData plugin to any of its iCustomGuis ?
That way everytime I have to update the custom gui from Node Data, I can send a message to it.Thank you.
-
On 12/09/2017 at 02:22, xxxxxxxx wrote:
Hello,
typically a NodeData based plugin has no business of sending messages to custom GUI elements. A NodeData based plugin stores parameters that may be displayed in the GUI using a custom GUI. So in your NodeData plugin you can set the value of the parameter displayed with that GUI element.
Another idea would be to modify the parameter description. You can store additional data in that description that defines how the custom GUI should look like (see this thread).
Another option is to listen to core messages. A custom GUI is based on GeDialog so it should be possible to listen to core messages sent with SpecialEventAdd() in GeDialog::CoreMessage() (see Core Messages Manual).
And finally, if you want that your custom GUI to react to a button why not simply add this button to that custom GUI itself? The buttons to control the Layer Shader are part of the layer shader GUI.
best wishes,
Sebastian