Enlil
06-09-2008, 09:04 AM
Hello,
I am attempting to make a class that manages the actions of a 3d avatar. I am new at python and vizard, so I may be missing something fundamental. Never the less, here is my problem:
I define my class like so if a file called test1.py:
import viz
import vizact
class testclass:
def __init__(self):
self.female = viz.add('vcc_female.cfg')
self.face = viz.add('biohead_talk.vzf')
self.female.setFace(self.face)
self.female.state(14)
self.female.translate(0.3,0.1,1)
self.female.rotate(0,1,0,180)
self.smile = smile = vizact.morph('smile', .5, .1)
def smile():
self.face.add(self.smile)
Then, in a second file, speech_test.py, I write the following:
import viz
import test1
viz.go()
foo2 = testclass()
foo2.smile()
I then get the error
File "<string>", line 11, in ?
File "speech_test2.py", line 18, in ?
foo2.smile()
TypeError: 'ActionData' object is not callable
Can anyone tell me why this is happening and what I need to do to fix it?
Thanks,
Christian
I am attempting to make a class that manages the actions of a 3d avatar. I am new at python and vizard, so I may be missing something fundamental. Never the less, here is my problem:
I define my class like so if a file called test1.py:
import viz
import vizact
class testclass:
def __init__(self):
self.female = viz.add('vcc_female.cfg')
self.face = viz.add('biohead_talk.vzf')
self.female.setFace(self.face)
self.female.state(14)
self.female.translate(0.3,0.1,1)
self.female.rotate(0,1,0,180)
self.smile = smile = vizact.morph('smile', .5, .1)
def smile():
self.face.add(self.smile)
Then, in a second file, speech_test.py, I write the following:
import viz
import test1
viz.go()
foo2 = testclass()
foo2.smile()
I then get the error
File "<string>", line 11, in ?
File "speech_test2.py", line 18, in ?
foo2.smile()
TypeError: 'ActionData' object is not callable
Can anyone tell me why this is happening and what I need to do to fix it?
Thanks,
Christian