Hello all,
I am looking for a way to set a specific preference in Houdini with python. The preference I am looking to set is named “Auto Save Method” in the UI. I've tried to use the hou.getPreferanceNames() to get a list of all the pref name variables I can set but this does not appear in there.
I have had a dig through the preference files stored inside the Houdini folder and have found a parameter inside the hcommon.pref file that would seem to match the setting I am looking to change, however, if I were to edit this text file whilst Houdini is running, would that update the setting or would it require a restart of Houdini? And is it even a good idea to be editing these .pref files whilst Houdini is running?
Here is a link to the help file for the parameter I am looking to change, sorry I don't have a picture: https://www.sidefx.com/docs/houdini/ref/windows/mainprefs.html#persistence [www.sidefx.com]
You'll have to forgive me if this is very basic stuff, I am kinda new to Python in Houdini and am trying to make tools to learn more.
Thanks for the read!
Houdini Python hou.setPreference()
1535 4 1-
- underscoreus
- Member
- 24 posts
- Joined: 7月 2017
- Offline
-
- dkzone
- Member
- 23 posts
- Joined: 2月 2014
- Offline
-
- underscoreus
- Member
- 24 posts
- Joined: 7月 2017
- Offline
dkzone
Hi, maybe you should double check names because when I type
hou.getPreference('general.autosaveinterval.val')
it returns ‘1’ meaning 1 minute. Your desired preference is below this, I think that it should be there…
Hey dkzone,
Sorry, I've been meaning to update this to add clarity with a picture. I'm not after the interval (already got that one
![](/static/djangobb_forum/img/smilies/smile.png)
I've found what seems to be the file on disk that controls this parameter inside hcommon.pref, if I can't find a way of editing the preference via a python command I might just end up editing the .pref file directly through python but I am kinda unsure if its such a good idea to edit these files on the fly whilst Houdini is running.
Thanks for the reply though!
Here's the image:
Marked Image [imgur.com]
Edited by underscoreus - 2020年2月11日 15:02:49
-
- dkzone
- Member
- 23 posts
- Joined: 2月 2014
- Offline
-
- underscoreus
- Member
- 24 posts
- Joined: 7月 2017
- Offline
-
- Quick Links