mechanicmarx / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

crash on playing armature animation via game logic #304

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. add bone armatures
2. assign mesh object parent to bones
3. animate armature action with keyframes
4. play action via game logic

What is the expected output? What do you see instead?
i thought this would animate the mesh objects, crashed instead

What version of the product are you using? On what operating system?
latest repo build as of posting this, win 8 64b

Please provide any additional information below.
if i leave the armature action at the last keyframe and run the game the mesh 
objects are actually in the correct position, so i have everything linked up 
fine it seems. i believe it has to do with game logic playing armature action 
from the bone armature game logic menu.

Original issue reported on code.google.com by ChrisFG...@gmail.com on 21 Feb 2013 at 2:48

Attachments:

GoogleCodeExporter commented 8 years ago
Yes, this is a known bug :D. An Armature-Animation expects a mesh attached via 
armature-deform (e.g. parent->armature deform with automatic weights). When 
there is no mesh -> crash. If there is a mesh you can use the bone-parenting of 
objects as well... I will have a look and try to fix that this weekend...

Original comment by thomas.t...@googlemail.com on 22 Feb 2013 at 8:54

GoogleCodeExporter commented 8 years ago
Just so I understand:
"If there is a mesh you can use the bone-parenting of objects as well..." 
isn't this what I did? So I take it, I must parent to armature as deform with 
weights. I'd rather not have it deform the mesh, which is what seemed to happen 
with that option. I think Blender has a deform option to turn off, I'll see.

Just to be clear:
this only breaks when i run animation via game logic actuator. if i leave the 
armature animation on keyframe in the middle of the animation and start 
gamekit, the mesh is animated up to that point. this makes me think it's a 
logic-brick issue specifically. i haven't been able to figure out lua yet, all 
the commands i try seems to do nothing and the lua bindings section on the site 
is a bit 'thin' on details :)

thanks for looking in to this!

ps: look in to my comment on building for android on windows, i noticed i had 
to set android_ndk as well as ndk to the ndk source directory.

Original comment by ChrisFG...@gmail.com on 23 Feb 2013 at 8:29

GoogleCodeExporter commented 8 years ago
Nono, it is an armature animation issue. Blender exports the current pose as 
mesh, so there is no armature animation involved to make the current state 
(when saved the blend)visible.(therefore I have the problem when using 
boneparenting with an armature that is not in rest-position,which is of course 
solveable(someday))

To start an animation via lua just do it like this:
Obj = OgreKit.getActiveScene():getObject('yourobj')
Obj:playAnimation('animname',0)

And of course place the code in a textbooks called 'OnInit.lua'

Cheers and 95olé

Original comment by thomas.t...@googlemail.com on 23 Feb 2013 at 11:10

GoogleCodeExporter commented 8 years ago

Original comment by thomas.t...@googlemail.com on 23 Feb 2013 at 2:58

GoogleCodeExporter commented 8 years ago
cool thanks for your help on this!
i see what you mean with the issue. i also tried the lua script and it crashes, 
so yes it definitely seems to be the way you described the issue. i'll poke 
around the code and see what i can do. 
how else could i go about doing what i want to do? basically a mechanical mesh 
that i want to control with an interface. i figured armatures would be the way 
to go :)

Original comment by ChrisFG...@gmail.com on 23 Feb 2013 at 5:08

GoogleCodeExporter commented 8 years ago
Yeah, I started working on it and it is not thaaat trivial as I thought in the 
beginning (but I now how to solve it, more or less). The best workaround would 
be to create e.g. a plane, do a parent->with automatic weights... and then 
remove in edit-mode all vertices. So you have a mesh without geometry...silly, 
but works...
Since F95 lost minutes ago their match vs Schalke :( I won't go on working on 
this issue today anymore... 

Original comment by thomas.t...@googlemail.com on 23 Feb 2013 at 7:47

GoogleCodeExporter commented 8 years ago
Thanks for lookinng into this, I'll try the plane idea. That's a smart work 
around!

Original comment by ChrisFG...@gmail.com on 23 Feb 2013 at 8:43

GoogleCodeExporter commented 8 years ago
Ok, I think I found a fix. Might need some testing, but it seems(<--) to work 
:D.

http://code.google.com/p/gamekit/source/detail?r=1252

Thx for reporting....have fun and plz report back if it works or if we have to 
revive the issue

95ole,ToM

Original comment by thomas.t...@googlemail.com on 23 Feb 2013 at 9:43

GoogleCodeExporter commented 8 years ago
thanks, seems to work great!

Original comment by ChrisFG...@gmail.com on 23 Feb 2013 at 10:35