Announcement

Collapse
No announcement yet.

Control render settings of VRay 6 using Python

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Control render settings of VRay 6 using Python

    Hello! I am trying to control the render settings of VRay using a python script (as a tag on an object) and here is what I am doing :

    Code:
    import c4d
    from c4d import gui
    
    def main():
        obj = op.GetObject()
        rd = doc.GetActiveRenderData()
        min_subdivision = obj[c4d.ID_USERDATA,1]
        rd[c4d.SETTINGSIMAGESAMPLER_DMC_MINSUBDIVS] = min_subdivision
    main()​
    But it is not working for me. How can I make it work please? I am not familiar with coding so I am still trying to figure things out. Thanks!

  • #2
    I actually figured it out. This post helped > https://plugincafe.maxon.net/topic/1...-with-python/2

    My code is now :

    Code:
    import c4d
    from c4d import gui
    
    def main():
    
        doc = c4d.documents.GetActiveDocument()
        obj = op.GetObject()
        rd = doc.GetActiveRenderData()
        VRayID = 1053272
        vidpost = rd.GetFirstVideoPost()
    
        min_subdiv = obj[c4d.ID_USERDATA,46]
    
        vidpost[c4d.SETTINGSIMAGESAMPLER_DMC_MINSUBDIVS] = min_subdiv
    
    
        c4d.EventAdd()
    main()​

    Comment


    • #3
      Hello fazil_aboura,

      I am glad to hear that you managed to find an answer to your query. Should you have any further queries, please don't hesitate to let us know. Thanks.
      Aleksandar Kasabov
      chaos.com

      Comment

      Working...
      X