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
    • Register
    • Login

    how to make parameter stick to position with dynamic parameters hiding?

    General Talk
    programming
    2
    3
    588
    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.
    • aghiad322A
      aghiad322
      last edited by

      i am struggling to align the cycle button to the bottom , i tried flag "ALIGN_BOTTOM" on both the parameter and the group containing the parameter in the ".res" file, it didn't work, and i am hiding the above parameters using "GetDDescription()" i want the cycle button to stick to the bottom in the red area even when above parameters changed.

      2023-12-18 18-10-29_2.gif

      
      GROUP{
      		COLUMNS 2;
      		ALIGN_BOTTOM;  //causes an error when loading the tag plugin
      		LONG PRESET 
      		{
      			ANIM OFF;
      			CYCLE
      			{
      				ANIMATION_CLONER;
      				SWEEP_PRO;
      				CUSTOM_INPUT;
      			}
      		}
      				
      	}
      
      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @aghiad322
        last edited by

        Hi @aghiad322,

        You can use some dummy element (e.g. empty STATICTEXT) with SCALE_V directive to keep your dropdown aligned to the bottom. Keep in mind that the parent group also needs the SCALE_V. Try Setup #1 (attached below) in your .res file (based on our atom example).

        The only downside here would be the gap to the top part when scaled all the way down (notice that on gif).

        In case you want to keep your dropdown inside its own group with 2 columns, you can do that as well, but here you again need to make sure all groups use SCALE_V as well. Example Setup #2 is below.

        Cheers,
        Ilia

        Setup #1. Simple example:

        CONTAINER Oatom
        {
         NAME Oatom;
         INCLUDE Obase;
        
         GROUP ID_OBJECTPROPERTIES
         {
           SCALE_V;
           REAL ATOMOBJECT_CRAD { ANIM OFF; UNIT METER; MIN 0.01; STEP 0.01; }
           REAL ATOMOBJECT_SRAD { UNIT METER; MIN 0.01; STEP 0.01; }
           LONG ATOMOBJECT_SUB	{ MIN 3; MAX 1000; }
           BOOL ATOMOBJECT_SINGLE	{ }
        
           STATICTEXT { SCALE_V; }
        
           LONG ATOMOBJECT_CYCLE
           {
             ANIM OFF;
             CYCLE
             {
               ATOMOBJECT_CYCLE_1;
               ATOMOBJECT_CYCLE_2;
               ATOMOBJECT_CYCLE_3;
             }
           }
         }
        }
        

        Setup #1. Result
        3b5f47a2-b895-4a7a-a7e2-b3bacb1e7c6e-Cinema_4D_LUIR3rLB0e.gif

        Setup #2. 2-column group example:

        CONTAINER Oatom
        {
          NAME Oatom;
          INCLUDE Obase;
        
          GROUP ID_OBJECTPROPERTIES
          {
            SCALE_V;
            REAL ATOMOBJECT_CRAD { ANIM OFF; UNIT METER; MIN 0.01; STEP 0.01; }
            REAL ATOMOBJECT_SRAD { UNIT METER; MIN 0.01; STEP 0.01; }
            LONG ATOMOBJECT_SUB	{ MIN 3; MAX 1000; }
            BOOL ATOMOBJECT_SINGLE	{ }
        
            GROUP
            {
              SCALE_V;
              COLUMNS 2;
        
              STATICTEXT { SCALE_V; }
              
              STATICTEXT { JOINEND; }
        
              LONG ATOMOBJECT_CYCLE
              {
                ANIM OFF;
                CYCLE
                {
                  ATOMOBJECT_CYCLE_1;
                  ATOMOBJECT_CYCLE_2;
                  ATOMOBJECT_CYCLE_3;
                }
              }
        
              STATICTEXT { JOINEND; }
            }
          }
        }
        

        Setup #2. Result:
        cd73548a-fcc8-44b8-8430-324877988fb3-Cinema_4D_mIxb9apxaX.gif

        MAXON SDK Specialist
        developers.maxon.net

        aghiad322A 1 Reply Last reply Reply Quote 1
        • aghiad322A
          aghiad322 @i_mazlov
          last edited by

          Thanks a lot @i_mazlov that's exactly what i needed.
          however on one of the options for the dropdown i have a single Text input that spans across the whole attribute manager, now after i added the "STATICTEXT { SCALE_V; }" it eats up half the space in the image below
          Screenshot 2023-12-22 211432.png
          i tried to give it a Description id and treat it as any other parameter and hiding it using "c4d.DESC_HIDE", below is the layout of the whole tab

          	GROUP ADVANCED_TAB
          	{
          		SCALE_V;
          		STRING CUSTOM_TXT_PARAMETER{ ANIM OFF; CUSTOMGUI MULTISTRING; SCALE_V; WORDWRAP; };
          
          		GROUP{
          			COLUMNS 2;
          			
          			LONG ANIMATION_CLONER_FROM { MIN 0; ANIM OFF; };
          			LONG ANIMATION_CLONER_TO { MIN 0; ANIM OFF; };	
          			LONG ANIMATION_CLONER_SPAN { MIN 1; ANIM OFF; };
          		
          			GROUP{
          				COLUMNS 1;		
          				SEPARATOR ANIMATION_CLONER_SEPARATOR{ LINE; };
          				REAL ANIMATION_CLONER_MULTIPLIER { MIN 0.1 ; STEP 0.1 ; ANIM OFF; };
          			}
          		}
          		
          		GROUP{
          			COLUMNS 2;
          			REAL SWEEP_PRO_RADIUS { UNIT METER ; STEP 0.1 ; MIN 0.1; ANIM OFF; };
          			REAL SWEEP_PRO_MULTIPLIER { MIN 0.1; ANIM OFF; };
          
          		}
          
          		STATICTEXT UI_FILLER{SCALE_V;}
          		GROUP{
          				COLUMNS 2;
          				LONG PRESET 
          				{
          					ANIM OFF;
          					CYCLE
          					{
          						
          						ANIMATION_CLONER;
          						SWEEP_PRO;
          						CUSTOM_INPUT;
          					}
          				}
          				
          			}
          	}
          

          but when i try to hide it from the "GetDDescription()" the description "description.GetParameterI(paramId)" is empty ! ,in the "GetDDescription()" in my source code i have the hiding for the other parameters implemented as well but didn't copy them to keep the snippet at minimum lines

          def GetDDescription(self, node: c4d.GeListNode, description: c4d.Description, 
                                  flags: int) -> typing.Union[bool, tuple[bool, int]]:
          
                  if not description.LoadDescription(node.GetType()):
                      return False, flags
          
                  paramId: c4d.DescID = c4d.DescID(c4d.DescLevel(c4d.UI_FILLER, c4d.DTYPE_STRING, 0))
                  evalId: c4d.DescID = description.GetSingleDescID()
          
                  if (evalId and not paramId.IsPartOf(evalId)):
                      return True, flags
          
                  paramData: c4d.BaseContainer = description.GetParameterI(paramId)  #paramData for the "c4d.UI_FILLER" is empty 
                  
                  
                  if paramData is None:
                      return True, flags
                  
                  # parameter ID_HIDE_CONDITION.
                  paramData[c4d.DESC_HIDE] = True if node[c4d.PRESET] == c4d.CUSTOM_INPUT else False
          
                  return True, flags | c4d.DESCFLAGS_DESC_LOADED
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post