karanveer singh
2009-12-16 17:51:10 UTC
Hi, I created a simple animated model in blender, which I have
attached with this mail (third.blend). It is of a gingerbread man
walking. I tried loading that in soya, however, when I play the
animation, instead of showing the model walking, it creates a bounded
box sort of thing on top of the model and shows him walking. As in, I
can't see the actual model. If i don't use it as an animated model and
just use it as a normal model, it displays it properly.
What could be the problem. Could there be something wrong in the
blender2cal3d file?
I have included the model, here is my code:
import sys, os, os.path, soya, soya.widget as widget
soya.init()
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))
# Creates the scene.
scene = soya.World()
man_model = soya.AnimatedModel.get("third")
print "Available meshes :", man_model.meshes .keys()
print "Available animations:", man_model.animations.keys()
man = soya.Body(scene, man_model)
man.rotate_lateral(180)
man.animate_blend_cycle("Action")
camera = soya.Camera(scene)
camera.set_xyz(0.0, 1.5, 16.0)
soya.set_root_widget(widget.Group())
soya.root_widget.add(camera)
soya.root_widget.add(widget.FPSLabel())
soya.Light(scene).set_xyz(5.0, 5.0, 2.0)
soya.MainLoop(scene).main_loop()
attached with this mail (third.blend). It is of a gingerbread man
walking. I tried loading that in soya, however, when I play the
animation, instead of showing the model walking, it creates a bounded
box sort of thing on top of the model and shows him walking. As in, I
can't see the actual model. If i don't use it as an animated model and
just use it as a normal model, it displays it properly.
What could be the problem. Could there be something wrong in the
blender2cal3d file?
I have included the model, here is my code:
import sys, os, os.path, soya, soya.widget as widget
soya.init()
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))
# Creates the scene.
scene = soya.World()
man_model = soya.AnimatedModel.get("third")
print "Available meshes :", man_model.meshes .keys()
print "Available animations:", man_model.animations.keys()
man = soya.Body(scene, man_model)
man.rotate_lateral(180)
man.animate_blend_cycle("Action")
camera = soya.Camera(scene)
camera.set_xyz(0.0, 1.5, 16.0)
soya.set_root_widget(widget.Group())
soya.root_widget.add(camera)
soya.root_widget.add(widget.FPSLabel())
soya.Light(scene).set_xyz(5.0, 5.0, 2.0)
soya.MainLoop(scene).main_loop()