How to animate a model – ArmA: Armed Assault Talk
I decided to make move this article from my sandbox to an own article on the wiki since I don't have enough time to finish an article of this size. Feel free to add things to the article or change it. Cheers, --TeRp 15:58, 1 March 2007 (CET)TeRp.
animations / translations
after my own tests on the animations, i have discovered the following things: for the bones, it is possible to link several bones almost like in the article.
skeletonBones[]= { "bone1","" "bone2","bone1", "bone3","bone2" };
here, we have bone3 connected to bone2, which is connected to bone1. if bone1 move, bone2 and bone3 will move with him. if bone2 move, only bone3 will move with it, bone1 will remain unchanged, etc... i haven't tested the maximum limit of bones you can link like that, but 3 bones linked like that works perfectly.
the translations.
for the translations, you need offset0 and offset1 in place of angle0 and angle1.
one thing important to know about translation axis(done several tests about it)
the distance between the two points of your axis will become the "unit" of the offset. in the following example, i have an offset1="5", which means the bone will translate by 5 units. if the distance between the two points of my axis is 1 meter (assuming meters are the base unit in oxygen), the bone will move by 5 meters. if the distance between my two points is different, the bone movement will scale accordingly - if distance between the two points of the axis is 0.5m, the bone will only translate by 2.5 meters.
this particular point might be useful if you have to scale up or scale down your whole model, if it is already animated, because the offset value may not need to change.
class translatedobject { type="translation"; source="animtranslate"; selection="translatedbone"; axis="translateaxis"; memory=1; sourceAddress="clamp"; minValue="0"; maxValue="1"; offset0="0"; offset1="5"; };
another important point to know, is that the types TranslationX, TranslationY, and TranslationZ, if used without axis, do not have a meter based unit. so it may be better to use your own axis for doing accurate translations. Also, without an axis, the translation will correctly translate along the X, Z or Y axis, but the game engine seems to act weird for the direction to follow along this axis (several times, the object moved only in one direction, whatever the offset1 value was negative or not.)
weapon models' axis not working
I came across a strange problem with animation axis not working. It seems that a named property needs to be added to resolution LOD with our bones in O2 to make the axes work properly for weapon models.
property name: autocenter
value: 0
Could someone confirm and add to the article?