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

    Knowing if C4D is actually rendering

    Cinema 4D SDK
    3
    3
    606
    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.
    • V
      victor
      last edited by

      In our Anima plugin we receive several calls to GetVirtualObjects and that's ok but we've found a issue, if I want to check if I'm in render right now I could use

      HierarchyHelp *hh;
      if (hh->GetBuildFlags() & A_INTERNAL_RENDERER || hh->GetBuildFlags() & A_EXTERNAL_RENDERER)
         rendering = true;
      

      The problems is that I receive the same flag if I press 'C' (make editable) in my object and we'll need a different behaviour for rendering and make editable.

      Is there any other tag I could check in the document or whatever?

      Thank you in advance for any tip.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        Hi @victor, sorry for the late reply, you can use CheckIsRunning, for this purpose.
        Here a code sample from a Python Generator.

        import c4d
        
        # main == GetVirtualObject
        def main():
            if c4d.CheckIsRunning(c4d.CHECKISRUNNING_EDITORRENDERING) or c4d.CheckIsRunning(c4d.CHECKISRUNNING_EXTERNALRENDERING):
                return c4d.BaseObject(c4d.Osphere)
            return c4d.BaseObject(c4d.Ocube)
        

        Another option that will be more consistent is to listen to MSG_MULTI_RENDERNOTIFICATION which is a message sent to all BaseList2D of a scene, before and at the end of the rendering.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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

          Hello @victor,

          without any further questions, we will consider this topic as solved by Monday and flag it accordingly.

          Thank you for your understanding,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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