Blit to MultipassBitmap GeClipMap not working

  • @r_gigante
    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.

  • Hi Daniel,

    I filed a bug report with regard to this unexpected behavior. I will keep you updated on resolution.

    Best, Riccardo

  • I was doing a search through the forum related to AutoBitmap and 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:

    • R20.011
    • R20.030
    • R20.059
    • R21.022
      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.

    Cheers, R

  • @r_gigante
    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.


  • @r_gigante

    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.

  • 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 GE_CM_DRAWMODE::BLEND by calling

    		// use a clipmap for drawing/blitting the bitmap
    		AutoAlloc<GeClipMap> bitmapClipmap;
    		if (!bitmapClipmap)
    		if (bitmapClipmap->Init(bitmap) != IMAGERESULT::OK)
    		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 GE_CM_BLIT::COPY works properly.

    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!

  • @r_gigante

    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"

    Without 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
    Cheers, R

  • @r_gigante
    While doing some code cleanup to add new features to a plugin, I noticed some comments regarding this particular topic. The comment mentioned the need for a workaround since the Blit() functionality on Windows was faulty.

    Problem with Blit() and MultipassBitmap still occurs after switching to Visual Studio 2017, Windows 10, running R20.059

Log in to reply