-
Notifications
You must be signed in to change notification settings - Fork 201
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
Restore session layer properly or create one when root-layer is not editable. #899
Conversation
lib/mayaUsd/nodes/stageNode.cpp
Outdated
@@ -109,7 +109,10 @@ MStatus UsdMayaStageNode::compute(const MPlug& plug, MDataBlock& dataBlock) | |||
UsdStageCacheContext ctx(UsdMayaStageCache::Get(loadAll)); | |||
usdStage = UsdStage::Open(rootLayer, ArGetResolver().GetCurrentContext()); |
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 would think similar to what's in proxyShapeBase.cpp, we should probably be checking permissions and possibly creating the sessionLayer
first, and then use the Open()
overload that takes a sessionLayer if we created one. Otherwise the anonymous layer created below is not part of the stage's layer stack.
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.
Makes sense.
@marsupial thank you for reporting an issue and opening a pull-request to address it. We have a tricky situation here, since the change of the default edit target was requested internally (and merged with #661). Let's have a conversation on the issue first to make sure we have a solution that works for all stakeholders. |
90aafab
to
4e7da99
Compare
4e7da99
to
14dde13
Compare
Update with comments from #898 |
14dde13
to
eca8845
Compare
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.
Just some tiny, mostly cosmetic notes, but otherwise looks good to me!
// limitations under the License. | ||
// | ||
|
||
#pragma once |
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.
The coding guidelines would suggest #include
-style guards rather than #pragma once
.
// Convenience to convert a TfToken to MString | ||
// | ||
static inline MString toMString(const TfToken& token) | ||
{ | ||
return MString(token.data(), token.size()); | ||
} |
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.
A helper for this actually exists already as UsdMayaUtil::convert()
:
maya-usd/lib/mayaUsd/utils/util.h
Line 514 in d76c4a0
MString convert(const TfToken& token); |
Already been merged, so function-removal and guard changes: #935 |
No description provided.