Houdini Scripts Temp

From bernie's
Jump to: navigation, search

Match pos and scale of last selected object

import hou
objs = hou.selectedNodes()
for obj in objs[1:]:
    xf = obj.parent().createNode("xform")
    xf.setFirstInput(obj)
    print(obj.position()[0])
    xf.setPosition(obj.position()+hou.Vector2((0.5, -1.0)))
    #objectMerge.parm("objpath1").set(node.path())
    group = xf.parmTemplateGroup()
    bob = hou.StringParmTemplate("name", "Name", 1, default_value=(["temp1"]), naming_scheme=hou.parmNamingScheme.Base1, string_type=hou.stringParmType.Regular, menu_items=([]), menu_labels=([]), icon_names=([]), item_generator_script="", item_generator_script_language=hou.scriptLanguage.Python, menu_type=hou.menuType.Normal)
    group.append(bob)
    xf.setParmTemplateGroup(group)
    print group