User Tools

Site Tools


arma:howto_animate_model

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
arma:howto_animate_model [2007-07-12 04:31]
snakeman changed page pretty much
arma:howto_animate_model [2009-04-17 12:01]
snakeman added animate cargo door tips.
Line 20: Line 20:
 </​code>​ </​code>​
  
-If your model has Geometry LOD the above needs to be also done for your Geometry LOD. This property ​stopps ​engine from shifting the animation axes.+If your model has Geometry LOD the above needs to be also done for your Geometry LOD. This property ​stops engine from shifting the animation axes.
  
-If you encounter a bug when your weapon bones fall apart after you dropp it to the ground the reason might be lack of Geometry or View - pilot LODs.+If you encounter a bug when your weapon bones fall apart after you drop it to the ground the reason might be lack of Geometry or View - pilot LODs.
  
 ====== model.cfg ====== ====== model.cfg ======
Line 51: Line 51:
 </​code>​ </​code>​
  
-You may define multiple bones by strining ​them togeter.+You may define multiple bones by stringing ​them together.
  
 **Attention:​** Do not leave out the second string as this will lead to errors! (see linked bones for more information on the second string argument) **Attention:​** Do not leave out the second string as this will lead to errors! (see linked bones for more information on the second string argument)
Line 167: Line 167:
 **Animations** **Animations**
  
-To define animations for your model, you have to make use of the class animations in your modelclass. Each animation is a subclass in the class animations with a userdefinable ​name and consists of the following parameters:+To define animations for your model, you have to make use of the class animations in your modelclass. Each animation is a subclass in the class animations with a user definable ​name and consists of the following parameters:
  
 ^ Parameter ^ Description ^ ^ Parameter ^ Description ^
Line 217: Line 217:
 Keep in mind that this image shows only the direction of these axes and //not// their position. The position is always defined by the center of your animated selection. Keep in mind that this image shows only the direction of these axes and //not// their position. The position is always defined by the center of your animated selection.
  
-As a short examle, the wheels would need "​rotationX"​ as animation type.+As a short example, the wheels would need "​rotationX"​ as animation type.
  
 {{http://​tactical.nekromantix.com/​images/​wiki/​howtoanimmodel_axes.jpg}} {{http://​tactical.nekromantix.com/​images/​wiki/​howtoanimmodel_axes.jpg}}
Line 329: Line 329:
  };  };
 }; };
 +</​code>​
 +
 +====== Machine Gun Belt Rotation ======
 +
 +Open your model in O2 and make a selection called "​belt_rotation",​ redefine the entire belt of bullets you want move on your MG and save it.
 +
 +Inside your model.cfg file open this class:
 +<code cpp>
 +class CfgSkeletons
 +{
 + class NameOfYourWeapon
 + {
 + isDiscrete = 0;
 + skeletonInherit = "";​
 + skeletonBones[] =
 + {
 + "​belt_rotation",​ ""​
 + };
 + };
 +};
 +</​code>​
 +Again in the model.cfg file, inside your CfgModels describe the new selection and animation as you see below.
 +<code cpp>
 +class CfgModels
 +{
 + class Default
 + {
 + sections[] = {};
 + sectionsInherit = "";​
 + };
 +
 + class Weapon: default{};
 +
 + class NameOfYourWeapon
 + {
 + skeletonName = "​NameOfYourWeapon";​
 +
 + class Animations
 + {
 +
 + class belt_rotation
 + {
 + type = "​rotationx";​
 + source = "​reload";​
 + selection = "​belt_rotation";​
 + axis = "​belt_rotation_axis";​
 + minValue = 0;
 + maxValue = "​5";​
 + angle0 = "​0";​
 + angle1 = "​1";​
 + };
 + };
 +
 + sections[] = { "​zasleh"​ };
 + sectionsInherit = "";​
 + };
 +};
 +</​code>​
 +To play around with the sliding belt you just need to take two values in consideration.
 +
 +The first is the type = "",​ "​rotationx"​ will move you belt from the left to the right or right to the left, the second is the definition of the starting side the angle1 = ""​.
 +
 +"​0"​ is a static value which means it won't move at all, negative values like "​-1",​ "​-2"​ ... will make the belt move from the right to the left, positive values like the "​1",​ "​2"​ ... will make it move from the left to the right.
 +
 +One thing to take into consideration is the "​rotationz"​ not presented here. Let's say you have the belt not attached to a box but instead falling from the ground. If that is the case you want the belt to move from below to above, for that you will use the "​rotationz"​ and again you play with the angle called angle1 = ""​ to set direction of the belt's movement.
 +
 +Now something worth noticing, let's say that you want the belt to move not straight but unbalanced, for that you will play with the angle0 = ""​. I think most of us won't be using this angle but now you know what it does.
 +
 +
 +====== Animate Cargo Door ======
 +
 +In your model.cfg file in cfgModels put this for example:
 +<code cpp>
 +class Animations
 +{
 + class cargodoor
 + {
 + type = "​rotation";​
 + source = "​MoveX1";​
 + animPeriod = 2.5;
 + sourceAddress = "​clamp";​
 + selection = "​cargodoor";​
 + axis = "​osa_cargodoor";​
 + memory = true;
 + minValue = 0;
 + maxValue = 1;
 + angle0 = 0;
 + angle1 = -0.488690;
 + };
 +</​code>​
 +
 +In config.cpp file in cfgVehicles put this:
 +<code cpp>
 + class AnimationSources:​ AnimationSources
 + {
 + class MoveX1 // Should be the same as your selection name.
 + {
 + source = "​user";​ //The controller is defined as a user animation.
 + animPeriod = 10;  //The animation period used for this controller.
 + initPhase = 0;     //​Initial phase when object is created. 0 = CLOSED
 + };
 + };
 +</​code>​
 +And
 +<code cpp>
 + class UserActions
 + {
 + class CargoDoor_OpenP
 + {
 + displayName = "Open cargodoor";​
 + position = "​pilotcontrol";​
 + onlyforplayer = false;
 + radius = 0.5;
 + condition = "this animationPhase ""​cargodoor_down""​ < 0.5";
 + statement = "this animate [""​cargodoor_down"",​1];​ this animate [""​cargodoor_up"",​1]";​
 + };
 </​code>​ </​code>​
arma/howto_animate_model.txt ยท Last modified: 2017-10-06 22:08 by snakeman