CGTalk > Software > Autodesk 3ds max
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 05-01-2013, 10:21 PM   #1
Artbot
Mostly Harmless
 
Artbot's Avatar
CGTalk Forum Leader
portfolio
Richard Green
The Man Who Sold the World
USA
 
Join Date: Dec 2001
Posts: 5,122
Need to identify which Mat ID channels are used by any given object

I am trying figure out a way to identify all the material IDs that are used by an object. I have an object that might have 10 material channels on it, and a multi-sub material that might have 30 channels. How can I quickly figure out which polys are using which channels?

The "Select ID" (in Edit Poly) does this, but I'd have to do use it 30 times (the number of Multi-S/O channels) for every object in the scene, so it's not practical. The "Select by Material" button in the mat-ed only shows the top level of the M-S/O material, not the actual channels.

Any help would be much appreciated.
__________________
www.artbot.com

 
Old 05-01-2013, 11:02 PM   #2
gandhics
Expert
 
gandhics's Avatar
Changsoo Eun
VFX Artist
FuseFX
USA
 
Join Date: Sep 2002
Posts: 888
try this.
select objects and run this code.

Code:
for o in selection do ( tmpMesh = o.mesh FaceIDList = #() for i = 1 to (getNumFaces tmpMesh) do ( appendIfUnique FaceIDList (getFaceMatID tmpMesh i) ) format "objname:%\n" o.name format "FaceID:%\n" FaceIDList )
 
Old 05-02-2013, 12:02 AM   #3
Artbot
Mostly Harmless
 
Artbot's Avatar
CGTalk Forum Leader
portfolio
Richard Green
The Man Who Sold the World
USA
 
Join Date: Dec 2001
Posts: 5,122
Thanks! This works, but I have a question. I dragged the code from the "new script" window to the toolbar to make a button, but the objects and their MatIDs appears in the listener. Is this where it's supposed to appear?
__________________
www.artbot.com

 
Old 05-02-2013, 12:09 AM   #4
gandhics
Expert
 
gandhics's Avatar
Changsoo Eun
VFX Artist
FuseFX
USA
 
Join Date: Sep 2002
Posts: 888
It will output object name and ID list to listener.
Do you want to see in pop-up dialog?
 
Old 05-02-2013, 12:15 AM   #5
Artbot
Mostly Harmless
 
Artbot's Avatar
CGTalk Forum Leader
portfolio
Richard Green
The Man Who Sold the World
USA
 
Join Date: Dec 2001
Posts: 5,122
Not really necessary. I was just wondering if I was looking in the right place or doing something wrong.

Thanks again!
__________________
www.artbot.com

 
Old 05-02-2013, 12:15 AM   #6
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:28 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.