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

    Python Bug - RenderDocument results in black Image

    Scheduled Pinned Locked Moved Bugs
    5 Posts 0 Posters 1.0k Views
    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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 24/03/2011 at 06:56, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R12 
      Platform:     Mac  ;  
      Language(s) :

      ---------
      Hey guys,

      just started learning Python and stumbled on a problem what is apparently a bug. When I render the image with my script and show it in the picture viewer, the resulting image is just black.

      Here's the script I use:

      import c4d
      from c4d import bitmaps, documents
        
      doc = documents.GetActiveDocument()
      rd = doc.GetActiveRenderData().GetData()
        
      res_x = 512	# image resolution x
      res_y = 512	# image resolution y
      bitdepth = 8 # image depth
        
      bmp = bitmaps.BaseBitmap()
      bmp.Init(x=res_x, y=res_y, depth=bitdepth)
        
      documents.RenderDocument(doc, rd, bmp, c4d.RENDERFLAGS_EXTERNAL)
      bitmaps.ShowBitmap(bmp)
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 24/03/2011 at 10:23, xxxxxxxx wrote:

        Hi pelZ,

        The bit depth in your code is not correct.

        Cheers, Sebastian

        bitdepth = 24 # image depth
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 24/03/2011 at 11:56, xxxxxxxx wrote:

          Originally posted by xxxxxxxx

          Hi pelZ,

          The bit depth in your code is not correct.

          Cheers, Sebastian

          bitdepth = 24 # image depth
          

          Hi Sebastian,

          that fixes the problem. Thanks! 
          But why is it 24 (16 and 32 seem to work as well)?

          Ciao,
          Philipp

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 24/03/2011 at 16:59, xxxxxxxx wrote:

            16 bit works fine as well but the image has a lower quality.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 24/03/2011 at 22:38, xxxxxxxx wrote:

              When you render an Image "with 8 Bit" it is 8 Bit per Channel, not the overall bitdepth.

              There are 3 Channels. (RGB)
              3 * 8 = 24

              With Alpha, there are 4 Channels.
              4 * 8 = 32

              Higher Bitdepths per Channel:
              4 * 32 = 128

              Cheers, nux

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