Forum

Moving model parts by API that are connected to an armature

28 August 2015 13:15
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
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.
31 August 2015 15:21
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
Ответ на сообщение пользователя 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.
31 August 2015 19:07

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.
 
Please register or log in to leave a reply.