View Full Version : FaceMatID Loop Problem

02 February 2009, 07:15 PM
I've written a script that cleans a multimaterial subduplicatematerials, mainly to clean up the mess after attaching multiple objects that had mutli-sub materials.
It is working as intended but I'm facing a bit of a problem:
for k = 1 to $.numfaces do (
idm = getFaceMatID $ k
if idm == $.material.materialIDList[i] then (
setFaceMatID $ k $.material.materialIDList[j]
This is the code that I'm using to switch the FaceIDS that happen to be different, but link to duplicate materials.
The problem is I'm attaching a lot of objects with a goal of a fairly large object, as I attach more, the face count gets bigger and the performance is becoming sluggish/non responsive.
The question is (and I've searched the manual all over the place but couldn't find) there a command that will function as the "Select ID k" Button in Editable_Mesh?
I think this will improve the performance greatly since I don't need to cycle through the entire face count to find what I'm looking for, something like this:
select $.faces.matID[k] --or something

02 February 2009, 12:21 PM
looks like editable poly does..

<void><EditablePoly>.selectByMaterial <index>materialID [clearCurrentSelection:<bool>]

or even an Unwrap UVW modifier...

<void><Unwrap_UVW>.selectByMatID <integer>matID

I'm guessing there should be one for editable meshes as well.. didn't spot one immediately though.

CGTalk Moderation
02 February 2009, 12:21 PM
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.