Script to select all non-Vray materials in a scene?

The scene converter is all well and good, but is there a way I can get all the non-Vray materials in to my editor easily so I can swap them out for my predefined Vray mats?

I’m talking about a Revit model where there are lots of Autodesk materials, multiples of the same type, instances going in to many multiSubMaterials etc. I’ve swapped a lot out already but it’s now a case of finding those bits that have flown under the radar.

I use Sini Tools. I also have the Fix Utility

Does Sini have that exact function? i.e. just collecting the non-vray materials, rather than converting.

Not come across Fix Utility, am I wrong in assuming this is a 3rd party script?

This is probably the most savage way of coding it (I’m still learning), but it works:


select (for o in $* where superClassOf o == geometryClass collect o) --selects all geometry
deselect (for i in selection where i.material==undefined collect i) -- deselects geometry without materials
select (for g in selection where G.mat.category == #VRay collect g) -- selects geometry with V-Ray materials
actionMan.executeAction 0 "40044" --inverts selection
deselect (for p in selection where superClassOf p!=geometryClass collect p) --deselects non-geometry items​

here, just run it with the scene open.
If no offending material is found, no change will happen to the material editor, and a box will show up warning of the scene’s cleanliness.
If more than 24 materials are found, the mat editor will be fully populated, and a dialog box will warn you of how many more are left.
Notice it does not check what is in the material editor, so any content in it will be overwritten with the offending materials.
The operation isn’t undoable: save/hold before running the script.
nonVrayMatFinder_001.zip (762 Bytes)

Amazing! sounds perfect, will give it a try soon.

For this or similar questions there’s one tool to rule them all and it’s Modifier Modifier Zorb.

Oh i agree.
That thing saved my bacon *countless* times, in so many different aspects of production.
Zorb’s perennially on my “i’ll offer you the next one” list.