根据不同项目,节点路径需要相应的修改,旨在快捷键修改.
当前代码中缓存路径为Linux
其中所有$均为houdini内部的环境变量
# -*- coding: utf-8 -*-
import hou
def mess(count):
message = ' 设置了{0}个节点'.format(count)
print('-'*14)
print(message)
print('-'*14)
hou.ui.setStatusMessage(message, severity=hou.severityType.ImportantMessage)
def main():
hip_name = hou.expandString("$HIPNAME")
if hip_name == 'untitled':
hou.ui.displayMessage('先保存文件')
exit()
try:
parent_node = hou.selectedNodes()[0].parent()
except:
hou.ui.displayMessage('至少选择一个节点')
exit()
task_node = parent_node.parent().parent()
all_nodes = parent_node.children()
cache_path = '$HOME/geoCache/$PROJ_NAME/$SHOT_NAME/$HIPNAME/{0}/$OS/$OS.$F4.bgeo.sc'.format(task_node)
count = 0
for node in all_nodes:
node_type = node.type().name()
if 'filecache' in node_type:
node.parm('loadfromdisk').set(True)
node.parm('filemethod').set(1)
node.parm('file').set(cache_path)
count += 1
elif 'vellumio' in node_type:
node.parm('loadfromdisk').set(True)
node.parm('file').set(cache_path)
count += 1
if count == 0:
hou.ui.displayMessage('进入需要设置缓存节点的层级下')
else:
mess(count)
把以上代码放在工具架,然后编辑此工具的键盘快捷键即可
文章作者:甜面酱先生
文章标题:Houdini 一键设置统一filecache缓存路径
文章链接:https://cfxer.cn/?post=41
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明来自甜面酱先生 !
文章标题:Houdini 一键设置统一filecache缓存路径
文章链接:https://cfxer.cn/?post=41
本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明来自甜面酱先生 !
设备上扫码阅读
版权说明
文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权。版权声明:未标注转载均为本站原创,转载时请以链接形式注明文章出处。如有侵权、不妥之处,请联系站长删除。敬请谅解!