[Closed] count not assigned materials
One simple question. How to go by all materials on scene and count those which are not assigned to any object? Do anybody has any clue something like:
for o in materials where o is not assigned to object collect o
When you use(run) “scenematerials” U will get only collection of assigned mateials.
But if you want to collect all not used materials then simply loop through Material Editor
for i = 1 to 24 where not MeditUtilities.isMaterialInUse meditMaterials[i] collect meditMaterials[i]
ok thanks but it’s a little misunderstanding so I gonna be more preside now. It’s my fold.
I want to count how many unused materials are on scene so:
I assume those materials must be different then standard materials (materials must be defined by user) and not attached to any object – something like (Condense Material Editor Slot) but insteand of removing it I want count it only. Your code count also defoult materials in empty slots and I want know how many materials are not in use excluding “empty” materials. Second issue is your code count only 24 slots but if there is more unused materials on scene how to check it?
I tried this to count unused materials:
unusedmaterials=(for i = 1 to 24 where meditMaterials[i] != undefined and not MeditUtilities.isMaterialInUse meditMaterials[i] collect meditMaterials[i])
but won’t work