I tried to seperate some functions to a seperate file, but it never worked…
My intension is while pressing the “r” key, the model’s position will be reset to the initial place.
## arFunc.py
# _targetObj_ and _pos_ are parameters
def resetPosition(self, _targetObj_, _pos_):
_targetObj_.setPos(_pos_)
## main.py
import arFunc
class World(DirectObject):
def __init__(self)
self.growl = Actor.Actor(MYDIR+"/models/growl")
growlStartPos = self.environ.find("**/start_point").getPos()
self.growl.reparentTo(render)
self.growl.setPos(growlStartPos) #The main purpose I want to do#
self.accept("r", arFunc.resetPosition(self.growl, growlStartPos) )
When I run the script (main.py), it would complain about:
AssertionError: method not callable in accept (ignoring): None []
Any ideas?