Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Alembic plugin: Optionally disable parent-xform-as-mesh behavior #527

Conversation

ablev-dwa
Copy link
Contributor

Description of Change(s)

When reading an Alembic file, the generated USD Prim hierarchy is currently affected by the structure of the Alembic file itself. In cases where the Alembic hierarchy consists of an Xform with a single geometry or camera, like so:

/Xform xformNameA
    /Subd geomNameB

The generated USD Prim hierarchy looks like this:

/Mesh xformNameA

However, if the Alembic hierarchy has an Xform with two or more geometries or cameras:

/Xform xformNameA
    /Subd geomNameB
    /Subd geomNameC

The USD Prim hierarchy maintains the same structure as the Alembic hierarchy:

/Xform xformNameA
    /Mesh geomNameB
    /Mesh geomNameC

This is problematic in a pipeline that expects assets to maintain a consistent Prim hierarchy regardless of their contents.

This change adds a control, USD_ABC_XFORM_PRIM_COLLAPSE, set to true to maintain existing behavior, that when set to false will maintain the Xform -> Prim hierarchy in all cases.

… with xform parents

Signed-off-by: Alan Blevins <alan.blevins@dreamworks.com>
@jtran56
Copy link

jtran56 commented Jun 15, 2018

Filed as internal issue #161888.

if (!TfGetEnvSetting(USD_ABC_XFORM_PRIM_COLLAPSE)) {
// Transform collapse is specified as unwanted behavior
break;
}
// Parent has to be a transform.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alan! We're looking to accepting this PR shortly; one thing I'd like to point out, which is completely undocumented, is that TfGetEnvSetting() is protected by a std::mutex, so by adding a call to it in _ReadPrim(), we're potentially introducing contention if Alembic files are being opened simultaneously in multiple threads. (We should have made this same observation for the change that introduced USD_ABC_WRITE_UV_AS_ST_TEXCOORD2FARRAY, which we should fix).

What I'd suggest is adding a member flag to class _ReaderContext, which gets initialized in its ctor, then _ReadPrim() can just consult that flag.

Cheers,
--spiff

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore my prior comment, Alan - I was looking at the wrong version of TfGetEnvSetting - what you have should be fine - no changes necessary!

Sorry about that!
--spiff

@pixar-oss pixar-oss merged commit 246be1b into PixarAnimationStudios:dev Sep 4, 2018
pixar-oss added a commit that referenced this pull request Sep 4, 2018
Alembic plugin: Optionally disable parent-xform-as-mesh behavior

(Internal change: 1882784)
@ablev-dwa ablev-dwa deleted the alembic_no_xform_merge branch September 7, 2018 18:01
AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
…lve/adsk/internal-only/feature/pipeline_adsk

Update Pipeline of adsk/dev for Packaging Uploading
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants