Hello, I’m trying to set up a python node that only runs it’s script when a run button is pressed.
The only thing preventing me from making it work is that the button doesn't seem to set a 0 or 1 value for when its pressed.
I’ve tried setting status to 1 using hou.setenv("status",1)
and then read it in the script using hou.getenv("status")
But that didn`t seem to work.
Make a button paramater set value to 1 while clicked ?
1953 5 0-
- NicTanghe
- Member
- 244 posts
- Joined: Dec. 2016
- Offline
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
-
- NicTanghe
- Member
- 244 posts
- Joined: Dec. 2016
- Offline
Hello,
THis throws me the error
I’m also a bit confused, wouldn't I need to use.
('python') if I want to use the normal python script ?
Ps.
I whould think
whould be the propper formatting ?
THis throws me the error
AttributeError: 'dict' object has no attribute 'parm'
I’m also a bit confused, wouldn't I need to use.
('python') if I want to use the normal python script ?
Ps.
I whould think
__import__ (kwargs.parm('python'));main()
Edited by NicTanghe - Jan. 10, 2023 16:20:45
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
If you just want one or a couple of run buttons and then some python code it is possible to simply attach this to a null. Probably you could attach it to any subnetwork or HDA as well (I've not really been trying this though).
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- SWest
- Member
- 313 posts
- Joined: Oct. 2016
- Offline
If you need to set values accessible from any node, without keeping track of paths to nodes, you could do something like:
def a(): hou.session.my_value=1 def b(): hou.session.my_value=0 try: print(hou.session.my_value) except: pass
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
-
- NicTanghe
- Member
- 244 posts
- Joined: Dec. 2016
- Offline
-
- Quick Links


