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

meshTransform cannot execute twice #82

Open
bdeda opened this issue May 1, 2018 · 3 comments
Open

meshTransform cannot execute twice #82

bdeda opened this issue May 1, 2018 · 3 comments

Comments

@bdeda
Copy link

bdeda commented May 1, 2018

https://github.com/AnimalLogic/AL_USDMaya/tree/master/tutorials/meshTranslation

When working through this tutorial process, I can import the sphere, pull some verts, and save those changes to the session layer. This initial process works fine. When I try to do this a second time, where I import the mesh, move different verts, then save those changes to the session layer, the second edit is lost. The code never hits the Mesh::writeEdits logic the second time around.

I tracked it down to TranslatorContext::unloadPrim, (line 532), there is a test to ensure preTearDown is only called once.
// call pretearDown if it hasn't been called before
if(!translator->isTearingDown()) {...call preTearDown...}

This "isTearingDown" test prevents the edits from being saved the second time the mesh is edited and saved back to the session layer. I changed this in a local build to remove the if statement, and then the mesh edits save each time I import, edit, and save to the session layer. I don't know if that is a valid fix for this though.
meshTranslationEdits.py.txt

@dbaz
Copy link
Contributor

dbaz commented May 3, 2018

Hi Ben, That if was to make sure the isTearingDown didn't get called twice, but it might not be actually necessary, I'll take a look and confirm

-Baz

@dbaz dbaz self-assigned this May 4, 2018
@dbaz
Copy link
Contributor

dbaz commented May 8, 2018

A fix will be out for the next release. I removed the bool entirly. which means the preTearDown can get called more than once in some cases, such as a variant switch that removes a Mesh. But no ill-effects happen because of this from what I have seen.

@dbaz
Copy link
Contributor

dbaz commented May 25, 2018

Next release will be mid next week

@dbaz dbaz removed their assignment Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants