Announcement

Collapse
No announcement yet.

How to explore/edit a vr scene with nested procedurals ?

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

  • How to explore/edit a vr scene with nested procedurals ?

    Hi guys. I'm pretty new to the SDK, sorry in advance if this has been discussed already.
    Using python, I am looking at loading a main vrscene containing instances of VRayScene's, where each included scene can contain other scenes and so on. The main and the included scenes contain BitmapBuffer nodes, of which I am interested in getting the filenames and possibly change them before rendering.
    So, ideally, upon a scene load, I'd like to have a flattened representation of the entire scene, over which I could iterate all the bitmaps.
    All the VRayScene's have the preload_assets flag enabled, however I can't get the desired behaviour. After loading the main scene, only the bitmaps in the main scene itself get discovered by my script:

    Code:
    ...
    with vray.VRayRenderer() as renderer:
      renderer.renderMode = 'production'
      renderer.load(os.path.join(SCENE_PATH, 'main_scene.vrscene'))
      instances = renderer.classes.BitmapBuffer.getInstances()
      # instances will not include the bitmaps in the included vrscenes
    ...
    Is there a way to work around this behaviour ?

    Thankyou.
    Stefano Jannuzzo

  • #2
    Hi Stefano,

    Unfortunately, no, you cannot currently do that. VRayScene is treated as just a regular plugin by the plugin manipulation functions. May I suggest alternatives solutions? You can append vrscenes directly without going through VRayScene. There is also .appendFiltered() function which accepts a callback which allows you to reject some plugins and rename others if needed (it has its own weirdnesses but we'll talk about them later if needed).
    Other possible way is to load the sub-scene in another VRayRenderer instance and copy-and-modify what you need from there to the main renderer. Or modify and export to another vrscene file to load it later via VRayScene, etc.

    Best regards,
    Stan

    Comment


    • #3
      I see, thank you Stan.

      Comment

      Working...
      X