Adding a lot of Avatars
Hello,
How to add many avatars at once? If we try to add 100 different avatars, do we need to use 'addAvatar()' for each avatar? Thanks |
You can note it all down in a list and iterate through it. Here's a sample script for it.
import viz viz.clearcolor(viz.SKYBLUE) avatar_files = ['vcc_male.cfg', 'vcc_female.cfg', 'vcc_male2.cfg'] avatars = [] position = 0 for i in avatar_files: new = viz.addAvatar(i, pos = (position*2, 0, 4), euler=(180,0,0)) avatars.append(new) position += 1 viz.go() |
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 |
Hi Roy,
There was just a bug in your code. You were setting "avatarAnim" to visible off and on states in your experiment function instead of using "trial" which would iterate between your shuffled states. Code:
import viz |
Hi kennethkarthik,
Thank you, it works! But I'm wondering any other way to add avatars. In this program, 2 avatars are loaded 15 times, causing long time to run the program. Any ideas? Thanks |
Hey Roy,
Vizard does it's optimisation when it reuses objects. However if you do want to improve load time, I would suggest just changing the state of your characters on the same avatar instead of adding a new one for each animation state. Check out the code below Code:
import viz |
All times are GMT -7. The time now is 02:24 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC