Hi guys,
I'm trying to write a script to automatically set certain VRay material values of all VRay mats in the scene, by entering one value in the script. But how do I avoid the script trying to set specific VRay material settings in native Max materials in the scene, causing an unknown property error?
Here's my script so far:
------------------------------------------------
MainFloater = NewRolloutFloater "Set VRay properties" 300 315
Rollout VRaymat_prop_refl_subd "VRay mat refl subdivs"
(
group "Refl subdivs value"
(
label enterreflsubdvalue "Enter refl subdivs value for all VRay mats in the scene"
spinner reflsubdvalue align:#center range:[1,1000,15] type:#integer scale:1 fieldwidth:45
button setreflsubdvalue "Set refl subdivs"
) -- close group
on setreflsubdvalue pressed do
(
for i = 1 to sceneMaterials.count do
(
sceneMaterials[i].reflection_subdivs = reflsubdvalue.value
)
)
) -- close rollout
AddRollout VRaymat_prop_refl_subd MainFloater
------------------------------------------------
Thanks very much in advance for your help.
Cheers,
Metin
I'm trying to write a script to automatically set certain VRay material values of all VRay mats in the scene, by entering one value in the script. But how do I avoid the script trying to set specific VRay material settings in native Max materials in the scene, causing an unknown property error?
Here's my script so far:
------------------------------------------------
MainFloater = NewRolloutFloater "Set VRay properties" 300 315
Rollout VRaymat_prop_refl_subd "VRay mat refl subdivs"
(
group "Refl subdivs value"
(
label enterreflsubdvalue "Enter refl subdivs value for all VRay mats in the scene"
spinner reflsubdvalue align:#center range:[1,1000,15] type:#integer scale:1 fieldwidth:45
button setreflsubdvalue "Set refl subdivs"
) -- close group
on setreflsubdvalue pressed do
(
for i = 1 to sceneMaterials.count do
(
sceneMaterials[i].reflection_subdivs = reflsubdvalue.value
)
)
) -- close rollout
AddRollout VRaymat_prop_refl_subd MainFloater
------------------------------------------------
Thanks very much in advance for your help.
Cheers,
Metin
Comment