Discussion:
problem loading animated blender model
karanveer singh
2009-12-16 17:51:10 UTC
Permalink
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()
Toni Alatalo
2009-12-17 07:45:35 UTC
Permalink
Post by karanveer singh
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.
Really? It seems that you are using subsurfing, and I thought that Soya
and game engines in general don't typically have subsurf out of the box.
So I'm thinking that you are not seeing a bounding box on top of the
model, but just the actual mesh geometry without subsurfing applied --
the same thing you see in Blender when you disable the modifier (e.g. by
disabling the showing of it in the interactive view).

But if you really see the subsurfed version when not using an animation
.. I guess the subsurf is working somehow for the non-animated shape,
but not for the cal3d version? I don't know if the Soya exporter
automatically applies the modifier in Blender, that could explain it.

~Toni
Post by karanveer singh
What could be the problem. Could there be something wrong in the
blender2cal3d file?
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()
------------------------------------------------------------------------
_______________________________________________
Soya-user mailing list
https://mail.gna.org/listinfo/soya-user
Loading...