sessionbeer Posted October 8, 2022 Share Posted October 8, 2022 This button works every time I press it but is there a way to get it to trigger every frame? Quote Link to comment Share on other sites More sharing options...
Atom Posted October 8, 2022 Share Posted October 8, 2022 (edited) You can add a callback to the playbar. def outputPlaybarEvent(event_type, frame): # Code here. print ("Playbar event", event_type, "at frame", frame) hou.playbar.addEventCallback(outputPlaybarEvent) Or the Pre-Frame event of a ROP. Code inside the playbar callback won't update when you're rendering. import hou frame = int(hou.frame()) print(frame) Edited October 8, 2022 by Atom Quote Link to comment Share on other sites More sharing options...
sessionbeer Posted October 8, 2022 Author Share Posted October 8, 2022 Thanks Atom. I'm unsure how to piece together what you've suggested and the callback script that's on node above? Where do you put a script on the playbar? Quote Link to comment Share on other sites More sharing options...
Atom Posted October 8, 2022 Share Posted October 8, 2022 (edited) Put the playbar code in a shelf tool, and click the button. Scrub the timeline to observe the print statement. To embed it in a hip file, so it runs every time the file is opened, place the code inside the source editor. You can open the editor under the Windows/Python Source Editor menu along the top of the Houdini app. Edited October 8, 2022 by Atom 1 Quote Link to comment Share on other sites More sharing options...
sessionbeer Posted October 8, 2022 Author Share Posted October 8, 2022 (edited) Thanks, Atom! Edited October 9, 2022 by sessionbeer 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.