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

    Enables or disables all Emission in the scene

    Cinema 4D SDK
    python 2025 windows
    2
    3
    424
    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.
    • I
      itstanthony
      last edited by

      Hi everyone,

      I’m looking for a way to globally enable or disable all emission in a Cinema 4D scene using Redshift — ideally without having to iterate through each material. I’d like to control this via Python.

      Is there a way to access the global emission toggle through Redshift’s render overrides? (C4D+RS latest versions)

      Any pointers would be much appreciated

      Thanks in advance!

      2025-04-16 14_50_46-Cinema 4D 2025.2.0 - [Untitled 1 _] - Main.png

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

        Hello @itstanthony,

        Thank you for reaching out to us. Please have a look at Access renderer specific settings with python for the details of how and why. The ID you are looking for is REDSHIFT_RENDERER_EMISSION_ENABLE.

        Cheers,
        Ferdinand

        """Demonstrates how to access Redshift render engine render settings attached
        to render data.
        """
        
        import c4d
        
        def main():
            """Entry point.
            """
            # doc in predefined in script manger scripts, so this would not be 
            # necessary, but since you did call GetActiveDocument() I copied this
            # here.
            doc = c4d.documents.GetActiveDocument()
            if not isinstance(doc, c4d.documents.BaseDocument):
                raise RuntimeError("Could not access active document.")
        
            renderData = doc.GetActiveRenderData()
        
            # The elements in the render settings are video post plugins. Some of
            # the common entries, e.g., Output/Save are mapped automatically to the
            # render data, for everything that is optional, we must access the 
            # corresponding BaseVideoPost. Your idea with FindPlugin was not bad, but
            # that will only give you the BasePlugin and not the actual video post
            # instance associated with the concrete render data instance.
        
            # We could also get the Redshift id like you did with RDATA_RENDERENGINE,
            # but this assumes that the Redshift is indeed the active render engine.
            # So, for me it is a bit more comfy to hard-code it.
            redshiftRenderEngineId = 1036219
        
            # Iterate over the video post to find one matching the render engine.
            videoPost = renderData.GetFirstVideoPost()
            while (videoPost):
                if videoPost.CheckType(redshiftRenderEngineId):
                    break
                videoPost = videoPost.GetNext()
        
            if not isinstance(videoPost, c4d.documents.BaseVideoPost):
                raise RuntimeError(
                    f"Could not access video post for '{redshiftRenderEngineId = }'")
             
            # Disable the emisssion in Globals/Other Overrides
            videoPost[c4d.REDSHIFT_RENDERER_EMISSION_ENABLE] = False
        
            c4d.EventAdd()
        
        
        if __name__ == '__main__':
            main()
        

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • I
          itstanthony
          last edited by itstanthony

          Hi Ferdinand,

          Thanks a lot for the clear explanation and for taking the time to share the code. The part about accessing BaseVideoPost and using REDSHIFT_RENDERER_EMISSION_ENABLE was spot on. Exactly what I needed. Works perfectly!

          Really appreciate it.

          Anthony

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