Jump to content

auto-execute python on a node


tagosaku

Recommended Posts

HI, I am learning python script. So far, I can execute python code by clicking a custom button, and it sets parameters of today(string) and switch(integer). 

I wonder how we can automatically execute that python code. For instance,  when I select the node SOP, or houdini accesses node network from somewhere as need, these parameter values are automatically calculated or updated.  

 

Question 1
When I directly write python code in the parameter like second screenshot, it works for integer but not strings.  Why did not the string work? 

Question 2
Let's say I have 20 parameters, and ideally I want to control all the parameters from one master python script in the code parameter, instead of writing python code each parameter 20 times.  Then I was thinking :
code parameter{string) > Callback script > exec(kwargs['node'].parm('code').eval())
However, auto-execution happens only when I change code's strings. And this is not what I am looking for. Execution should happen when I select the node or Houdini access it during  node network calculation. 

If anyone knows how I should change, it would be appreciated. Thanks!

 

image.thumb.png.2bb473a6c987e46213295c4212fe953c.png

 

image.thumb.png.3168dfbe675aded721e83c03593a23b7.png
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...