Hi Jeff,
Thanks, yes the scene is dark when I turn off the models' visibility. I figured out that it was indeed an issue with the textures. Here are some code snippets (note that I changed the names of the corridors to 't_node_'):
Code:
#load the corridor models
models['t_node_l0r0'] = viz.add('Models/T_node_l0r0/T_node_l0r0.OSGB')
models['t_node_l1r0'] = viz.add('Models/T_node_l1r0/T_node_l1r0.OSGB')
models['t_node_l0r1'] = viz.add('Models/T_node_l0r1/T_node_l0r1.OSGB')
models['t_node_l1r1'] = viz.add('Models/T_node_l1r1/T_node_l1r1.OSGB')
#switch off visibility
models['t_node_l1r1'].visible(viz.OFF)
models['t_node_l1r0'].visible(viz.OFF)
models['t_node_l0r1'].visible(viz.OFF)
models['t_node_l0r0'].visible(viz.OFF)
# Turn on corridor according to conditions
if (cur_trial[0] == 1) and (cur_trial[1] == 1):
models['t_node_l1r1'].visible(viz.ON)
print 'all lights on'
elif (cur_trial[0] == 1) and (cur_trial[1] == 0):
models['t_node_l1r0'].visible(viz.ON)
print 'left lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 1):
models['t_node_l0r1'].visible(viz.ON)
print 'right lights on'
elif (cur_trial[0] == 0) and (cur_trial[1] == 0):
models['t_node_l0r0'].visible(viz.ON)
print 'all lights off'
I found a workaround to the problem. I gave every texture a unique name before baking in 3ds max which solved the issue. This is quite tedious though, especially when there are a lot of textures.
If I don't rename the textures, all 4 corridors will have identical textures (the texture of the model that is being loaded first). Each model is saved in a separate folder and contains a subfolder with the textures.
Thanks!