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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    DESC_PARENT_COLLAPSE Display

    Cinema 4D SDK
    r20 c++ sdk
    2
    5
    700
    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.
    • J
      JohnTerenece
      last edited by

      Hello.

      I am trying to create a parameter that will function as a parent to another parameter using DESC_PARENT_COLLAPSE. with the code below.

      cid = DescLevel(idAngleEdgeThreshold, DTYPE_REAL, 0);
      			if (!singleid || cid.IsPartOf(*singleid, NULL))
      			{
      				BaseContainer bc;
      				bc = GetCustomDataTypeDefault(DTYPE_REAL);
      				bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_REALSLIDER);
      				bc.SetInt32(DESC_UNIT, DESC_UNIT_DEGREE);
      				bc.SetFloat(DESC_STEP, PI / 180.0);
      				bc.SetFloat(DESC_MIN, 0);
      				bc.SetFloat(DESC_MAX, PI);
      				bc.SetFloat(DESC_DEFAULT, 0);
      
      				bc.SetInt32(DESC_PARENT_COLLAPSE, -1);
      				bc.SetString(DESC_NAME, "Angle Threshold"_s);
      				if (!description->SetParameter(cid, bc, DescMainTabGroup))
      					return TRUE;
      			}
      
      			cid = DescLevel(idAngleEdgeInvert, DTYPE_BOOL, 0);
      			if (!singleid || cid.IsPartOf(*singleid, NULL))
      			{
      				BaseContainer bc;
      				bc = GetCustomDataTypeDefault(DTYPE_BOOL);
      
      				bc.SetInt32(DESC_PARENT_COLLAPSE, idAngleEdgeThreshold);
      				bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BOOL);
      				bc.SetString(DESC_NAME, "Invert"_s);
      				bc.SetBool(DESC_DEFAULT, FALSE);
      				if (!description->SetParameter(cid, bc, DescMainTabGroup))
      					return TRUE;
      			}
      

      This code works properly to set the parameter as a parent of the other.

      My question is it possible for me to control whether the twirl down will be open or closed based on the user selecting different parameters or pressing something like a button?

      I looked at the sdk and in the Description Settings Manual it is specifically stated that the child parameter is hidden until the user click on the little arrow, is it possible to control this or is this functionality only available to a user.

      Any help would be greatly appreciated.

      John Terenece

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi I guess setting the boolean value DESC_GUIOPEN on the group (so idAngleEdgeThreshold), should do the trick, but I'm not 100% sure if this does not work I will have a look more indepth tomorrow.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • J
          JohnTerenece
          last edited by

          Thanks for the response.

          DESC_GUIOPEN works having the twirl down open by default. What I'm looking for is the ability to modify whether or not it is actively open based on controls by the user. For example if "Angle Threshold" is greater than 90 degrees than have it twirled down, otherwise have it closed.

          John Terenece

          1 Reply Last reply Reply Quote 1
          • M
            m_adam
            last edited by

            Hi after looking into the code this is sadly not possible to open/close a group.

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • J
              JohnTerenece
              last edited by

              Thanks for the response. I was assuming that would be the case.

              John Terenece

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