[Closed] Could use help with a material conversion tool
i am tryin to create a script that changes all the reflection slots from raytrace maps to vray maps. For this i already made this:
for i = 1 to scenematerials.count do
if(classOf scenematerials[i]) == standardmaterial then
(
if (classOf sceneMaterials[i].reflectionMap) == Raytrace then
(
sceneMaterials[i].reflectionMap = VRayMap ()
sceneMaterials[i].reflectionMap.reflect_maxDepth = 1
)
)
)
but that only changes the reflectionmaps in the regular materials, not in the “blend” materials or “multi-sub-object” ones. And of course this is what im tryin to achieve.
Can anyone help me out?
[color=white]just check for materials types and adjust:
something like
for[/color] mat in sceneMaterials do
(
if classOf mat == standardmaterial do
if classOf mat.reflectionMap == Raytrace do
(
mat.reflectionMap = VRayMap ()
mat.reflectionMap.reflect_maxDepth = 1
)
if classOf mat == MultiMaterial do
(
for submat in mat.materialList do
if classOf submat.reflectionMap == Raytrace do
(
submat.reflectionMap = VRayMap ()
submat.reflectionMap.reflect_maxDepth = 1
)
)
if classOf mat == Blend do
(
if classof mat.map1.reflectionMap == Raytrace do
(
mat.map1.reflectionMap = VRayMap ()
mat.map1.reflectionMap.reflect_maxDepth = 1
)
if classof mat.map2.reflectionMap == Raytrace do
(
mat.map2.reflectionMap = VRayMap ()
mat.map2.reflectionMap.reflect_maxDepth = 1
)
)
)