Blit to MultipassBitmap GeClipMap not working
I can confirm no problems exist on macOS, the output contains the blitted bitmap, as expected.
I thus assume the provided implementation is OK, and should work on Windows ... in theory.
Looking forward to you conclusion.
I filed a bug report with regard to this unexpected behavior. I will keep you updated on resolution.
I was doing a search through the forum related to
AutoBitmapand came along this topic.
What's the current status regarding R20.059, was it fixed in the latest update?
And what about R21?
Hi Daniel, thanks for following up.
Honestly, and I would say with huge surprise, I can't reproduce anymore the issue at this time. I've tried rerunning your code on:
and on none of these I was able to hit the break point on Windows 10.
Can you kindly check again and see if it's still the case on your side? I would really like to dive more and understand what's happened in the meantime.
I will try to check again, later today.
However, I noticed you mentioned -early in the thread- you could reproduce it with Visual Studio 2015.
Might it be the case you are currently using 2017 instead, and therefore don't encounter the issue anymore?
For R20 I am still developing with 2015 on my laptop (windows 8.1) and use another machine (windows 10) for R21 with Visual Studio 2017.
I will try to check on both development environments.
@C4DS I've used VS2015 as well to run the tests.
Tested on R20.057 with VS2015 on Windows 8.1 -> still get the exception, and no output
Tested on R21.026 with VS2017 on Windows 10 -> same exception, and no output.
r_gigante last edited by r_gigante
Hi Daniel, I should strongly apologize here because due to an overlook of mine I forget to copy the test bitmap in the resource folder resulting in the code not to be executed and the breakpoint not to be hit.
Sorry about that.
I've looked more in detail and in order to get it done you have to actually set the draw mode to
// use a clipmap for drawing/blitting the bitmap AutoAlloc<GeClipMap> bitmapClipmap; if (!bitmapClipmap) return; if (bitmapClipmap->Init(bitmap) != IMAGERESULT::OK) return; clipmap->SetDrawMode(GE_CM_DRAWMODE::BLEND, GE_CM_SRC_MAX_OPACITY); clipmap->Blit(0, 0, *bitmapClipmap, 0, 0, bitmapClipmap->GetBw() - 1, bitmapClipmap->GetBh() - 1, GE_CM_BLIT::COPY);
This will ensure that upon calling the GE_CM_BLIT::COPY the GeClipMap->Blit() function using
Unfortunately this doesn't completely solve the issue, because it seems that initing a GeClipMap with a MultipassBitmap created via AddLayer has some issue I still need to investigate.
I'll get back on Monday, hopefully, with more details.
Again sorry for the confusion and have a nice weekend!
Without the line
I could continue after the "Cinema 4D has triggered a breakpoint" messagebox, now with that extra line I get a plain access violation. (tried on R20 with VS2015)
Exactly, that's what I meant by
initing a GeClipMap with a MultipassBitmap created via AddLayer has some issue"
clipmap->SetDrawMode(GE_CM_DRAWMODE::BLEND, GE_CM_SRC_MAX_OPACITY);you hit a default case in a switch statement which fires a critical stop whilst using it you actually try to blit to the GeClipMap but now you end up in a memory issue.
I'll get back to you later next week