[Tut] Animate with Blender and Nifscope

Please somebody help!
I followed the tutorial, but I got a strange problem.:sad:


I am edited the greeting animation of julius caesar.

EDIT: Problem fixed. No need to help. :)
 

Attachments

  • Civ4ScreenShot0143.JPG
    Civ4ScreenShot0143.JPG
    13.2 KB · Views: 547
  • Civ4ScreenShot0144.JPG
    Civ4ScreenShot0144.JPG
    14.1 KB · Views: 546
I want to change KF . Where can I chose it?

PS I have read tutorial. But I want only change.
 
if you import you leaderhead you can also import an animation, select import animation and select the kf under keyframe file.

After the import you have the model with already set animation, now you have to remove or alter the already set keyframes of the bones you want change. (More or less the sam steps like described in the tutorial, only you will have a lot of keys already set).

No idea how stable the import script is, the last time i used it with leaderhead animations there were some issues (i was unable to import the periclas animation error free)
 
:rolleyes: - it´s called sarcastic, just in case, perhaps a pic with the two important areas marked in the import script dialog could help ...



btw it will take some to import an animation. And if all went good, in Blender after the import it will look like

 

Attachments

  • import_animation.jpg
    import_animation.jpg
    86.2 KB · Views: 461
  • import_animation2.jpg
    import_animation2.jpg
    88.6 KB · Views: 490
Is this normal?

unfortunally yes, but in most cases i saw it, there was no real problem with the imported animation (at least you will se no differences between you imported animation and the original animation). But like said, sometimes the can be a problem
 
Unfortunally, most skeleton bones are again set again in the animation. In general, if there is any info (rotation, scale, position) for a bone in the kf, this information will override the new setting in the nif.

If you only want a constant change of the values (eg change the relative position), you could add a new bone between the bone you want to change and their master in the skeleton. With the new bone you can control the position (or scale, rotation) of the other bone. And because the informations are applied relative to the current master, this would avoid the overriding from the kf
 
Unfortunally, most skeleton bones are again set again in the animation. In general, if there is any info (rotation, scale, position) for a bone in the kf, this information will override the new setting in the nif.

If you only want a constant change of the values (eg change the relative position), you could add a new bone between the bone you want to change and their master in the skeleton. With the new bone you can control the position (or scale, rotation) of the other bone. And because the informations are applied relative to the current master, this would avoid the overriding from the kf

thanks. I'll try messing with the animation then. I'm hoping the mesh will move easily with it.

In NIFSKOPE I tried editing position in the kf but couldnt make sense of how location changes in the kf file. for example if a hand moves up to the head - how to specify a start and end point at a certain time
 
In NIFSKOPE I tried editing position in the kf but couldnt make sense of how location changes in the kf file. for example if a hand moves up to the head - how to specify a start and end point at a certain time

honestly, beside really small things i wouldn´t use nifskope for this. I´ve started my experiments with animation there and you can really waste a lot of time trying to acheive the things there you could do quickly (~ 1 hour) in Blender. The biggest problem with nifskope and leaderheads kf is, that you have mostly NiBSplineCompTransformInterpolator, which can´t be easily (means, i still have no clue how) modified and there is no transform NiBSplineCompTransformInterpolator to NiTransformInterpolator spell included.

If you import and reexport a kf, the blender script will do this job. You can edit the NiTransformData in the kf quite easy, you have the 3 big values, rotation (sometimes as xyz rotation or also as quaternion), translation and scale. Every key has also the inforamation at which time he shall be played. There keys represent the keys in Blender [everytime you press Alt + I in Blender a new key is generated].* If there are no values in a certain object - eg no scale, than the scale from the parent node (NiTransformInterpolator) is used. Only if there also no scale is defined, the scale from the nif is used.

to your example:
if you want to move the arm up, you go to the controller for the bones. There you look for a key (if there is non, add keys) around the time you want to start the sequence. As next step, go to next key and set the end position and adjust the time.
(this is a quite short describtion, of course you must in most cases the number of keys, also every keys must(?) be in order considering the time and a to look natural you must add some keys between the start and the end position) - hope this doesn´t sound too confusing.
 
if someone can help, it will be greatly appreciated..... :) trying my hand at very simple animation but not being very successful.... :(

i made a simple kneel/shooting animation to replace the rangedstrike kf. i imported to blender the original infantry nif and original rangedstrike kf as per tutorial. i linked the body mesh to the bones and did the animation. i exported the kf and replaced the original rangedstrike.kf with the modified version. i put all the nifs, kfs and kfm in the "american infantry" folder (SEE PIC 1)



and modified the xml (SEE PIC 2)




the first result had the rifle in the correct positions EXCEPT during the rangedstrike animation, so i made the rifle a child of the bones in blender and this is what i now get...

in PIC 3 we see that the rifle is in the wrong place in idle, also the UI for the unit does not correspond correctly....also the avatar is missing in the left corner...



in PIC 4 we see that the amination plays correctly but I have not figured out how to attach the effects correctly....



i have attached a zip file which includes the modified kf, blend and nif and would appreciate some education :D
 

Attachments

  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    152.8 KB · Views: 457
  • ArtDef.jpg
    ArtDef.jpg
    190.7 KB · Views: 427
  • unit.jpg
    unit.jpg
    117.5 KB · Views: 449
  • Civ4ScreenShot0007.JPG
    Civ4ScreenShot0007.JPG
    240.7 KB · Views: 434
  • infantry_anim_test.zip
    146.8 KB · Views: 274
Ok, i will try to post my guesses about the issues you posted:

The rifle itself is a child of the Rifle_Springfield node and is therefore affected by the movements of this node, if you move the rifle to another node they mesh of the rifle will also be affected by the this movements and no longer by the movements of the Rifle node.

You could try to work with the Rifle_Springfield bone in the animation to set the position of the rifle in the animation and i wouldn´t rig (or attach) the weapon to any other node. To get this node also imported you have to activate the "import extra skeleton nodes as bones" option. (unforuntally it would be good to remove the weapon effect node, the sounds node, the effects node from the imported mesh). If you have trouble doing this you could attach a second instance of the rifle to the hands and work with manual added visibilites controllers in the kf to "switch" between the weapons and the effect placeholders.

The effect itself is played at the position of the RIFLEBLAST_MODERN placeholder node in the nif, if you use the Rifle_Springfield bone to set the position of the rifle, it should automatically have the correct position (it´s also a child of the Rifle_Springfield bone and therefore also affected by animation attached to this bone). If you choose another way you could add a new node (eg a copy of RIFLEBLAST_MODERN called RIFLEBLAST_MODERN2) and use this node as placeholder node in the kf (editing the text keys of the animations and exchanging the name of the node there)

Also looking at your blend i saw that you didn´t set the framerate to 30 FPS. It´s important for civ4, because some animations have fixed sequence lengths - and differences from this length can cause problems. A second issue could be that your strike animation is to short, strike has a fixed frame length of 21 frames, your animation has only 15 frames atm. [or to be more exact: number in the flowchart +1 and 30 FPS, so you should have 22 frames in the animation, otherwise the length of the exported kf is not identical to a similar vanilla kf] Also if you alter the strike animation you must/should also alter the fortify, fortify idle, hurt and die animation. Because looking at the animation flowcharts all this animations are linked. And i believe that differences between end position in one and start position in another of this linked animation sequences can cause problems.

i attached a not in game tested version of your kf with fixed length (means 22 frames) and informtation for the Rifle_Springfield node to fit to your soldiers position (to work the weapons should be like in the vanilla infantry nif a child of the Rifle_Springfield and not of the hand bone)

and after all this: your work looks really nice so far :)

edit:
your UI problem could be caused by a missing reference file - i see you renamed the kfm to infantry_america.kfm (i guess it´s a copy from the infantry.kfm), and there is no infantry.nif. If your kfm is an unchanged copy, the kfm refers to a master nif (infantry.nif), if this file isn´t in the same folder the games produces errors (with python errors activated you have a lot to click). I guess this is the reason for the UI problem.

To check this, try to open the kfm with nifskope, if you see a model the reference nif is there, if you see no model, your reference nif is missing. If it´s the second, try to rename one of your nifs to infantry.nif (or copy the vanilla one in the folder or change the name of the reference nif in the kfm)
 

Attachments

  • infantry_md_rangedstrike2.zip
    3.9 KB · Views: 310
BIG THANKS!!

still at work, but i will keep u informed of progress :goodjob:
 
Top Bottom