Chaos Corona Forum
Chaos Corona for Cinema 4D => [C4D] General Discussion => Topic started by: frv on 2024-10-18, 23:30:52
-
Hi,
There was someone here at the forum who had a small script that deletes all duplicate materials. Very handy when working with Maxtree trees and plants and when using the C4D asset browser.
I lost the script when reinstalling my system so maybe someone still has it. I did a search but could not find it.
-
Hi,
Is it this one ?
(https://i.imgur.com/lsLfKLH.gif)
-
Is that a built-in script, or one written by a user? Would be nice if the C4D Remove Duplicate Materials worked with Corona mats.
-
Yes John, that's the one. Any idea how I could get it again. Did you post it before.
It was written by a users. I accidentally deleted it when I wiped out my harddisk to install a new system.
-
I must have shared it here before but I'm too lazy to look for the post. It's in the attachment.
For context, it's a script from Aturtur (https://github.com/aturtur/cinema4d-scripts/)that I've fixed and modified. It compares materials' names and merges all those with the same name with the one at the top of the list. It DOESN'T check if the materials data is the same so it might merge materials that are completely different. That's why I modified it to run only on the current material selection.
-
That's exactly what I was looking for. It's a great script for Maxtree assets. Maxtree has done their plants with rather smart materials with all their versions of the same plant using the same materials. But when you open the assets you still get all the same materials loaded. They don't delete well with the C4D delete duplicate.
Thanks !
-
frv,
how do save the MT assets to your asset browser?
I always “overwrite” the 5 variations with the first material, so all 6 assets use the same material. Then I group all in a null before adding to the asset browser.
This way, when you load these assets into a scene they only use 1 set of materials for all variations.
But of course, John_Do’s scripts are brilliant!
-
Tx Jojo,
good idea to group the variations. Will start doing that too.
Overwriting is still a hassle. I used to convert the materials to PB. But Stefan from 3Dtools wrote me once that the legacy materials are just as good to work with so I stopped doing so.
Happy I have the script again.