felo44 Posted March 9, 2017 Share Posted March 9, 2017 (edited) Hi, Someone know how to use "save as" in Pyhton? Note: I'm looking for the same functionality as the "save as" under file drop menu. Therefore saveAsBackup() is not ideal. Thanks, Edited March 9, 2017 by felo44 Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted March 9, 2017 Share Posted March 9, 2017 fileStr = '/path/to/save.hip' hou.hipFile.save(file_name=fileStr, save_to_recent_files=False) Something like that should work? 1 Quote Link to comment Share on other sites More sharing options...
felo44 Posted March 9, 2017 Author Share Posted March 9, 2017 No really, I forgot to said that the current session should not be affected, so if I use save(), the session will became the new file, that's why I am looking into a "save as" functionality. Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted March 9, 2017 Share Posted March 9, 2017 I usually do something like this in that case: originalFile = hou.hipFile.path() # run the code I posted earlier to save the file here hou.hipFile.setName(originalFile) So after the code runs the file is reverted back to kind of an untouched state. If you wanted to wrap that up into a saveAs() function it should be pretty easy Quote Link to comment Share on other sites More sharing options...
felo44 Posted March 9, 2017 Author Share Posted March 9, 2017 Nice Thanks for your help John. Quote Link to comment Share on other sites More sharing options...
jkunz07 Posted March 9, 2017 Share Posted March 9, 2017 No problem, that's just the easiest way I could think of but if anyone else knows a better method please feel free to share! 1 Quote Link to comment Share on other sites More sharing options...
animatrix Posted March 15, 2017 Share Posted March 15, 2017 This also throw me off when i wanted to save as. SESI should have a utility function in any case IMO. 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.