On 30/03/2013 at 04:08, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
I'm trying to render a preview-image of a BaseShader, but I get crashes in sdl.cdl. I guess it's because
I don't pass a VolumeData to the ChannelData? I can't get it right. Strange thing is, that the call-stack
only shows one call to my plugin which is the BaseContainer destructor.. And I don't even use a
BaseContainer in this code.
Code:
sla.cdl!5f9f1ac6()
[Unten angegebene Rahmen sind möglicherweise nicht korrekt und/oder fehlen, keine Symbole geladen für sla.cdl]
xtensions.cdl!5f73a5e7()
CINEMA 4D.exe!01718250()
CINEMA 4D.exe!01718250()
CINEMA 4D.exe!016a2b74()
CINEMA 4D.exe!01bcd2d2()
CINEMA 4D.exe!01bd0012()
CINEMA 4D.exe!01509238()
CINEMA 4D.exe!0145a4de()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!016186e1()
CINEMA 4D.exe!016186e1()
CINEMA 4D.exe!01716a94()
CINEMA 4D.exe!016a17bb()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!016186e1()
CINEMA 4D.exe!016186e1()
CINEMA 4D.exe!01716a94()
CINEMA 4D.exe!01716a94()
CINEMA 4D.exe!016a2595()
CINEMA 4D.exe!017024ef()
CINEMA 4D.exe!01711f53()
CINEMA 4D.exe!01626739()
CINEMA 4D.exe!016975ce()
CINEMA 4D.exe!01b71a3c()
CINEMA 4D.exe!0161130f()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!0161132c()
CINEMA 4D.exe!016186e1()
CINEMA 4D.exe!01716b74()
CINEMA 4D.exe!01701696()
CINEMA 4D.exe!01711f53()
CINEMA 4D.exe!01626739()
CINEMA 4D.exe!016975ce()
CINEMA 4D.exe!01716b74()
CINEMA 4D.exe!0170e612()
CINEMA 4D.exe!01716f63()
CINEMA 4D.exe!0172088e()
CINEMA 4D.exe!0171a86d()
CINEMA 4D.exe!01b71a3c()
CINEMA 4D.exe!0171cd91()
CINEMA 4D.exe!0174e19c()
CINEMA 4D.exe!0174e19c()
user32.dll!75368e63()
user32.dll!75368e9f()
msctf.dll!74dc5123()
msctf.dll!74dc439e()
msctf.dll!74dc3ad3()
user32.dll!7537491f()
user32.dll!75374902()
user32.dll!753729d5()
user32.dll!753729b8()
user32.dll!75368112()
CINEMA 4D.exe!01b58efc()
CINEMA 4D.exe!0161a415()
CINEMA 4D.exe!01619581()
CINEMA 4D.exe!016975ce()
CINEMA 4D.exe!0169fbe9()
CINEMA 4D.exe!01701696()
CINEMA 4D.exe!01711f53()
CINEMA 4D.exe!01711f53()
CINEMA 4D.exe!01711f53()
CINEMA 4D.exe!01643962()
CINEMA 4D.exe!01619581()
CINEMA 4D.exe!016975ce()
CINEMA 4D.exe!01696d7a()
CINEMA 4D.exe!01619581()
CINEMA 4D.exe!016975ce()
CINEMA 4D.exe!016975ce()
KernelBase.dll!75195338()
> myplugin.cdl!BaseContainer::~BaseContainer() Zeile 41 C++
0039c634()
CINEMA 4D.exe!01bd59cd()
CINEMA 4D.exe!01ba3054()
CINEMA 4D.exe!01b1bd67()
CINEMA 4D.exe!00e60ef9()
CINEMA 4D.exe!01bc7dbf()
CINEMA 4D.exe!01707671()
CINEMA 4D.exe!0147ad67()
Code:
Bool RenderShader(BaseShader* shader, BaseBitmap* bmp, Real scale=1.0) {
InitRenderStruct irs;
if (shader->InitRender(irs) != INITRENDERRESULT_OK) return FALSE;
LONG w = bmp->GetBw();
LONG h = bmp->GetBh();
ChannelData cd;
for (LONG x=0; x < w; x++) {
for (LONG y=0; y < h; y++) {
cd.p.x = x * scale;
cd.p.y = y * scale;
cd.p.z = 0.0;
Vector pixel = shader->Sample(&cd);
LONG r = pixel.x * 255;
LONG g = pixel.y * 255;
LONG b = pixel.z * 255;
bmp->SetPixel(x, y, r, g, b);
}
}
shader->FreeRender();
return TRUE;
}
Any tips much appreciated. Thanks in advance!
-Niklas