Skip to main content

Send to Tops

 

import hou
nodes = hou.selectedNodes()
topnet = hou.node("/obj/topnet1")
for x in nodes:
    name = x.name()
    fstart = x.parm("f1").eval()
    fend = x.parm("f2").eval()
    ver = x.parm("version")
    path = x.path()
    
    topcache = topnet.createNode("ropfetch")
    if x.parm("cachesim").eval() is 1:
        topcache.parm("batchall").set(1)
        topcache.setColor(hou.Color(.5,0,0))
    else:
        topcache.parm("framesperbatch").set(15)
        topcache.setColor(hou.Color(0,.5,0))
    p = hou.IntParmTemplate("version", "Version", 1)
    g = topcache.parmTemplateGroup()
    g.append(p)
    topcache.setParmTemplateGroup(g)
    topcache.parm("version").set(ver)
    topcache.parm("roppath").set(path)
    topcache.setName(name)