Is there a way to start a Python Sop by calling one of its functions from a button, e.g. on the hda containig the py sop? Since the python script generates geometry I can't place it inside the hda's python section. And because the script otherwise evaluates each time I load the scene I want to start it with a button so it only evaluates if I want it to.
Is there a way to achieve that?
Cheers
Tom
Start Python Sop via button?
853 2 1- Tom Mangold
- Member
- 96 posts
- Joined: Nov. 2017
- Offline
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
- elovikov
- Member
- 122 posts
- Joined: June 2019
- Offline
Tom Mangold
Since the python script generates geometry I can't place it inside the hda's python section.
Technically you can. You're still able to use write-access to hou.Geometry you just have to either create an object yourself or get a frozen geometry from any other sop by calling hou.Geometry.freeze
For programmable geometry I'd suggest to not abuse Python SOP but generate geometry in a regular python script and then assign this geometry to stash parameter of the Stash SOP.
This parameter is a regular one but holds geometry and as a regular parm it can be promoted to HDA so you won't have to use editable nodes or whatever.
-
- Quick Links