//------------------------------------------------------------------------------ //-- Aa_Transfer_UVs //-- //-- Transfer UVs from a poly object to all poly objects with the same name //-- (duplicated objects, ex : from polysphere1 to polysphere2, polysphere3, ...) //-- //-- Version : 1.0 //-- Author : Alexandre Aillet (webmaster@F-oeni-X.com) //-- Created : June 2004 //-- Updated : March 2005, july 2009 //-- //-- How-to : call 'Aa_Tranfer_UVs()' from script editor or shelf command //------------------------------------------------------------------------------ //----------------------------------------------------------------------- //-- Aa_Tranfert_UVs //----------------------------------------------------------------------- //-- Create an UI window //-- input : null //-- output : null //----------------------------------------------------------------------- global proc Aa_Tranfer_UVs(){ window -t "Transfert uvs" -s 1 -mxb 0 -rtf 1 windowTransfer; columnLayout -adj 1 -cal "center"; textFieldGrp -cw 1 150 -adj 1 -cal 1 "center" -l "Tranfser UV from" objsuv; textFieldGrp -cw 1 150 -adj 1 -cal 1 "center" -l "To" objsre; button -l "transfer" -c "Transfer()"; showWindow windowTransfer; } //----------------------------------------------------------------------- //-- Transfer //----------------------------------------------------------------------- //-- Transfer UVs from a poly object to all poly objects with the same name //-- input : null //-- output : null //----------------------------------------------------------------------- global proc Transfer() { select -cl; string $objaTrans = `textFieldGrp -q -tx objsuv`; string $objSemblables = `textFieldGrp -q -tx objsre`; string $noSuffix = `match ".*[^0-9]" $objSemblables`; if (($noSuffix!= "") && ($objaTrans != "") && ($objSemblables != "")){ string $obj; string $lsObj[] = `ls -s ($noSuffix + "*")`; for($obj in $lsObj){ polyTransfer -ch 0 -vc 0 -v 0 -uv 1 -ao $objaTrans $obj; } } else{ warning("No object found"); } }