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

    Rendering in Picture Viewer

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 615 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 02/08/2012 at 13:16, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R13 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Hi, I have a question about C++ plugins: are there any possibility to know if rendering in Picture Viewer is done?

      I have achieved it with a VideoPost plugin Execute and VIDEOPOSTCALL_FRAMESEQUENCE, which i found here, but it seams that the message is sent after the last frame is rendered, but before saving it to the disk. So if the frame is very big - Picture Viewer is still doing something (in this case - writing an image to the disk) and I've already received VIDEOPOSTCALL_FRAMESEQUENCE message.

      Are there any way to know if the rendering is totally finished? (rendering + saving to disk + whatever Picture Viewer is doing after rendering)

      Thank you for all the answers in advance 🙂

      P.S.: Sorry if my question is totally stupid 😠 - I'm building my first plugin in C4D 😄

      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 03/08/2012 at 01:23, xxxxxxxx wrote:

        You must check for the value of VideoPostStruct::open member. It's FALSE for closing calls and TRUE for opening calls.

        Example:

        RENDERRESULT MyVideoPost::Execute(BaseVideoPost *node, VideoPostStruct *vps)
        {
        	if (vps->vp==VIDEOPOSTCALL_FRAMESEQUENCE && !vps->open && *vps->error==RENDERRESULT_OK && !vps->thread->TestBreak())
        	{
        ...
        

        cheers,
        Matthias

        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 03/08/2012 at 03:48, xxxxxxxx wrote:

          Thank you, Matthias, but I'm checking open member already:

          RENDERRESULT MyVideoPost::Execute(BaseVideoPost *node, VideoPostStruct *vps)
          {
              if(vps->vp != VIDEOPOSTCALL_FRAMESEQUENCE)
              {
                  return RENDERRESULT_OK;
              }
              if(vps->open)
              {
                  return RENDERRESULT_OK;
              }
              else
              {
                  if(vps->renderflags & RENDERFLAGS_EXTERNAL)
                  {
                      // Rendering in picture viewer is done.
                      // Send message.
                      SpecialEventAdd(MYVIDEOPOST_ID);
                  }
              }
              return RENDERRESULT_OK;
          }

          I expect SpecialEventAdd(MYVIDEOPOST_ID) call only when picture viewer is finished, but it is not.

          If in the other place, when I get CoreMessage with MYVIDEOPOST_ID, I call CallCommand(12099) to start rendering again - Picture Viewer  asks if I need to stop previous rendering... So, as I understand, I can not identify if rendering is done this way.

          Thanks,
          Simonas

          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 03/08/2012 at 04:45, xxxxxxxx wrote:

            You need to check for  VIDEOPOSTCALL_FRAMESEQUENCE AND !vps- >open if rendering is finished.
             Please have a look again at my example, it's checking if rendering is finished.

            cheers,
            Matthias

            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 03/08/2012 at 11:59, xxxxxxxx wrote:

              Sorry Matthias that I'm still struggling and wasting your time 😊 I know my code posted above may look awkward 😄 but it works almost the same way you suggested.

              Any way - I have rewritten it as you suggested, but the problem does not disappear.

              RENDERRESULT MyVideoPost::Execute(BaseVideoPost *node, VideoPostStruct *vps)
              {
                  if(vps->vp==VIDEOPOSTCALL_FRAMESEQUENCE && !vps->open && *vps->error==RENDERRESULT_OK && !vps->thread->TestBreak())
                  {
                      // Rendering in picture viewer is done.
                      // Send message.
                      SpecialEventAdd(RENDERMASTER_VIDEOPOST_ID);
                  }
                  return RENDERRESULT_OK;
              }

              Thanks,
              Simonas

              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 09/08/2012 at 07:31, xxxxxxxx wrote:

                Hi Simonas,

                Here's more information I got from the developers:

                If you are in VideoPost::Execute() the render process is still ongoing (even if it is shortly before exiting), so stopping it will ask if the current render shall be stopped.
                If you set RDATA_FINISHMESSAGE in the render settings to TRUE, then you'll get a message EVMSG_RAYTRACER_FINISHED at a much later time, however even then the render thread needs a couple more milliseconds to exit.

                The only reliable way is to set a (global) finished flag either in VideoPost::Execute() or EVMSG_RAYTRACER_FINISHED (better) and then periodically check (using a timer in a message plugin) if the rendering is done (calling CheckIsRunning()). It also would be possible to just surveil CheckIsRunning() in a message plugin.

                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 11/08/2012 at 08:36, xxxxxxxx wrote:

                  Super duper - it works! 😄

                  Thanks Yannick - you saved my life !Handshake[URL-REMOVED]


                  [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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