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

    Update Picture Viewer from Videopost

    SDK Help
    0
    2
    271
    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
      Helper
      last edited by

      On 08/04/2016 at 03:08, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R14-R17 
      Platform:      
      Language(s) :

      ---------
      Hi! Is it possible to update the Picture Viewer while rendering? I'm rendering into a VPBuffer from a
      VideoPost plugin. Currently it only updates the Picture Viewer when it goes on to the next frame or
      when I force it to by dragging along the timeline or dragging the picture around.

      Thanks in advance!
      Niklas

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

        On 11/04/2016 at 02:12, xxxxxxxx wrote:

        Hello,

        changes to the VPBuffer should be visible in the Picture Viewer window. This example updates just fine while "rendering". But it seems the Picture Viewer only updates a few times per second.

          
        VPBuffer* colorBuf = vps->render->GetBuffer(VPBUFFER_RGBA, NOTOK);  
          
        Int32 const xres = colorBuf->GetInfo(VPGETINFO_XRESOLUTION);  
        Int32 const yres = colorBuf->GetInfo(VPGETINFO_YRESOLUTION);  
          
        Random rnd;  
          
        for (Int32 y = 0; y < yres; ++y)  
        {  
          for (Int32 x = 0; x < xres; ++x)  
          {  
          this->SetPixelBuffer(x, y, Vector(rnd.Get01(), rnd.Get01(), rnd.Get01()), colorBuf);  
           
          if (vps->thread->TestBreak())  
            return RENDERRESULT_USERBREAK;  
          }  
          
          GeSleep(20);  
        }  
        

        The SetPixelBuffer () utility function simply sets the given VPBuffer using GetLine()/SetLine(). Do you do something different?

        Best wishes,
        Sebastian

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