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

    Render to PV / Video Post plugin

    Cinema 4D SDK
    c++
    3
    12
    1.5k
    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.
    • P
      PluginStudent
      last edited by

      What is a "draw plugin"?

      A VideoPostData plugin is used to do two things: creating a video post (that does something with the rendered image), or implementing a render engine, that renders the scene.

      If you want Cinema to skip rendering the scene, you are creating a de-facto render engine.

      Calling RegisterVideoPostPlugin(), you can set PLUGINFLAG_VIDEOPOST_ISRENDERER to make that clear.

      You can call VolumeData::SkipRenderProcess() to tell Cinema not to render the scene; I'm not sure when the correct time is to call that. But you find some threads in this forum discussin that function.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by Manuel

        hi,

        sorry for the other thread, I'm trying to create an example and trying to do it the very right way.

        About your question, you could probably check this thread
        Let me know if that doesn't helped.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • WickedPW
          WickedP
          last edited by WickedP

          Thanks folks,

          PluginStudent - I missed the SkipRenderProcess() function, thanks for pointing that out, that takes care of one part πŸ‘

          Manuel - no probs on the other thread, I know you guys are busy 😊 I'm still trying to nut out how I want this to work. But I'm looking at the code in the thread you linked to, and I've got it running in a VP plugin (with higher render passes to see the changes). It looks like Cinema takes care of updating the PV window, is that correct? If so, what initiates this update e.g. colorBuf->SetLine(), a timer, or a core message?

          WP.

          wickedp.com

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hi,

            SetLine set the buffer (the bitmap) dirty.
            The Pictures viewer use the Timer function, after some other checks, if the bitmap is dirty, it update the GeUserArea with the new data.

            Cheer,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            WickedPW 1 Reply Last reply Reply Quote 0
            • WickedPW
              WickedP @Manuel
              last edited by

              @m_magalhaes Thanks, makes sense. Is this kind of dirty update inside all points that touch the pixel colours? E.g. does PixelPost also do this when setting col inside ExecutePixel()?

              Just out of interest, what's a reasonable refresh rate for a timer with something like this? 200-500ms?

              WP.

              wickedp.com

              1 Reply Last reply Reply Quote 0
              • ManuelM
                Manuel
                last edited by Manuel

                hi,

                well, the picture viewer is a bit more complexe than just this timer. But it is set to 500ms if it's the benchmark and 350ms for internal render. But it doesn't hurt to lower the delay.

                edit :
                about pixelPost i'm not sure what you are talking about, there's no function there, only pointer.

                Cheers,
                Manuel

                MAXON SDK Specialist

                MAXON Registered Developer

                WickedPW 1 Reply Last reply Reply Quote 0
                • WickedPW
                  WickedP @Manuel
                  last edited by

                  @m_magalhaes Sorry, I was a bit unclear on PixelPost, I need to stop working at night. I'll try this way - if I'm working at a pixel level, is SetLine() still the best way to do it?

                  Re timer, thanks for the thought. My dialog doesn't need to be realtime, 500 sounds like a good starting point.

                  WP

                  wickedp.com

                  1 Reply Last reply Reply Quote 0
                  • ManuelM
                    Manuel
                    last edited by

                    hi,

                    i didn't tried, but you can cast the vpBuffer to MultiPassBitmap it is written in the documentation here.

                    And as multiPassBitmap inherit from Bitmap, you can use SetPixel

                    And yes, SetPixel also Set the Bitmap Dirty πŸ™‚

                    Cheers,
                    Manuel

                    MAXON SDK Specialist

                    MAXON Registered Developer

                    1 Reply Last reply Reply Quote 0
                    • WickedPW
                      WickedP
                      last edited by

                      OK, I've managed to get the 'render' plugin going, I can see it drawing in the PV. A couple of followup queries:

                      • can I update the PV progress bar manually?

                      • how can I break the rendering in my custom threads when the 'stop rendering' button is pressed?

                      • am I suppose to use GetDDescription() to draw the options in the render settings dialog (mine isn't showing anything)?

                      WP.

                      wickedp.com

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        PluginStudent @WickedP
                        last edited by PluginStudent

                        @WickedP said in Render to PV / Video Post plugin:

                        • can I update the PV progress bar manually?

                        You can set render process settings using BASEBITMAP_DATA parameters: BaseBitmap Manual.

                        • am I suppose to use GetDDescription() to draw the options in the render settings dialog (mine isn't showing anything)?

                        You can use a standard parameter description resource as usual. You find a dozen examples in your installation or in the SDK examples.

                        WickedPW 1 Reply Last reply Reply Quote 1
                        • WickedPW
                          WickedP @PluginStudent
                          last edited by

                          @PluginStudent Thanks πŸ‘, progress bar sorted. For anyone reading, cast the vpBuffer into a Bitmap and use SetData().

                          Re GetDDescription(), I hard code my descriptions, but the function is never called. Any ideas?

                          WP.

                          wickedp.com

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