Skip to content

Commit

Permalink
Merge pull request #3231 from Autodesk/bailp/EMSUSD-261/AE-root-layer…
Browse files Browse the repository at this point in the history
…-update

EMSUSD-261 fix root layer attribute in AE
  • Loading branch information
seando-adsk authored Jul 18, 2023
2 parents df33b99 + 3c8307e commit cff0ff3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/mayaUsd/nodes/proxyShapeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ MStatus MayaUsdProxyShapeBase::initialize()
retValue = attributeAffects(filePathAttr, outStageDataAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);
retValue = attributeAffects(filePathAttr, outStageCacheIdAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);
retValue = attributeAffects(filePathAttr, rootLayerNameAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);
retValue = attributeAffects(filePathAttr, sessionLayerNameAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);
retValue = attributeAffects(filePathAttr, primPathAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);

retValue = attributeAffects(primPathAttr, outStageDataAttr);
CHECK_MSTATUS_AND_RETURN_IT(retValue);
Expand Down
18 changes: 17 additions & 1 deletion plugin/adsk/scripts/AEmayaUsdProxyShapeBaseTemplate.mel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ global proc AEmayaUsdProxyShapeInfoNew(string $input)
AEmayaUsdProxyShapeInfoReplace($input);
}

global proc AEmayaUsdProxyShapeInfoReplace(string $input)
global proc string AEmayaUsdProxyShapeInfoChanged(string $input)
{
// From the input attribute we simply want the node name.
string $nodeName = plugNode($input);
Expand All @@ -24,6 +24,22 @@ global proc AEmayaUsdProxyShapeInfoReplace(string $input)

textFieldGrp -edit -text $rootLayer mayaUsdProxyShapeRootLayer;
textFieldGrp -edit -text $defaultPrim mayaUsdProxyShapeDefaultPrim;

return $fullNodeName;
}

global proc AEmayaUsdProxyShapeInfoReplace(string $input)
{
string $fullNodeName = AEmayaUsdProxyShapeInfoChanged($input);

// Add a script job on the file path attribute so we can update the AE control
// if the attribute changes from the outside.
global int $mayaUsdProxyShapeInfoScriptJobId = -1;
if (`scriptJob -exists $mayaUsdProxyShapeInfoScriptJobId`)
scriptJob -kill $mayaUsdProxyShapeInfoScriptJobId;
string $cmd = "AEmayaUsdProxyShapeInfoChanged(\"" + $input + "\")";
string $attrName = $fullNodeName + ".filePath";
$mayaUsdProxyShapeInfoScriptJobId = `scriptJob -parent mayaUsdProxyShapeRootLayer -attributeChange $attrName $cmd`;
}

global proc AEmayaUsdProxyShapeShareStageNew(string $shareStageAttr)
Expand Down

0 comments on commit cff0ff3

Please sign in to comment.