Jump to content

Default autosave


Recommended Posts

  • 10 months later...

 

Hi,

 

In your $HOME/houdniversion/scripts folder create 456.py file with this content:

import hou
hou.appendSessionModuleSource('''hou.hscript("autosave on")''')

 

 

May I ask a silly question? Why does it have to be 456.py? I changed the file name and the code stopped working.

Link to comment
Share on other sites

  • 4 weeks later...

Hello i have a question about this;

i can't find the scripts folder you are talking about

Also; there is no folder called 'Houdini 15' or something in my home folder. (mac)

the only scripts folder i can find is in my project folder, but that is project based, right?

 

And how do i create a .py file?

Link to comment
Share on other sites

on mac it will be in /Users/yourName/Library/Preferences/Houdini

I always drag this Houdini folder into my sidebar for quick access.

in there you will find a folder for every version major/minor version of Houdini that you have installed (14.0, 15.0 etc)

this is where Houdini stores all sorts of preference files and installed plugins...

 

a .py file is a python file

just open a text editor (not TextEdit.app - it sucks) and write the code you want/need (it must be valid python code) and save it with the .py extension 

Link to comment
Share on other sites

  • 1 year later...

I'm trying to set this up for the whole studio, I have it working in my 456.py with:

hou.hscript('autosave on')

But autosave defaults to save every 1 minute, how can I change this (through the 456.py or some other method) to every 10 minutes for example? I can't find anything relevant in hscript or hou..

Link to comment
Share on other sites

  • 2 years later...

Someone else noticed this doesn’t work anymore in H18? At least with me it doesn’t.. 

I am on Houdini 18.0.416 right now.
Did anything change? 

Thanks again,

Edit: Not needed anymore. It just works now.

Edited by Krion
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

You can try to set it in your 456.cmd file in $HOME/houdiniX.Y/scripts/456.cmd (X=Major version, Y=Minor version, e.g.: 18.0) directly:

autosave on

 

https://www.sidefx.com/forum/topic/25350/

Or you can ask the user what they want: https://www.sidefx.com/forum/topic/12971/#post-61684

I like the idea of having it in File Menu under File Save As too: https://www.sidefx.com/forum/topic/12971/#post-256607

Environment variable to force it on/off wouldn't be bad but it is a little bit harder to discover: https://www.sidefx.com/forum/topic/45068/#post-201467 and there is already plenty of other options.

Always on in preferences (GUI) was probably already requested, but you can add RFE (voice) for it too.

 

Link to comment
Share on other sites

  • 9 months later...
On 4/24/2015 at 5:54 PM, pezetko said:

 


import hou
hou.appendSessionModuleSource('''hou.hscript("autosave on")''')

Just curious, regarding the Python method, what's the Python 3 version of this?

 

Didn't have the time to look into the differences between Python 2 & 3, but I am going to look now in that 456.cmd method and watch those links. Asking the user seems like a nice option indeed.

EDIT: both 456.cmd versions do not seem to work. :( I am on version "18.5.462 Python 3".

Edited by Krion
Link to comment
Share on other sites

Hi, it should be the same.

Just tested both 456.cmd and 456.py on 18.5.514 (apprentice) on Windows 10 and it is working fine (456.cmd script is running on scene open/new file).

O would prefer 456.cmd over 456.py as the python version modifies the session module and it could result in inserting this script multiple times if you don't add guard against that.

 

Btw: Now the 123.py works only in Houdini FX. The Core has houdinicore.py instead. https://www.sidefx.com/docs/houdini/hom/locations.html#startup

Alternatively, you can use pythonrc.py it is running only on startup (same as 123 scripts).

 

But for always-on autosave, I would go with 456.cmd variant.

 

 

Link to comment
Share on other sites

  • 4 weeks later...

Thanks, it was actually something else in my packages folder that was causing the issue. The Houdini ToolBox library.

After deleting that now the autosave scripts work. (btw I pressed sideFX in an RFE too during this time that they should make this an ui option)

Edited by Krion
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...