arma:howto_animate_model
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| arma:howto_animate_model [2007/07/12 04:31] – changed page pretty much snakeman | arma:howto_animate_model [2024/08/01 15:57] (current) – links added. snakeman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== How To Animate Model ====== | + | ====== |
| + | |||
| + | [[https:// | ||
| + | |||
| + | **ArmA 1** aka Armed Assault (ArmA) | ||
| **Attention: | **Attention: | ||
| Line 15: | Line 19: | ||
| Besides adding selections (same as in OFP but in ArmA bone selections should never overlap) you also need to add a following named property to your first resolution LOD (press **ALT-P** to open named properties window): | Besides adding selections (same as in OFP but in ArmA bone selections should never overlap) you also need to add a following named property to your first resolution LOD (press **ALT-P** to open named properties window): | ||
| - | < | + | < |
| | | ||
| | | ||
| </ | </ | ||
| - | If your model has Geometry LOD the above needs to be also done for your Geometry LOD. This property | + | If your model has Geometry LOD the above needs to be also done for your Geometry LOD. This property |
| - | 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 47: | Line 51: | ||
| A bone is defined by using two strings: | A bone is defined by using two strings: | ||
| - | < | + | < |
| :" | :" | ||
| </ | </ | ||
| - | You may define multiple bones by strining | + | You may define multiple bones by stringing |
| **Attention: | **Attention: | ||
| Line 57: | Line 61: | ||
| **Example** | **Example** | ||
| - | < | + | < |
| skeletonBones[]= | skeletonBones[]= | ||
| { | { | ||
| Line 69: | Line 73: | ||
| The second argument (empty in the example above) is used for linking two bones: | The second argument (empty in the example above) is used for linking two bones: | ||
| - | < | + | < |
| :" | :" | ||
| </ | </ | ||
| Line 77: | Line 81: | ||
| **Example** | **Example** | ||
| - | < | + | < |
| skeletonBones[]= | skeletonBones[]= | ||
| { | { | ||
| Line 89: | Line 93: | ||
| You can not link more than two bones in a row! If you do something like | You can not link more than two bones in a row! If you do something like | ||
| - | < | + | < |
| " | " | ||
| </ | </ | ||
| Line 99: | Line 103: | ||
| However, it should be possible to use a syntax like this (not tested yet): | However, it should be possible to use a syntax like this (not tested yet): | ||
| - | < | + | < |
| skeletonBones[]= | skeletonBones[]= | ||
| { | { | ||
| Line 112: | Line 116: | ||
| **cfgSkeletons Example** | **cfgSkeletons Example** | ||
| - | < | + | < |
| class cfgSkeletons | class cfgSkeletons | ||
| { | { | ||
| Line 155: | Line 159: | ||
| **Example** | **Example** | ||
| - | < | + | < |
| sections[]= | sections[]= | ||
| { | { | ||
| Line 167: | Line 171: | ||
| **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 | + | 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 |
| ^ Parameter ^ Description ^ | ^ Parameter ^ Description ^ | ||
| Line 195: | Line 199: | ||
| **Example** | **Example** | ||
| - | < | + | < |
| class mainRotor | class mainRotor | ||
| { | { | ||
| Line 217: | Line 221: | ||
| 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 " | + | As a short example, the wheels would need " |
| - | {{http://tactical.nekromantix.com/images/wiki/ | + | {{https://pmc.editing.wiki/ |
| **cfgModels example** | **cfgModels example** | ||
| - | < | + | < |
| class cfgModels | class cfgModels | ||
| { | { | ||
| Line 330: | Line 334: | ||
| }; | }; | ||
| </ | </ | ||
| + | |||
| + | ====== Machine Gun Belt Rotation ====== | ||
| + | |||
| + | Open your model in O2 and make a selection called " | ||
| + | |||
| + | Inside your model.cfg file open this class: | ||
| + | <code cpp> | ||
| + | class CfgSkeletons | ||
| + | { | ||
| + | class NameOfYourWeapon | ||
| + | { | ||
| + | isDiscrete = 0; | ||
| + | skeletonInherit = ""; | ||
| + | skeletonBones[] = | ||
| + | { | ||
| + | " | ||
| + | }; | ||
| + | }; | ||
| + | }; | ||
| + | </ | ||
| + | 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 = " | ||
| + | |||
| + | class Animations | ||
| + | { | ||
| + | |||
| + | class belt_rotation | ||
| + | { | ||
| + | type = " | ||
| + | source = " | ||
| + | selection = " | ||
| + | axis = " | ||
| + | minValue = 0; | ||
| + | maxValue = " | ||
| + | angle0 = " | ||
| + | angle1 = " | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | sections[] = { " | ||
| + | sectionsInherit = ""; | ||
| + | }; | ||
| + | }; | ||
| + | </ | ||
| + | To play around with the sliding belt you just need to take two values in consideration. | ||
| + | |||
| + | The first is the type = "", | ||
| + | |||
| + | " | ||
| + | |||
| + | One thing to take into consideration is the " | ||
| + | |||
| + | 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 = "" | ||
| + | |||
| + | |||
| + | ====== Animate Cargo Door ====== | ||
| + | |||
| + | In your model.cfg file in cfgModels put this for example: | ||
| + | <code cpp> | ||
| + | class Animations | ||
| + | { | ||
| + | class cargodoor | ||
| + | { | ||
| + | type = " | ||
| + | source = " | ||
| + | animPeriod = 2.5; | ||
| + | sourceAddress = " | ||
| + | selection = " | ||
| + | axis = " | ||
| + | memory = true; | ||
| + | minValue = 0; | ||
| + | maxValue = 1; | ||
| + | angle0 = 0; | ||
| + | angle1 = -0.488690; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | In config.cpp file in cfgVehicles put this: | ||
| + | <code cpp> | ||
| + | class AnimationSources: | ||
| + | { | ||
| + | class MoveX1 // Should be the same as your selection name. | ||
| + | { | ||
| + | source = " | ||
| + | animPeriod = 10; //The animation period used for this controller. | ||
| + | initPhase = 0; // | ||
| + | }; | ||
| + | }; | ||
| + | </ | ||
| + | And | ||
| + | <code cpp> | ||
| + | class UserActions | ||
| + | { | ||
| + | class CargoDoor_OpenP | ||
| + | { | ||
| + | displayName = "Open cargodoor"; | ||
| + | position = " | ||
| + | onlyforplayer = false; | ||
| + | radius = 0.5; | ||
| + | condition = "this animationPhase "" | ||
| + | statement = "this animate ["" | ||
| + | }; | ||
| + | </ | ||
| + | |||
arma/howto_animate_model.1184214687.txt.gz · Last modified: 2007/07/12 04:31 (external edit)
