(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

Use .appendFiltered(): https://docs.chaosgroup.com/vray_app…appendFiltered

So how would I use this function if I want to add a namespace to all nodes in a vrscene file?

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

Thanks.
It works great.