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

[usdMaya] Improving primvar export from maya. #330

Conversation

sirpalee
Copy link
Contributor

Description of Change(s)

The PR expands primvar export from Maya, adds support for changing topology and animated primvars, and optimises memory in a few cases.

It's important to note that this PR is not final yet, it's more of a place to start a discussion to improve solutions here.

Features of the patch.

  • Primvar export now happens per frame. This can be useful in cases when colour sets and such contain animated data. Rigs, data imported from Alembic etc...
  • Primvar export works with variable topology over time.
  • Key deduplication happens during export, this can significantly increase memory usage in cases where there are lots of color sets and geometry data. We saw up to 10 times less memory usage.
  • Exporting colour sets as motion vectors. Looking for the most common names, like v, velocity, velocityPP.

Things broken by the patch:

  • Primvar unassigned value index.
  • Tests disabled related to the new way of exporting primvars.

What's there to figure out?

  1. What to do with unassigned value index. Currently, there is no way to setup the unassigned value index for primvars per frame, and that can cause issues with variable topology. We can either change the export code, and use the first value for unassigned values, meaning we always have to allocate it when exporting animation because we don't know beforehand if there'll be an unassigned value on one of the frames, or make the parameter vary over time. The second one seems to be the easiest way, but we decided not to make core changes in the initial version.
  2. Expose accessing the indices value on the primvars. The accessor function is private at the moment, and not accessible in any way. IMHO it should behave like the value, i.e., the user can directly access it if needed. That also means removing the _ prefix from the accessor function.
  3. Improve the handling of the memory optimizations (set attribute key), avoid passing around VtValues (use templated functions) and improve the comparisons. If we set up the keys using the new function, should we even care about cleaning up the keys afterwards?
  4. Move the new set attribute key functions to the USD core? Either as part of the attribute or in a utility header. Implementing this memory optimisation in UsdAttribute itself is probably a way bigger change than we want to do as part of this PR so that I wouldn't care about that right now.
  5. What to do with velocity export? We could improve it by allowing the user to set the parameter up via something on the mesh. How should we store that value? Looking for a specific user attribute name? Extension attributes? Extension attributes could have issues when loading a scene in a Maya session where the USD plugin is not available.

Fixes Issue(s)

No reported issue.

@jtran56
Copy link

jtran56 commented Nov 21, 2017

Filed as internal issue #154158.

@sirpalee sirpalee force-pushed the pr/maya_primvar_export branch 2 times, most recently from a976878 to 82b2acd Compare March 15, 2018 23:07
@pmolodo pmolodo force-pushed the pr/maya_primvar_export branch from 82b2acd to 3771637 Compare April 11, 2018 18:57
@sirpalee
Copy link
Contributor Author

I'm going to check on the latest usdSparseValueWriter changes that more or less implement the same functionality we had in this change, and update the PR if anything is missing from there.

@spiffmon
Copy link
Member

spiffmon commented Apr 30, 2018 via email

@sirpalee sirpalee force-pushed the pr/maya_primvar_export branch from 3771637 to faa2f9e Compare May 4, 2018 07:02
@sirpalee
Copy link
Contributor Author

sirpalee commented May 4, 2018

@spiffmon Updated the PR with the changes, synced up the tests and removed the motion vector functionality. That should probably belong to its own PR.

@pmolodo pmolodo force-pushed the pr/maya_primvar_export branch from faa2f9e to 20c521a Compare May 23, 2018 00:52
@pmolodo
Copy link
Contributor

pmolodo commented May 23, 2018

pushed new version to fix some merge conflicts

Signed-off-by: Pal Mezei <palm@lumapictures.com>
@sirpalee sirpalee force-pushed the pr/maya_primvar_export branch from 20c521a to 5d57380 Compare June 25, 2018 23:16
@sirpalee
Copy link
Contributor Author

Updated the changes to work with the latest PR merges and refactors of usdMaya.

pixar-oss added a commit that referenced this pull request Jun 26, 2018
[usdMaya] Improving primvar export from maya.

(Internal change: 1867884)
@sunyab
Copy link
Contributor

sunyab commented Jun 26, 2018

Merged this PR, closing!

@sunyab sunyab closed this Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants