ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
In case someone needs a script for the same purpose.
Here is a fast, dirty and functional script (thanks to Anubis)
--Destroy the dialog if it is already open try(destroyDialog roll_matselection)catch()-- UI STUFF
rollout roll_matselection "Material Selector V1.0"(
group "Select Materials:"(
button btn_VRay "Select Object with VRay Materials" height:22 width:190 tooltip:"Select Object with VRay Materials" align:#center
button btn_Standard "Select Object with Standard Materials" height:22 width:190 tooltip:"Select Object with Standard Materials" align:#center
button btn_MentalRay "Select Object with MentalRay Materials" height:22 width:190 tooltip:"Select Object with MentalRay Materials" align:#center
button btn_Brazil "Select Object with Brazil Materials" height:22 width:190 tooltip:"Select Object with Brazil R/S Materials" align:#center
)
HyperLink hl_homepage "..:: Raymond H. Ingebretsen ::.." address:"http://www.homme3d.com/" color:(color 255255255) hovercolor:(color 111111111) visitedcolor:(color 255255255) align:#center
-- select all objs with VRay mat's
on btn_VRay pressed do(
select (for o in objects where o.mat.category == #vray collect o))
on btn_Standard pressed do-- select all objs with standard mat's(
select (for o in objects where o.mat.category == #standard collect o))
on btn_MentalRay pressed do-- select all objs with mr mat's(
select (for o in objects where o.mat.category == #mental_ray collect o))
on btn_Brazil pressed do-- select all objs with brazil mat's(
select (for o in objects where o.mat.category == #Brazil_r_s collect o)))-- End Rollout-- Create Dialog Stuff
createDialog roll_matselection 210160 pos:[150,150]
What your vray_materials array hold? If their're classes then your code would work fine. Also may try ".category" property of the material. Examples:
-- select all objs with standard mat's
select (for o in objects where o.mat.category == #standard collect o)-- select all objs with mr mat's
select (for o in objects where o.mat.category == #mental_ray collect o)-- select all objs with brazil mat's
select (for o in objects where o.mat.category == #Brazil_r_s collect o)
I not work with VRay, so just select 1 vr-mat and get the category from it ;) Cheers!
Comments
In case someone needs a
In case someone needs a script for the same purpose.
Here is a fast, dirty and functional script (thanks to Anubis)
/ Raymond
The solution you came up with
The solution you came up with did the job, so i used this with VRay:
select (for o in objects where o.mat.category == #vray collect o)Thank you so much :)
EDIT: The purpose was to select all objects in the scene with Vray materials, and fix them to arc_and_design for rendering with Mentalray.
/ Raymond
try .category
What your
vray_materialsarray hold? If their're classes then your code would work fine. Also may try ".category" property of the material. Examples:I not work with VRay, so just select 1 vr-mat and get the category from it ;) Cheers!
my recent MAXScripts RSS (archive here)