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-107239 - Proxy Shape AE template cleanup #922

Merged

Conversation

seando-adsk
Copy link
Collaborator

MAYA-107239 - Don't show attributes that aren't supported in the Stage AE template

  • First pass at cleaning up the Proxy Shape AE template.

…e AE template

* First pass at cleaning up the Proxy Shape AE template.
@seando-adsk seando-adsk added the adsk Related to Autodesk plugin label Nov 16, 2020
Comment on lines +14 to +15
editorTemplate -addControl "visibility";
editorTemplate -label (uiRes("m_AEdagNodeCommon.kLODVisibility")) -addControl "lodVisibility";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Current Maya has a label for "Visibility" as well, but that tag doesn't exist in Maya 2020.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why you bother reusing a string defined in Maya at all? Everything else is kind of hard-coded and in English only, but a couple of them will come from Maya and possibly be in another language. It should work, and the odds of Maya changing (or moving the location of) one of those strings is pretty small, but just wondering why you're even bothering.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because the proxy shape is a Maya node, so I figured we should try and support the localization as much as possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And this "Object Display" section is available on every Maya node.

Comment on lines +111 to +112
editorTemplate -suppress "ghostRangeStart";
editorTemplate -suppress "ghostRangeEnd";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some of these (including these two) are from Maya 2020 (either removed or renamed). If an attribute doesn't exist the suppress/addControl will silently return.

@seando-adsk
Copy link
Collaborator Author

@fowlertADSK First pass at cleanup of the MayaUsd proxy shape AE template. Basically removing a bunch of sections (by suppressing all the attributes). I no longer derive from the shape template, but instead fully define one here. It works in both Maya 2020 and current PR.

@kxl-adsk kxl-adsk added the proxy Related to base proxy shape label Nov 18, 2020
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.

uiRes calls are ok, but I did leave a question about why you're bothering with them.

Also, double check that those strings are available even if this template is the very first thing the AE displays.

Other than that, looks good.

// include/call base class/node attributes
AEsurfaceShapeTemplate $nodeName;
// Object Display (from AEdagNodeCommon.mel):
editorTemplate -beginLayout (uiRes("m_AEshapeTemplate.kObjectDisplay"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the uiRes call going to fail if AEdagNodeCommon.mel hasn't been sourced yet? You were calling AEsurfaceShapeTemplate before (which calls a bunch of other base Templates). Almost anything would end calling it, but if the AE is not being shown on startup and the first time it's shown we have a USD node selected...will it spit out an error?

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 tried your steps just to be sure. But even at startup the AE is empty and if I just create an empty stage that is the first object to be displayed in the AE.

uiRes is just a MEL proc that actually sources the correct xxx.res.mel file. It doesn't need AEdagNodeCommon.mel.

Comment on lines +14 to +15
editorTemplate -addControl "visibility";
editorTemplate -label (uiRes("m_AEdagNodeCommon.kLODVisibility")) -addControl "lodVisibility";
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason why you bother reusing a string defined in Maya at all? Everything else is kind of hard-coded and in English only, but a couple of them will come from Maya and possibly be in another language. It should work, and the odds of Maya changing (or moving the location of) one of those strings is pretty small, but just wondering why you're even bothering.

@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 18, 2020
@seando-adsk
Copy link
Collaborator Author

@kxl-adsk This change is just a single MEL file that is only copied to the install folder. There is nothing to build, so a preflight is not needed. Please merge when you're ready.

@kxl-adsk kxl-adsk merged commit d76c4a0 into dev Nov 18, 2020
@kxl-adsk kxl-adsk deleted the donnels/MAYA-107239/first_pass_at_proxy_shape_ae_template branch November 18, 2020 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin proxy Related to base proxy shape ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants