// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: June 24, 1997 // // // // // // // refreshAE // // // None // // // Refreshes the attribute editor. (Only if it's visible.) // If the focus node (i.e., the selected node that was last known to be // displayed in the AE) still exists, re-build all tabs, and if the current tab // no longer exists, force an update of the AE. If the focus node no longer // exists, clear the AE. // // // None // // // refreshAE; // // global proc refreshAE() { global string $gAttributeEditorWindowName; global string $gAETabLayoutName; global string $gAEFocusNode; if ( ( `window -exists $gAttributeEditorWindowName` && `window -q -vis $gAttributeEditorWindowName`) || (`isAttributeEditorVisible`)) { // update the tabs if (`objExists $gAEFocusNode`) { // find out what tab is currently being viewed // string $tabLabels[] = `tabLayout -q -tl $gAETabLayoutName`; int $tabIndex = `tabLayout -q -sti $gAETabLayoutName`; string $currentTab = $tabLabels[$tabIndex-1]; AEbuildAllTabs $gAEFocusNode; // check if the currentTab still exists $tabLabels = `tabLayout -q -tl $gAETabLayoutName`; for ($i = 0; $i < size($tabLabels); $i++) { if ($currentTab == $tabLabels[$i]) { tabLayout -e -st ("formTab"+$i) $gAETabLayoutName; return; } } // if we've gotten this far, currentTab no longer // exists, rebuild the AE and select $gAEFocusNode's tab // updateAE($gAEFocusNode); } else { // BUG #172131 // In certain cases (like a curve on surface) $gAEFocusNode // does not exist but $gAEFocusNode stripped of '|' does. // Only make the formLayout invisible if neither $gAEFocusNode // nor $gAEFocusNode stripped of '|' exist. string $stripped = `substitute "|" $gAEFocusNode ""`; if ( !`objExists $stripped` ) { AEsetDisplayToEmpty(); } if (`window -exists $gAttributeEditorWindowName`) { window -e -title (localizedUIComponentLabel("Attribute Editor")) $gAttributeEditorWindowName; } } } }