does such a script exist? i cant find anything on scriptspot.
Announcement
Collapse
No announcement yet.
select all objects with incompatible materials?
Collapse
X
-
Had same issue, KStudio path was suggested, didnt try it yet (has some options like selecting by name etc.) but what actually solved everything is Vrayscene converter without bothering with those mats anymore
-
I use this:Code:( local allSceneMats fn matSortFN mat1 mat2 = ( case of ( (mat1.name < mat2.name):-1 (mat1.name > mat2.name):1 default:0 ) ) fn getSceneMats = ( local sceneMats = #() for c in material.classes where c.creatable == true do ( mats = getClassInstances c join sceneMats mats ) qsort sceneMats matSortFN sceneMats ) fn analyseScene = ( clearListener() allSceneMats = getSceneMats() for om in allSceneMats where (not (areMtlAndRendererCompatible om renderer:(vray())) or (isKindOf om architectural)) do format "% - % %\n" (classOf om) om.name (refs.dependentNodes om) ) analyseScene() )
Dan Brew
Comment
-
-
Ok, here's an updated script that selects all objects that have incompatible materials.
Code:( clearSelection() clearListener() fn matSortFN mat1 mat2 = ( case of ( (mat1.name < mat2.name):-1 (mat1.name > mat2.name):1 default:0 ) ) fn getSceneMats = ( local sceneMats = #() for c in material.classes where c.creatable do ( mats = getClassInstances c join sceneMats mats ) qsort sceneMats matSortFN sceneMats ) fn analyseScene = ( local objs = #() for om in getSceneMats() where (not (areMtlAndRendererCompatible om renderer:(vray())) or (isKindOf om architectural)) do ( local nodes = refs.dependentNodes om format "% - % %\n" (classOf om) om.name nodes for n in nodes do appendIfUnique objs n ) select objs ) analyseScene() )
Dan Brew
- Likes 1
Comment
-
thanks!
if i wanted to give this to my colleague, who uses Octane.. is there a way to make it renderer agnostic (i.e. it will select objects with materials that are incompatible with *whatever* the current renderer is?) or would that involve code specific to each renderer?
Comment
-
Originally posted by super gnu View Postthanks!
if i wanted to give this to my colleague, who uses Octane.. is there a way to make it renderer agnostic (i.e. it will select objects with materials that are incompatible with *whatever* the current renderer is?) or would that involve code specific to each renderer?
Code:( clearSelection() clearListener() fn matSortFN mat1 mat2 = ( case of ( (mat1.name < mat2.name):-1 (mat1.name > mat2.name):1 default:0 ) ) fn getSceneMats = ( local sceneMats = #() for c in material.classes where c.creatable do ( mats = getClassInstances c join sceneMats mats ) qsort sceneMats matSortFN sceneMats ) fn analyseScene = ( local objs = #() for om in getSceneMats() where not areMtlAndRendererCompatible om renderer:renderers.current do ( local nodes = refs.dependentNodes om format "% - % %\n" (classOf om) om.name nodes for n in nodes do appendIfUnique objs n ) select objs ) analyseScene() )
Dan Brew
- Likes 1
Comment
-
-
Comment