Put a given type of material into Material Editor slots?

Is there already-make script or some line of code to put all Material in scene if they're in a given type?...

I mean If I want to search for VrayFastSSS2 in a *.max scene (with more than thousand objects and around hundreds different unorganized materials of all types), there's apparently no way to do this task by any build-in tool on 3dsmax or vray. But I believe it only take some line of code if you ask the right community. If anyone have idea or answer thanks so much.

Somethings to put all materials which is VrayFastSSS2 into 24 slots of Material Editor for editing or replacing? (if they are more than 24 then I accept I will have to manually replace the 1st 24 slots and then move on until finish).

My initial purpose was replace all VrayFastSSS2 with regular VrayMtl (doesn't matter of diffuse color convertion or anything, just replace) because for animation rendering, SSS material always take more time in prepass phase even with pre-calculated IRR map. VrayFastSSS2 exists in the scene and no clue which object has it or how many of them (there're thousands un-organized ones). Those scene which I usually work on is archviz type, so by mistake of prework by other department, there're objects with SSS material which is not even appear in image frame but noway to detect or remove expect they slowdown rendering process by adding more prepass phase(Like the passes added with reflection/refraction interpolation prepasses when you don't use raytraced for grossiness in vraymtl). But realised maybe it's getting complicated so I'll just need to put as many as possible VrayFastSSS2 into Material Editor for further manual editing. Thanks for reading.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pixamoon's picture



to put first 24 to mEdit Slots:

mArr = getclassinstances VrayFastSSS2
for i = 1 to mArr.count where i < 25 do meditMaterials[i] = mArr[i]

but you can also try MultiConvertor, and add your own preset for convert all VRayFassSSS2 to VRayMtl


Hope this helps,

nnq2603's picture

Fill ME slots with VrayFastSSS2. Thanks

Thanks, man. Your code works very well. I tried it on a scene and work as expected.

About your suggestion with MultyConvertor, I thought I heard about that tool before but didn't realise it has such capability. I get that tool and try in simple scene, it works for converting VRayFastSSS2 to regular VrayMtl (only I've to setlink for somes properties but in my case those details are less important so I just set diffuse color link). Thanks again for great help!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.