How can I get the default value of a channel in expression?

   2860   3   0
User Avatar
Member
1 posts
Joined: April 2015
Offline
Hello there,

I know that I can use ch() function to get current value of a certain channel.
But how can I get the default value instead of current value?
User Avatar
Member
319 posts
Joined:
Offline
There might be a better way, but I managed to get at it with Python using parmTemplate:-


#Node which has the parm you want to get default of
n = hou.node(“/obj/geo1/attribwrangle4”)

#Get the default ('count' is just the name of the parm I am grabbing)
default = n.parm(“count”).parmTemplate().defaultValue()

#return the value
return default
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
Why you need expression for that? Default value is always constant so why not to type it by hand.
User Avatar
Member
319 posts
Joined:
Offline
Maybe if the default value is being set dynamically by an automated UI builder? Or maybe a little script to reset all parms to default or something? Could be anything!
  • Quick Links