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] Adding a maya particle writer. #208

Merged

Conversation

sirpalee
Copy link
Contributor

@sirpalee sirpalee commented May 4, 2017

Description of Change(s)

Adding a prim writer for Maya Particles and NParticles. The logic for exporting user attributes (which ones to ignore mostly) is taken from partio4Maya.

Note, the exporter fails on Maya 2016 ext2 if you are writing out a cached NParticle. However, the same code works with Maya 2016 and Maya 2017. There seems to be a critical bug in 2016 ext2 that zeroes out all the position values, but all the other attributes work just fine. The same problem was seen with Maya To Arnold, PartIO Export, and even the built-in Maya Instancer.

Fixes Issue(s)

No reported issue.

@sirpalee
Copy link
Contributor Author

sirpalee commented May 5, 2017

Uh-oh... I forgot that the velocity in maya is per second, and it's most likely per frame in USD. I'm going to check that and update the pull request with scaling down the velocity if necessary.

@sirpalee sirpalee force-pushed the pr/maya_particle_writer branch from ca8a0c5 to f29d9e1 Compare May 5, 2017 05:59
@sirpalee
Copy link
Contributor Author

sirpalee commented May 5, 2017

Added velocity scaling.

@sirpalee
Copy link
Contributor Author

sirpalee commented May 9, 2017

The documentation is going to be changed for pointBased, and the requirement for the velocity is going to be per second, so I removed the velocity scaling from the writer.

@sirpalee sirpalee force-pushed the pr/maya_particle_writer branch from f29d9e1 to 7ef2fc4 Compare May 9, 2017 22:53
@jtran56
Copy link

jtran56 commented Jun 2, 2017

Filed as internal issue #147136.

@sirpalee sirpalee force-pushed the pr/maya_particle_writer branch from 7ef2fc4 to b98b6b2 Compare July 24, 2017 04:20
Copy link
Contributor

@sunyab sunyab left a comment

Choose a reason for hiding this comment

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

Passing along notes from our sets team.

We were also wondering if it'd be possible to include some tests. Thanks!

@@ -0,0 +1,362 @@
//
// Copyright 2016 Pixar
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you update the year in the copyright notice here to 2017?

constexpr auto _cached = "cached";
constexpr auto _Cache = "Cache";
const auto attrNameSize = attrName.size();
if (attrNameSize > 5 && attrName.substr(attrNameSize - 6) == _Cache) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be:
return TfStringEndsWith(attrName, _Cache) || TfStringStartsWith(attrName, _cached);

(need to include "pxr/base/tf/stringUtils.h")

}

const auto particleNode = getDagPath().node();
MFnParticleSystem PS(particleNode);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just one nitpick: for consistency with coding conventions, could we change the variable names PS and DPS? I think i would've gone with particleSys and deformedParticleSys but that is quite a lot to type..

@@ -0,0 +1,68 @@
//
// Copyright 2016 Pixar
Copy link
Contributor

Choose a reason for hiding this comment

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

Like above, please update year to 2017 here

Signed-off-by: Pal Mezei <palm@lumapictures.com>
@sirpalee sirpalee force-pushed the pr/maya_particle_writer branch from 9fc5380 to e731851 Compare January 29, 2018 04:37
@sirpalee
Copy link
Contributor Author

sirpalee commented Jan 29, 2018

@sunyab updated the PR and added a simple test. I also updated the copyright notices to 2018. :)

@pixar-oss pixar-oss merged commit e731851 into PixarAnimationStudios:dev Mar 10, 2018
pixar-oss added a commit that referenced this pull request Mar 10, 2018
[usdMaya] Adding a maya particle writer.
@sunyab
Copy link
Contributor

sunyab commented Mar 10, 2018

I finally got around to merging this change, thanks so much for your patience.

There were a few fixups I had to make to resolve conflicts and to get this change trued up with the current state of the world. Most notably, the particle writing code was using a VtArray when writing the ids attribute, which broke on Windows and MacOS. The documentation on the ids attribute does say to use VtArray, but this is a bug in our code generation we need to fix. I've changed this to use VtArray<int64_t>, which lines up with the Int64Array attribute type. The unit test you added (thank you for that!) passes with this change.

Please let me know if there's any issues with these changes. Thanks again!

AdamFelt pushed a commit to autodesk-forks/USD that referenced this pull request Apr 16, 2024
…74] Add the support for input/output qualifiers (PixarAnimationStudios#208)

### Description of Change(s)
Add the support for input/output qualifiers.
Currently only "flat" qualifier is supported.

### Fixes Issue(s)
OGSMOD-2574: Input/output layout doesn't support qualifiers
For example, you can not add "flat", "smooth" or "noperspective" to an input.

(cherry picked from commit 6bcb00af841f3abfc8353c32338e54c44a71a2f0)

Co-authored-by: Pierre Wang <Pierre.Wang@autodesk.com>
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.

4 participants