Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select UV tile via MEL/python

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
T0M0X
4537 Views, 6 Replies

Select UV tile via MEL/python

Hello Maya forum,

 

is there a way how to select a UV tile via MEL/python ?

 

What I'm trying to do is apply different materials on different parts of single mesh which has UVs on multiple tiles.

 

Example:

Lets have two materials mat1, mat2 and a single sphere with UV layout splitted into two parts, one part on u1v1 tile and second part on u2v1 tile.

The script should select the sphere, select the u1v1 tile and every existing UV there and finally apply mat1. Then select u2v1 tile and every existing UV and apply mat2.

 

Or someone have better idea/solution for this ?

Thanks.

 

6 REPLIES 6
Message 2 of 7
sean.heasley
in reply to: T0M0X

Hi @T0M0X

 

I think I understand what you're trying to do and I don't believe you'd need a script for it.

 

I believe you should be able to just select the parts of the sphere you'd want as one material and apply the material to it.

 

That said, when you get a chance, can you please zip and attach the scene file here or via dropbox/google drive or another file sharing program so I can take a look at it?

Message 3 of 7
T0M0X
in reply to: sean.heasley

Hi Sean,

thank you for answer, but I do need that script, it is a part of process which I need to automate.

Currently I do it, as you said, manually selecting UV shells and applying materials manually, but it is really tedious. I'm going through that process (applying materials via UV shells) quite often (I agree, it would be stupid to request help if it would be just one-time situation.)

In the example I described a simple sphere for simplicity, but my object has UVs on 6 tiles (u1v1 - u5v1 and u1v2) and I'm applying 6 different materials.

I would be really thankful if someone could help me with creating such a function in MEL or Python (select all UV shells inside specific UV tile).

(unfortunately I can't share the scene 😞 )

best regards,
Tom

Message 4 of 7
sean.heasley
in reply to: T0M0X

Hi @T0M0X

 

If the file is confidential you can send it to me in a private message. We work with confidential files all the time and it would strictly be on my machine till the issue is resolved 🙂

Message 5 of 7
sean.heasley
in reply to: sean.heasley

Hi @T0M0X

 

Thanks for sending me the file!

 

I see what you're going for now and while it may be possible to create a script for this, I found this article that may help you!

 

Please let me know if this information helps or if you need any more assistance!

 

 

If one or more of these posts helped answer your question, please click Accept as Solution on the posts that helped you so others in the community can find them easily.

 

 

 

Kudos are greatly appreciated. Everyone likes a thumbs up!

Message 6 of 7
T0M0X
in reply to: T0M0X

Hmm... the problem is, when you need to apply different materials with different parameters Smiley Indifferent

I still have to find a better solution for this.

Message 7 of 7
absoluteKelvin
in reply to: T0M0X

try this script.

 

http://forums.cgsociety.org/showthread.php?t=1123235

 

just convert selection to face after

https://www.artstation.com/kelvintam

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report