Notifications
Clear all

[Closed] Collect scene materials in Multi/-SubObject

Hi!

Is there a script around that would let me do the following?:

Collect all materials from a scene, removal of duplicates (even if they have different settings, what counts is that they’re calling the same texture file) and then lists all of them combined in a Multi/-SubObject material? Assignments to objects in the scene do not matter for now.

Thank you!

2 Replies
 MZ1

FileNames = #()
Materials = #()
for b in (getclassinstances bitmaptexture) where (f = b.filename) != undefined do
if appendifunique FileNames f do
for r in refs.dependents b where iskindof r material do appendifunique Materials r

Now you can create a MultiMaterial from Materials array.

I’ll see what I can do with that – thank you very, very much!