-
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-107380 - On stage AE template, load and unload all payloads #1203
Conversation
…l payloads * Replaced loadPayloads checkbox with two buttons.
cmdStr = 'Load with Descendants' if loadAll else 'Unload' | ||
cmd = contextOps.doOpCmd([cmdStr]) | ||
ufeCmd.execute(cmd) |
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.
Use the context ops to either load or unload all. This makes the action undoable.
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 ""; |
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.
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).
global proc AEMayaUsdProxyShapePayloadsCmd(string $fullNodeName, int $loadAll) | ||
{ | ||
python("import AETemplateHelpers; AETemplateHelpers.ProxyShapePayloads('" + $fullNodeName + "', " + $loadAll + ")"); | ||
} |
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.
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).
|
||
editorTemplate -callCustom "AEmayaUsdProxyShapePayloadsNew" "AEmayaUsdProxyShapePayloadsReplace" loadPayloads; |
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.
Replace the loadPayloads control (checkbox) with a custom control containing the label/buttons.
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; | ||
} | ||
|
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 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?
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.
Other than wondering if there are any problems with multiple AE tabs, it looks good to me.
@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. |
MAYA-107380 - On the stage AE template I'd like to load and unload all payloads