how to make parameter stick to position with dynamic parameters hiding?
-
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.
GROUP{ COLUMNS 2; ALIGN_BOTTOM; //causes an error when loading the tag plugin LONG PRESET { ANIM OFF; CYCLE { ANIMATION_CLONER; SWEEP_PRO; CUSTOM_INPUT; } } }
-
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,
IliaSetup #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
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:
-
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
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 tabGROUP 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