01.geo 对应创建mantra
import hou
null_path=[]
for i in hou.selectedNodes():
mantra=hou.node('out').createNode('ifd','{0}'.format(i.name()))
mantra.parm('trange').set(1)
frame=hou.parmTuple('{0}/f'.format(mantra.path()))
frame.deleteAllKeyframes()
for s in i.children():
if s.type().name()=='null':
null_path=s.path()
star=hou.parm('{0}/start'.format(null_path)).eval()
end=hou.parm('{0}/end'.format(null_path)).eval()
star=int(star)
end=int(end)
mantra.parm('f1').set(star)
mantra.parm('f2').set(end)
mantra.moveToGoodPosition()
02.关于节点批量排序
Lambda表达式
》》》learn form 大佬
注意列表中的顺序
nodes=list((hou.node('/obj/topnet1/null1'), hou.node('/obj/topnet1/null2'), hou.node('/obj/topnet1/null3'), hou.node('/obj/topnet1/null4')))
nodes.sort(key=lambda x:x.name())
reduce(lambda x ,y:y.setNextInput(x)or y ,nodes)