The value of 'porgress' during the use of RenderDocument() is greater than 1.0
-
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
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!
-
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