Jump to content

Houdini Python hou.setPreferance


tagosaku

Recommended Posts

I am learning python, and found hou.setPreference is very useful. However, I cannot find what exact names and values we can write in hou.setPreference(XXX,XX). Do we have that info/list in sidefx document pages?  

So far, I only found some in odForce, not from sidefx:

        hou.setPreference("general.autosaveinterval.val", "15")
        hou.setPreference("general.autosaveinc.val", "2")
        hou.appendSessionModuleSource('''hou.hscript("autosave on")''')


Or ideally Sidefx implements a feature that houdini can monitor what a user change parameters in UI, and automatically generate python code in python window? (I know we can drag and drop a parameter to python winodw to generate parm's path, but more convinient way ^^.)

 

image.png.fc8f8d67ecfa3295ca0f411f2e97ee05.png

Link to comment
Share on other sites

Hi! Yes. I recall helping out sometime last year on a similar topic. To get the list of names and values, you can run the following quick snippet on a Python shell:

list_of_prefs = sorted(hou.getPreferenceNames())
for pref in list_of_prefs:
  print(pref + ": " + hou.getPreference(pref))

Basically, hou.getPreferenceNames() will return a tuple of all the preference names (the names you would use in setPreference). the sorted function is optional.

In a loop, you can process each name to get its current value using hou.getPreference().

  • Like 1
Link to comment
Share on other sites

Jael, 

That's perfect!, thanks! ! SideFX should write it on that document.  Just in case, I am pasting all the commands here for everyone.:

 

networkeditor.TopInOutColorTag_15: 
networkeditor.TopInOutColorTag_16: 
networkeditor.TopInOutColorTag_17: 
networkeditor.TopInOutColorTag_18: 
networkeditor.TopInOutColorTag_19: 
networkeditor.TopInOutColorTag_2: 
networkeditor.TopInOutColorTag_3: 
networkeditor.TopInOutColorTag_4: 
networkeditor.TopInOutColorTag_5: 
networkeditor.TopInOutColorTag_6: 
networkeditor.TopInOutColorTag_7: 
networkeditor.TopInOutColorTag_8: 
networkeditor.TopInOutColorTag_9: 
networkeditor.TopInOutColor_0: 
networkeditor.TopInOutColor_1: 
networkeditor.TopInOutColor_10: 
networkeditor.TopInOutColor_11: 
networkeditor.TopInOutColor_12: 
networkeditor.TopInOutColor_13: 
networkeditor.TopInOutColor_14: 
networkeditor.TopInOutColor_15: 
networkeditor.TopInOutColor_16: 
networkeditor.TopInOutColor_17: 
networkeditor.TopInOutColor_18: 
networkeditor.TopInOutColor_19: 
networkeditor.TopInOutColor_2: 
networkeditor.TopInOutColor_3: 
networkeditor.TopInOutColor_4: 
networkeditor.TopInOutColor_5: 
networkeditor.TopInOutColor_6: 
networkeditor.TopInOutColor_7: 
networkeditor.TopInOutColor_8: 
networkeditor.TopInOutColor_9: 
networkeditor.allowdiveintohdas: 1
networkeditor.allowdroponwire: 1
networkeditor.autoscroll: 1
networkeditor.badge64bit: normal
networkeditor.badgechilderror: large
networkeditor.badgecomment: normal
networkeditor.badgeconstraints: normal
networkeditor.badgedynamictop: normal
networkeditor.badgeerror: large
networkeditor.badgehastakedata: hide
networkeditor.badgehdalocked: normal
networkeditor.badgehdaunlocked: normal
networkeditor.badgekinematics: hide
networkeditor.badgelopdebug: normal
networkeditor.badgeloppopulationmask: normal
networkeditor.badgelopunloadedpayloads: normal
networkeditor.badgemessage: normal
networkeditor.badgeneedscook: hide
networkeditor.badgenodehasdata: hide
networkeditor.badgenodelocked: normal
networkeditor.badgenodeunload: normal
networkeditor.badgenotcompilable: hide
networkeditor.badgetimedep: normal
networkeditor.badgevexcache: normal
networkeditor.badgewarning: normal
networkeditor.connectorsnapradius: 0.700000
networkeditor.copypathstoclipboard: 1
networkeditor.dimunusednodes: 0
networkeditor.distancefordrag: 0.050000
networkeditor.doautomovenodes: 1
networkeditor.dosnapping: 1
networkeditor.flagsallowpreselect: 1
networkeditor.gridsnapping: 1
networkeditor.maxflyoutscale: 10000.000000
networkeditor.maxnameheight: 0.000000
networkeditor.maxnamewidth: 10000.000000
networkeditor.maxtaskgraphrows: 20
networkeditor.maxworkitemsperrow: 10
networkeditor.minnameheight: 0.000000
networkeditor.shakesensitivity: 1.000000
networkeditor.showanimations: 1
networkeditor.showcancelledworkitems: 1
networkeditor.showcookedworkitems: 1
networkeditor.showcookingworkitems: 1
networkeditor.showdirtyworkitems: 1
networkeditor.showfailedworkitems: 1
networkeditor.showloplayercolor: 1
networkeditor.shownodeshapes: 1
networkeditor.shownodetypes: 1
networkeditor.showpartitionworkitems: 1
networkeditor.showpreviews: 1
networkeditor.showprompttext: 1
networkeditor.showsimpleshape: 0
networkeditor.showstackedlook: 1
networkeditor.showstaticworkitems: 1
networkeditor.showtaskgraph: 1
networkeditor.showvopinoutlabels: 0
networkeditor.snapradius: 0.100000
networkeditor.solohighlightedworkitems: 0
networkeditor.taskgraphlimitrows: 1
networkeditor.textbadgecomment: truncated
networkeditor.textbadgecontextoptiondeps: selected_full
networkeditor.textbadgedescriptiveparm: truncated
networkeditor.textbadgedetailid: hide
networkeditor.textbadgelayercount: truncated
networkeditor.textbadgeloplastmodifiedprim: truncated
networkeditor.textbadgeoutputforview: truncated
networkeditor.transientinfo: 1
networkeditor.wirefadefactor: 1.000000
notify.echohotkey: 1
notify.echohotkey.val: 1
notify.errors.location: 0
notify.helptip.location: 0
notify.helptip.menu: 0
notify.location.menu: 0
notify.timelimit.duration: 5
notify.timelimit.enable: 1
notify.timelimit.val: 5
notify.timelimited.val: 1
objcache.clear.val: 
objcache.memory.val: Always
objcache.memory.val: Always
objcache.memorylimit.val: 153600
objcache.memorylimit.val: 153600
objects.folderflipping.val: 1
objects.folderflipping.val: 1
objects.highlight.val: 1
objects.highlight.val: 1
objects.keepPos.val: 2
objects.keepPos.val: 2
objects.keepPosMoving.val: 2
objects.keepPosMoving.val: 2
objects.kinoverride.val: 0
objects.kinoverride.val: 0
objects.linkchanneleditor.val: 1
objects.linkchanneleditor.val: 1
objects.linkchopviewer.val: 0
objects.linkchopviewer.val: 0
objects.openchanneleditor.val: 1
objects.openchanneleditor.val: 1
objects.overwriteanim.val: 0
objects.overwriteanim.val: 0
objects.pickingmenu.val: 0
objects.pickingmenu.val: 0
objects.selectsubnet.val: 0
objects.selectsubnet.val: 0
objsop.switch.val: 
offsetzoomdefault.val: 1
ok.val: 
oldtumble.val: 3
open.val: 
openShell: 
openState: 1
orientation.val: Y Up
parmdialog.embedviseditor.val: 1
parmdialog.embedviseditor.val: 1
perfmon.rampprefs.val: 0 0.45 0.82 0.08 1 0 0.4 0.9 0.45 0 1 0 0.75 0.8 0 0 1 0 
pl.pathbehaviour.val: 0
pl.showAll.val: 0
pl.showHidden.val: 0
playbar: 
point_percent.val: 
project.history.menu: 0
radial_edit.act: 
radial_pin.val: 0
radialmenu.val: 24
radials_manage.act: 
ramp_color_schemes.val: 0
render.activerenderers.val: Mantra
render.edit.menu: 0
render.preview.menu: 0
render.showallrops.val: 1
render.showallrops.val: 1
render.start.menu: 0
rendererListVscroll: 
resmgr.autosave.desk.val: 0
resmgr.pathbehaviour.val: 0
resmgr.showall.val: 0
resmgr.showhidden.val: 0
save.asset.menu: 0
saveastype.menu: 0
saveviewcmds.val: 2
scripting.exprlanguage: hscript
scripting.exprlanguage.menu: hscript
scrollstyle.val: 0
selector.areaselvisible.val: 0
selector.areaselvisible.val: 0
selector.fullloops.val: 0
selector.fullloops.val: 0
selector.geopickdistance.val: 5
selector.geopickdistance.val: 5
selector.useexisting.val: 1
selector.useexisting.val: 1
sendAnonymousStats: 0
setpivottumbledefault.val: 1
shelf: 
showCurrentSimMenu.val: 1
showmenu.val: 1
side_help.val: 0
simcreatenew.val: 
simenable.val: 1
simenabletoggle.val: 
simresetlist.menu: 0
smoothLines: 1
smoothlines.val: 1
sopcache.level.val: 1
sopcache.level.val: 1
sopcache.memory.val: Never
sopcache.memory.val: Never
sopcache.memorylimit.val: 1024
sopcache.memorylimit.val: 1024
sopcache.unload.val: Flag
sopcache.unload.val: Flag
sopstates.exportcookselectiontype.val: 0
sopstates.exportcookselectiontype.val: 0
startupPage: 0
states.bones.autoenablecplane.val: 0
states.bones.autoenablecplane.val: 0
states.curve.autoenablecplane.val: 0
states.curve.autoenablecplane.val: 0
states.objcurve.autoenablecplane.val: 0
states.objcurve.autoenablecplane.val: 0
states.path.autoenablecplane.val: 0
states.path.autoenablecplane.val: 0
status: Successfully loaded toolBox_v083_dateStamp.hip
statusbar: 
take.autoincludeassets.val: 0
take.autoincludeassets.val: 0
takecreate.val: 
takemenu.val: 0
tiles.perfstats.val: 1
tiles.perfstats.val: 1
timeStampToAskAboutAnonymousStats: -1
toggleSideHelp.val: 
tools.createincontext.val: 0
tools.createincontext.val: 0
tools.maxhistory.val: 6
tools.maxhistory.val: 6
tools.opnamespacefilter.val: 1
tools.opnamespacefilter.val: 1
tools.secure.val: 1
tools.secure.val: 1
tools.sopviewmode.val: 1
tools.sopviewmode.val: 1
trees.displayicons.val: 1
trees.displayiconsbydefault.val: 1
ui.bright.val: 1
ui.contrast.val: 1
ui.editor.paren: 1
ui.editor.paren: 1
ui.editor.syntax: 1
ui.editor.syntax: 1
ui.editor.toolbar: 1
ui.editor.toolbar: 1
ui.gamma.val: 1
ui.parm.external: 0
ui.parm.external: 0
ui.parm.help: 1
ui.parm.help: 1
ui.parm.paren: 1
ui.parm.paren: 1
ui.parm.syntax: 1
ui.parm.syntax: 1
ui.saturation.val: 1
ui.textport.help: 1
ui.textport.help: 1
ui.textport.paren: 1
ui.textport.paren: 1
ui.textport.syntax: 1
ui.textport.syntax: 1
undo.menu: 0
undomemlimit.val: 100000
unlock.asset.menu: 0
up.val: 
updatemode.menu: 0
viewport.allowadaptivesubd.val: 1
viewport.altkeyviewcontrols.val: 1
viewport.autosetviewpivotonselection.val: 0
viewport.defaulthoming.val: 0
viewport.delayinactive.val: 0
viewport.directeddollydefault.val: 1
viewport.lightpasscolorbuffertype.val: 0
viewport.locatecomponents.val: 1
viewport.offsetzoomdefault.val: 1
viewport.oldtumble.val: 3
viewport.orientation.val: Y Up
viewport.scrollstyle.val: 0
viewport.setpivottumbledefault.val: 1
viewport.wire_toggle.menu: Wireframe
viewport.wiretoggle.val: Wireframe Ghost
wiretoggle.val: Wireframe Ghost

 

  • Like 1
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...