Assigning specific key/values from Render Setup json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm a little unfamiliar with assigning a volume of data from a .json file onto attributes inside Maya manually and was hoping someone could provide some guidance.
Up to now I have been using Maya's recommended import render setup function, which brings in everything. But what I would like to do is take one category of settings (say defaultRenderNodes) and loop through the entire list and assign those settings. So far I have:
render_settings_path = "path to json"
with open(render_settings_path) as json_file:
data = json.load(json_file)
defaultRenderNodesData = (data['sceneSettings']['redshift']['defaultRendererNodes'])
#get key names full
defaultRenderNodesKeys = defaultRenderNodesData.keys()
defaultRenderNodesValues = defaultRenderNodesData.values()
This gives me a list of key/value pairs, as well as keys and values separately.
My question is, how can I now take the data inside the defaultRenderNodesData variable and assign them en masse to the render settings using a loop?
I understand it's more of a python question than Maya related but any hep would be greatly appreciated
Thank you
Craig