Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    How to get the status of video post in python

    Cinema 4D SDK
    sdk python
    3
    4
    662
    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.
    • R
      render_exe
      last edited by

      hello there!

      I want to get the status of video post, open or close, but I don't know the way, can you help me? Thank you!
      5a79b340-725a-4231-a2de-f3c4c582aa1c-image.png

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by ferdinand

        Hello @render_exe,

        Thank you for reaching out to us. The user you have been replying to was a spam-bot. I have removed the posting of the bot as well as your answer to it.

        About your Question

        The activation state of a video post node is expressed by the bit c4d.BIT_VPDISABLED. Find below an example for reading and writing the state of all video post nodes in the active render data.

        Cheers,
        Ferdinand

        Result for running the script three times in a row on render settings which contain the 'Magic Bullet Looks' and 'Denoiser' video post effects.

        ----------------------------------------------------------------------------------------------------
        New state for video post 'Magic Bullet Looks' = False
        New state for video post 'Denoiser' = False
        ----------------------------------------------------------------------------------------------------
        New state for video post 'Magic Bullet Looks' = True
        New state for video post 'Denoiser' = True
        ----------------------------------------------------------------------------------------------------
        New state for video post 'Magic Bullet Looks' = False
        New state for video post 'Denoiser' = False
        

        Code:

        """Demonstrates how to toggle the activation state of a video post node in a render data instance.
        
        Must be run as a Script Manger script.
        """
        
        import c4d
        
        doc: c4d.documents.BaseDocument  # The active document
        
        def main() -> None:
            """Toggles the activation state of all video post nodes in the active render data.
            """
            print ("-"*100)
            # Get the active render data and iterate over its video post nodes.
            renderData: c4d.documents.RenderData = doc.GetActiveRenderData()
            videoPost: c4d.documents.BaseVideoPost = renderData.GetFirstVideoPost()
            while videoPost:
                # If a video post is enabled or not is expressed as the bit #BIT_VPDISABLED. Remove the bit
                # when it is set, add it when it is not.
                state: bool = videoPost.GetBit(c4d.BIT_VPDISABLED)
                videoPost.DelBit(c4d.BIT_VPDISABLED) if state else videoPost.SetBit(c4d.BIT_VPDISABLED)
                print (f"New state for video post '{videoPost.GetName()}' = {not state}")
                videoPost = videoPost.GetNext()
        
        if __name__ == '__main__':
            main()
        

        MAXON SDK Specialist
        developers.maxon.net

        R 1 Reply Last reply Reply Quote 0
        • R
          render_exe
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • R
            render_exe @ferdinand
            last edited by

            @ferdinand Thank you, the code runs well. └(^o^)┘

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