Jump to content

run python script from button in node


Fomal

Recommended Posts

Hi,

I made a python script that runs from the shelf. I'd like to have the script run when I press an update button created in a node. Looked at the callback function but can't figure out how to get it to work.

Hope someone can help

cheers Coen

Link to comment
Share on other sites

In the "scripts" tab of your hda add a PythonModule and put your function there, e.g. def runMe()

In your button callback, enter hou.pwd().hdaModule().runMe()

Better if you take a look at the mdd writer hda at http://undo.fi/houdini/mdd/ - it has a button set up that runs a script.

There might be better ways to do it, but at least that works for me :)

eetu.

Link to comment
Share on other sites

thanks eetu,

starting to make sense now. But is that only suitable for digital asset? Just trying it on a null now and the method doesn't seem to work

Edited by Fomal
Link to comment
Share on other sites

  • 8 months later...
Nevermind... Got it to work, forgot some brackets :blink:

Thanks for the example eetu

Hey guys,, I'm trying this out now.. on a null..? how did you get it working Coen/Fomal..? or do I have to make it into a hda..?

I'm struggling to shovle the script into a function also..?

any help would be great..?

cheers

ben.

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