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-107380 - On stage AE template, load and unload all payloads #1203

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

seando-adsk
Copy link
Collaborator

MAYA-107380 - On the stage AE template I'd like to load and unload all payloads

  • Replaced loadPayloads checkbox with two buttons.

…l payloads

* Replaced loadPayloads checkbox with two buttons.
Comment on lines +34 to +36
cmdStr = 'Load with Descendants' if loadAll else 'Unload'
cmd = contextOps.doOpCmd([cmdStr])
ufeCmd.execute(cmd)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use the context ops to either load or unload all. This makes the action undoable.

Comment on lines +32 to +37
rowLayout -nc 5 -cl5 "right" "center" "center" "center" "center";
text -label `getMayaUsdString("kPayloads")` -ann `getMayaUsdString("kPayloadsAnn")`;
button -label `getMayaUsdString("kLoadAll")` payloadsLoadAllBtn;
button -label `getMayaUsdString("kUnloadAll")` payloadsUnloadAllBtn;
text -label "";
text -label "";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use the same trick as Maya source does to get things to line up. I have a text field with two buttons (on a row with 5 columns).

Comment on lines +43 to +46
global proc AEMayaUsdProxyShapePayloadsCmd(string $fullNodeName, int $loadAll)
{
python("import AETemplateHelpers; AETemplateHelpers.ProxyShapePayloads('" + $fullNodeName + "', " + $loadAll + ")");
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wrap the call to python into a MEL proc. This way its the MEL proc name that will appear in the undo/redo menu (rather than the python line).

Comment on lines +125 to +126

editorTemplate -callCustom "AEmayaUsdProxyShapePayloadsNew" "AEmayaUsdProxyShapePayloadsReplace" loadPayloads;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Replace the loadPayloads control (checkbox) with a custom control containing the label/buttons.

Comment on lines +48 to +58
global proc AEmayaUsdProxyShapePayloadsReplace(string $loadPayloads)
{
// From the input attribute we simply want the node name.
string $nodeName = plugNode($loadPayloads);
string $res[] = `ls -l $nodeName`;
string $fullNodeName = $res[0];

button -e -c ("AEMayaUsdProxyShapePayloadsCmd(\"" + $fullNodeName + "\", 1)") payloadsLoadAllBtn;
button -e -c ("AEMayaUsdProxyShapePayloadsCmd(\"" + $fullNodeName + "\", 0)") payloadsUnloadAllBtn;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering if you've tested this with a torn off AE tab? So have more than one node and separate tabs visible. Does it all get updated correctly?

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.

Other than wondering if there are any problems with multiple AE tabs, it looks good to me.

@seando-adsk seando-adsk added adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge labels Feb 23, 2021
@seando-adsk
Copy link
Collaborator Author

@kxl-adsk Marked as ready-for-merge. The changes are in our proxy shape AE template which is not really part of anything the preflight will catch (since these files are just installed). So I skipped the preflight, unless you think I should run it.

@kxl-adsk kxl-adsk merged commit 5a6a28c into dev Feb 24, 2021
@kxl-adsk kxl-adsk deleted the donnels/MAYA-107380/load_unload_all_payloads branch February 24, 2021 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin 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