On 05/12/2013 at 08:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
I'm trying to paint on a texture layer (Set pixels).
So I go from Paintexture to Paintlayer to PaintlayerBmp and then use SetPixelCnt to set pixels in the layer (paint on it).
However, from Paintlayer to Paintlayerbmp gives an error "cannot be used to initialize Paintlayerbmp".
What to do?
// Get selected texture - layer
PaintTexture *pTex;
pTex = PaintTexture::GetSelectedTexture();
PaintLayer *pLayer = pTex->GetFirstLayer();
PaintLayerBmp* cLayer = pLayer->GetLayerDownFirst(); //Here it goes wrong
String name;
Int32 bh, bw;
// getting the info of the painttexture and paintlayer is ok
name = pTex->GetPaintTexture()->GetName(); // texture name: myimage.jpg
bh = pTex->GetFirstLayer()->GetBh();
bw = pTex->GetFirstLayer()->GetBw();
GePrint ("bw -bh: " + String::IntToString(bw) + " - " + String::IntToString(bh));
Int32 y; UChar buf[] = { 128 };
for (y=0;y<100;y++)
cLayer->SetPixelCnt(0,y,100,buf,0,COLORMODE_GRAY, PIXELCNT_0);