Announcement

Collapse
No announcement yet.

(Resolved) AppSDK: Append VRScene file using namespace

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

  • (Resolved) AppSDK: Append VRScene file using namespace

    Hi,

    Is it possible to add a namespace to the content of vrscene files loaded with vray.VRayRenderer.append("file").
    We are running into issues with duplicate node names.

    Best,
    Jacob
    Jacob Børsting
    Head of Pipeline @ Ghost VFX

  • #2
    Use .appendFiltered(): https://docs.chaosgroup.com/vray_app...appendFiltered
    V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
    andrei.izrantcev@chaos.com
    Support Request

    Comment


    • #3
      So how would I use this function if I want to add a namespace to all nodes in a vrscene file?
      Jacob Børsting
      Head of Pipeline @ Ghost VFX

      Comment


      • #4
        Code:
        import vray
        
        def onFilterPlugin(r, className, pluginName):
          print(className, pluginName)
          if className == 'Node': # is it a Node?
            return 'namespace' + pluginName #create the plugin with a different name
          return False # skip other plugins (or return True if you don't want to skip or rename)
        
        with vray.VRayRenderer() as renderer:
          renderer.appendFiltered('file.vrscene', onFilterPlugin)
        
          # print the names of the plugins held in the renderer
          i = 0
          for plugin in renderer.plugins:
            i += 1
            print(str(i) + '. ' + plugin.getName())
        Last edited by stanislav.kirilov; 06-10-2020, 02:33 AM.

        Comment


        • #5
          Thanks.
          It works great.
          Jacob Børsting
          Head of Pipeline @ Ghost VFX

          Comment

          Working...
          X