-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fix anonymous layer default name #660
Conversation
lib/mayaUsd/nodes/proxyShapeBase.cpp
Outdated
@@ -584,7 +585,7 @@ MayaUsdProxyShapeBase::computeInStageDataCached(MDataBlock& dataBlock) | |||
} | |||
else { | |||
// Create a new stage in memory with an anonymous root layer. | |||
usdStage = UsdStage::CreateInMemory("", loadSet); | |||
usdStage = UsdStage::CreateInMemory(kanonymousLayerName, loadSet); |
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.
@seando-adsk Setting identifier passed to CreateInMemory routine automatically sets the anonymous name.
lib/mayaUsd/nodes/proxyShapeBase.cpp
Outdated
@@ -98,6 +98,7 @@ TF_DEFINE_PUBLIC_TOKENS(MayaUsdProxyShapeBaseTokens, | |||
MayaUsdProxyShapeBase::ClosestPointDelegate | |||
MayaUsdProxyShapeBase::_sharedClosestPointDelegate = nullptr; | |||
|
|||
const auto kanonymousLayerName{"anonymousLayer1"}; |
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.
createInMemory takes a std::string, so instead of auto why not make this a std::string?
According to our coding standards constants "should be named with a leading “k” followed by UpperCamelCase". So this should be "kA..."
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.
auto already deduces the type to std::string.
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.
@seando-adsk please see 5dd8221
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.
All good
@@ -98,6 +98,7 @@ TF_DEFINE_PUBLIC_TOKENS(MayaUsdProxyShapeBaseTokens, | |||
MayaUsdProxyShapeBase::ClosestPointDelegate | |||
MayaUsdProxyShapeBase::_sharedClosestPointDelegate = nullptr; | |||
|
|||
const std::string kAnonymousLayerName{"anonymousLayer1"}; |
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.
Not a blocker for the change...but non exported definitions we prefer to put in the unnamed namespace - https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf22-use-an-unnamed-anonymous-namespace-for-all-internalnon-exported-entities. Consider adapting to this rule in a new PR.
No description provided.