Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Setting custom gui attributes

    SDK Help
    0
    15
    1.3k
    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 20/01/2016 at 09:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   13 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      I've created a custom dial gui using iCustomGui. And I've placed in it the Integer drop down options in the User Data AM window.
      It works good. But I want to change the default Min Max values.
      They are currently set to:      Min: 0         Max: 100
      And I want to set them to:    Min: -100    Max:100

      Normally I access these descriptions by getting an object's UserData container.
      How do we change these values from inside a custom gui plugin?

      -ScottA

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

        On 20/01/2016 at 11:08, xxxxxxxx wrote:

        gui is just gui.
        so to adjust the min max, you just change the descriptions "I do it from GetDDescription()"

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

          On 20/01/2016 at 11:36, xxxxxxxx wrote:

          Can I really do that?
          The docs say: class iCustomGui : public SubDialog
          And the SubDialog class does not list GetDDescription() as an override method.

          I don't see how I can use that method?

          -ScottA

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

            On 20/01/2016 at 11:42, xxxxxxxx wrote:

            If it is derived from SubDialog then you should be able to use GeDialog Setxxxx() methods (which include min and max arguments) to do the trick.  ToolData works the same way in that you use a SubDialog not a Description for A.M. control.

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

              On 20/01/2016 at 11:44, xxxxxxxx wrote:

              The constructor of iCustomGUI accepts a  const BaseContainer & settings. That's where you can read
              the DESC_MIN and DESC_MAX values from.

              Originally posted by xxxxxxxx

              If it is derived from SubDialog then you should be able to use GeDialog Setxxxx() methods (which include min and max arguments) to do the trick.  ToolData works the same way in that you use a SubDialog not a Description for A.M. control.

              Hm either of us may have misunderstood the question? If its about DESC_MIN and DESC_MAX, you can
              not read those values from the iCustomGUI::GetInt32() (or the like). They are decoupled from the widgets
              you actually display in the GUI. As I mentioned above, they are in the settings  parameter of the
              iCustomGUI constructor. These are passed down from CustomGuiData::Alloc()

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

                On 20/01/2016 at 11:49, xxxxxxxx wrote:

                ^I need to change the values Niklas.
                Since that "settings" container is a const. I can't change them there. It was the first place I tried to do it.

                -ScottA

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

                  On 20/01/2016 at 11:51, xxxxxxxx wrote:

                  Originally posted by xxxxxxxx

                  ^I need to change the values Nicklas.
                  Since that container is a const. I can't change them there. It was the first place I tried to do it.

                  -ScottA

                  I see, overlook that before.

                  Hm, usually it should work the same way. Just grab the user data container and set DESC_MIN/DESC_MAX respectively.

                  Edit

                  Originally posted by xxxxxxxx

                  How do we change these values from inside a custom gui plugin?

                  FFS, Niklas, just read it carefully. 🤢 You can't change these values from within  the GUI plugin.

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

                    On 20/01/2016 at 11:57, xxxxxxxx wrote:

                    Lol..we're all cross posting at the same time.😂

                    How do I grab the UD container from inside of an iCustomGui plugin?
                    Typically I grab the UD container from an object. And then go down the UD ownership chain.
                    But since  an iCustomGui plugin is a child of the UD container. I don't know how to go up the ownership chain like that.

                    -ScottA

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

                      On 20/01/2016 at 12:53, xxxxxxxx wrote:

                      Originally posted by xxxxxxxx

                      But since  an iCustomGui plugin is a child of the UD container. I don't know how to go up the ownership chain like that.

                      As I said, not possible. And you also don't know if the GUI is in a User Data or in the object description either.

                      Your GUI could just act as if the Min / Max value had the value you would like to to have though.

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

                        On 20/01/2016 at 14:32, xxxxxxxx wrote:

                        I see, what I'm doing in general is assigning the custom gui to a custom data type, and this custom data type can be accessed from GetDDescription()

                        I never set containers in a gui plugin.

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

                          On 20/01/2016 at 15:35, xxxxxxxx wrote:

                          I was thinking about using a custom data type in combination with my gui as a way to solve this problem. But I'm not sure it will work.

                          I'll have to think about this for while.
                          Right now it's a minor annoyance that we can't set the MIN/MAX values. Because the user will typically adjust them as needed anyway.
                          It just would be nice to be able to set them to a different default value.
                          But the fix seems to be a lot more trouble than it's worth.

                          -ScottA

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

                            On 21/01/2016 at 01:36, xxxxxxxx wrote:

                            Hello,

                            just to be clear: you are talking about the default values of the "Min" and "Max" field that appear in the User Data Manger when the datatype is switched to "Integer"? It is not possible to change these values from a CustomGui.

                            Best wishes,
                            Sebastian

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

                              On 21/01/2016 at 07:53, xxxxxxxx wrote:

                              Yes. Those are the values I'm trying to change.
                              It's a bit annoying that we can't change their default values when we load our custom gui's.
                              But it is, what it is.

                              -ScottA

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

                                On 21/01/2016 at 09:13, xxxxxxxx wrote:

                                True. There's CustomDataTypeClass::GetDefaultProperties(), but nothing comparable in the CustomGuiData class.

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

                                  On 21/01/2016 at 12:27, xxxxxxxx wrote:

                                  This is what happens when I have too much free time on my hands. Tongue
                                  umY4Exz3lrA

                                  -ScottA

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