Update Render Engine [SOLVED]

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?

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)

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.

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

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

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.

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

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()

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

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

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