tc_trent Posted March 12, 2011 Share Posted March 12, 2011 how can I get my chop network to execute a python script from the hda module whenever a trigger is passed. Quote Link to comment Share on other sites More sharing options...
benne5 Posted March 12, 2011 Share Posted March 12, 2011 how can I get my chop network to execute a python script from the hda module whenever a trigger is passed. Try placing your HDA python script on an expression chop inside of your chopnet. ( Don't forget to change the expression chop node to read python instead of Hscript.) Quote Link to comment Share on other sites More sharing options...
tc_trent Posted March 13, 2011 Author Share Posted March 13, 2011 Try placing your HDA python script on an expression chop inside of your chopnet. ( Don't forget to change the expression chop node to read python instead of Hscript.) hi thanks for the reply. could you give me an example of how you would format the expression. I keep getting an error. i don't know how to get the expression chop to execute a direct command like a print function. Quote Link to comment Share on other sites More sharing options...
anim Posted March 13, 2011 Share Posted March 13, 2011 just check with realtime python script all your trigger channels for current sample values and maybe previous sample values and trigger your HDA script for all channels that passed the test expression CHOP will not help you since CHOPs are precomputed, it would process all the channels just one time, that means it will trigger all your scripts and then it will do nothing when you play the animation Quote Link to comment Share on other sites More sharing options...
tc_trent Posted March 13, 2011 Author Share Posted March 13, 2011 just check with realtime python script all your trigger channels for current sample values and maybe previous sample values and trigger your HDA script for all channels that passed the test expression CHOP will not help you since CHOPs are precomputed, it would process all the channels just one time, that means it will trigger all your scripts and then it will do nothing when you play the animation so how do I get it to be in real time. how do I get A node to cook on every frame so that I can query my trigger values? Quote Link to comment Share on other sites More sharing options...
anim Posted March 16, 2011 Share Posted March 16, 2011 use it in spare parameter you can make your check function named for example getTriggers() in hou.session (Windows/Python Source Editor) then just call it from the parameter parameter expression will look like: hou.session.getTriggers() if it's not refreshing each frame, you can help it by hou.session.getTriggers() return hou.frame() Quote Link to comment Share on other sites More sharing options...
anim Posted March 16, 2011 Share Posted March 16, 2011 on second thought it may be safer to use ParmTupleChanged event callback for node with time dependent param ($F) or if the parm is on HDA, simple parm callback is probably the best way Quote Link to comment Share on other sites More sharing options...
tc_trent Posted March 17, 2011 Author Share Posted March 17, 2011 on second thought it may be safer to use ParmTupleChanged event callback for node with time dependent param ($F) or if the parm is on HDA, simple parm callback is probably the best way I tried using a parrm callback. it wouldn't work using a chop expression in the parameter to fetch the trigger values from chops. the callback script is only executed when you directlly change the parameter. I need a script to be executed automaticlly every time the trigger value hits 1. I noticed that the "logic" chop has the ability to execute hscript. I tried playing around with it, but I couldn't get it to execute anything. Does anybody have any expereice with the logic chop? Quote Link to comment Share on other sites More sharing options...
tc_trent Posted March 21, 2011 Author Share Posted March 21, 2011 Does anybody else have a solution for this. Has anybody ever done this before ? Quote Link to comment Share on other sites More sharing options...
edward Posted March 23, 2011 Share Posted March 23, 2011 Did you try what anim said? hou.session.getTriggers() return hou.frame() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.