// =========================================================================== // 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. // =========================================================================== global proc convertInstanceToObject (){ string $warning = (uiRes("m_convertInstanceToObject.kConvertInstanceWarning")); string $objects[] = `ls -sl`; for ($object in $objects){ // confirm if object is an instance string $children[] = `listRelatives -fullPath -children $object`; string $parents[] = `listRelatives -fullPath -allParents $children[0]`; if (`size($parents)` > 1){ string $duplicatedObject[] = `duplicate $object`; delete $object; rename $duplicatedObject[0] $object; } else { warning( `format -s $object $warning` ); } } }