diff --git a/lib/mayaUsd/nodes/proxyShapeBase.cpp b/lib/mayaUsd/nodes/proxyShapeBase.cpp index 522d0ff7da..623fcbca0f 100644 --- a/lib/mayaUsd/nodes/proxyShapeBase.cpp +++ b/lib/mayaUsd/nodes/proxyShapeBase.cpp @@ -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); diff --git a/plugin/adsk/scripts/AEmayaUsdProxyShapeBaseTemplate.mel b/plugin/adsk/scripts/AEmayaUsdProxyShapeBaseTemplate.mel index 852013a617..24a869684a 100644 --- a/plugin/adsk/scripts/AEmayaUsdProxyShapeBaseTemplate.mel +++ b/plugin/adsk/scripts/AEmayaUsdProxyShapeBaseTemplate.mel @@ -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); @@ -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)