View Single Post
  #2  
Old 08-18-2009, 12:54 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
There are a few ways to accomplish this. If all the choice strings exactly match the attribute name on the gr object, then you can use the following code:
Code:
def modifySettings(gr):
	settings = ['Environment','EnvSize','EnvDiffusion','RoomHF','RoomLF','DecayTime','DecayHFRatio','DecayLFRatio',
'Reflections','ReflectionsDelay','ReflectionsPan','Reverb','ReverbDelay','ReverbPan','EchoTime','EchoDepth',
'ModulationTime','ModulationDepth','AirAbsorptionHF','HFReference','LFReference','RoomRolloffFactor','Flags']
	name = settings[viz.choose('Modify which setting?',settings)]
	value = viz.input('Set '+name+' to')
	setattr(gr,name,value)
Reply With Quote