WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-09-2008, 10:04 AM
Enlil Enlil is offline
Member
 
Join Date: May 2008
Posts: 61
'ActionData' object is not callable error

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
Reply With Quote
  #2  
Old 06-09-2008, 11:23 AM
Enlil Enlil is offline
Member
 
Join Date: May 2008
Posts: 61
Thumbs up

Oops, the above was unreadable - let me try again (and make a couple of corrections):
test1.py:
mport 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 = vizact.morph('smile', .5, .1)
def smile(self):
self.face.add(self.smile)
The rest should be ok (I was not passing self to smile, but upon adding self to the def, I still got the same error).

Thanks,
Christian
edit: it flattened everything again, so I used the indent feature this time . . .

Last edited by Enlil; 06-09-2008 at 11:25 AM.
Reply With Quote
  #3  
Old 06-09-2008, 06:03 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Please use the [code][/code] tags when posting code samples. It will preserve indentations.

The problem with your code is that you assign the smile action to a variable called smile which will overwrite the smile method. You need to give it a name that does not conflict with the smile method.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve Object names Geoffrey Vizard 11 12-11-2009 05:26 AM
'int' object not callable enkeli Vizard 8 10-22-2009 05:12 PM
Unscriptable Object Error shivanangel Vizard 1 10-11-2006 12:04 PM
Error Message Jerhy Vizard 1 02-28-2006 02:59 PM
rotate to object jargon Vizard 1 08-08-2005 01:20 PM


All times are GMT -7. The time now is 07:57 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC