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

MAYA-106190 - Prim type icons #782

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mayaUsd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/usd/plugInfo.json
# -----------------------------------------------------------------------------
# subdirectories
# -----------------------------------------------------------------------------
add_subdirectory(ae)
seando-adsk marked this conversation as resolved.
Show resolved Hide resolved
add_subdirectory(base)
add_subdirectory(commands)
add_subdirectory(fileio)
add_subdirectory(listeners)
add_subdirectory(nodes)
add_subdirectory(python)
add_subdirectory(render)
add_subdirectory(resources)
if(UFE_FOUND)
add_subdirectory(ufe)
endif()
Expand Down
2 changes: 2 additions & 0 deletions lib/mayaUsd/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(ae)
add_subdirectory(icons)
File renamed without changes.
File renamed without changes.
45 changes: 45 additions & 0 deletions lib/mayaUsd/resources/icons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ---------------------------------------------------------------------------------------------
# install
# ---------------------------------------------------------------------------------------------
if (CMAKE_UFE_V2_FEATURES_AVAILABLE)
# Maya Outliner icons
set(OUTLINER_ICONS
BlendShape
Camera
Capsule
Cone
Cube
Cylinder
Def
GeomSubset
LightFilter
LightPortal
mayaReference
Mesh
NurbsPatch
PointInstancer
Points
Scope
SkelAnimation
Skeleton
SkelRoot
Sphere
UsdGeomCurves
UsdGeomXformable
UsdLuxLight
UsdTyped
Volume
)
foreach(ICON_BASE ${OUTLINER_ICONS})
# The _100.png files need to be installed without the _100. This is the
# base icon name that is used. Maya will automatically choose the _150/_200
# image if neeeded.
install(FILES "out_USD_${ICON_BASE}_100.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons"
RENAME "out_USD_${ICON_BASE}.png"
)
install(FILES "out_USD_${ICON_BASE}_150.png" "out_USD_${ICON_BASE}_200.png"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons"
)
Comment on lines +37 to +43
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install all the Outliner icon files (for the various prim types).

endforeach()
endif()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Camera_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Camera_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Camera_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Capsule_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Capsule_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Capsule_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cone_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cone_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cone_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cube_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cube_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cube_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cylinder_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cylinder_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Cylinder_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Def_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Def_150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Def_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lib/mayaUsd/resources/icons/out_USD_Mesh_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Mesh_150.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Mesh_200.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Points_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Scope_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Scope_150.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Scope_200.png
Binary file added lib/mayaUsd/resources/icons/out_USD_SkelRoot_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Skeleton_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Sphere_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Sphere_150.png
Binary file added lib/mayaUsd/resources/icons/out_USD_UsdTyped_100.png
Binary file added lib/mayaUsd/resources/icons/out_USD_UsdTyped_150.png
Binary file added lib/mayaUsd/resources/icons/out_USD_UsdTyped_200.png
Binary file added lib/mayaUsd/resources/icons/out_USD_Volume_100.png
28 changes: 28 additions & 0 deletions lib/mayaUsd/ufe/UsdContextOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ namespace {
// Ufe::ContextItem strings
// - the "Item" describe the operation to be performed.
// - the "Label" is used in the context menu (can be localized).
// - the "Image" is used for icon in the context menu. Directly used std::string
// for these so the emplace_back() will choose the right constructor. With char[]
// it would convert that param to a bool and choose the wrong constructor.
static constexpr char kUSDLayerEditorItem[] = "USD Layer Editor";
static constexpr char kUSDLayerEditorLabel[] = "USD Layer Editor...";
static const std::string kUSDLayerEditorImage{"USD_generic.png"};
static constexpr char kUSDVariantSetsItem[] = "Variant Sets";
static constexpr char kUSDVariantSetsLabel[] = "Variant Sets";
static constexpr char kUSDToggleVisibilityItem[] = "Toggle Visibility";
Expand All @@ -56,20 +60,28 @@ static constexpr char kUSDAddNewPrimItem[] = "Add New Prim";
static constexpr char kUSDAddNewPrimLabel[] = "Add New Prim";
static constexpr char kUSDDefPrimItem[] = "Def";
static constexpr char kUSDDefPrimLabel[] = "Def";
static const std::string kUSDDefPrimImage{"out_USD_Def.png"};
static constexpr char kUSDScopePrimItem[] = "Scope";
static constexpr char kUSDScopePrimLabel[] = "Scope";
static const std::string kUSDScopePrimImage{"out_USD_Scope.png"};
static constexpr char kUSDXformPrimItem[] = "Xform";
static constexpr char kUSDXformPrimLabel[] = "Xform";
static const std::string kUSDXformPrimImage{"out_USD_UsdGeomXformable.png"};
static constexpr char kUSDCapsulePrimItem[] = "Capsule";
static constexpr char kUSDCapsulePrimLabel[] = "Capsule";
static const std::string kUSDCapsulePrimImage{"out_USD_Capsule.png"};
static constexpr char kUSDConePrimItem[] = "Cone";
static constexpr char kUSDConePrimLabel[] = "Cone";
static const std::string kUSDConePrimImage{"out_USD_Cone.png"};
static constexpr char kUSDCubePrimItem[] = "Cube";
static constexpr char kUSDCubePrimLabel[] = "Cube";
static const std::string kUSDCubePrimImage{"out_USD_Cube.png"};
static constexpr char kUSDCylinderPrimItem[] = "Cylinder";
static constexpr char kUSDCylinderPrimLabel[] = "Cylinder";
static const std::string kUSDCylinderPrimImage{"out_USD_Cylinder.png"};
static constexpr char kUSDSpherePrimItem[] = "Sphere";
static constexpr char kUSDSpherePrimLabel[] = "Sphere";
static const std::string kUSDSpherePrimImage{"out_USD_Sphere.png"};

//! \brief Undoable command for variant selection change
class SetVariantSelectionUndoableCommand : public Ufe::UndoableCommand
Expand Down Expand Up @@ -275,7 +287,11 @@ Ufe::ContextOps::Items UsdContextOps::getItems(
int hasLayerEditorCmd{0};
MGlobal::executeCommand("runTimeCommand -exists UsdLayerEditor", hasLayerEditorCmd);
if (hasLayerEditorCmd) {
#if UFE_PREVIEW_VERSION_NUM >= 2023
items.emplace_back(kUSDLayerEditorItem, kUSDLayerEditorLabel, kUSDLayerEditorImage);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added icon for the "USD Layer Editor" context menu item. And for the "Add New Prim" types below.

#else
items.emplace_back(kUSDLayerEditorItem, kUSDLayerEditorLabel);
#endif
items.emplace_back(Ufe::ContextItem::kSeparator);
}

Expand Down Expand Up @@ -346,6 +362,17 @@ Ufe::ContextOps::Items UsdContextOps::getItems(
} // Variants of a variant set
} // Variant sets
else if (itemPath[0] == kUSDAddNewPrimItem) {
#if UFE_PREVIEW_VERSION_NUM >= 2023
items.emplace_back(kUSDDefPrimItem, kUSDDefPrimLabel, kUSDDefPrimImage); // typeless prim
items.emplace_back(kUSDScopePrimItem, kUSDScopePrimLabel, kUSDScopePrimImage);
items.emplace_back(kUSDXformPrimItem, kUSDXformPrimLabel, kUSDXformPrimImage);
items.emplace_back(Ufe::ContextItem::kSeparator);
items.emplace_back(kUSDCapsulePrimItem, kUSDCapsulePrimLabel, kUSDCapsulePrimImage);
items.emplace_back(kUSDConePrimItem, kUSDConePrimLabel, kUSDConePrimImage);
items.emplace_back(kUSDCubePrimItem, kUSDCubePrimLabel, kUSDCubePrimImage);
items.emplace_back(kUSDCylinderPrimItem, kUSDCylinderPrimLabel, kUSDCylinderPrimImage);
items.emplace_back(kUSDSpherePrimItem, kUSDSpherePrimLabel, kUSDSpherePrimImage);
#else
items.emplace_back(kUSDDefPrimItem, kUSDDefPrimLabel); // typeless prim
items.emplace_back(kUSDScopePrimItem, kUSDScopePrimLabel);
items.emplace_back(kUSDXformPrimItem, kUSDXformPrimLabel);
Expand All @@ -355,6 +382,7 @@ Ufe::ContextOps::Items UsdContextOps::getItems(
items.emplace_back(kUSDCubePrimItem, kUSDCubePrimLabel);
items.emplace_back(kUSDCylinderPrimItem, kUSDCylinderPrimLabel);
items.emplace_back(kUSDSpherePrimItem, kUSDSpherePrimLabel);
#endif
}
} // Top-level items

Expand Down
3 changes: 1 addition & 2 deletions lib/mayaUsd/ufe/UsdSceneItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ std::vector<std::string> UsdSceneItem::ancestorNodeTypes() const
const TfType& schemaType = fPrim.GetPrimTypeInfo().GetSchemaType();
#endif
if (!schemaType) {
TF_CODING_ERROR("Could not find prim type '%s' for prim %s",
fPrim.GetTypeName().GetText(), UsdDescribe(fPrim).c_str());
Comment on lines -65 to -66
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error was too extreme. There are nodes which don't have a schema type, so just silently return empty ancestor types.

// No schema type, return empty ancestor types.
return strAncestorTypes;
}

Expand Down
44 changes: 44 additions & 0 deletions lib/mayaUsd/ufe/UsdUIInfoHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <maya/MDoubleArray.h>
#include <maya/MGlobal.h>

#include <map>

MAYAUSD_NS_DEF {
namespace ufe {

Expand Down Expand Up @@ -71,6 +73,48 @@ bool UsdUIInfoHandler::treeViewCellInfo(const Ufe::SceneItem::Ptr& item, Ufe::Ce
return changed;
}

std::string UsdUIInfoHandler::treeViewIcon(const Ufe::SceneItem::Ptr& item) const
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override this UFE method to provide an image for specific node types. Avoids the ancestor types call.

{
// Special case for nullptr input.
if (!item) {
return "out_USD_UsdTyped.png"; // Default USD icon
}
Comment on lines +79 to +81
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can call with nullptr to get a default USD icon.


// We support these node types directly.
static const std::map<std::string, std::string> supportedTypes{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to avoid repetition, could we have a really small map with the exceptions (empty string and "AL_MayaReference"), and a set for the rest? I.e.

static const std::map<std::string, std::string> exceptionsTypes {
{"", "out_USD_Def.png"},
{"AL_MayaReference", "out_USD_mayaReference.png"}};
if (inTheExceptionsTypes) {
return that;
}
static const std::setstd::string supportedTypes {"BlendShape", "Camera", ...};
if (inSupportedTypes) {
return "out_USD_" + theType + ".png";
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not really repetition as the map key is node type, which are never repeated. I see your point, but I like the current table. It is very clear what icon filename is associated with each node type. What benefit do you see from your suggestion? It actually requires a 2nd search.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think the second search is a big deal. The repetition is in having the type twice, once in the key type, once in the mapped type, when the mapped type is simply the key type with a fixed prefix and a fixed suffix. Therefore, the set feels more appropriate, because there really is just one value in the associative data structure, the key type.

If you like the way it is now, I don't have that strong an opinion on it, so I'll leave it up to you.

{"", "out_USD_Def.png"}, // No node type
{"BlendShape", "out_USD_BlendShape.png"},
{"Camera", "out_USD_Camera.png"},
{"Capsule", "out_USD_Capsule.png"},
{"Cone", "out_USD_Cone.png"},
{"Cube", "out_USD_Cube.png"},
{"Cylinder", "out_USD_Cylinder.png"},
{"GeomSubset", "out_USD_GeomSubset.png"},
{"LightFilter", "out_USD_LightFilter.png"},
{"LightPortal", "out_USD_LightPortal.png"},
{"mayaReference", "out_USD_mayaReference.png"},
{"AL_MayaReference", "out_USD_mayaReference.png"}, // Same as mayaRef
{"Mesh", "out_USD_Mesh.png"},
{"NurbsPatch", "out_USD_NurbsPatch.png"},
{"PointInstancer", "out_USD_PointInstancer.png"},
{"Points", "out_USD_Points.png"},
{"Scope", "out_USD_Scope.png"},
{"SkelAnimation", "out_USD_SkelAnimation.png"},
{"Skeleton", "out_USD_Skeleton.png"},
{"SkelRoot", "out_USD_SkelRoot.png"},
{"Sphere", "out_USD_Sphere.png"},
{"Volume", "out_USD_Volume.png"}
};

const auto search = supportedTypes.find(item->nodeType());
if (search != supportedTypes.cend()) {
return search->second;
}

// No specific node type icon was found.
return "";
seando-adsk marked this conversation as resolved.
Show resolved Hide resolved
}

std::string UsdUIInfoHandler::getLongRunTimeLabel() const
{
return "Universal Scene Description";
Expand Down
1 change: 1 addition & 0 deletions lib/mayaUsd/ufe/UsdUIInfoHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class MAYAUSD_CORE_PUBLIC UsdUIInfoHandler : public Ufe::UIInfoHandler

// Ufe::UIInfoHandler overrides
bool treeViewCellInfo(const Ufe::SceneItem::Ptr& item, Ufe::CellInfo& info) const override;
std::string treeViewIcon(const Ufe::SceneItem::Ptr& item) const override;
std::string getLongRunTimeLabel() const override;
}; // UsdUIInfoHandler

Expand Down
2 changes: 1 addition & 1 deletion modules/mayaUSD.mod.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PYTHONPATH+:=lib/python
USD_LOCATION:=

+ MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}
icons:
icons: lib/icons
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the outliner icons above were added to this folder (as part of the base lib). So that any of the 3 plugins will get them.

plug-ins:
presets:
scripts:
Expand Down
2 changes: 1 addition & 1 deletion modules/mayaUSD_Win.mod.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PATH+:=lib
USD_LOCATION:=

+ MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}
icons:
icons: lib/icons
plug-ins:
presets:
scripts:
Expand Down
1 change: 1 addition & 0 deletions plugin/adsk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ message("========== ADSK USD Plugin ==========")

set(INSTALL_DIR_SUFFIX plugin/adsk)

add_subdirectory(icons)
add_subdirectory(plugin)
add_subdirectory(scripts)
21 changes: 21 additions & 0 deletions plugin/adsk/icons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ---------------------------------------------------------------------------------------------
# install
# ---------------------------------------------------------------------------------------------

set(PLUGIN_ICONS
out_mayaUsdProxyShape
USD_generic
USD_stage
)
Comment on lines +5 to +9
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These icons are specific to the adsk mayausd plugin.

foreach(ICON_BASE ${PLUGIN_ICONS})
# The _100.png files need to be installed without the _100. This is the
# base icon name that is used. Maya will automatically choose the _150/_200
# image if neeeded.
install(FILES "${ICON_BASE}_100.png"
DESTINATION "${INSTALL_DIR_SUFFIX}/icons"
RENAME "${ICON_BASE}.png"
)
install(FILES "${ICON_BASE}_150.png" "${ICON_BASE}_200.png"
DESTINATION "${INSTALL_DIR_SUFFIX}/icons"
)
endforeach()
Binary file added plugin/adsk/icons/USD_generic_100.png
Binary file added plugin/adsk/icons/USD_generic_150.png
Binary file added plugin/adsk/icons/USD_generic_200.png
Binary file added plugin/adsk/icons/USD_stage_100.png
Binary file added plugin/adsk/icons/USD_stage_150.png
Binary file added plugin/adsk/icons/USD_stage_200.png
Binary file added plugin/adsk/icons/out_mayaUsdProxyShape_100.png
Binary file added plugin/adsk/icons/out_mayaUsdProxyShape_150.png
Binary file added plugin/adsk/icons/out_mayaUsdProxyShape_200.png
3 changes: 3 additions & 0 deletions plugin/adsk/scripts/mayaUsdMenu.mel
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ proc initRuntimeCommands() {
-annotation "Create a new, empty USD Stage"
-category "Menu items.Maya USD"
-command "python(\"import mayaUsd_createStageWithNewLayer; mayaUsd_createStageWithNewLayer.createStageWithNewLayer()\")"
-image "USD_stage.png"
mayaUsdCreateStageWithNewLayer;
}

Expand All @@ -73,6 +74,7 @@ proc initRuntimeCommands() {
-annotation "Create a USD Stage from an existing USD file"
-category "Menu items.Maya USD"
-command "mayaUsd_createStageFromFile"
-image "USD_stage.png"
mayaUsdCreateStageFromFile;
}

Expand Down Expand Up @@ -111,6 +113,7 @@ global proc mayaUsdMenu_createMenuCallback() {
$gMayaUsdCreateSubMenu = `menuItem -subMenu true -insertAfter $sceneManagementDivider -tearOff true
-label "Universal Scene Description (USD)"
-annotation "Create a USD stage"
-image "USD_generic.png"
-version $mayaVersion`;
menuItem -runTimeCommand mayaUsdCreateStageWithNewLayer;
menuItem -runTimeCommand mayaUsdCreateStageFromFile;
Expand Down
4 changes: 1 addition & 3 deletions plugin/adsk/scripts/mayaUsd_createStageFromFile.mel
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ global proc stageFromFile_UICommit(string $parent) {
proc doCreateStage(string $fileName) {
// actually load the file
string $baseName = capitalizeString(`basenameEx $fileName`);
if( isValidObjectName($baseName) )
$baseName += "_usd";
Comment on lines -84 to -85
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per spec from Nat, remove this _usd from proxy shape name.

else
if( ! isValidObjectName($baseName) )
$baseName = "UsdStage";

string $ppath = `optionVar -q stageFromFile_primPath`;
Expand Down