Skip to content
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

Merged
merged 2 commits into from
Jul 15, 2020

Conversation

HamedSabri-adsk
Copy link
Contributor

No description provided.

@HamedSabri-adsk HamedSabri-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows labels Jul 15, 2020
@@ -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);
Copy link
Contributor Author

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.

See here:
https://github.com/PixarAnimationStudios/USD/blob/ebac0a8b6703f4fa1c27115f1f013bb9819662f4/pxr/usd/usd/stage.cpp#L777

@@ -98,6 +98,7 @@ TF_DEFINE_PUBLIC_TOKENS(MayaUsdProxyShapeBaseTokens,
MayaUsdProxyShapeBase::ClosestPointDelegate
MayaUsdProxyShapeBase::_sharedClosestPointDelegate = nullptr;

const auto kanonymousLayerName{"anonymousLayer1"};
Copy link
Collaborator

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..."

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

Copy link
Collaborator

@seando-adsk seando-adsk left a 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"};

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.

@kxl-adsk kxl-adsk merged commit a5caedc into dev Jul 15, 2020
@kxl-adsk kxl-adsk deleted the sarih/MAYA-104777/anonymous_layer_default_name branch July 15, 2020 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants