Search - User list
Full Version: "Pack Geometry Before Merging" for Houdini Engine Maya
Root » Houdini Engine for Maya » "Pack Geometry Before Merging" for Houdini Engine Maya
nd_sliu
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.
johnmather
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]
nd_sliu
Great. Thanks for the new feature! Is it possible to add this to Houdini 20 too?
johnmather
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?
nd_sliu
I'll make sure to get the build that has this update. Thanks!
porcho
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.
nd_sliu
@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!
johnmather
Would you be able to attach the HDA that you're using?
nd_sliu
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
johnmather
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.
johnmather
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]
nd_sliu
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.
johnmather
HAPI has a concept called parts [www.sidefx.com], where a number of parts makes up an object. What Maya does, is create a hierarchy that describes the parts and their relations to each other. When building your asset, there is only a single extraneous transform that isn't connected to the asset node, and it's what encloses all of the related parts. Unfortunately changing the way that things are laid out could break some workflows, so it's not something that I'm comfortable with doing. I tried skipping the creation of that group but ran into some errors as other parts of the plugin assume that it exists.

That said, I'm surprised that transforms would have any impact on something like PaintVertexColorTool. Have you taken a look at the profiler to see if perhaps something else is cooking when using that tool?
johnmather
nd_sliu
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.
Thanks for reporting. This has been fixed in 19.5.1071/20.0.798/20.5.326: https://www.sidefx.com/forum/topic/72894/#post-428724 [www.sidefx.com]
nd_sliu
johnmather
nd_sliu
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.
Thanks for reporting. This has been fixed in 19.5.1071/20.0.798/20.5.326: https://www.sidefx.com/forum/topic/72894/#post-428724 [www.sidefx.com]
Great! I can confirm the "Set to Selection" now respects "Pack Geo Before Merge" on 20.5.326.
However, perhaps the programmatic setAttr fix got lost in this update? I tried
cmds.setAttr("my_hda_node.packBeforeMerge", 1)
cmds.evalDeferred(partial(mel.eval, 'houdiniEngine_syncAsset my_hda_node;'))
but the output still results in a single mesh.
I also tried running just the first line, and hitting "Sync Asset" via Attribute Editor, and got the same issue.
johnmather
nd_sliu
Great! I can confirm the "Set to Selection" now respects "Pack Geo Before Merge" on 20.5.326.
However, perhaps the programmatic setAttr fix got lost in this update?
Indeed it did! It looks like a commit from the Unreal plugin partially reverted some of my most recent changes. This will be fixed in 20.5.328.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB