问题描述:

如何使用Python设置houdini的首选项

相关方法

Houdini中和PREFERENCES相关的有三个方法。
官方文档

hou.getPreference()

getPreference(name) → string
这个方法根据属性的名字返回属性的值

hou.getPreferenceNames()

getPreferenceNames() → tuple of strings
这个方法将会返回所有Preference属性的名字,便于查询


# 这是打印结果
('composites.cinplut.val', 'general.voppreview.val', 'networkeditor.wirefadefactor', 'networkeditor.textbadgeoutputf
orview', 'networkeditor.textbadgedescriptiveparm', 'networkeditor.taskgraphlimitrows', 'networkeditor.solohighlighte
dworkitems', 'networkeditor.showpreviews', 'networkeditor.shownodetypes', 'networkeditor.shownodeshapes', 'networked
itor.showfailedworkitems', 'networkeditor.showdirtyworkitems', 'networkeditor.showcookedworkitems', 'networkeditor.s
howcancelledworkitems', 'networkeditor.maxworkitemsperrow', 'networkeditor.maxtaskgraphrows', 'networkeditor.maxflyo
utscale', 'networkeditor.doautomovenodes', 'networkeditor.badgevexcache', 'networkeditor.badgetimedep', 'networkedit
or.badgeneedscook', 'networkeditor.badgehdaunlocked', 'networkeditor.badgehdalocked', 'networkeditor.allowdroponwire
', 'networkeditor.TopInOutColor_8', 'networkeditor.TopInOutColor_4', 'networkeditor.TopInOutColor_17', 'networkedito
r.TopInOutColor_16', 'networkeditor.TopInOutColor_15', 'networkeditor.badgehastakedata', 'networkeditor.badgenodeloc
ked', 'networkeditor.TopInOutColor_10', 'networkeditor.TopInOutColor_0', 'networkeditor.TopInOutColorTag_9', 'networ
keditor.TopInOutColorTag_8', 'networkeditor.TopInOutColorTag_7', 'networkeditor.TopInOutColorTag_6', 'networkeditor.
TopInOutColorTag_5', 'networkeditor.TopInOutColorTag_4', 'networkeditor.TopInOutColorTag_19', 'networkeditor.TopInOu
tColorTag_18', 'networkeditor.TopInOutColorTag_17', 'networkeditor.TopInOutColorTag_16', 'networkeditor.TopInOutColo
rTag_14', 'networkeditor.TopInOutColorTag_13', 'networkeditor.showcookingworkitems', 'networkeditor.TopInOutColorTag
_12', 'networkeditor.TopInOutColor_12', 'networkeditor.TopInOutColorTag_11', 'AP_KeyboardHit', 'exttools.foldercompa
re.options', 'exttools.filecompare.options', 'exttools.filecompare.path', 'ui.textport.paren', 'networkeditor.badgew
arning', 'networkeditor.TopInOutColor_1', 'ui.textport.syntax', 'networkeditor.TopInOutColor_6', 'ui.editor.paren',
'ui.parm.paren', 'ui.parm.syntax', 'notify.timelimit.val', 'networkeditor.TopInOutColorTag_10', 'notify.helptip.menu
', 'hipoptions.unitmass.val', 'hipoptions.unitlength.val', 'misc.opencl_env.override', 'misc.make_spare_parms.val',
'misc.externalhelpurl.val', 'take.autoincludeassets.val', 'general.autosaveinterval.val', 'general.newfilesavescenef
ormat', 'resmgr.showhidden.val', 'notify.timelimited.val', 'resmgr.autosave.desk.val', 'misc.cansendanonymousstats.v
al', 'render.showallrops.val', 'anim.underlinescoped.val', 'anim.underlinescopedcolor.val', 'anim.followscopedchanne
lreferences.val', 'objects.linkchopviewer.val', 'notify.location.menu', 'ui.textport.help', 'anim.includeconstraints
.val', 'anim.includechild.val', 'networkeditor.badgenodeunload', 'anim.includeanim.val', 'objects.linkchanneleditor.
val', 'networkeditor.maxnamewidth', 'anim.autoupdatechannels.val', 'networkeditor.badgeconstraints', 'networkeditor.
showprompttext', 'anim.setautoscope.val', 'anim.nopendingkey.val', 'anim.autokeytuples.val', 'general.newfilesavesce
neformat.val', 'anim.slope.val', 'anim.firstfunc.val', 'states.bones.autoenablecplane.val', 'networkeditor.badgenotc
ompilable', 'states.curve.autoenablecplane.val', 'states.objcurve.autoenablecplane.val', 'misc.restricttosafe.val',
'menu.val', 'handles.defaultxformglobal.val', 'anim.autofunc.val', 'states.path.autoenablecplane.val', 'networkedito
r.badgenodehasdata', 'handles.defaultgimbal.val', 'handles.viewaxisrotatering.val', 'handles.useviewdirtohiderotater
ings.val', 'handles.indirectdragprefertranslateoverscale.val', 'handles.indirectdragprefertranslateoverrotate.val',
'resmgr.pathbehaviour.val', 'anim.autoslope.val', 'networkeditor.TopInOutColor_7', 'handles.tumbleinside.val', 'gene
ral.loadwarndeprecated.val', 'networkeditor.TopInOutColor_9', 'handles.planartranslatetargets.val', 'anim.holdlastke
y.val', 'networkeditor.badgecomment', 'handles.extendedaxes.val', 'handles.pickdistance.val', 'handles.scalehandlest
yle.val', 'handles.axistoorienttonormal.val', 'handles.indirectdragspidermethod.val', 'handles.indirectdragtranslate
method.val', 'networkeditor.TopInOutColor_11', 'anim.firstfunc.menu', 'misc.useexternalhelp.val', 'viewport.locateco
mponents.val', 'networkeditor.TopInOutColorTag_3', 'misc.revert_invisible.val', 'viewport.setpivottumbledefault.val'
, 'networkeditor.textbadgeloplastmodifiedprim', 'handles.indirectdrag.val', 'viewport.autosetviewpivotonselection.va
l', 'general.undolimit.val', 'networkeditor.TopInOutColor_5', 'viewport.scrollstyle.val', 'viewport.wire_toggle.menu
', 'viewport.lightpasscolorbuffertype.val', 'viewport.allowadaptivesubd.val', 'viewport.offsetzoomdefault.val', 'vie
wport.wiretoggle.val', 'networkeditor.TopInOutColor_14', 'viewport.orientation.val', 'networkeditor.badgeerror', 'vi
ewport.defaulthoming.val', 'objsop.switch.val', 'handles.indirectdragprefertranslateovervrotate.val', 'objcache.memo
ry.val', 'ui.parm.help', 'sopcache.unload.val', 'networkeditor.showtaskgraph', 'network.autohighlight.val', 'network
editor.TopInOutColor_13', 'selector.areaselvisible.val', 'objects.folderflipping.val', 'sopcache.memory.val', 'objec
ts.highlight.val', 'anim.setfirstkey.val', 'trees.displayicons.val', 'networkeditor.textbadgelayercount', 'objcache.
memorylimit.val', 'tiles.perfstats.val', 'chops.mincooks.val', 'tools.secure.val', 'networkeditor.maxnameheight', 'r
esmgr.showall.val', 'networkeditor.minnameheight', 'objects.keepPos.val', 'networkeditor.shakesensitivity', 'general
.autosaveinc.val', 'networkeditor.snapradius', 'sopcache.level.val', 'networkeditor.flagsallowpreselect', 'networked
itor.badgedynamictop', 'exttools.filecompare.menu', 'handles.hidelockedparts.val', 'networkeditor.allowdiveintohdas'
, 'networkeditor.transientinfo', 'networkeditor.TopInOutColorTag_1', 'networkeditor.showvopinoutlabels', 'sopstates.
exportcookselectiontype.val', 'tools.createincontext.val', 'misc.destructive_revert.val', 'networkeditor.TopInOutCol
orTag_2', 'networkeditor.showanimations', 'networkeditor.TopInOutColorTag_0', 'objects.overwriteanim.val', 'networke
ditor.gridsnapping', 'chops.deftimeslice.val', 'parmdialog.embedviseditor.val', 'networkeditor.dosnapping', 'general
.audionotice_question.val', 'networkeditor.TopInOutColor_3', 'ui.editor.toolbar', 'tools.sopviewmode.val', 'anim.add
edfunc.val', 'anim.addedfunc.menu', 'general.audionotice_warning.val', 'handles.translateinside.val', 'general.lod.v
al', 'networkeditor.connectorsnapradius', 'general.lefthandmenus.val', 'tools.opnamespacefilter.val', 'general.fileb
rowserimages.val', 'objects.openchanneleditor.val', 'networkeditor.textbadgecomment', 'networkeditor.showstaticworki
tems', 'general.smoothlines.val', 'general.audionotice_message.val', 'general.uiscale', 'general.nopending.val', 'ge
neral.filechooserstyle.menu', 'networkeditor.textbadgecontextoptiondeps', 'general.saveviewcmds.val', 'objects.kinov
erride.val', 'objects.keepPosMoving.val', 'general.inc.val', 'sopcache.memorylimit.val', 'selector.useexisting.val','viewport.delayinactive.val', 'anim.keepchannelselection.val', 'misc.opencl_device.menu', 'handles.openchanneledito
r.val', 'misc.opencl_devicetype.menu', 'viewport.oldtumble.val', 'handles.colorxform.val', 'handles.scope.val', 'net
workeditor.copypathstoclipboard', 'notify.echohotkey.val', 'networkeditor.badgelopdebug', 'networkeditor.showsimples
hape', 'general.icon_size.menu', 'networkeditor.TopInOutColor_18', 'networkeditor.TopInOutColor_2', 'networkeditor.s
howstackedlook', 'exttools.foldercompare.path', 'general.coppreview.val', 'point_percent.val', 'handles.translateins
ideobscuresbackaxes.val', 'networkeditor.badgekinematics', 'delpoint.val', 'objects.pickingmenu.val', 'networkeditor
.TopInOutColorTag_15', 'handles.defaultworldalign.val', 'general.panecoloring.val', 'handles.keepalign.val', 'tools.
maxhistory.val', 'general.audionotice_error.val', 'anim.setkey.val', 'addpoint.val', 'objects.selectsubnet.val', 'FU
SE_PREF.ramp_val', 'anim.rotationfunc.menu', 'ramp_color_schemes.val', 'scripting.exprlanguage.menu', 'anim.rotation
func.val', 'general.uiplaybar.menu', 'viewport.altkeyviewcontrols.val', 'general.desk.val', 'handles.scale.val', 'ge
neral.keepfloatwindowsontop.val', 'networkeditor.TopInOutColor_19', 'viewport.directeddollydefault.val', 'networkedi
tor.distancefordrag', 'ui.editor.syntax', 'objcache.clear.val', 'open.val', 'networkeditor.showpartitionworkitems',
'ok.val', 'misc.parmdel_warnings.val', 'selector.fullloops.val', 'chops.maxtimeslice.val', 'networkeditor.autoscroll
', 'rendererListVscroll')

hou.setPreference()

setPreference(name, value) → bool
设置属性的值,如果成果就返回True

实际操作

简单来说就是先通过 hou.getPreferenceNames() 获取到想要修改的属性名,然后再通过 hou.setPreference() 进行操作,非常简便

Houdini 使用Python设置Preference相关推荐

  1. python houdini_【微笔记】houdini使用python创建城市教程笔记II

    原标题:[微笔记]houdini使用python创建城市教程笔记II 今天继续学习第二部分,使用python处理block和创建属性,批量处理导入的建筑模型.最大的感受是使用程序去处理批量重复的东西真 ...

  2. python houdini_【微笔记】houdini使用python创建城市教程笔记I

    原标题:[微笔记]houdini使用python创建城市教程笔记I 昨天小编分享了houdini使用python制作城市的教程,讲解得非常不错,不过个人建议大家至少有一些python基础和houdin ...

  3. python 设置开机自动启动 .py 文件

    python 设置开机自动启动 .py 文件 创建python_auto.bat的快捷方式,放入启动项: C:\Users\Administrator\AppData\Roaming\Microsof ...

  4. python modbus tk 库_如何使用modbus tk rtu(python)设置简单的从机和主机

    我想通过modbus协议在树莓pi(从机)和pc(主机)之间建立通信.目前,我正在使用 modbus-tk (python)设置通信协议. 问题是主设备无法从从设备读取寄存器我能知道我的代码有什么问题 ...

  5. python中文版界面-python设置中文界面实例方法

    下面,小编将通过一组实例演示,让大家更直观,更清楚明白的了解要设置中文这一内容的操作步骤. 首先展示实例代码: import pygame from pygame.locals import * de ...

  6. python设置坐标轴刻度值字体大小_python 设置xlabel,ylabel 坐标轴字体大小,字体类型...

    本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...

  7. python设置本机IP地址、子网掩码、DNS,获取本机IP地址、子网掩码、DNS、MAC

    python设置本机IP地址.子网掩码.DNS,获取本机IP地址.子网掩码.DNS.MAC main.py """=== coding: UTF8 ==="&q ...

  8. python设置二维列表_Python设置为列表

    python设置二维列表 Python设置为列表 (Python Set to List) Sometimes we have to create a list from the set object ...

  9. python设置环境变量_Python设置环境变量

    python设置环境变量 We can set an environment variable in Python using os module. Python os module environ ...

最新文章

  1. iscroll动态加载数据完美解决方案
  2. Fundebug前端JavaScript插件更新至1.6.0,新增test()方法用于测试
  3. 【十五分钟Talkshow】工作流及工作流框架、服务
  4. angle-class
  5. easyui的因为url名和视图名相同出现上面的异常。
  6. 木马编程DIY (Delphi版) - 第2篇 单实例运行
  7. python源文件后缀_Python怎样获取文件扩展名
  8. linux每日命令(11):cat命令
  9. 系统调用的概念和类型
  10. k3修改服务器,金蝶k3客户端修改服务器地址
  11. Python从excel读取数据并绘图
  12. 机器学习笔记 - 探索性数据分析(EDA) 概念理解
  13. [Irving] Android 点击两次返回退出系统
  14. STM32串口屏学习
  15. 二哥回复读者:研三秋招一败涂地了,怎么办?
  16. mysql 怎么加上撇号_php - 如何在写入Mysql数据库时处理撇号
  17. 新手C语言实现判定三角形及其面积运算
  18. 【OpenCV】imshow()和namedWindow()之间的关系,解决两个窗口问题
  19. x64dbg破解一个简单的Demo教程
  20. libreoffice安装教程_win10怎么安装libreoffice6.4_win10系统libreoffice6.4安装教程

热门文章

  1. 【数据结构】线段树的扩展与应用
  2. ESP32 Arduino TM1638 数码管 按键 LED
  3. 【二】gym初次入门一学就会---代码详细解析简明教程----平衡杆案例
  4. 主数据标准化项目阶段划分、实施难点及应对措施经验分享
  5. windows置顶程序DeskPins的下载、安装和使用
  6. 做BI财务数据分析,国产BI软件经验更足
  7. Fiddler抓手机app的包
  8. Instagram密友名单与私密账户的区别
  9. ByteV打造3D海上风电监控平台 ——助力风电能源可持续发展
  10. mysql基础约束详解