Different behaviour in abc payload openUsd standalone and Houdini's Usd

Hello,

I came across some differences when using OpenUSD in standalone, vs using the same code within Houdini in a python node or just using Hython (Houdini’s python). (I am using OpenUSD 24.03 and Houdini-20.5.410)

I have a simple abc file with a camera exported from maya.
It holds the following hierarchy (a simple maya camera):

  • camera
    • cameraShape

I then created a simple USD stage that payloads this abc under a “/camera” primitive.

When traversing this USD with python + OpenUSD or using usdview, I only get the camera primitive that is a UsdGeomCamera. (As if we disable “Display Shapes” in maya.) So this is the behavior I would expect when using USD and payloading an abc.

But if I payload or reference this USD in Houdini, I now see both in the hierarchy (camera as a Xform, and cameraShape as a UsdGeomCamera). I get the same result when traversing the stage but using hython instead of python+openusd, or when using usdview with the Houdini environment (having Houdini’s version of USD).

My issue is that in I set some attributes on the UsdGeomCamera in standalone USD, and then when opening in Houdini those attributes aren’t on the correct primitive since the camera becomes an Xform and the Shape is now the UsdGeomCamera.

Is there some configuration somewhere that manages how abc are payloaded into the USD (expanding the shapes or not) ? How could I get an identical behaviour when using OpenUSD standlone and Houdini’s USD ?

Here is a screenshot of the differences (Houdini’s usdview on the left, vs OpenUsd’s usdview on the right):

Same when just using the python api with the following code:

stage = pxr.Usd.Stage.Open(<path_to_usd_stage)
print("---------")
for prim in stage.TraverseAll():
    print(prim)

With OpenUsd and python I get:

---------
Usd.Prim(</camera>)

But with hython I get:

---------
Usd.Prim(</camera>)
Usd.Prim(</camera/cameraShape>)

Here is the usd_stage payloading the camera.abc
camera_stage.zip (1.4 KB)

Thank you for the help

When using OpenUSD in usdview, you are using your own build, I assume.
Have you built it with the Alembic plugin enabled ?
https://openusd.org/release/plugins_alembic.html

The usdAbc translator provides an environment variable, USD_ABC_XFORM_PRIM_COLLAPSE which defaults to true, so all gprims (and camera) get translated into a single UsdGeom prim. But maybe something in your Houdini configuration is setting that env var to false/0?

1 Like

Thank you so much ! That is exactly was I was hoping for, but was so hard to find in documentations online ! :raised_hands::raised_hands:
Works as expected now

Thanks again

Thanks Spiff!

Just to state this officially, Houdini’s USD changes the default setting of this environment variable because we got a lot of users complaining about the “official” default behavior. The alternative behavior better matches how Alembics get imported into a SOP context, and our users found that discrepancy confusing.

Thanks for the context, @mtucker , though that is a little concerning, and reignites the desire I had a long while back to turn those usdAbc behavior-controlling env vars into FileFormatArguments to the plugin, so that DCC’s can, at user-request, make those decisions permanently/consistently for each asset they create.

But this is the first time, it seems, that the inconsistency has caused folks problems…