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

Proxy Shape AE Template - Part 2 #944

Merged
merged 4 commits into from
Nov 30, 2020

Conversation

seando-adsk
Copy link
Collaborator

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

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

…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 ''
Copy link
Collaborator Author

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

Comment on lines +25 to +26
textFieldGrp -edit -text $rootLayer mayaUsdProxyShapeRootLayer;
textFieldGrp -edit -text $defaultPrim mayaUsdProxyShapeDefaultPrim;
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 will update the two fields with the values from the current proxy shape being shown.

Comment on lines +3 to +9
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;
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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

Proxy shape AE template organization.


def GetDefaultPrimName(proxyShape):
if not proxyShape.startswith('|world'):
proxyShape = '|world' + proxyShape
Copy link
Collaborator

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().

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 we discussed I cleaned up all the usage of "|world"


def GetRootLayerName(proxyShape):
if not proxyShape.startswith('|world'):
proxyShape = '|world' + proxyShape
Copy link
Collaborator

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.

@kxl-adsk kxl-adsk added proxy Related to base proxy shape workflows Related to in-context workflows labels Nov 26, 2020
…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()); }
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 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();
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 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.

@seando-adsk seando-adsk requested a review from ppt-adsk November 27, 2020 16:31
Copy link
Collaborator

@ppt-adsk ppt-adsk left a 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!

Copy link
Contributor

@fowlertADSK fowlertADSK left a comment

Choose a reason for hiding this comment

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

LGTM

@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 30, 2020
@kxl-adsk kxl-adsk merged commit 192ef72 into dev Nov 30, 2020
@kxl-adsk kxl-adsk deleted the donnels/proxy_shape_ae_template_part_2 branch November 30, 2020 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proxy Related to base proxy shape ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants