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

    Collapsing a settings group from a tag

    SDK Help
    0
    6
    611
    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 01/11/2015 at 16:14, xxxxxxxx wrote:

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

      ---------
      I'm trying to collapse/uncollapse some videopost effect groups based from a tag, so when the user go to edit settings, will see the options available already open, and the ones that doesn't matter closed.

      I found some ways to do it but I think none of them is what I need, because no success yet.

      > bool groupIsOpen = true;
      >
      > BaseVideoPost *post = GetMyVideoPost();
      >
      > BaseContainer *postData = post->GetDataInstance();
      >
      > postData->SetBool( VP_GROUP_ID, groupIsOpen );
      >
      > post->SetParameter(DescLevel(VP_GROUP_ID), groupIsOpen, DESCFLAGS_SET_0);
      >
      > post->SetParameter(DescLevel(VP_GROUP_ID), GeData(groupIsOpen), DESCFLAGS_SET_0);
      >
      > post->SetParameter(DescID(VP_GROUP_ID), groupIsOpen, DESCFLAGS_SET_0);
      >
      > post->SetParameter(DescID(VP_GROUP_ID), GeData(groupIsOpen), DESCFLAGS_SET_0);
      How do I do it??

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

        On 01/11/2015 at 18:51, xxxxxxxx wrote:

        I'm not sure if it will work, try to set it to -1

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

          On 02/11/2015 at 02:28, xxxxxxxx wrote:

          Hello,

          if a group is opened of not has nothing to do with the "value" of the "parameter". For example, you can open multiple Attribute Manager windows. And in each of the windows the state of a group may be different. So if a group is open or not is not stored with the "parameter" but only in the GUI element. The Render Settings window is using that GUI element.

          But in your resource file you can define a "default value" of "DEFAULT -1;" that will make sure that a group is open every time it is created in the GUI.

          See also

          • DTYPE_GROUP unfolded
            best wishes,
            Sebastian
          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 02/11/2015 at 04:18, xxxxxxxx wrote:

            I tried setting DESC_DEFAULT of DTYPE_GROUP, but it behaves like setting DEFAULT 1  on the res file.

            Using -1 on the res file won't work, because I want to choose which one is open and which one is closed depending on the tag properties.

            My tag has 3 camera types to choose from, (A, B and C), and each type has it's own settings group.
            If the user is using camera type A, when he goes to the plugin settings, would be nice to have type A group open, and type B and C closed, because they are useless now.
            Same for cameras B and C.

            I still don't understand how to set DESC_DEFAULT using just the BaseVideoPost.
            I can set it only from VideoPostData::GetDDescription()

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

              On 02/11/2015 at 04:51, xxxxxxxx wrote:

              what about a better approach.
              you can do something like this in GetDDescription()

              if(a)
                 //add code to create group a descriptions
              else if(b)
                 //....

              and so on

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

                On 02/11/2015 at 09:52, xxxxxxxx wrote:

                Hello,

                as said before, the state of the group is stored in the GUI element, not in the object. So you can't the description properties from the outside. As Mohamed suggested, you could set a parameter that defines how your GetDDescription() acts. If some parameters are useless in a certain situation, you could simply hide the corresponding groups.

                Best wishes,
                Sebastian

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