[py] How to change label of a single paramer instance of multiparm block folder?

   2842   4   2
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
It's seems not be possible.
When I retrieve the parmTemplates() of the FolderParmTemplate (which is a multiparm folder), it would return the template for parameter parm#, not the actual instance parm1, parm2, etc
So I cannot use the .setLabel(“myNewLabel”) function on specific instances.

I also tried the following, without success:

group = node.parmTemplateGroup()
parmPlate = node.parm("parm3").tuple().parmTemplate() # this actually returns the parmTemplate of the instance
parmPlate.setLabel("myNewLabel")
node.setParmTemplateGroup(group)


Any idea? Thanks!
User Avatar
Member
1904 posts
Joined: Nov. 2006
Offline
This is definitely not possible I'm afraid. The best you could do would be to use an actual Label type parameter and set that to your desired value and it would remain for the life of that instance.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Ok, thanks Graham! I will try your tip.

Since I only need two different labels to be displayed for my parameter instance, I also thought of creating a copy of the instance paramater with a different label, and toggle between the two parms based on which label I have to display on the user interface.

A little bit of effort to adjust the scripts in my pyhton module, but it can be done I guess.
I'm just not a big fan of the idea of adding unnecessary parms, especially in a multiparm folder, that's already not super snappy.

Cheers
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
The label type paramater seems to do the trick, thanks!
But interestingly when you set the value for myLabelParm.set(“My label”), it would set the value for the Label1 field, not for the actual main label.

That's an issue because I would like the text to be justified to the left, and not floating around like mad when you resize the window. Only the main label stays on place.

I bet there's some kind of RFE already for labels alignment options.



Also, labels this kind of labels misalignment with everything else is really triggering me


Edited by Andr - Feb. 21, 2019 15:21:49
User Avatar
Member
13 posts
Joined: Jan. 2013
Offline
Andr
The label type paramater seems to do the trick, thanks!
But interestingly when you set the value for myLabelParm.set("My label"), it would set the value for the Label1 field, not for the actual main label.

That's an issue because I would like the text to be justified to the left, and not floating around like mad when you resize the window. Only the main label stays on place.

I bet there's some kind of RFE already for labels alignment options.



Also, labels this kind of labels misalignment with everything else is really triggering me



hey Hi men, is possible to know how you achive this, Im stock trying to do it, I just make a new post for get help
https://www.sidefx.com/forum/topic/79905/?page=1#post-343322 [www.sidefx.com]
  • Quick Links