Attribute Value as Label?
6653 10 1- subscriptions
- Member
- 28 posts
- Joined: 10月 2017
- Offline
How do I use the value of a detail attribute as a Label in the Edit Parameters Interface?
I'd also be fine if I could add a float parameter and put an expression in the field that would display the value.
I tried many variations of `print detail.attribValue(“cost”)`
Trying to display the value of a findshortestpath cost attribute.
Thanks,
Tim
I'd also be fine if I could add a float parameter and put an expression in the field that would display the value.
I tried many variations of `print detail.attribValue(“cost”)`
Trying to display the value of a findshortestpath cost attribute.
Thanks,
Tim
- animatrix_
- Member
- 4726 posts
- Joined: 2月 2012
- Online
Hi,
Try:
Try:
`detail(0, "cost", 0)`
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- Andr
- Member
- 899 posts
- Joined: 2月 2016
- Offline
animatrix3d
Hi,
Try:`detail(0, "cost", 0)`
Ohh, it would super nice if the Label field of the editor interface could also accept hscript.
A lot of less time wasted working with parmgroup templates.
I wonder if there's any valid technical reason for not being able to do that?
Anyway, if you want instead to change the label itself, you can use the following code.
Have a look at the attached example file
node = hou.pwd() targetParm = node.parm("targetParm") newLabel = node.parm("newLabel").eval() group = node.parmTemplateGroup() oldParm = targetParm.tuple().parmTemplate() newParm = targetParm.tuple().parmTemplate() newParm.setLabel(newLabel) group.replace(oldParm, newParm) node.setParmTemplateGroup(group)
Edited by Andr - 2019年7月24日 03:55:15
- subscriptions
- Member
- 28 posts
- Joined: 10月 2017
- Offline
- Mohanpugaz
- Member
- 146 posts
- Joined: 6月 2016
- Offline
Expressions in label works for me
using H17.5.327
using H17.5.327
Mohan Pugaz
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
movfx
https://www.instagram.com/movfx/ [www.instagram.com]
https://www.youtube.com/channel/@_movfx
- HaniJahan
- Member
- 14 posts
- Joined: 5月 2021
- Offline
- tamte
- Member
- 8822 posts
- Joined: 7月 2007
- Offline
You need to use details() [www.sidefx.com] function for string
Edited by tamte - 2023年7月27日 10:36:28
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- HaniJahan
- Member
- 14 posts
- Joined: 5月 2021
- Offline
tamte
You need to use details() [www.sidefx.com] function for string
Thanks! I was trying details() function like this
`details("../OUT", "test")`
`details(0, "test")`
However this one worked
`details("./OUT", "test")`
not sure why ../ not working here
Edited by HaniJahan - 2023年7月27日 14:39:31
- tamte
- Member
- 8822 posts
- Joined: 7月 2007
- Offline
Hannah Jahanshahiit's because it results in an invalid path
not sure why ../ not working here
lets say your node is at "/obj/geo1/test_attrib_name"
since your OUT node is inside your HDA, relative path: "./OUT" or potentially also just "OUT" will result in a correct full path "/obj/geo1/test_attrib_name/OUT"
however relative path "../OUT" will result in "/obj/geo1/OUT" which is most likely nonexistent, but even if it existed and would work, it's undesirable as it's outside of your HDA and therefore not self contained
Edited by tamte - 2023年7月27日 18:08:12
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- pandapin223
- Member
- 1 posts
- Joined: 12月 2013
- Offline
- tamte
- Member
- 8822 posts
- Joined: 7月 2007
- Offline
pandapin223If you mean upper case use toupper() [www.sidefx.com] expression function
Just wanted to ask that The Shown Info from a label could it be in block letter?
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links