global proc stupidMayaGlobals(){//Getting Selectionstring $sel[] = `ls -sl`;//Declaring outside loop so I can access it laterstring $objects[];//Cycle through selection for ($object in $sel){ //Get shape node of current string $shapes[] = `listRelatives -shapes -path $object`; //Get parents of shape node $objects =…