- Wed Feb 29, 2012 5:54 am
#353282
The following issue was tested in max2012, maxwell 2.6.1, win7 64
I'm creating a script to convert vray scenes to maxwell. The issue is that if you assign a texture trough maxscript apparently it has worked fine but once you save the max file and try to re-open it the file is damaged.
It turns out that I can create the maxwell bitmap and it will not damage the file but if I assign a filename then it does damage the file.
You can try it with the following code.
Create an object assign a vray material with a texture in the diffuse slot, select it and run the following code.
You will see that it gets converted correctly but after saving the file you will not be able to open it again.
Now try it again but remove the line (theBitmap.FileName = mtl.texmap_diffuse.filename) and the file will open just fine.
-- Maxscript --
mtl = $.material
newmtl = Maxwell_Material ()
newmtl.Layers[2] = MaxwellLayer()
newmtl.Layers[2].name = newmtl.name + "_base"
theBitmap = maxwellbitmap()
theBitmap.FileName = mtl.texmap_diffuse.filename
newmtl.Layers[2].Bsdfs[1] = MaxwellBsdf()
newmtl.Layers[2].Bsdfs[1].ReflectedColorTexture = theBitmap
$.material = newmtl
Is this a known issue? Is there any work around?
Thanks
Guillermo Leal.
I'm creating a script to convert vray scenes to maxwell. The issue is that if you assign a texture trough maxscript apparently it has worked fine but once you save the max file and try to re-open it the file is damaged.
It turns out that I can create the maxwell bitmap and it will not damage the file but if I assign a filename then it does damage the file.
You can try it with the following code.
Create an object assign a vray material with a texture in the diffuse slot, select it and run the following code.
You will see that it gets converted correctly but after saving the file you will not be able to open it again.
Now try it again but remove the line (theBitmap.FileName = mtl.texmap_diffuse.filename) and the file will open just fine.
-- Maxscript --
mtl = $.material
newmtl = Maxwell_Material ()
newmtl.Layers[2] = MaxwellLayer()
newmtl.Layers[2].name = newmtl.name + "_base"
theBitmap = maxwellbitmap()
theBitmap.FileName = mtl.texmap_diffuse.filename
newmtl.Layers[2].Bsdfs[1] = MaxwellBsdf()
newmtl.Layers[2].Bsdfs[1].ReflectedColorTexture = theBitmap
$.material = newmtl
Is this a known issue? Is there any work around?
Thanks
Guillermo Leal.