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

    Set IRR settings

    General Talk
    2
    3
    722
    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
      InterfaceGuy
      last edited by

      Hello,

      in this thread it is explained how to set the size of the IRR.

      I would also like to set parameters like the resolution.

      When dragging the GUI element into the console it says:

      Sniper[c4d.IRR_DETAIL]
      

      and when I execute it without the ID I get

      >>> Sniper 
      <c4d.BaseList2D object called Sniper/Sniper with ID 430000000 at 4756143680>
      

      How can I get access to this inside a script?

      Thank you!

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

        Hello @interfaceguy,

        Thank you for reaching out to us. The 'sniper' thing is something which is called a scene hook. You can get hold of scene hooks via c4d.documents.BaseDocument, in this case the most relevant method is BaseDocument.FindSceneHook for you. Find a small example which puts all the pieces together at the end of my posting.

        Cheers,
        Ferdinand

        """Provides an example for getting hold of the Interactive Render Region (IRR) scene hook.
        
        Scene hooks are 'managing entities' that are attached to a document. The IRR has one that is called
        'sniper' because some engineer was feeling funny ;) Run this as a Script Manger script, and it will 
        set the active IRR to 50% detail rate.
        """
        
        
        import c4d
        
        doc: c4d.documents.BaseDocument  # The active document
        
        def main() -> None:
            """
            """
            # Get the scene hook for the IRR from the active document.
            sniperHook: c4d.BaseList2D = doc.FindSceneHook(430000000)
            if not isinstance(sniperHook, c4d.BaseList2D):
                raise RuntimeError("Could not access Interactive Render Region scene hook.")
            
            # Set the detail to 50% and push an update event to Cinema 4D.
            sniperHook[c4d.IRR_DETAIL] = 0.5
            c4d.EventAdd()
        
        if __name__ == '__main__':
            main()
        

        MAXON SDK Specialist
        developers.maxon.net

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

          Works like a charm, thank you!

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