K'n'K Posted March 29, 2019 Share Posted March 29, 2019 Hey there. I would like to record a series of UI commands and replay them via a hotkey. Coming from Modo I have macros in mind but not sure what is the equivalent of that in Houdini. Can someone point me in a right direction? For now as a very simple example: I just want to have the F1 key assigned to "Restart playback from first frame" so essentially Stop > Go back to frame 1 > Play. Right now this would be Shift Up, then Up which is inconvenient and requires two hands. Hitting F1 would be tremendously useful during tweaking my simulations. Thanks! Kristof Quote Link to comment Share on other sites More sharing options...
garf Posted March 29, 2019 Share Posted March 29, 2019 (edited) Add this script from Maurits to a keyboard shortcut and you're good to go. Not sure if Macros is something that can be done in houdini but you can definitely script this stuff. Edited March 29, 2019 by garf 1 Quote Link to comment Share on other sites More sharing options...
K'n'K Posted March 29, 2019 Author Share Posted March 29, 2019 Ohh yesss! Exactly what I wanted. Here's the code, I'll just leave it here as a solution in case anyone stumbles accross this: def outputPlaybarEvent(event_type, frame): if event_type == hou.playbarEvent.FrameChanged and frame == 1: print event_type hou.playbar.play() hou.playbar.removeEventCallback(outputPlaybarEvent) return False hou.playbar.addEventCallback(outputPlaybarEvent) hou.setFrame(1) Quote Link to comment Share on other sites More sharing options...
garf Posted March 29, 2019 Share Posted March 29, 2019 (edited) You could even make it a start/stop toggle: def outputPlaybarEvent(event_type, frame): if event_type == hou.playbarEvent.FrameChanged and frame == 1: #print event_type hou.playbar.play() hou.playbar.removeEventCallback(outputPlaybarEvent) return False if not hou.playbar.isPlaying(): hou.playbar.addEventCallback(outputPlaybarEvent) hou.setFrame(1) else: hou.playbar.stop() Edited March 29, 2019 by garf 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.