younglegend Posted August 8, 2017 Share Posted August 8, 2017 Hey guys! On opening or saving any scene file, i want houdini to shift to frame $FSTART and turn to manual cook mode. So i know houdini needs a 456.py file in its home directory but i need help with the code. I've manged to find some help from other forums and ended up with this, which obviously doesn't work Badum Tss! hou.setFrame(1) hou.setUpdateMode(hou.updateMode.Manual) hou.updateModeSetting() hou.updateMode.Manual Quote Link to comment Share on other sites More sharing options...
Hartman- Posted August 8, 2017 Share Posted August 8, 2017 Is the 456.py file in the correct location? It should be located in $HOME/houdiniXX.X/scripts. On windows this will most likely be C:/Users/USERNAME/Documents/houdini16.0/scripts. I'm not on a mac box right now and I'm blanking on the location, you should be able to get a idea for it through some quick commands. http://www.sidefx.com/docs/houdini/basics/config_env#browsing-environment-variables ... you could even go into the save dialog and type in $HOME to path to the home directory. The first 10-15 minutes of this video talks the 123.py and 456.py files and how they are used. https://www.sidefx.com/tutorials/illume-webinar-houdini-in-the-pipeline/ My best guess is that the file isn't being found. I was able to setup a quick 123.py file that set the update to manual and the frame to 30 without trouble. Hope this helps! 1 Quote Link to comment Share on other sites More sharing options...
younglegend Posted August 8, 2017 Author Share Posted August 8, 2017 35 minutes ago, Hartman- said: Is the 456.py file in the correct location? It should be located in $HOME/houdiniXX.X/scripts. On windows this will most likely be C:/Users/USERNAME/Documents/houdini16.0/scripts. Oh ya, now it works. Thanks! hou.setFrame(1) hou.setUpdateMode(hou.updateMode.Manual) hou.updateModeSetting() Now, how do i tell houdini to always save with manual mode and shift to $FSTART? I think it's better to save hip file in manual mode instead. Quote Link to comment Share on other sites More sharing options...
Hartman- Posted August 8, 2017 Share Posted August 8, 2017 (edited) For the frame range... You can try to execute hscript via python using hou.hscript() http://www.sidefx.com/docs/houdini/hom/hou/hscript Similar to what this guy was trying to do: https://www.sidefx.com/forum/topic/43552/ I'm not at my box to confirm but these seem like they are what you want. Also look into the hou.playbar module, lots of good stuff in there. I'm not sure about saving in manual mode... I'll have to do a bit more research myself, I've always just defaulted to opening in manual mode, no matter what. Edited August 8, 2017 by Hartman- Quote Link to comment Share on other sites More sharing options...
Hartman- Posted August 9, 2017 Share Posted August 9, 2017 6 hours ago, kishenpj said: Oh ya, now it works. Thanks! hou.setFrame(1) hou.setUpdateMode(hou.updateMode.Manual) hou.updateModeSetting() Now, how do i tell houdini to always save with manual mode and shift to $FSTART? I think it's better to save hip file in manual mode instead. As a quick update... it looks like the best solution for the frame range to start at $FSTART would be to do something like this: firstFrame = hou.playbar.timelineRange()[0] hou.setFrame(firstFrame) timelineRange() returns the first and last frame of the animation settings ($FSTART, $FEND), not necessarily what the timeline is set to ($RFSTART, $RFEND) Quote Link to comment Share on other sites More sharing options...
younglegend Posted August 9, 2017 Author Share Posted August 9, 2017 (edited) 14 hours ago, Hartman- said: As a quick update... it looks like the best solution for the frame range to start at $FSTART would be to do something like this: firstFrame = hou.playbar.timelineRange()[0] hou.setFrame(firstFrame) timelineRange() returns the first and last frame of the animation settings ($FSTART, $FEND), not necessarily what the timeline is set to ($RFSTART, $RFEND) Awesome! I've found this btw http://www.sidefx.com/docs/houdini/hom/locations but beforescenesave.py seem to work only for H16. I'm stuck with H15.5 for now and http://www.sidefx.com/docs/houdini15.5/hom/locations doesn't say anything about scripts before or after saving the hip file. Edited August 9, 2017 by kishenpj 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.