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

    Update Render Engine [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    9 Posts 0 Posters 701 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 15/07/2015 at 10:32, xxxxxxxx wrote:

      After changing the render engine to hardware via:

      RenderData_<_gs_<_gs_>_gs> = doc_/gs>GetFirstRenderData_rk">()
      _>RenderData__SOFTWARE_mark">[c4d.RDATA_RENDERENGINE] = 300001061
      

      The _R_SOFTWARE_mark">renderer is changed, but the Videopost elements stay the same and do not update. How do I notify cinema to update the VideoPost?

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

        On 15/07/2015 at 12:18, xxxxxxxx wrote:

        maybe adding after only c4d.EventAdd() or both   _doc.Message(c4d.MSG_CHANGE)   _and  _c4d.EventAdd()

        _ If do not open render dialog, use __ doc.Message(c4d.MSG_CHANGE) - open it and c4d refresh it(something like it)

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

          On 15/07/2015 at 12:46, xxxxxxxx wrote:

          Thanks for the input Ilya, I tried that initially, but it still did not work.

          Here's what I just figured out:

          RenderID_<_gs_>_ = 300001061 #Hardware Renderer
            
          RenderD_<_gs_>_gs> = doc_.GetActiveRenderData_k">() # Get the currently used Render Data
          _rData_ARE_mark">[c4d.RDATA_RENDERENGINE] = RenderID # Change the Renderer
            
          Render_VP = c4d.BaseList2D_ER_SOFTWARE_mark">(_OFTWARE_mark">RenderID) # Add the renderer as VideoPost
              
          _SOFTWARE_mark">RenderData.InsertVideoPost(Render_VP) # Insert the VideoPost
            
          c4d.EventAdd() # global Update
          

          I'm not sure if this is the correct way to achieve this being you can accidentally double up your renderer by adding it multiple times.

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

            On 15/07/2015 at 13:04, xxxxxxxx wrote:

            strange
            I test at winOS and 16.050 - all works for me

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

              On 15/07/2015 at 13:48, xxxxxxxx wrote:

              Took another look, it works as you said through a script, however, it doesn't seem to work in a plugin.  Doc. Message (c4d.MSG_CHANGE) returns as True, but does not seem to do anything.

              I am also adding a new RenderData () is that could be what's causing it.

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

                On 15/07/2015 at 13:56, xxxxxxxx wrote:

                Here is the actual code that isn't working: Even in the script editor.

                import_<_gs_>_ c4d
                f_<_gs_>_gs> c4d import _i
                _from c4d_mark">.d_<_gs_>_nts import GetActiveDocument, RenderData
                #Add _k">renderData
                  
                  
                TEST_RD = RenderData_SOFTWARE_mark">()
                                
                _OFTWARE_mark">print TEST_RD.SetName('TEST _GER_SOFTWARE_mark">playblast')
                  
                TEST_RD[c4d.RDATA_RENDERENGINE] = 300001061
                  
                doc.InsertRenderData(TEST_RD)
                  
                doc.SetActiveRenderData(TEST_RD)
                  
                doc.Message(c4d.MSG_CHANGE)
                  
                c4d.EventAdd_c71bcd-3296-4e5f-81f9-c60ea205c2ee" ="GINGER_SOFTWARE_mark">()
                  
                Hardware_VP = TEST_RD_"44dd0a84-33e0-49eb-8c4b-0fa249f6da41" ="GINGER_SOFTWARE_mark">.GetFirstVideoPost_id="44dd0a84-33e0-49eb-8c4b-0fa249f6da41" ="GINGER_SOFTWARE_mark">()
                Hardware_VP_eguid="43a4ef36-bf24-41ae-a36c-13a9a5786863" ="GINGER_SOFTWARE_mark">[c4d.VP_PREVIEWHARDWARE_ANTIALIASING] = 16
                  
                TEST_RD_raseguid="f47692a8-d053-46e1-9115-6d023fcf618d" ="GINGER_SOFTWARE_mark">[c4d.RDATA_FRAMESEQUENCE] = 3
                
                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 15/07/2015 at 21:42, xxxxxxxx wrote:

                  From Niklas's great tip

                  I test without opened render dialog, i don't how to update custom gui if it will be open. If even it will open, user click at name of preset, it will be renew

                  (i feel that needs to cut script from unused segments)

                  import c4d  
                  from c4d import gui  
                  from c4d.documents import GetActiveDocument, RenderData  
                  #Add renderData  
                    
                  doc = GetActiveDocument()  
                    
                  TEST_RD = RenderData()  
                                  
                  TEST_RD.SetName('TEST playblast')  
                    
                  TEST_RD.Message(c4d.MSG_UPDATE)  
                    
                  doc.InsertRenderData(TEST_RD)  
                    
                  doc.SetActiveRenderData(TEST_RD)  
                    
                  doc.Message(c4d.MSG_CHANGE)  
                  c4d.EventAdd()  
                    
                  if TEST_RD.IsAlive() :  
                    print TEST_RD.GetName()  
                    if TEST_RD[c4d.RDATA_RENDERENGINE] is not 300001061:  
                        TEST_RD[c4d.RDATA_RENDERENGINE] = 300001061  
                        doc.Message(c4d.MSG_CHANGE)  
                        c4d.EventAdd()  
                        Hardware_VP = TEST_RD.GetFirstVideoPost()  
                        if not Hardware_VP:  
                            vpost = c4d.BaseList2D(300001061)  
                            TEST_RD.InsertVideoPost(vpost)  
                            if vpost:  
                                vpost[c4d.VP_PREVIEWHARDWARE_ANTIALIASING] = 16  
                                TEST_RD[c4d.RDATA_FRAMESEQUENCE] = 3  
                                doc.Message(c4d.MSG_CHANGE)  
                                c4d.EventAdd()
                  
                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    On 16/07/2015 at 05:05, xxxxxxxx wrote:

                    Hello,

                    as show by Ilya, changing the renderer parameter won't automatically create the needed video post. So you have to insert the needed hardware video post yourself. The code could look like this:

                      
                    TEST_RD = c4d.documents.RenderData()             
                      
                    # edit  
                    TEST_RD.SetName('TEST playblast')  
                    TEST_RD[c4d.RDATA_RENDERENGINE] = 300001061  
                      
                    # add vp  
                    vpost = c4d.BaseList2D(300001061)  
                    TEST_RD.InsertVideoPost(vpost)  
                        
                    doc.InsertRenderData(TEST_RD)  
                    doc.SetActiveRenderData(TEST_RD)  
                      
                    c4d.EventAdd()  
                    

                    Only the video post can filter the parameter groups of the render settings. See VideoPostData::RenderEngineCheck().

                    Best wishes,
                    Sebastian

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

                      On 16/07/2015 at 06:27, xxxxxxxx wrote:

                      Thanks for the help guys! Everything seems to work fine now.

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