Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Assigning specific key/values from Render Setup json

Assigning specific key/values from Render Setup json

craig_kane
Participant Participant
213 Views
0 Replies
Message 1 of 1

Assigning specific key/values from Render Setup json

craig_kane
Participant
Participant

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

 

0 Likes
214 Views
0 Replies
Replies (0)