-
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
MAYA-114603 persist USD payload state #2226
Conversation
Load rules conversions - Add functions to convert the USD stage load rules into text and back. - Add function to save/load load rules on a dynamic Maya attribute. - Add unit tests for the text conversions. - Only run load rules unit test on Windows. - Other platforms have linker or un-time link problems with Cg and OpenMaya. Load rules persistence - Add a class to handle the persistence. - It keeps a list of proxy shape that need to be updated before being saved - Listen to kBeforeSave Maya message and transfers the load rules to the proxy stage. - Each proxy shape registers with this class. - The proxy shape applies the persisted load rules on load if present. - Implemented the persistence using dynamic attributes. - Since there won't be a ton of them, use MEL as it is more robest and simpler. Others - Fix a bug in UsdMayaSceneResetNotice.
endfunction() | ||
|
||
if(IS_WINDOWS) | ||
# There are link problems on Linux and OSX with C++ test using USD + Maya, |
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.
I could not get the C++ unit test to link on Linux or run on OSX.
- On Linux 2020, the linker would fail to find OpenSubDiv
- On Linux 2022, execution ofthe test would fail to find libCg.so
- On OSX master, execution would fail to find libOpenMaya.dylib
But all other platforms / versions would work... so I only kept the test on Windows. It is enough to validate during pre-flight.
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.
Maybe you are missing something like this: https://git.autodesk.com/maya3d/maya-usd/blob/dev/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt#L62-L82
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.
I tried yesterday this exact setup to fix it, and a few variations found elsewhere (some were also adding lib64 in Linux, other varied the number of ../..) and it did not fix anything. Not having access to an Mac or Linux made it difficult to fix.
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.
Please assign it to me after it is merged, I will give it a try.
@@ -0,0 +1,95 @@ | |||
// | |||
// Copyright 2016 Pixar |
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.
Copyright should be Autodesk right?
@@ -0,0 +1,58 @@ | |||
// | |||
// Copyright 2022 Pixar |
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.
Copyright?
{ | ||
MString nodeName = depNode.absoluteName(); | ||
MString cmd; | ||
cmd.format("addAttr -query -exists \"^2s.^1s\"", loadRulesAttrName, nodeName); |
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.
It is a shame to call MEL code in c++. How hard would it be to find the proper OpenMaya call to do the same?
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.
I tried initially, but the code would just crash when accessing the dynamic attribute I added. Since I had prototyped it in MEl in Maya and it worked just fine, that MEL mostly never crashes even when things are not right and that I doubt people will create many stages in a single Maya file, I don't think it is worth trying to optimize it.
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.
Plus, frankly, the docs in the C++ API related to dynamic attribute is... obscure or missing. Even searching the Maya code base yielded next to zero use case examples.
The only failure is the known Linux interactive where image comparison unit tests now fail due to viewport changes. |
Load rules conversions
Load rules persistence
Others