shadowst17 Posted May 31, 2019 Share Posted May 31, 2019 (edited) Hi guys, I was wondering if I can save through python without changing the current save to it? I want add a feature to my cache node where once it's cached it saves a back up file in a new folder. I don't want the current scene to change to said newly saved file through. Is this possible? Edited May 31, 2019 by shadowst17 Solved Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted May 31, 2019 Share Posted May 31, 2019 import time import hou # Save a backup of the current Houdini session def saveArchive(): # Get the file path of the current Houdini session # (Equivalent to $HIP/$HIPNAME) ogFile = hou.hipFile.path() # What do we want to save the archive file as? fileStr = hou.getenv("HIP")+"/backup/BKUP_"+time.strftime("%Y%m%d%H%M%S")+"_"+hou.hipFile.basename() # Make sure this is a string (I was getting errors if I didn't do this) fileStr = str(fileStr) # Save the archive file hou.hipFile.save(file_name=fileStr, save_to_recent_files=False) # Revert the name of the Houdini session to what it was prior to executing this function hou.hipFile.setName(ogFile) # Return the path of the newly saved file return fileStr 2 Quote Link to comment Share on other sites More sharing options...
shadowst17 Posted May 31, 2019 Author Share Posted May 31, 2019 Brilliant! thank you very much. 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.