ScriptSpot home

Forum topic · General Scripting

Unable to convert: BitMap: to type: TextureMap

By anybany · 2012-06-09

Description

My code
FerstTexture=Bitmaptexture()
FerstTexture =bitmap 100 100 color:red
SecondTexture=Bitmaptexture()
SecondTexture=bitmap 100 100 color:green
CompoMap=compositeTexture()
CompoMap.mapEnabled.count = 2
CompoMap.mapList =#(FerstTexture,SecondTexture)

MAX answer --Unable to convert: BitMap: to type: TextureMap

Explain my mistake please.........

Comments (3)
anybany

BARIGAZY, glad to see and listen you....
Thank you

Branko Živković

Do it like this

The problem is that you need to save bitmap first before you assigne it.
Just specify your path where you want to save bitmaps.

mypath = "c:\\temp\\"
redmap = (bitmap 100 100 color:red filename:(mypath+"red.bmp"))
save redmap
FerstTexture = Bitmaptexture bitmap:redmap
greenmap = (bitmap 100 100 color:green filename:(mypath+"green.bmp"))
save greenmap
SecondTexture = Bitmaptexture bitmap:greenmap
CompoMap=compositeTexture()
CompoMap.mapEnabled.count = 2
CompoMap.mapList =#(FerstTexture,SecondTexture)
meditmaterials[1].diffusemap = CompoMap