Hi, i want to clone a TextureMaterial, modify it and keep the original and the clone for later use.
What i did so far is following:
var BT:BitmapTexture = defaultMaterial.texture as BitmapTexture;
var BD:BitmapData = BT.bitmapData;
var clone:BitmapData = BD.clone();
var newBT:BitmapTexture = new BitmapTexture(clone);
transparentMaterial = new TextureMaterial(newBT, false, true);
transparentMaterial.lightPicker = defaultMaterial.lightPicker;
But the cloned TextureMaterial does not look like the original (see attachment). Can anyone help me with that problem please? I think i am missing some important information from the texture? uv-coordinates maybe or something like that.