Need to identify which Mat ID channels are used by any given object

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  05 May 2013
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.

  05 May 2013
try this.
select objects and run this 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"
		format "FaceID:%\n" FaceIDList
  05 May 2013
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?

  05 May 2013
It will output object name and ID list to listener.
Do you want to see in pop-up dialog?
  05 May 2013
Not really necessary. I was just wondering if I was looking in the right place or doing something wrong.

Thanks again!

  05 May 2013
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

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
Society of Digital Artists

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

All times are GMT. The time now is 01:30 PM.

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