Andy Saia

saiacide

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Procedural bone creation June 24, 2018, 11:48 p.m.

Thanks for the response. It does seem like python is the easiest way to do this. I finally got it working after looking at the sop_skinning_converter. You can view the python script by right clicking on the node and selecting Type Properties than the Scripts tab. I didn't even realize you could bundle python scripts with an HDA which is very cool.

Now I'm trying to figure out how to procedurally influence weights and have multiple mesh's share the same rig.

If anybody else is interested here's the python code.

def GenerateBones():    
    print("Creating Bones")    
    
    ThisNode = hou.pwd()
    
    ContainerObject = hou.node("/obj").createNode("subnet", "%s_Generated_Bones" % (ThisNode.name()))
    
    Root = ContainerObject.createNode("null", "root")
    Geometry = ContainerObject.createNode("geo")
    hou.node(Geometry.path()+"/file1").destroy()
    Geometry.moveToGoodPosition()
    
    ObjMerge = Geometry.createNode("object_merge")
    ObjMerge.parm("objpath1").set(ThisNode.path()+"/IN")
    ObjMerge.parm("xformtype").set("local")
        
    # Setup Capture
    CaptureNode = None
    CaptureMethod = ThisNode.parm("capture_method").eval()
    
    #Biharmonic Capture
    if CaptureMethod == 0:
        CaptLines = Geometry.createNode("bonecapturelines")
        CaptLines.parm("rootpath").set(Root.path())
        SolidEmbed = Geometry.createNode("solidembed::2.0")
        SolidEmbed.setInput(0, ObjMerge)
        SolidEmbed.setInput(1, CaptLines)
        CaptureNode = Geometry.createNode("bonecapturebiharmonic")
        CaptureNode.setInput(0, ObjMerge)
        CaptureNode.setInput(1, SolidEmbed)
        for node in [CaptLines, SolidEmbed, CaptureNode]:
                node.moveToGoodPosition()

    #Proximity Capture
    elif CaptureMethod == 1:
        CaptureNode = Geometry.createNode("captureproximity")
        CaptureNode.setNextInput(ObjMerge)    
        CaptureNode.parm("rootpath").set(Root.path())
        CaptureNode.parm("maxinfluences").set(ThisNode.parm("max_bone_influence").eval())
        CaptureNode.parm("usecaptpose").set(1)
        CaptureNode.parm("forcecook").pressButton()
        CaptureNode.moveToGoodPosition()
    
    Deform = Geometry.createNode("deform")
    Deform.setNextInput(CaptureNode)
    Deform.parm("donormal").set(1)
    Deform.parm("fast").set(1)
    Deform.moveToGoodPosition()

    Deform.setDisplayFlag(True)
    Deform.setRenderFlag(True)
    
    CaptureRadius = ThisNode.parm("capture_radius").eval()
    
    # Make Bones
    for i, point in enumerate(hou.node(ThisNode.path()+"/POINTS_OUT").geometry().points()):
        bone = ContainerObject.createNode("bone", "bone_%i" % i)
        
        bone.parm("rOrd").set(0)
        CaptureLength = [0.1, 0.001]
        bone.parm("length").set(CaptureLength[CaptureMethod])
        bone.parm("displaycapture").set(True)
        bone.parm("captposelen").set(0.1)
        
        Position = point.attribValue("P")        
        for i, parm in enumerate(['tx', 'ty', 'tz']):
            bone.parm(parm).set(Position[i])        
    
        for parm in ['crtopcapx', 'crtopcapy', 'crtopcapz', 'crbotcapx', 'crbotcapy', 'crbotcapz']:
            bone.parm(parm).set(CaptureRadius)
            
        bone.setNextInput(Root)
        bone.moveToGoodPosition()
    
    hou.hscript("bonealigncapture -c %s/bone*" % str(ContainerObject.path()))
                    
    ContainerObject.moveToGoodPosition()
    
    print "Bones Creation complete! Output at %s" % ContainerObject.path()

Game Baker Custom Channel Alpha Support June 12, 2018, 1:35 a.m.

Hey guys,

I have a point attribute I'm trying to bake to a texture using the game baker's custom channel but it always exports without alpha. As an example lets say the attribute is p@output = {.1, 1, .1, .2};

Is there something I'm doing wrong or does the game baker not support alpha for custom channels?

Procedural bone creation June 5, 2018, 11:28 p.m.

Hey guys,

I'm new to rigging in houdini and every tutorial I find goes over manually creating bones in the viewport. I'm trying to figure out how to generate bones in a more procedural way.

For example, say I wanted to scatter bones onto a sphere and export this as a skinned mesh FBX for use in Unity? The bones would all be parented to a single root.

Is this possible? I've seen some people recommend python scripting to create bones but it feels a bit overly complicated for something like this.