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

    IRR coordinates [SOLVED]

    PYTHON Development
    0
    9
    1.1k
    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.
    • H
      Helper
      last edited by

      On 04/07/2016 at 17:40, xxxxxxxx wrote:

      How can I set, through programming, the corners of the Interactive Render Region?
      Thank you very much in advance for any reply.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 04/07/2016 at 20:53, xxxxxxxx wrote:

        Perhaps these?

        RDATA_RENDERREGION
        RDATA_RENDERREGION_LEFT
        RDATA_RENDERREGION_TOP
        RDATA_RENDERREGION_RIGHT
        RDATA_RENDERREGION_BOTTOM

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 04/07/2016 at 23:37, xxxxxxxx wrote:

          I found those. But aren't those for the final render?
          I mean in the editor screen. Where are those stored?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 05/07/2016 at 01:54, xxxxxxxx wrote:

            Hello,

            the size of the interactive Render Region is stored in the active BaseView. This is internal data and might not be save to be edited by third parties.

            See "Get size of the IRR?"

            best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 05/07/2016 at 02:38, xxxxxxxx wrote:

              Hello Sebastian.

              I did found that thread. However, it is for reading.
              How can I write to that internal data structure?

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 05/07/2016 at 08:58, xxxxxxxx wrote:

                Hello,

                as you can see in the linked thread the information is stored in a subcontainer. You can edit this subcontainer and write it back into the given data instance. Calling c4d.EventAdd() can then be used to inform Cinema that something changed.

                Best wishes,
                Sebastian

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 05/07/2016 at 09:10, xxxxxxxx wrote:

                  What are the IDs of the parameters, so that I can store new values there?

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 05/07/2016 at 09:29, xxxxxxxx wrote:

                    Give this a try Rui.

                    import c4d  
                    def main() :  
                        
                      #Get the Editor window  
                      bd = doc.GetActiveBaseDraw()  
                      if bd is None: return  
                      
                      #Get it's size in pixels  
                      size = bd.GetFrame()  
                      #print(size)  
                      
                      #Get it's container(the master container)  
                      bc = bd.GetDataInstance()  
                      if bc is None: return  
                      
                      #Get the subcontainer entry that holds the IRR  
                      subcontainer = bc.GetContainer(430000020)   
                      
                      #Change the left corner positions of the IRR  
                      subcontainer.SetReal(0, 0.0)  
                      subcontainer.SetReal(1, 0.0)  
                        
                      #Update the master container to use the changed subcontainer values  
                      bc.SetContainer(430000020, subcontainer)  
                       
                      #Print the IRR's 4 corner positions  
                      for i in subcontainer:  
                          print(i)  
                      
                      c4d.EventAdd()  
                      
                    if __name__=='__main__':  
                      main()
                    

                    -ScottA

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 05/07/2016 at 14:27, xxxxxxxx wrote:

                      Thank you very much, Scott. It works perfectly 🙂

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