Getting settings from VRay RenderData?



  • On 07/07/2014 at 01:48, xxxxxxxx wrote:

    Hello,

    I'm trying to get some infos on the active rendersettings - what's activated and what not. The problem with that is that those settings are in VrayBridge. If I pull anything from VrayBridge into the console then I get the code but cannot do anything with it.

    example: >    doc = documents.GetActiveDocument()

    rd = doc.GetActiveRenderData().GetData()
      print rd[c4d.VP_VRAYBRIDGE_SPLITON]

    just returns "None". Should return 0 or 1 (VrayBridge is the active renderer).

    Greetings!

    _Edit:
    If I hit Enter, then of course the console prints it out right:

    [OK] VrayBridge[c4d.VP_VRAYBRIDGE_SPLITON]
    0

    _



  • On 09/07/2014 at 03:24, xxxxxxxx wrote:

    Nobody? 😲



  • On 09/07/2014 at 13:15, xxxxxxxx wrote:

    It sounds as if you're getting confused between the render data and the Vray settings in the render settings dialog. You are looking for the value of the parameter VP_VRAYBRIDGE_SPLITON, but you won't find that in the render data class; you need to look at the base container of the videopost plugin that is the Vraybridge.

    To do this, you will first need to get the Vraybridge videopost. Get the active render data, then get the first videpost (RenderData.GetFirstVideoPost()). Use its GetType function to check if this is the Vray VP, and if it isn't then iterate through all other VPs (GeListNode.GetNext()) until you find it.

    When you do, get its base container(BaseList2D.GetDataInstance()) and then you can use that to get the value of VP_VRAYBRIDGE_SPLITON.



  • On 10/07/2014 at 01:24, xxxxxxxx wrote:

    Hi!
    Thank you for your post. Yes, I always thought VideoPost was not for the RenderEngine but for the PostEffects & MultiPass.

    doc = documents.GetActiveDocument()
      rd = doc.GetActiveRenderData()
      vp = rd.GetFirstVideoPost()
      if vp:
          print "PlugIn used: (ID)"
          print vp.GetType()
      else:
          print "Default RenderEngine used"

    works so far! :)

    Now comes the hard bit for me:

    bc = c4d.BaseContainer()
      bc.GetDataInstance()
    .................... but thats is creating a new container I fear.

    Think I'm a "little" stuck on basics... Is there any way of getting easy and fast input on these basics? Any book recommendation?



  • On 10/07/2014 at 01:36, xxxxxxxx wrote:

    It's not just the first VideoPost, it must be the one with the correct ID. Internally, VideoPosts can
    also be standalone renderers, like VRay.

    import c4d
      
    def find_vray_bridge(rd) :
        vp = rd.GetFirstVideoPost()
        while vp and vp.GetType() != 1019782:
            vp = vp.GetNext()
        return vp
      
    def main() :
        vp = find_vray_bridge(doc.GetActiveRenderData())
        if not vp:
            print "VRay not enabled"
            return
        print vp[c4d.VP_VRAYBRIDGE_DISP]
      
    main()
    

    Best,
    -Niklas



  • On 10/07/2014 at 01:54, xxxxxxxx wrote:

    hm okay just wanted to post that I've got it!:D But maybe not?

    I want to check the active rendersettings on some parameters.

    doc = documents.GetActiveDocument()
      rd = doc.GetActiveRenderData()
      vp = rd.GetFirstVideoPost()
      if vp == 1019782:
          print "PlugIn used: (ID)"
          print vp.GetType()
          vpvray = vp.GetDataInstance()
          print vpvray
          print vpvray[c4d.VP_VRAYBRIDGE_SPLITON]
          print vpvray[c4d.VP_VRAYBRIDGE_QMCSAMPLER_ADAPTTHR]
          print "-------------------------------------------------------------[End VRAY]-----------------"
      else:
          print "Warning ! Other RenderEngine then VRay is being used"

    I always got quite a few rendersettings and this is how I want to check some data before exporting & rendering.



  • On 10/07/2014 at 01:57, xxxxxxxx wrote:

    Well, it's almost alright what you do, but the first VideoPost does not necessarily be the Vray
    VideoPost. It could be some arbitrary other VideoPost, too. So you'll have to get the next VideoPost
    until you found the on with the right ID.

    And you get the ID with vp.GetType(), vp == 1019782 will always give you False.

    -Niklas


Log in to reply