Forum

Moving model parts by API that are connected to an armature

28 August 2015 13:15 #3568
I have my model with several bodies that I can move around by Javascript API calls.
The model has an armature which "connects" the bodies for animation purpose.
Now when I export the JSON with the armature I am not able to move the bodies by API calls anymore. Without exporting the armature API calls work fine, but the model seems discrambled. Some bodies fall apart of the rest . They seems to be held in place by the armature, in the JSON. The model looks good in blender. I already tried to play around with the bodies centers but this doesn't have any effect.
28 August 2015 17:24 #3578
Hello.
If an armature is a mesh parent, you cannot move mesh, because it has relative coordinates, quaternion and etc. But the new API methods to moving children objects has been added in the 15.08 release.
They are:
set_translation_rel, set_translation_rel_v, set_rotation_rel and etc.
Try to use the new API

If an armature is a object modifier, you should make the armature as parent of mesh too.
Blend4Web developer
31 August 2015 15:21 #3606
Alright, awesome..this did the trick.
I also have physics enabled. Should I be using the set_translation() function of the physics module instead (did not try it yet)?
31 August 2015 18:49 #3612
Ответ на сообщение пользователя goeck
Alright, awesome..this did the trick.
I also have physics enabled. Should I be using the set_translation() function of the physics module instead (did not try it yet)?
I assume, you have already tried, but nevertheless - yes, that is the way to go. If you have an object which is influenced by physics, you have to use corresponding physics functions.
Blend4Web developer
31 August 2015 19:07 #3615

If you have an object which is influenced by physics, you have to use corresponding physics functions

You can read about physical methods in our doc.
Blend4Web developer
 
Please register or log in to leave a reply.