Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

MAYA-123509 fix merging of normals #2387

Merged
merged 4 commits into from
Jun 6, 2022

Conversation

pierrebai-adsk
Copy link
Collaborator

Normals in USD can be kept in the "normals" attribute or the "primvars:normals" attribute. This breaks the semantic-agnostic merge algorithm as it did not relate the two attributes.

In addition, the "privars:normals" has higher priority.

The result was that the round-trip of Edit-as-Maya and Merge-to-USD would create the "normals" attribute attribute and the resulting prim would have both attributes, but the old unmodified primvats would win.

This was bad when the mesh was edited as the wrong normals were used, but catastrophic when the topology was edited as the number of normals was incorrect.

The fix is to add custom logic to handle normals merging. The new strategy is to rely on the USD exportdone during merge to always author the "normals" attribute and to delete the existing "primvars:normals" from the original USD data so that it does not take priority on the newly edited normals.

While fixing this, other small fixes were done:

  • the messages printed during merging were improved to be easier to understand.
  • Added support for some additional data-type during USD import: byte and unsigned int were not supported.
  • Added a comments about the fact that we currently do no compare metadata to determine if a prim has changed.

Normals in USD can be kept in the "normals" attribute or the "primvars:normals" attribute. This breaks the semantic-agnostic merge algorithm as it did not relate the two attributes.

In addition, the "privars:normals" has higher priority.

The result was that the round-trip of Edit-as-Maya and Merge-to-USD would create the "normals" attribute attribute and the resulting prim would have both attributes, but the old unmodified primvats would win.

This was bad when the mesh was edited as the wrong normals were used, but catastrophic when the topology was edited as the number of normals was incorrect.

The fix is to add custom logic to handle normals merging. The new strategy is to rely on the USD exportdone during merge to always author the "normals" attribute and to delete the existing "primvars:normals" from the original USD data so that it does not take priority on the newly edited normals.

While fixing this, other small fixes were done:
- the messages printed during merging were improved to be easier to understand.
- Added support for some additional data-type during USD import: byte and unsigned int were not supported.
- Added a comments about the fact that we currently do no compare metadata to determine if a prim has changed.
@pierrebai-adsk pierrebai-adsk requested review from boudrey and williamkrick and removed request for boudrey May 30, 2022 17:23
@pierrebai-adsk
Copy link
Collaborator Author

Only PF failure is a texture image comparison failure on Linux that is unrelated.

williamkrick
williamkrick previously approved these changes May 31, 2022
@pierrebai-adsk pierrebai-adsk added ready-for-merge Development process is finished, PR is ready for merge and removed ready-for-merge Development process is finished, PR is ready for merge labels Jun 3, 2022
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 6, 2022
@seando-adsk seando-adsk merged commit ce82882 into dev Jun 6, 2022
@seando-adsk seando-adsk deleted the t_bailp/MAYA-123509/topo-edit-break-normals branch June 6, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants