Alembic Vs USD Scene Location Hierarchy Difference

165 views
Skip to first unread message

noizf...@gmail.com

unread,
Dec 10, 2022, 1:22:23 AM12/10/22
to gaffer-dev
Hi gaffer devs,

I have noticed that when reading the abc for a geo in gaffer, the transform location also contains the shape data (i.e. object). However, when reading in the usd version of the same geo, it retains the transform location as well as the shape i.e. the object location which I think is the correct behaviour since the source hierarchy is preserved. I checked the exported alembic file with abcecho and it does contain the xform and the shape as well. Is there some some optimisation being done when reading in the abc which ignores the shape? Bringing in the same abc into maya or blender retains the source hierarchy.

Below is a snapshot and a simple repro.

sphere_cache.png


Thanks,
Sachin

Sachin Shrestha

unread,
Dec 10, 2022, 1:23:57 AM12/10/22
to gaffe...@googlegroups.com
Repro attached.

Thanks,
Sachin

--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/a63d2615-c2c5-4d68-b469-87e1b5b5556dn%40googlegroups.com.
sphere_cache.zip

John Haddon

unread,
Dec 11, 2022, 3:32:27 AM12/11/22
to gaffe...@googlegroups.com
Hi Sachin,

Yes, we intentionally collapse the shape in an Alembic file into the parent location on load. Any location in Gaffer can have both a primitive (mesh, curves, etc) and a transform (matrix), but in Alembic (as in Maya) a location is either a transform or a shape. So we can gain efficiency by significantly reducing the number of locations in Gaffer, without any loss of data.

Efficiency isn't the only reason though. We want to be able to round-trip scenes from Gaffer into Alembic and then back into Gaffer. Taking the output from a Sphere node as an example, in Gaffer we have a single location with a sphere primitive and a transform. Alembic can't represent that in a single location, so we have to write out an Xform and a PolyMesh separately. To get back the original scene when reloading the Alembic, we need to collapse the shape back into the transform. So its about consistency too.

I believe USD's Alembic file format plugin has the same default behaviour as this. This is mentioned briefly in the "Minimising Prim Count" section on this page : https://graphics.pixar.com/usd/release/maxperf.html.

Hope that makes sense...
Cheers...
John



Alex Fuller

unread,
Nov 23, 2023, 7:35:51 PM11/23/23
to gaffer-dev
Just digging this one back up.

I ran into this one and have a situation where the original `Shape` in the hierarchy needs to be preserved somehow for lookdev portability purposes. Would it be a cool idea to store a temporary string attribute onto the geo that preserves the original shape/object name so round-tripping can bring this original name back? For example:

`/sphere/sphereShape` becomes `/sphere` in Gaffer, but writing the Alembic out, it becomes `/sphere/object` in other DCCs which breaks round-tripping. A hypothetical `abc:shapename` could store the original name.

Cheers
Reply all
Reply to author
Forward
0 new messages