SimplyMaya Forums

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

Home / forum / Animation / Mel Scripts & Programming / Automated unwrapping of multiple objects using scripting
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 07-05-2008, 05:12 AM   #1
Kartzan
Subscriber
 
Join Date: Oct 2005
Location: US of A
Posts: 114
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automated unwrapping of multiple objects using scripting

I have a quick question, that hopefully someone on here can help me with. I have a lot of small objects that I would like to unwrap (250 or so) using a standard spherical unwrap, and I want to create a script that would do it for me. The pieces are labeled "polySurface383" through "polySurface572".

The biggest problem I'm having is after getting the script to select an object is how to get it to unwrap it, mainly with some unique selection Maya does (look at the second line):

1| select r- polySurface383;
2| select r- polySurface383.f[0:119];
3| polyProjection -ch 1 -type Spherical -ibd on -sf on polySurface383.f[0:119];

Any help would be appreciated. Thanks all!
__________________
Death is certain, Life is not.
Kartzan is offline   Reply With Quote
Old 07-05-2008, 12:00 PM   #2
Xander-0
Registered User
 
Xander-0's Avatar
 
Join Date: Feb 2005
Location: This Place
Posts: 220
Thanks: 0
Thanked 2 Times in 1 Post
Default

The second line is maya saying its selected those faces. which, if that's all the faces on the sphere, you don't need to worry about; I think all unwraps by default affect the whole object if you don't otherwise specify the faces.
as for the third line, you really only to input the following;
polyProjection -type Spherical polySurface383.f[0:n]
(where n is your last face)
although that assumes the default values for things are what you want (for an explanation of the flags in the command, look in the MEL command reference in the help menu).
Not 100% sure how to get it to count the faces like you need, though.
__________________
Book Wise

http://X4nd5r.deviantart.com
Xander-0 is offline   Reply With Quote
Old 19-05-2008, 03:12 AM   #3
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm looking for a very similar thing, infact heres the exact thread I started elsewhere...

"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"

As is mentioned above I am looking for a way to do multiple projections, however it doesn't seem to like it with multiple objects. This is a real pain, any ideas guys.

PS. Soz for semi-hijacking your thread
bendingiscool is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem solving many dynamic objects in a pile? rohiniduggal Dynamics & Special Effects 3 14-01-2011 06:26 PM
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Technical Issues 4 04-12-2010 10:56 PM
New Feature: Multiple Image Upload David Members Lounge 0 30-11-2010 08:40 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.