Preserve maya hierarchy

   1317   1   0
User Avatar
33 posts
Joined: 5月 2015

is there a way to preserve Maya hierachy upon "Baking Asset" from an houdiniEngine's Hda in maya?

All hierarchy is merged when using "Bake Asset" from houdini node.
Seems like I can use maya "Mesh -> separate" to separate mesh after baking, but I have no clue to associate baked meshes from the source ones. (used HDA's 'Split geos by group option')

I wished I could have set an attribute on original meshes in maya (ex; current path attribute) so I could have retrieved them in the baked geos (bake asset) and set meshes back to their original hierarchy/named upon baking.

Any workaround exists?

User Avatar
451 posts
Joined: 8月 2019
It's not pretty, but it's possible.

When a hierarchy is passed from Maya to Houdini, the primitive name attribute will describe the hierarchy.


In your asset, right before you output it, do the following:

Put down a primitive wrangle and enter:
s@safename = replace(s@name, "|", "ZZ");

This will produce a safename attribute with names such as:

Now, add a Groups from Name node and specify the safename attribute, which will convert the primitive name attribute to groups with the same name. We needed to create the safe name as pipe characters cannot be used in a group name.

Now, in Maya, if you turn on "Split Geos By Group", it will split the objects based on these strings, giving you objects such as:

Now, all you need to do is bake the asset, chop off the prefix and _# at the end and replace the "ZZ" characters with "|" to get the original path of the objects.

If you're feeling adventurous, you could try and wrap this final process up into the post-sync callback. []
Edited by johnmather - 2023年5月9日 19:17:20
  • Quick Links