Make auto-save on default

   13565   12   4
User Avatar
Member
975 posts
Joined: April 2008
Offline
How can I make auto-save on as a default when I start up Houdini?
https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Staff
1081 posts
Joined: July 2005
Offline
Add “autosave on” to either your 123.cmd or 456.cmd file.
User Avatar
Member
252 posts
Joined:
Offline
Hi, thanks for this.

I just wanted to make a note here just in-case I forget the method in the future.

Windows:
  1. Go to your Documents/HoudiniX.X
  2. Create a “scripts” folder.
  3. Inside the scripts folder, create a 123.cmd (or also a 456.cmd) file - using notepad will do.
  4. Add “autosave on” for the files (without quotes).

    So far, that is how it worked on my Win10, Houdini Indie 15
User Avatar
Member
5 posts
Joined: Sept. 2014
Offline
Hi !

How do you do that on linux ?

I tried to make a 456.py file in script folder with this content, as founded in another forum but it didn't work:

import hou
hou.appendSessionModuleSource('''hou.hscript(“autosave on”)''')

Any clue ?
Thanks.
User Avatar
Member
518 posts
Joined: Dec. 2013
Offline
It's a bit silly that it's an option that you have to set each session(if you want to use it).
It's a conspiracy to get us into writing 456 files!

One thing though, auto backup has never worked for me. I'm on OSX, maybe that's it??
User Avatar
Member
12 posts
Joined: Oct. 2019
Offline
peteski
It's a bit silly that it's an option that you have to set each session(if you want to use it).
It's a conspiracy to get us into writing 456 files!

One thing though, auto backup has never worked for me. I'm on OSX, maybe that's it??
Why 456?
Best regards,
Faxcorp
User Avatar
Member
643 posts
Joined: June 2006
Offline
It's in the doc's.
456.cmd or 456.py will be executed when the user loads a hip file.

https://www.sidefx.com/docs/houdini/hom/locations.html#startup [www.sidefx.com]
User Avatar
Member
313 posts
Joined: Oct. 2016
Offline
While you're at it, add a line that creates a new folder (maybe today's date) and saves your file there because I don't think auto save will work unless you first do that.

Here's some Py for your shelf

# AUTOSAVE TOGGLE

autoSave = hou.getPreference('autoSave')

if autoSave == '1':
  hou.setPreference('autoSave','0')
  hou.ui.displayMessage('Autosave is now disabled')
if autoSave == '0':
  hou.setPreference('autoSave','1')
  hou.ui.displayMessage('Autosave is now active')
Edited by SWest - Aug. 9, 2023 07:00:40
Interested in character concepts, modeling, rigging, and animation. Related tool dev with Py and VEX.
User Avatar
Member
274 posts
Joined: July 2013
Offline
If you place the afterSceneSave handler, linked below, in the same scripts folder it will do some housekeeping only keeping a certain number of backups, see source to set the number to keep. (make sure to keep the exact filename, houdini uses that to identify it's function)

https://www.dropbox.com/scl/fi/pv3v2rm1gnhovy6cj23hv/afterscenesave.py?rlkey=608r3wn14kx89zvs746najcet&dl=0 [www.dropbox.com]
More code, less clicks.
User Avatar
Member
33 posts
Joined: Feb. 2017
Offline
Jonathan de Blok
If you place the afterSceneSave handler, linked below, in the same scripts folder it will do some housekeeping only keeping a certain number of backups, see source to set the number to keep. (make sure to keep the exact filename, houdini uses that to identify it's function)

https://www.dropbox.com/scl/fi/pv3v2rm1gnhovy6cj23hv/afterscenesave.py?rlkey=608r3wn14kx89zvs746najcet&dl=0 [www.dropbox.com]


This script sounds useful, but I'm getting the following error, and don't know enough Python to troubleshoot:

" File \"C:/Users/User/Documents/houdini20.0/scripts/afterscenesave.py\", line 12
print \"WARNING, saving into a backup folder.. skipped pruning\"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(\"WARNING, saving into a backup folder.. skipped pruning\")?
"

I'm not sure if this means it's not pruning. I assume not as all previous backups and autosaves still exist. What do you mean by exact filename? The exact filename of the script?

Any insight would be great.

Thanks,
User Avatar
Member
518 posts
Joined: Dec. 2013
Offline
I think now (in python 3) you have to put the print in brackets. So print ("Blah") or something like that. You could probably just remove that line or comment it out too.
User Avatar
Member
33 posts
Joined: Feb. 2017
Offline
peteski
I think now (in python 3) you have to put the print in brackets. So print ("Blah") or something like that. You could probably just remove that line or comment it out too.

Yeah that was the first thing I tried, but I still seemed to error out. I'll try again, also with it commented out.
User Avatar
Member
33 posts
Joined: Feb. 2017
Offline
BenjaminMarkus
peteski
I think now (in python 3) you have to put the print in brackets. So print ("Blah") or something like that. You could probably just remove that line or comment it out too.

Yeah that was the first thing I tried, but I still seemed to error out. I'll try again, also with it commented out.

I guess I forgot to add parenthesis to all the print commands. No more errors, but it still doesn't look like the script is working and pruning the old autosave and/or backups.
  • Quick Links