Notifications
Clear all
[Closed] loop through all slots in material
Page 2 / 2
Prev
Mar 04, 2011 1:31 pm
fn cleanBitmapTextures mat =
(
for tx in (getclassinstances bitmaptexture target:mat asTrackViewPick:on) where
not doesfileexist tx.anim.filename do tx.client[tx.subNum].value = undefined
)
4 Replies
Hi Denis, on which Max version you test this function?
Due to the docs [b]GetClassInstances/b is fixed in Max 2011.
Not tested by me, am still on Max 2009 and here it is a real disaster.
I test your function with Blend material. The result is – Mask slot is not cleaned,
and the most worst – the materials are removed from Blend slots.
getclassinstance in max 2009 and 2010 has bug and sometime doesn’t return trackpickvalue right.
the function returns wrong subNum value.
it’s fixed in 2011…
here is a version to trick it:
fn cleanBitmapTextures mat =
(
for tx in (getclassinstances bitmaptexture target:mat asTrackViewPick:on) where
not doesfileexist tx.anim.filename do
(
for s=1 to tx.client.numsubs where tx.client[s].value == tx.anim do tx.client[s].value = undefined
)
)
Page 2 / 2
Prev