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

    Change RenderData and Update SafeFrame

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 280 Views
    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 Offline
      Helper
      last edited by

      On 13/02/2017 at 08:30, xxxxxxxx wrote:

      Hey guys,

      Id like to change the output size of renderData with custom controller. The output fields and the visual safeframe are well influenced by that change, but doc.GetBaseDraw(0).GetSafeFrame() doesnt return updated values. What do I have to do to fix it?

      import c4d  
      #Welcome to the world of Python  
      prev_data = 0  
        
      def main() :  
        global prev_data  
        obj = op.GetObject()  
        if prev_data != obj[c4d.ID_USERDATA,1]:  
            rd = c4d.documents.GetActiveDocument().GetActiveRenderData()  
            rd[c4d.RDATA_XRES] = rd[c4d.RDATA_XRES_VIRTUAL] = prev_data = obj[c4d.ID_USERDATA,1]          
              
            #rd.Message(c4d.MSG_CHANGE)  
            #rd.Message(c4d.MSG_BASECONTAINER)  
            #c4d.EventAdd()  
              
            bd = doc.GetBaseDraw(0)  
            print bd.GetSafeFrame()
      

      Thx and greetings
      rownn

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

        On 13/02/2017 at 09:31, xxxxxxxx wrote:

        Ah ok, I got it. GetSafeFrame() is calculated from the aspect, so Ive to set rd[c4d.RDATA_FILMASPECT], too.

        obj = op.GetObject()  
          rd = c4d.documents.GetActiveDocument().GetActiveRenderData()  
          rd[c4d.RDATA_XRES] = rd[c4d.RDATA_XRES_VIRTUAL] = prev_data = obj[c4d.ID_USERDATA,1]  
            
          rd[c4d.RDATA_FILMASPECT] = rd[c4d.RDATA_XRES]/rd[c4d.RDATA_YRES]  
            
          bd = doc.GetBaseDraw(0)  
          print bd.GetSafeFrame()
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post