ive got an fbx of a satellite that has been converted from who knows what. not only is it 18000 objects (in some parts each poly is an object) but it also appears to have 18000 (non vray, sometimes cryptically named) materials to go along with it.
i initially assumed that the names were consistent (i.e. 1000 materials all named “brushed steel” ) in which case a script like “instance materials by name” from the kstudios pack would have resolved it fairly easily.
however on seeing the full list of materials i see i have, for example:
so in the end even if i condense all the identical ones, ill *still* have several hundred+ materials, and the kstudios one only works for IDENTICAL names.
what i want is a script that allows me to choose a chunk of materials from a list (even with varying names) and instanciate them all to a single material.
any suggestions? client is (of course) expecting that ill just be able to grab this model and use it. if i have to spend a week cleaning it up itll be an issue.
Identify how many materials there are, disregarding copies.
E.g. if there are 5 materials then create 5 objects and assign each one of the 5 mats. Save selected objects and delete/remerge them, which will give the opportunity to overwrite those existing 5 mats, which
should then be the only materials in the scene.
that works for identically named materials.. as noted ive already got a script to instanciate those. my problem is the hundreds (possibly more than a thousand) *similarly* named materials i.e. brushedmetal 1, brushedmetal 2, brushedmetal_panels, brushed_metal etc etc.
no the scene is a real mess, 4600 max objects, a heirarchy based on linked helpers at least 20 branches deep, with everything named semi-randomly, half an object (random faces) in one max object, 3 faces in another, and the rest in a third. god knows where it was exported from, almost looks deliberate. all i can say is the source is a multibillion dollar space technology company so youd think they would have some good workflows.
This sounds easily scriptable actually, you can try ChatGPT for that. I wrote a bunch of scripts together with ChatGPT or Claude.ai to clean up things like this. I’d say give it a try.
yeah i tried chatgtp, copilot and claude.ai (all free versions) not one of them could produce a working script, and all had a habit of going round in circles with their modifications when shown the error messages.. not impressed.
Is it possible to do this based on geometry itself. I normally use search word based on *object name* and this way make selection sets. Another option would be to select objects based on face amount. If there are unwanted objects selected as well just unselect those.
This is my way for organizing scenes containing hundreds of thousands of objects.
in the end this script sorted the scene enough to start going through the geometry and tidying up:
it reduced the scene from 4000+ materials to 12.. took a while to process but does not appear to have broken anything. client also finally sent through some (bad) reference photos, so i have something to work from. thanks all.