Let's imagine that we want to create a one toe file, and then depending on the IP address of a given machine we want TouchDesigner to set up different configurations. On one machine we might have two projectors, another might have three, another still might be our control machine. How can we make this work? Well, in this case we can store all of that information in a data structure like a python dictionary (you might also use JSON, or XML, or any data structure that you like). Next we'll create a table based on our IP address, next we'll loop through that table and then create our operators. Once you get a feeling for how this works with a table, you'll quickly see how you could skip that step and just do this from the loop itself.
uri = {
"10.0.0.2" : {
"name" : "mission_control" ,
"role" : "controller" ,
"displays" : [
"control01"
]
},
"10.0.0.3" : {
"name" : "eyes" ,
"role" : "node" ,
"displays" : [
"projector01" ,
"projector02"
]
}
}
displays = {
"control01" : {
"width" : 1920 ,
"height" : 1080 ,
"orientation" : 0
},
"projector01" : {
"width" : 1920 ,
"height" : 1080 ,
"orientation" : 0
},
"projector02" : {
"width" : 1920 ,
"height" : 1080 ,
"orientation" : 1
}
}