Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Send message from NodeData to iCustomGui.

 Post Reply Post Reply
Author
Message
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 284
Post Options Post Options   Quote peterakos Quote  Post ReplyReply Direct Link To This Post Topic: Send message from NodeData to iCustomGui.
    Posted: 2017 Sep 11 at 7:03am

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.
Back to Top
S_Bach View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2011 Jun 27
Online Status: Offline
Posts: 1302
Post Options Post Options   Quote S_Bach Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Sep 12 at 2:22am
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
SDK Support Engineer
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.