PDA

View Full Version : Could use help with a material conversion tool


Ojah
01-06-2005, 11:46 AM
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?

Zbuffer
01-11-2005, 11:57 AM
just check for materials types and adjust:
something like

for 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

)

)

)

CGTalk Moderation
01-20-2006, 09:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.