Jump to content

foreach in a callback script


Mzigaib

Recommended Posts

Attached is a scene with buttons that call a Python script. The buttons are on the "BUTTON_HERE" null in /obj/geo1. The script is in the "Python Source Editor" window. The same script could just as easily be on a shelf button but if it's for a one off scene I'd just do it in the scene itself like shown in the example.

pythonButtonExample.hip

Link to comment
Share on other sites

I Still I would like to know how to do it with hscript in a callback.

I don't know much hscript, barely any really so I can't help you there. If the issue is multiple lines then use Alt + E to bring up an external editor. When you close the editor be sure to save it and Houdini will import the contents of that save into the text field (including multiple lines).

Link to comment
Share on other sites

Yeah but it seems that in the case of the callback you can only use one line, but I can b wrong.

Instead of using Python and hou.session you could use the "Aliases and Variables" window (on the expressions tab) to create custom functions with hscript. Then call those from the callback. I haven't tried it but it's the hscript equivalent of hou.session which would allow multiple lines. I think there are other places to stuff hscript if that doesn't work, hopefully an hscript expert will chime in. I'd still use Python personally. :D

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...