Using python to load Render Settings (maya 2018 - Vray)

Hi all,

I’m quite new to python scripting. What i’m trying to do is set up some code to load default render settings and AOV’s. I can export the setting to a .json file and import them again using the Maya Render settings menu. However I want to automate this. I found this code but it’s giving me errors:

import maya.app.renderSetup.model.renderSetup as renderSetup
import json

def importRenderSetup(filename):
with open(filename, “r”) as file:
renderSetup.instance().decode(json.load(file), renderSetup.DECODE_AND_OVERWRITE, None)

def exportRenderSetup(filename, note = None):
with open(filename, “w+”) as file:
json.dump(renderSetup.instance().encode(note), fp=file, indent=2, sort_keys=True)

Error: TypeError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\maya\app\renderSetup\model\renderSetup.py line 740: Unknown keys found in the dictionary: vray

Does anybody have an idea on how to approach this?

All help is welcome :slight_smile: