SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Programming / mapping multiple objects in mel

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
 
Thread Tools
19-05-2008, 03:13 AM   #1
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
mapping multiple objects in mel
I have a bunch of cubes and I would like to write a script that does an automatic map on them. I tried this after selecting all the cubes...

string $polyBlocksArray[] = `ls -sl`;

for ($myObject in $polyBlocksArray) {

polyAutoProjection;

}

I get an error saying "Doesn't work with multiple objects selected". How would I go about getting the loop to go through them one at a time and map that way?

Many thanks in advance
Chris
  Reply with quote
19-05-2008, 05:33 AM   #2
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Nevermind I got it, forgot to put the select command in there, heres the revised version...

string $polyBlocksArray[] = `ls -sl`;

for ($myObject in $polyBlocksArray) {

select $myObject;
polyAutoProjection;

}

Cheers, Chris
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
using mel to select multiple objects davad138 Programming 2 29-01-2020 03:10 PM
Objects move inconsistently when I move multiple MrSandman Maya Technical Issues 5 20-04-2015 08:13 PM
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Maya Technical Issues 4 04-12-2010 11:56 PM
Problems with multiple collision objects Uglynakedguy Maya Technical Issues 1 08-05-2008 01:06 AM
Renaming Objects using MEL Scripts oneshotflinch Maya Basics & Newbie Lounge 0 21-10-2005 01:25 PM