UV packing multiple objects

   2405   2   1
User Avatar
Member
559 posts
Joined: March 2014
Offline
I was wondering what the best workflow is in Houdini to pack a lot of objects into a single UV layout.

I have several FBX files with about 20 separate objects.

So it looks like I first have to merge all the objects I want into a new GEO node, then pack them with a "uv layout" SOP. And if I want to export them as a new FBX with separate objects, I have to manually extract them from the merged SOP into new GEO nodes one by one.

That seems a little silly to me.

So I was wondering if there's a faster way to do something basic like this in Houdini ?

Thanks.
User Avatar
Member
802 posts
Joined: Feb. 2017
Offline
Hey toonafish,

I think it is the way you have to do it. for the extraction part, there used to be a LABS tool that extracted groups to objects but I can't find it anymore. Nevertheless, I have a script that does the same. Make sure each piece that should become its own GEO container has its own primitive group. Then select your geo in OBJ context and run the script as a custom shelf tool.

Cheers
CYTE

def extract_groups(selected_nodes):
    '''Create objects using target object primitive groups.'''

    if len(selected_nodes) != 1:
        return

    with hou.undos.group('Separate Objects'):
        node = selected_nodes[0]
        node.setDisplayFlag(False)

        groups = node.displayNode().geometry().primGroups()

        for group in groups:
            obj = node.createOutputNode('geo', group.name(), run_init_scripts=False)

            merge = obj.createNode('object_merge')
            merge.parm('objpath1').set(node.path())
            merge.parm('group1').set(group.name())

       
          

            

extract_groups(hou.selectedNodes())
User Avatar
Member
559 posts
Joined: March 2014
Offline
I already packed the uv's in Blender in no time, suppose Blender is your best friend as a Houdini user :-)

But I'm sure this script will come in handy next time.

Thanks a lot.
  • Quick Links