-
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-106190 - Prim type icons #782
Conversation
MAYA-106684 - ProxyShape icon MAYA-106805 - Icons in the Create USD sub-menu MAYA-106628 - Icons in the UFE menu and a DEF icon in the Outliner MAYA-106629 - Generic USD icon in the main menu * Moved "ae" templates folder (from "lib/mayaUsd/") to new "resources" folder. * Added new "resources/icons" folder with all the prim Outliner icons. The icons are part of the MayaUsd_LIB so added icon folder in module path. * In UFE context menu added icon for "USD Layer Editor menu item. * In UFE context "Add New Prim" submenu added icons for all the prim types. * Implemented "treeViewIcon" override in UsdUIInfoHandler interface. * Added a few icons to the adsk MayaUsd plugin. ** mayaUsdProxyShape - outliner icon ** USD_stage/USD_generic used in menus * Removed "_usd" from proxy shape name, when creating a stage from file.
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" | ||
) |
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.
Install all the Outliner icon files (for the various prim types).
@@ -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); |
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.
Added icon for the "USD Layer Editor" context menu item. And for the "Add New Prim" types below.
TF_CODING_ERROR("Could not find prim type '%s' for prim %s", | ||
fPrim.GetTypeName().GetText(), UsdDescribe(fPrim).c_str()); |
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.
This error was too extreme. There are nodes which don't have a schema type, so just silently return empty ancestor types.
@@ -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 |
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.
Override this UFE method to provide an image for specific node types. Avoids the ancestor types call.
if (!item) { | ||
return "out_USD_UsdTyped.png"; // Default USD icon | ||
} |
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.
Can call with nullptr to get a default USD icon.
@@ -8,7 +8,7 @@ PYTHONPATH+:=lib/python | |||
USD_LOCATION:= | |||
|
|||
+ MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX} | |||
icons: | |||
icons: lib/icons |
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 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.
set(PLUGIN_ICONS | ||
out_mayaUsdProxyShape | ||
USD_generic | ||
USD_stage | ||
) |
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.
These icons are specific to the adsk mayausd plugin.
if( isValidObjectName($baseName) ) | ||
$baseName += "_usd"; |
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.
As per spec from Nat, remove this _usd from proxy shape name.
} | ||
|
||
// We support these node types directly. | ||
static const std::map<std::string, std::string> supportedTypes{ |
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 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";
}
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 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.
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.
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.
} | ||
|
||
// We support these node types directly. | ||
static const std::map<std::string, std::string> supportedTypes{ |
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.
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.
MAYA-106190 - Prim type icons
MAYA-106684 - ProxyShape icon
MAYA-106805 - Icons in the Create USD sub-menu
MAYA-106628 - Icons in the UFE menu and a DEF icon in the Outliner
MAYA-106629 - Generic USD icon in the main menu