Attribute Value as Label?
6721 10 1- subscriptions
- Member
- 29 posts
- Joined: Oct. 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
- 4729 posts
- Joined: Feb. 2012
- Offline
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: Feb. 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 - July 24, 2019 03:55:15
- subscriptions
- Member
- 29 posts
- Joined: Oct. 2017
- Offline
- Mohanpugaz
- Member
- 146 posts
- Joined: June 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: May 2021
- Offline
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
You need to use details() [www.sidefx.com] function for string
Edited by tamte - July 27, 2023 10:36:28
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- HaniJahan
- Member
- 14 posts
- Joined: May 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 - July 27, 2023 14:39:31
- tamte
- Member
- 8833 posts
- Joined: July 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 - July 27, 2023 18:08:12
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- pandapin223
- Member
- 1 posts
- Joined: Dec. 2013
- Offline
- tamte
- Member
- 8833 posts
- Joined: July 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