// =========================================================================== // 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. // =========================================================================== proc atomAddNodeRecursive( string $layerNode, string $layers[] ) { $layers[size($layers)] = $layerNode; string $children[] = `animLayer -query -children $layerNode`; int $iter = 0; for(; $iter < size($children); $iter++) { atomAddNodeRecursive( $children[$iter], $layers ); } } global proc string[] atomGetAllLayersOrdered( ) { // string $layers[]; string $rootLayer = `animLayer -q -root`; if( $rootLayer != "" ) { atomAddNodeRecursive( $rootLayer, $layers ); } return $layers; }