Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Seeking AM CustomGui help/example

    SDK Help
    0
    27
    15.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 12/09/2013 at 05:41, xxxxxxxx wrote:

      Hi WP,

      do you redraw the UserArea on iCustomGui::SetData()?

      If it's not something you can ask in the forum, go ahead and contact me via PM.

      Cheers,
      -Niklas

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 12/09/2013 at 06:58, xxxxxxxx wrote:

        Oooo no, I've missed that function.. I may have even removed it at one stage..

        Is this what I'm needing? Can this be called without an instance? Below are the functions used in my iCustomGui thus far:

          
        class MyCustomGui : public iCustomGui   
        {   
            typedef iCustomGui super;   
          
        private:   
          
            LONG Height;   
            MyUserArea UserArea; // instance of GeUserArea   
          
        public:   
          
            MyCustomGui(const BaseContainer& settings, CUSTOMGUIPLUGIN* plug) : super(settings, plug);   
            virtual LONG CustomGuiWidth();   
            virtual LONG CustomGuiHeight();   
            virtual void CustomGuiRedraw();   
            virtual Bool CreateLayout();   
            virtual Bool InitValues();   
            virtual Bool Command(LONG id, const BaseContainer& msg);   
            virtual LONG Message(const BaseContainer& msg, BaseContainer& result);   
        };   
        

        WP.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 13/09/2013 at 13:37, xxxxxxxx wrote:

          Hi WP,

          well the SetData() method is called to give you the data you should display in your custom GUI. It is
          called when the data was changed and the AM is updated (for instance). You need to redraw your
          user-area(s) from this method, CustomGuiRedraw() is not called automatically afterwards.

          Simply do

          UserArea.Redraw();

          from MyCustomGui::SetData().

          -Niklas

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 24/09/2013 at 03:31, xxxxxxxx wrote:

            Ok, I've stumped myself on this one. I can't get SetData() to call, or any auto-refreshing of the user area happening. I've tried my own custom functions and sending messages... and I just can't seem to get it to work without having to click in the user area itself in the attributes manager. Come to think of it, I don't think SetData() is even called when I 'load' the tool plugin.

            So, bare bones question - how do I refresh a customgui element in the AM (one that incorporates a GeUserArea)?

            WP.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 24/09/2013 at 04:25, xxxxxxxx wrote:

              Have you registered a fake library for your CustomGuiData plugin as described in the documentation?

              See the CustomGuiData class on <[URL-REMOVED]>

              That might explain why SetData() is not called.

              Best,
              -Niklas


              [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 24/09/2013 at 05:04, xxxxxxxx wrote:

                Hi Niklas,

                yep, I have. I played around with a few flags (and no flags) in the RegisterCustomGuiPlugin() to no avail.

                I've done some more looking over the posted examples, and I notice there's some custom functions which I haven't incorporated. I thought this was to do with sending data to the GeUserArea, but as I'm using separate structs to house necessary data I didn't think I'd need them. Could that be what I'm needing?

                Examples (I don't have these anywhere) :

                  
                static Bool SendValueChanged(iCustomGui* dlg, BaseContainer msg) {   
                    msg.SetLong(BFM_ACTION_ID, dlg->GetId());   
                    msg.RemoveData(BFM_ACTION_VALUE);   
                    msg.SetData(BFM_ACTION_VALUE, dlg->GetData().GetValue());   
                    return dlg->SendParentMessage(msg);   
                }   
                  
                static Bool InvokeCommandCall(GeDialog* dialog, LONG id) {   
                    BaseContainer actionmsg(BFM_ACTION), actionresult;   
                    actionmsg.SetLong(BFM_ACTION_ID, id);   
                    return dialog->Message(actionmsg, actionresult);   
                }   
                  
                

                WP.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 26/09/2013 at 04:59, xxxxxxxx wrote:

                  The functions you have quoted are from my TriState Custom GUI example code and are not part
                  of the Cinema 4D SDK. View the code on github.

                  Without seeing your full code, I can only tell you to skim the examples you have available and look
                  out for the issue. SetData() is called when set up correctly, but the issues can reside in very
                  different locations, that is why snippets help certainly rare.

                  Best,
                  -Niklas

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post