Blender Animation X-Plane - Stick

animation_stick_Blender_01.jpg

Aujourd'hui un nouveau test d'animation d'objet : un stick.

Jusqu'à présent, j'utilisais l'animation d'armature pour l'animation d'un stick. Une première armature pour le roll, une seconde armature pour le pitch parentée à la première armature et l'objet stick parenté à la seconde armature.

Le prototype est toujours aussi basique : un objet floor_stick et un objet stick. Le stick est parenté à floor-stick.
Pour ce test, j'ai choisi une animation de l'objet Stick avec 4 keyframes :

  • select stick object
  • Frame 1,  Rot Y -20, dataref sim/cockpit2/controls/yoke_roll_ratio, value -1
  • Frame 10, Rot Y 20, dataref sim/cockpit2/controls/yoke_roll_ratio, value 1
  • Frame 20, Rot X -15, dataref sim/cockpit2/controls/yoke_pitch_ratio, value -1
  • Frame 30, Rot X 20, dataref sim/cockpit2/controls/yoke_pitch_ratio, value 1.

Pour cet exemple, contrairement à l'animation d'aiguille, les positions des frames n'ont plus de rapport avec le temps.
Vous pouvez donc les placer comme il vous plaira. Là, j'ai choisi de poser une keyframe toutes les 10 images.

Il est possible d'organiser le code obj en affectant un weight différent sur les objets.
Pour ce faire, il faut sélectionner l'objet et, dans la fenêtre Properties / Object / Xplane, Override Weight, Attribuer une valeur
Plus le weight est important, plus le code de l'objet est décalé en fin de fichier.

J'ai attribué un weight de 10 à l'objet stick_left et un weight de 20 à l'objet stick_right.
Le code obtenu est le suivant :
 
TRIS 4092 2748
TRIS 6840 1332
 
TRIS 1194 852
ANIM_begin
ANIM_trans -0.2 0.40000001 1.79999995 -0.2 0.40000001 1.79999995
ANIM_rotate_begin 1 0 0 sim/cockpit2/controls/yoke_pitch_ratio
ANIM_rotate_key -1 -15.01
ANIM_rotate_key 1 20
ANIM_rotate_end
ANIM_rotate_begin 0 0 -1 sim/cockpit2/controls/yoke_roll_ratio
ANIM_rotate_key -1 -20
ANIM_rotate_key 1 20
ANIM_rotate_end
TRIS 0 1194
ANIM_end
 
TRIS 2046 852
ANIM_begin
ANIM_trans 0.2 0.40000001 1.79999995 0.2 0.40000001 1.79999995
ANIM_rotate 0 1 0 -30 -30
ANIM_rotate 0 0 -1 30 30
ANIM_rotate 1 0 0 30 30
ANIM_rotate_begin 1 0 0 sim/cockpit2/controls/yoke_pitch_ratio
ANIM_rotate_key -1 -15.01
ANIM_rotate_key 1 20
ANIM_rotate_end
ANIM_rotate_begin 0 0 -1 sim/cockpit2/controls/yoke_roll_ratio
ANIM_rotate_key -1 -20
ANIM_rotate_key 1 20
ANIM_rotate_end
TRIS 2898 1194
ANIM_end

Comme pour le premier test, j'ai exporté le fichier animation_stick.obj dans le dossier Objects / animation_test de mon Stinson L5 ANIM.
Et ajouter ce nouvel objet dans l'acf avec PlaneMaker.

C'est testé... et ca fonctionne.
Plus d'armatures, de bones, de parentages.
Plus la peine de vérifier si l'on est bien en mode objet, edit ou pose.
Il suffit de sélectionner l'objet et de l'animer.