Results 1 to 30 of 40

Thread: Editing Animation folder

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Editing Animation folder

    Hi Tanauser,

    (1) Let's just start with the basic stuff. You can change the animations
    in the keyframer to something that better approximates the Winchester
    action. You animate by rotating the bones or joints. You can experiment
    on your animated file and just don't save the changes. Say you want to
    change the first frame. You hit the key that looks like ||< (you get a tooltip
    if you hover over it). Go to the joints tab and click on the joint bone_Relbow
    to select it, then go to the model tab and press the rotate button. You
    should see something like this:



    The way the human skeleton works you'll mostly rotate about the x-axis.
    The units for those boxes are degrees. (Milkshape's coordinate system is
    x-axis to the right of the screen, y-axis is upwards, and the z-axis is out
    of the screen.) The rotations are relative to the current pose so you could
    rotate by 10 degrees three times in a row to go 30 degrees total. Go back
    and forth from the joints tab to the model tab selecting different bones and
    experimenting, just don't save your model.

    (2) At some point when you do have a completely redone animation you'll need
    to extract it out from the Milkshape .ms3d file into a .cas file. Say your file
    is called "bluecoat_animby_shoot.ms3d". Run the python animationutilities,
    click the animextract button.

    (If you get an error fussing about the line:
    float_vec3.fromfile( fidcas, 7 ) at line number 1091, that's my fault.
    Open animationutilities.py with any text editor and search for that
    string. It only occurs once in the file. Comment it out by putting the
    symbol # in front of it and saving.)

    The animextract button will put up a file chooser, Mouse to your file
    bluecoat_animby_shoot.ms3d and select it. It should produce a .cas
    file named shoot_modified.cas, the _modified is so it doesn't overwrite
    your original. Basically, whatever follows the _animby_ part will be the
    name of the output file with _modified added to it.

    (3) The animation family (defined in a moment) for a unit is specified in
    the modeldb file. For instance, for armored_sergeants near the bottom
    for that entry you would see:

    Code:
    5 slave 
    56 unit_models/AttachmentSets/Final Kite_slave_diff.texture 
    56 unit_models/AttachmentSets/Final Kite_slave_norm.texture 0  
    7 normans 
    58 unit_models/AttachmentSets/Final Kite_normans_diff.texture 
    58 unit_models/AttachmentSets/Final Kite_normans_norm.texture 0  
    1 
    4 None 
    10 MTW2_Spear 0  
    2 
    18 MTW2_Spear_primary 
    14 fs_test_shield 0 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    The red name is the name of the animation family.

    (4) If you now go to descr_skeleton.txt, you can find the definition of the
    family.


    Code:
    type		MTW2_Spear
    strike_distances 1.40 2.20 3.2 3.5 4.0
    locomotion_table soldier
    
    anim		default													data/animations/MTW2_Spear/MTW2_Spear_basepose.cas
    
    ;;;Defend
    anim		eager_defend_lo_stab									data/animations/MTW2_Spear/MTW2_Spear_defend_stab_med.cas								-fr	-if:6	-evade	-prob 10		-evt:data/animations/MTW2_Spear/MTW2_Spear_defend_stab_med.evt
    anim		eager_defend_mid_slashlr_light							data/animations/MTW2_Spear/MTW2_Spear_defend_slashlr_med.cas							-fr	-if:7	-evade	-prob 10		-evt:data/animations/MTW2_Spear/MTW2_Spear_defend_slashlr_med.evt
    anim		eager_defend_mid_slashrl_light							data/animations/MTW2_Spear/MTW2_Spear_defend_slashrl_med.cas							-fr	-if:6	-evade	-prob 10		-evt:data/animations/MTW2_Spear/MTW2_Spear_defend_slashrl_med.evt
    anim		eager_defend_overhead_stab								data/animations/MTW2_Spear/MTW2_Spear_defend_stab_hi.cas								-fr	-if:6	-evade	-prob 10		-evt:data/animations/MTW2_Spear/MTW2_Spear_defend_stab_hi.evt
    
    ;;;Reaction
    anim		knockback_from_front										data/animations/MTW2_Spear/MTW2_Spear_knockback_from_front.cas		-fr		-evt:data/animations/MTW2_Spear/MTW2_Spear_knockback_from_front.evt
    anim		knockback_from_right										data/animations/MTW2_Spear/MTW2_Spear_knockback_from_right.cas		-fr		-evt:data/animations/MTW2_Spear/MTW2_Spear_knockback_from_right.evt
    anim		knockback_from_back											data/animations/MTW2_Spear/MTW2_Spear_knockback_from_back.cas			-fr		-evt:data/animations/MTW2_Spear/MTW2_Spear_knockback_from_back.evt
    anim		knockback_from_left											data/animations/MTW2_Spear/MTW2_Spear_knockback_from_left.cas			-fr		-evt:data/animations/MTW2_Spear/MTW2_Spear_knockback_from_left.evt
    (There's a lot more there, I just cut it off.) The first word after anim is
    the action command which is followed by the path to the .cas file that
    performs the action.

    Basically, you would copy a MTW2_Musket directory to a new directory
    named MTW2_Winchester. Then edit descr_skeleton.txt, copy the
    MTW2_Musket family entry, name the new animation family
    MTW2_Winchester, and change all the .cas path names for that entry
    to point to the directory MTW2_Winchester. Then you can edit
    whatever .cas files in that directory you want and they only apply to
    units that specify MTW2_Winchester as their animation in the modeldb file.
    In other words, you still have unchanged musket animations for all
    other units.

    There's some more steps but this is probably too long already.

  2. #2

    Default Re: Editing Animation folder

    Good evening
    I can't see any joint or bones at all ; I can't have them appear
    All I see is this

    I can rotate the forearm....but
    I don't catch the process on how to give the new animation to the model

  3. #3
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Editing Animation folder

    It's always the details I forget. Go to the joints tab
    and check the checkbox that says show skeleton. If they
    come out as huge blue boxes go to File -> Preferences
    and on the dialog that pops up, click the Misc tab. and then change
    the joint size entry to 0.025. Then the joints should appear
    normal.

  4. #4

    Default Re: Editing Animation folder

    I did so

  5. #5

    Default Re: Editing Animation folder

    So I found that the model the nearest to the movement I need:


    question appear
    1) How do I save each rotation ?: I guess I would need 4 frames in front & 4 frames back with the right hand, that 8 changes


    This ms3d gives me 21 frames ; let say I want to start the movement at frame 15



    guessing : I start changing n°15 (rotation under -Y ), than I go to n° (-Y)16 , (-Y)17, (-Y)18 than backward 19( +Y) ...22 (+Y) So after the job done do I just save the file , and that's it ?


    2) when I will be done I guess I'll have to create a special folder in which I will put this Change + all animation LESS the original reloading ?; save the folder under a special name and put it at the end of the unit in the modeldb. ??? ...later

  6. #6

    Default Re: Editing Animation folder



    The problem I meet is that the rifle is moving along with the hand





    so when I rotate the hand I move the rifle also even if I reassign the weapon in order to make a new articulation in the wrist

    So I have tried to create a New joint in the middle of the hand (joint tool >>>add a new joint between the selected one and it's parent)




    but I cant find a way to join it with the rest ....!?
    For now I freeze investigating before you tell me more, maybe I am going the wrong way ....

  7. #7
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Editing Animation folder

    Hi Tanauser,

    What you want to do, that is, animating the lever of the Winchester, is going
    to be a lot of work for a detail many users may not even zoom in to see. An easier
    thing is to just animate the right arm to drop down a little after each shot to
    give the illusion of cocking to eject the spent round and chambering a new one.
    Most players watching a company of bluecoats firing that way would understand that
    they are seeing a rapid firing repeater rifle in action.

    I'm not encouraging the easier way, just pointing it out as a fall back. If you
    try the harder way and later decide it's too much work, you'll still have learned
    a lot about using Milkshape and animations so it won't be a wasted effort.


    Now, the mechanics of making joints. You are quite right, if you go to the model tab,
    click joint and then click in a viewport, you get an isolated joint which isn't good
    for anything. You need to add the new joint into the "bone hierarchy" of the model.
    I'll explain that in a moment. Right now you just want to have a new bone coming off
    of bone_Rhand, the terminology for that is that bone_Rhand is the "parent" and the new
    bone is the "child". Go to the joint tab and select bone_Rhand by double-clicking it.
    Then go to the model tab, click the joint button, then click in a viewport where you
    want the new joint, somewhere near bone_Rhand. Once you click you should see blue lines
    connecting bone_Rhand to your new joint. Since it was selected when you clicked, bone_Rhand
    is now the parent of your new bone. You can go to the joint tab and double-click on
    the new bone (probably called joint24 or something like that) and then in the edit
    box below you can select the name joint24 and then type in a new name, like bone_lever
    or something descriptive, and then click the rename button to the left to rename it.

    A tutorial on the bone hierarchy:

    Bones (or joints, a better and more descriptive terminology) form a tree structure with
    one root node or joint. For human models with CA's standard skeleton, the root joint
    is bone_pelvis. All other bones are children of bone_pelvis or of its children, down
    several generations, so to speak. Americans and the English will know this children's song

    "The hip bone's connected to the thigh bone,
    The thigh bone's connected to the leg bone,
    The leg bone's connected to the ankle bone,
    The ankle bone's connected to the foot bone..."
    It's actually kind of like that. Here's the hierarchy in CA's standard order:

    Code:
       1  [0]              2   [1]                 3  [2]              4  [3]
    bone_pelvis     -->  bone_RThigh     -->   bone_Rlowerleg   -->  bone_Rfoot     
    
       1  [0]              5   [1]                 6  [5]              7  [6]            8  [7]
    bone_pelvis     -->  bone_abs        -->   bone_torso       -->  bone_head    -->  bone_jaw     
                                                                                \
                                                                                 \       9  [7]
                                                                                   ->  bone_eyebrow 
    
    
       6  [5]               10  [6]               11  [10]            12  [11]          13  [12]
    bone_torso      -->  bone_Rclavical  -->   bone_Rupperarm   -->  bone_Relbow  -->  bone_Rhand      
    
       6  [5]               14  [6]               15  [14]            16  [15]          17  [16]
    bone_torso      -->  bone_Lclavical  -->   bone_Lupperarm   -->  bone_Lelbow  -->  bone_Lhand      
    
    
                          
       1  [0]             18   [1]                19  [18]            20  [19]
    bone_pelvis     -->  bone_RThigh     -->   bone_Rlowerleg   -->  bone_Rfoot


    The first number above each entry is a 1-based index of that bone and the second number in brackets
    is the index to its parent. The bracketed numbers are the hierarchy tree array for the skeleton.
    They tell the game engine which bone is whose parent so it can multiply all the right rotation matrices
    together to find out how to move a given vertex when an animation is played.

    Actually I've simplified it a little to explain how it looks in Milkshape. In a .cas animation file
    there is one more bone called Scene_Root that lies above bone_pelvis. It's position is always (0.0,0.0,0.0)
    and it is never animated. The way the above is encoded in a .cas file is


    Code:
    Scene_Root          0
    bone_pelvis         0
    bone_RThigh         1
    bone_Rlowerleg      2
    bone_Rfoot          3
    bone_abs            1
    bone_torso          5
    bone_head           6
    bone_jaw            7
    bone_eyebrow        7
    bone_Rclavical      6
    bone_Rupperarm     10
    bone_Relbow        11
    bone_Rhand         12
    bone_Lclavical      6
    bone_Lupperarm     14
    bone_Lelbow        15
    bone_Lhand         16
    bone_LThigh         1
    bone_Llowerleg     18
    bone_Lfoot         19

    In reality, the hierarchy tree array is a zero-based indexing into the bone name array with Scene_Root
    included. Those integers in that order is what you find in every .cas file containing a human animation
    for M2TW. This is a whole bunch of explanation to tell you that when you add bone_lever into your skeleton
    we will need to add one entry to the hierarchy tree array right after the number 19. That number will be 13,
    the zero-based index to bone_Rhand, which is it's parent. (This applies much later when the new skeleton
    gets exported to a family of .cas files.)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO