-
Notifications
You must be signed in to change notification settings - Fork 202
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
null and anonymous layer checks #1212
Conversation
lib/mayaUsd/nodes/layerManager.cpp
Outdated
if (!layer->IsAnonymous()) { | ||
layer->Save(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a larger change coming where we handle anonymous root layers better, but this avoids the error that is printed to the script editor even though everything appears to work correctly. The problem with an anonymous root layer is that we Export it and then do a setAttr on the filePath attribute of the proxy to update it, but right here after we've done the Export we are still holding on to the old root layer. All we need to do here is skip the anonymous layer, and it will be replaced shortly after when the proxy computes again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to consider using SdfLayer::PermissionToSave()
instead which will catch the anonymous case as well as others that might be problematic, such as saving to a muted layer:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I'm remember this one while I continue cleaning up some of the serialization code.
No description provided.