View Single Post
  #3  
Old 09-26-2020, 11:34 AM
Roy Roy is offline
Member
 
Join Date: Dec 2019
Posts: 9
Hi Sado,

How about animations for each avatar?
If animation is added by 'state()', do every avatars have different animations?
I tried to make 2avatars x 15 animations list, and show them in random order as program below. But the same avatar with same animation is shown.

Code:
avatar_files = ['vcc_male.cfg', 'vcc_female.cfg']#2avatars
animation = range(1,16)#default 15 animations

#make 30 stimuli list (2avatars x 15animations), and shuffule the order
stimulus = []
for i in avatar_files:
	for j in animation:
		avatarAnim = viz.addAvatar(i, pos=(0,0,0), euler=(180,0,0))
		avatarAnim.state(j)
		avatarAnim.visible(viz.OFF)
		stimulus.append(avatarAnim)
random.shuffle(stimulus)

def experiment():
	yield viztask.waitKeyDown(viz.KEY_RETURN)
	for trial in stimulus:
		yield viztask.waitTime(1)
		avatarAnim.visible(viz.ON)
		yield viztask.waitKeyDown(viz.KEY_RETURN)
		avatarAnim.visible(viz.OFF)

viztask.schedule(experiment())
Reply With Quote