"Pack Geometry Before Merging" for Houdini Engine Maya

   2853   11   1
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
I came across Houdini Engine for Unity's "Pack Geometry Before Merging" feature. I haven't used it, but it looks useful - "If checked, all the different Unity meshes will be packed individually before being merged into the asset's input."

The problem I'm having is that multiple geometries from Maya will always end up merged down to one geometry. For example, I have one 4-face plane and another 1-face plane. Ideally, I want them to appear in Houdini as 2 PackedGeometry prims, with packedfulltransform and such so I can retrieve their transform data. Instead, they merge to 5 Poly prims and I lose all the per-object transform data.

Even though I can separate prims by name using "For-each Named Primitive", I can't get the respective transform information associated with them.

I can't find any similar settings to "Pack Geometry Before Merging" in Houdini Engine for Maya. But in general, the question is Is there something I can do to get per-object transform data from Maya?

I've attached an HDA that displays point/prim/detail attributes in Maya for debugging.

Attachments:
Maya_Debug_Attribute_Output.png (37.2 KB)
Input_Geo.png (13.0 KB)
sop_sliu.show_attribs.1.0.hda (4.4 KB)

User Avatar
スタッフ
502 posts
Joined: 8月 2019
Offline
This is now possible in the plugin bundled with 19.0.1153 and 19.5.787

See: https://www.sidefx.com/forum/topic/72894/?page=1#post-404867 [www.sidefx.com]
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
Great. Thanks for the new feature! Is it possible to add this to Houdini 20 too?
User Avatar
スタッフ
502 posts
Joined: 8月 2019
Offline
It's already present, however it won't be in the initial gold release - the daily build following it will include it.

Will that work for you?
Edited by johnmather - 2023年11月3日 14:40:37
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
I'll make sure to get the build that has this update. Thanks!
User Avatar
Member
5 posts
Joined: 11月 2020
Offline
Hi! I've looked for the "Pack Geometry Before Merging" setting in the attribute editor (Maya), but I couldn't find it.

Here are info from the Houdini Engine pref. in Maya.

Houdini version 19.0.561
Houdini Engine version 4.2 (API:11)
Maya 2022

or the above Houdini Engine version doesn't have this feature?
Thank you.
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
@johnmather I've been testing the new "Pack Geo Before Merge" feature in Maya and it works great!
But I am getting one unwanted behavior, which slows down Maya quite a bit when working with heavy scenes. To demonstrate, I have a HDA that simply outputs the input without any processing. In Maya, it outputs a bunch of transform nodes that seemingly do nothing. On a heavy scene, this makes some Maya commands, such as the PaintVertexColorTool, extremely slow to the point it hangs the application. I'm wondering if there's a workaround to get rid of all that hierarchy, like an HDA normally does without "Pack Geo Before Merge".

Additionally, there's a bug where toggling the Pack Geo Before Merge via cmds
cmds.setAttr("my_hda_node.packBeforeMerge", 1)
, and syncing the asset does nothing. I only get the asset to pack the input geo when I toggle via the Attribute Editor. I believe there is a callback attached to the Pack Geo Before Merge toggle that actually does the work. Can we make it so that cmds.setAttr also works? I cross-checked cmds.setAttr on useInstancerNode, and it behaves properly after a sync, so ideally we have the same behavior on packBeforeMerge.

I'm on version 20.0.547. Thanks!
Edited by nd_sliu - 2024年7月11日 16:00:31

Attachments:
pack-before-merge-annotated.png (60.9 KB)
dont-pack-before-merge-annotated.png (58.4 KB)
test-hda.png (9.1 KB)

User Avatar
スタッフ
502 posts
Joined: 8月 2019
Offline
Would you be able to attach the HDA that you're using?
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
I don't believe we do anything special with the HDA, but I attached a test HDA that just takes the input and connects it to the output. You'll see in Maya it creates a deep hierarchy of transforms when "Pack Geo Before Merge" is enabled.

One other weird behavior I noticed is that if update the input via "Set to Selection", the HDA no longer respects "Pack Geo Before Merge", and the meshes are merged together as if "Pack Geo Before Merge" is disabled. Maybe Houdini Engine needs to double-check the geos are packed after updating the selection?

fwiw, I should mention also that I'm on Maya 2022
Edited by nd_sliu - 2024年7月11日 18:04:59

Attachments:
sop_sliu.test_houdini_engine.1.0.hda (3.1 KB)

User Avatar
スタッフ
502 posts
Joined: 8月 2019
Offline
For the extra transforms, I believe the best way to do this would be to unpack your geometry and pipe it through a Groups From Name node before your output node. Since you're not using instancer nodes, this shouldn't have too much of a performance impact. This will result in the following hierarchy:

sliu__test_houdini_engine__1_01
test_houdini_engine_1_0
_pCylinder1_pCylinderShape1_0
_pCube1_pCubeShape1_1
_pSphere1_pSphereShape1_2

For your other requests, I'll need to look into them a bit further, but I thought I would get you started with this in the mean time.
Edited by johnmather - 2024年7月23日 14:00:15
User Avatar
スタッフ
502 posts
Joined: 8月 2019
Offline
The issue where setting the attribute programatically would fail to run the associated callback has been fixed: https://www.sidefx.com/forum/topic/72894/#post-427287 [www.sidefx.com]
User Avatar
Member
20 posts
Joined: 9月 2023
Offline
Thanks for the programmatic attribute fix! As for your suggestion for using "Groups from Name", I assume unpacking the geometry and grouping by name will throw away the transform info. The reason I was using "Pack Geometry before Merge" is so I can preserve transform going in and out of Houdini, which is essential for some of our tools.

I'll give it a try anyways! But it'd be great to understand what's making Houdini Engine output the deep nested transforms or if there's an easy way to circumvent that.
  • Quick Links