-
Notifications
You must be signed in to change notification settings - Fork 69
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
Layers not initialising properly on file load #26
Comments
Hey alekamca, we have the same issue on our end. Did you had the chance to get it through legal? If you are not able to publish your fix any cues are appreciated. Thanks! |
I am still pushing on getting the CLA. From what I understand, it is coming; it just takes time. In the mean time, I made 2 changes. One is necessary for fixing the assert. The second fixes a related issue where layers can be orphaned and unable to become edit targets after file save-load. In Global.cpp::postFileOpen Rather than looping over the Layer nodes and deserializing them in the next block, instead recursively deserialize and init them starting with the session layer and following its ChildLayers and SubLayers. This means you will never deserialize "orphan" Layer nodes in your scene that cannot be connected to a proxy node, but they will at least be in a valid "empty" state rather than an invalid state. You could go through and find these orphans and do something with them? Secondly, in order to init a Layer node, you need to know its SdfLayer. The easiest way to do this is to always set the nameOnLoad attribute when calling Layer::populateSerialisationAttributes, even it has not been an editTarget. This has a lot of nice side effects, since it means these layers can become valid edit targets in the future (previously, they would just silently remain empty and not track any edits). |
Hi aleka, renaud - one of our external contributors has also made some related fixes in the layer handling part of the code which they have notified us of but not submitted for PR yet - when they do (hopefully in next few days?) we can probably have a discussion about it, and decide what the best solution is - we're happy to hold off merging until we discuss with you... |
Thanks for the update. It would be good to see what the changes are. I'm not particularly attached my to changes as long as the functionality I need is preserved. I imagine someone closer to the project would have better insight into how best to resolve these issues. |
Hi murphyeoin, same thing on our side. As long a we reach a more usable state we are happy! |
I put it up for PR just now! #28 |
…165/crash_when_duplicating_USD_objects MAYA-95165 : Crash when duplicating USD objects
This assert (and a matching one in setInternalValueInContext) is failing when loading a maya file that has Layers which deserialized (as part of Global.cpp::postFileOpen).
https://github.com/AnimalLogic/AL_USDMaya/blob/develop/lib/AL_USDMaya/AL/usdmaya/nodes/Layer.cpp#L578
This can easily be reproduced by running the supplied endToEndMaya Layout tutorial and saving the maya file, reopening the file, and doing anything that calls get/setInternalValue (e.g., looking at the node in the attribute editor, resaving the file).
The failure appears to be because Layer::setLayerAndClearAttribute is called (which sets m_handle), but m_shape has not been set (this can only be set via Layer::init).
I have what appears to be a fix, and I'm in the process of getting the CLA through legal (I am at Walt Disney Animation Studios).
The text was updated successfully, but these errors were encountered: