vasquez888
03-19-2007, 02:20 PM
Hello,
I'm having a problem with trying to change a material to another material type. I'm guessing it might be a problem with how I'm passing the reference of the material? All I can do is change the properties of the material through a function, e.g. name, but if I try making a new material and assigning the reference of the old material to the new material, it does nothing.
The following is a simplified version of what I'm trying to do:
(
fn convertMat &mat =
(
tempMat = VrayLightMtl()
tempMat.name = mat.name
tempMat.texMap = mat.diffuseMap
mat.name = "new material name" -- works
mat = tempMat -- does nothing, material is created but not replaced
)
-- array to hold the materials of the selected objects
local mats = #()
for i = 1 to selection.count do
(
mats[i] = selection[i].material
)
-- convert the materials to VrayLightMtl
for i = 1 to mats.count do
(
convertMat &mats[i]
)
)
Any help on this greatly appreciated!
I'm having a problem with trying to change a material to another material type. I'm guessing it might be a problem with how I'm passing the reference of the material? All I can do is change the properties of the material through a function, e.g. name, but if I try making a new material and assigning the reference of the old material to the new material, it does nothing.
The following is a simplified version of what I'm trying to do:
(
fn convertMat &mat =
(
tempMat = VrayLightMtl()
tempMat.name = mat.name
tempMat.texMap = mat.diffuseMap
mat.name = "new material name" -- works
mat = tempMat -- does nothing, material is created but not replaced
)
-- array to hold the materials of the selected objects
local mats = #()
for i = 1 to selection.count do
(
mats[i] = selection[i].material
)
-- convert the materials to VrayLightMtl
for i = 1 to mats.count do
(
convertMat &mats[i]
)
)
Any help on this greatly appreciated!
