Hi!
Well… i’m beginner, this is my “hello world” code:
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
from direct.showbase.DirectObject import DirectObject
class main(DirectObject):
def __init__(self):
self.character = Actor("Models/CharStatic",{"run":"Models/CharMove"})
self.character.reparentTo(render)
self.character.loop("run")
launch = main()
run()
Works fine! But, when i wank to “organize” the scenes putting classes within classes, in follow way:
import direct.directbase.DirectStart
from direct.actor.Actor import Actor
from direct.showbase.DirectObject import DirectObject
class main(DirectObject):
def __init__(self):
class room1(DirectObject):
def __init__(self):
self.character = Actor("Models/CharStatic",{"run":"Models/CharMove"})
self.character.reparentTo(render)
self.character.loop("run")
t1 = room1()
launch = main()
run()
The model appears, but do not run the animation.
¿What’s the problem?
Thanks!!!