Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    The value of 'porgress' during the use of RenderDocument() is greater than 1.0

    Cinema 4D SDK
    2025 python
    2
    2
    26
    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.
    • chuanzhenC
      chuanzhen
      last edited by chuanzhen

      Hi,
      I used the example code from c4d.documents.RendeDocument() in the document, which indicates that the values returned by progress are between 0-1.0. However, in my actual use, there may be some values greater than 1.0
      74fdd49f-2802-45eb-9756-b8e5fb46be7f-image.png

      This is my code, using Viewport Render with a frame range of 1001-1100

      """
      Copyright: MAXON Computer GmbH
      Author: Maxime Adam
      
      Description:
          - Render the current document with a progress hook to get notified about the current rendering progress.
      
      Class/method highlighted:
          - c4d.bitmaps.MultipassBitmap
          - c4d.documents.RenderDocument()
      
      """
      import c4d
      
      
      
      def PythonCallBack(progress, progress_type):
          """Function passed in RenderDocument. It will be called automatically by Cinema 4D with the current render progress.
      
          Args:
              progress (float): The percent of the progress for the current step
              progress_type (c4d.RENDERPROGRESSTYPE): The Main part of the current rendering step
          """
          print(progress)
      
      
      def main():
          # Retrieves the current active render settings
          rd = doc.GetActiveRenderData()
      
          # Creates a Multi Pass Bitmaps that will store the render result
          bmp = c4d.bitmaps.MultipassBitmap(int(rd[c4d.RDATA_XRES]), int(rd[c4d.RDATA_YRES]), c4d.COLORMODE_RGB)
          if bmp is None:
              raise RuntimeError("Failed to create the bitmap.")
      
          # Adds an alpha channel
          bmp.AddChannel(True, True)
      
      
      
          # Renders the document
          if c4d.documents.RenderDocument(doc, rd.GetDataInstance(), bmp,c4d.RENDERFLAGS_EXTERNAL, prog=PythonCallBack,
                                          wprog=None) != c4d.RENDERRESULT_OK:
              raise RuntimeError("Failed to render the temporary document.")
      
          # Displays the render in the Picture Viewer
          #c4d.bitmaps.ShowBitmap(bmp)
      
      
      if __name__ == "__main__":
          main()
      

      Thanks for any help!

      相信我,可以的!

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

        Hey @chuanzhen,

        Thank you for reaching out to us. I will have a look at this problem, at the latest by the end of next week (31/10). We are aware that RendeDocument keeps regressing, because there are a lot of render technology changes happening behind the scenes in the Cinema in the last releases.

        Hopefully, this is just a smaller bug, or a user error. But this could also be a more complicated thing. I will let you know at the latest by the end of next week.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

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