Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Shader crashes when quitting with unfinished IRR

    Cinema 4D SDK
    c++
    2
    3
    538
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rui_mac
      last edited by

      I coded a shader and it is working fine.
      However, when I have IRR on and I quit Cinema4D before the IRR finishes rendering, I get a crash. If the IRR finishes and I quit, everything works fine.
      What could it be?

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @rui_mac
        last edited by ferdinand

        Hey @rui_mac,

        Thank you for reaching out to us. Without your code we can just guess.

        1. This is likely an access violation, i.e., your plugin somehow causes your machine trying to access already deleted memory.
        2. The first thing I would do, is check if this is indeed caused by your plugin. Simply replace your shader with a builtin shader in a scene which crashes and see if it also crashes.
        3. Given your recent questions this probably has something to do with ShaderData::InitRender and ::FreeRender and the fact that you are poking around in the ray objects.
        4. The major distinguishing factor between an IRR and a Picture Viewer render is that the latter does clone the document while the former does not. I would check if your plugin also crashes for 'normal' viewport renders (also do not clone the document). On its own this does not make a difference, but when you have bad code, like for example a shader that tries to modify its document, or code that assumes that the shader always lives in the active document, this can lead to crashes (always use BaseList2D::GetDocument() to access the document of a node).
        5. Finally, for anything substantial, you should submit a crash report when Cinema 4D asks you to do so, make your code available to us, and submit a bug report. Please follow the guidelines given here for bug reports.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • R
          rui_mac
          last edited by

          It seems not to crash now. I made sure I freed all the bitmaps and flushed all containers.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post