-
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
Proxy Shape AE Template - Part 2 #944
Conversation
…o time MAYA-107350 As a user, on the stage AE template I'd like to see what my default prim is MAYA-107338 As a user, on the stage AE template I'd like to see what my Root Layer is MAYA-107273 As a user, on the stage AE template I'd like to toggle Purpose=Default * Create new AETemplatesHelpers.py file which is used by the MEL templates to query USD (thru python API). * Organized proxy shape template in sections: "Stage", "Stage Source" and "Stage Display". * Suppressed 'Stage Cache ID' and 'Out Stage Cache ID'. * Added new non-editable text fields (for display purposes only) for "Root Layer" and "Default Prim". * Added tooltips to some controls.
return rootLayer.GetDisplayName() if rootLayer.anonymous else rootLayer.realPath | ||
except: | ||
pass | ||
return '' |
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 created this python file to contains AE template helpers that I call from the actual MEL template.
// We aren't displaying the "inStageData" attribute in the ProxyShapeInfo. We simply | ||
// pass it in order to get the current nodename. Cannot use the input one here as it | ||
// changes based on which proxy shape the AE is viewing. | ||
editorTemplate -callCustom "AEmayaUsdProxyShapeInfoNew" "AEmayaUsdProxyShapeInfoReplace" inStageData; |
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 adds the "Root Layer" and "Default Prim" (non-editable) fields. These aren't actual attributes on the proxy shape. The fields are for display purposes only.
textFieldGrp -edit -text $rootLayer mayaUsdProxyShapeRootLayer; | ||
textFieldGrp -edit -text $defaultPrim mayaUsdProxyShapeDefaultPrim; |
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 will update the two fields with the values from the current proxy shape being shown.
textFieldGrp -label "Root Layer" -editable 0 | ||
-ann "Identifies the root layer of a stage. If a file path is shown in this field, the root layer is a file on disk. If a layerName is shown in this field, the root layer is an anonymous layer." | ||
mayaUsdProxyShapeRootLayer; | ||
|
||
textFieldGrp -label "Default Prim" -editable 0 | ||
-ann "As part of its metadata, each stage can identify a default prim. This is the primitive that is referenced in if you reference in a file." | ||
mayaUsdProxyShapeDefaultPrim; |
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.
Create two text fields for displaying info.
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.
Proxy shape AE template organization.
|
||
def GetDefaultPrimName(proxyShape): | ||
if not proxyShape.startswith('|world'): | ||
proxyShape = '|world' + proxyShape |
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.
We should not do this. We should fix the implementation of getStage() in wrapUtils.cpp so that it converts the argument path string to a path using Ufe::PathString::path().
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 we discussed I cleaned up all the usage of "|world"
|
||
def GetRootLayerName(proxyShape): | ||
if not proxyShape.startswith('|world'): | ||
proxyShape = '|world' + proxyShape |
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.
Same as above: let's fix the wrapper instead of working around it.
…o time MAYA-107350 As a user, on the stage AE template I'd like to see what my default prim is MAYA-107338 As a user, on the stage AE template I'd like to see what my Root Layer is MAYA-107273 As a user, on the stage AE template I'd like to toggle Purpose=Default * Code review comment - cleanup usage of "|world"
return Ufe::PathSegment(fullpath.asChar(), MAYA_UFE_RUNTIME_ID, MAYA_UFE_SEPARATOR); | ||
} | ||
|
||
Ufe::Path ProxyShape::ufePath() const { return Ufe::Path(ProxyShape::ufePathSegment()); } |
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 exact method already exists in the base class (which I fixed for the |world). The ufePathSegment() method above is not needed as you can get that from this ufePath() method.
…o time MAYA-107350 As a user, on the stage AE template I'd like to see what my default prim is MAYA-107338 As a user, on the stage AE template I'd like to see what my Root Layer is MAYA-107273 As a user, on the stage AE template I'd like to toggle Purpose=Default * Bullet-proof some code that can have null path.
@@ -316,8 +316,13 @@ void StagesSubject::onStageInvalidate(const MayaUsdProxyStageInvalidateNotice& n | |||
afterOpen(); | |||
|
|||
#ifdef UFE_V2_FEATURES_AVAILABLE | |||
Ufe::SceneItem::Ptr sceneItem = Ufe::Hierarchy::createItem(notice.GetProxyShape().ufePath()); | |||
Ufe::Scene::instance().notify(Ufe::SubtreeInvalidate(sceneItem)); | |||
auto p = notice.GetProxyShape().ufePath(); |
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 possible for this path to return empty when called before the proxy shape is ready. The MDagPath in the proxy shape is empty. The previous code (before my world cleanup) would thus return a Ufe::path to "|world" which was incorrect.
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.
Thanks for the cleanup!
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.
LGTM
JIRA items:
MAYA-107386 As a user, on the stage AE template I'd like to connect to time
MAYA-107350 As a user, on the stage AE template I'd like to see what my default prim is
MAYA-107338 As a user, on the stage AE template I'd like to see what my Root Layer is
MAYA-107273 As a user, on the stage AE template I'd like to toggle Purpose=Default