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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Switch render engine to Redshift (In memory)

    Cinema 4D SDK
    python
    3
    4
    495
    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.
    • J
      jwzegelaar
      last edited by

      Hi Guys,

      I prepared a scene in memory and like to render this now with Redshift. To do this I need to switch from the standard render engine to Redshift.

      A simple:

      rd = doc.GetActiveRenderData()
      rdata[c4d.RDATA_RENDERENGINE] = 1036219
      c4d.EventAdd()
      

      Is not working and it will just use the Standard render engine, I think because I need to set the VideoPost.

      I can get this by using:

      def GetRedshift(rd):
          rs = rd.GetFirstVideoPost()
          while rs and rs.GetType() != 1036219:       
              rs = rs.GetNext()
          return rs
      

      And trying to set it with InsertVideoPost but no luck. Maybe I'm completely on the wrong path.

      Can anybody help me do this.

      Thank you!😊

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi you need to insert the video post as shown in the C++ manual - Redshift Renderer - Set Render Engine to Redshift, adapting it to Python should be pretty straightforward.

        Have a nice weekend.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • J
          jwzegelaar
          last edited by

          Thank you Maxime!

          This was the part I needed, i was looking in the right direction. 🙂

          redshiftVideoPost = c4d.documents.BaseVideoPost(PID_REDSHIFT_RENDER_ENGINE)
                      print("RedshiftVideoPost: ", redshiftVideoPost)
                      # Insert the Redshift video post plugin.
                      rdata.InsertVideoPost(redshiftVideoPost)
          

          Have a great weekend!

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

            Hi @everyone,

            just as an FYI, the example is slightly outdated. With 2023.0.0 or newer, there is no need to manually define a symbol for the Redshift renderer, as one can use the newly exposed VPrsrenderer symbol (c4d.VPrsrenderer in Python).

            I have updated the C++ example.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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