Jump to content

2 Screenshots

About This File

First of all. Great thanks to all 2.49 NifTools creators!!! They did a GREAT job, but for too old version of Blender.
Time to go further? I'll try. ;)

 

Requires:
Blender 2.7+ (I'm using 2.78)
Pyffi 2.2.3 and nifxml-0.7.1.0 from https://github.com/niftools

 

Works ONLY with SKYRIM's nif-kf files.
Works with humans and creatures ones (if they have 'NPC Root [Root]' NiNode as reference point - seems all they have).

 

We have enough good looking armors (really?), but lack of good animations. This tool IS NOT for creating/editing armors, my goal - animations.

 

Functionality:

  1. Import bodies and skeletons '.nif' files.
  2. Export .kf-file for futher hkxcmd convertation to hkx.
  3. You may save skeleton's .nif file from Blender with unchecking 'create .kf', but I didn't see any reason and it will be unusable.


Installation:

 

Spoiler

If installed "msi"-version of Blender, then Python's path must be found automatic when installing "pyffi" with using pyffi's "install.bat".
If zip-version of Blender is used:
1. Suggested that you unpack Blender in "C:\Blender\2_79" - i call it as [bend_path]
2. You have to go in "[blend_path]\2.79\python\bin\" to check that python.exe is located here. In my case this path is "C:\Blender\2_79\2.79\python\bin". I'll call it as [blend_python_path]
3. Extract "pyffi-pyffi-2.2.3.zip" where you want. Let it be "c:\installs\pyffy" (call it [pyffi_inst_path])
4. I suggest that you are using Windows 8.1 and have no such tools as "Total commander" or similar. Then right click on 'windows start' button and select 'Run'. Type 'cmd'. 'command line tool' window will pop-up.
5. type:
cd "[pyffi_inst_path]\pyffi-pyffi-2.2.3"
In my case:
cd "c:\installs\pyffy\pyffi-pyffi-2.2.3"
6. type:
"[blend_python_path]\python.exe" setup.py install
In my case:
"C:\Blender\2_79\2.79\python\bin\python.exe" setup.py install
7. After notification lines will stop and you'll see a cursor for command, type:
exit
or just close window with 'close'-button.

That's all about Pyffi. Remains nif.xml:
1. Go to [blend_path]\2.79\python\lib\site-packages\pyffi\formats\nif (in my case it "C:\Blender\2_79\2.79\python\lib\site-packages\pyffi\formats\nif") and create folder "nifxml".
2. Put in created folder "nif.xml"-file from "nifxml-0.7.1.0.zip" archive
That's all.

With using "Skyrim nif-data utils 1.0 beta.zip" there is two ways:
1. Recommended. Unpack archive in "[blend_path]\2.79\scripts\addons".
2. With "File->User Preferences" just select archive while "Install Add-on from File". Even with notifications or errors in console while install all must work.

To delete my add-on:
1. Just delete folder 'io_nifdata' from "[blend_path]\2.79\scripts\addons". In case of "Install Add-on from File" search add-on in "C:\Users\YOUR_ACCOUNT_NAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\"

 

Goto Blender's 'File->User Preferences->Install From File" and so on...

 


Usage and Tips.
IMPORT
'File->Import->Skyrim nif-format Data (.nif)'

  1. About importing body nothing to say, just select .nif, import.
    1.1 After import select attached to imported body Armature and delete it.
  2. A skeleton (except XPMSE) can be imported without ANY preparations, i.e. as is (only scaling female's 'NPC L Hand [LHnd]' and 'NPC R Hand [RHnd]' to 1.0 have to be done). Non-standard scaled skeletons have to be prepared to 1.0 scaling or in-game you can get twice scaling. Due to a HUGE amount of bones in XPMSE skeleton is used it causes pyffi's scripts to raise an Exception while exporting '.kf', but import OK. So you have to delete with NifScope all unused branches, like ArmLeftDismember, LowBodyEviserate,... etc, all CME NiNodes nodes too. It will not affect on animations but will help you also do not mess with huge amout of bones in Blender and speed up the convertation.
    Note: I do not plan to modify pyffi's code to eliminate crash!!! At least, you have to reduce XPMSE skeleton's nodes amount only once and re-use it.
  3. Note about attaching MESHES to skeleton.
    3.1 With body selected, go to modifiers. Add Armature deform modifier and change 'object' property to imported skeleton. And repeat for other parts: feet, ...etc.
    3.2 Any 'Vertex Groups' that exist in body but absent in skeleton may be deleted (SPB_32_BODY, SPB_33_HANDS and so on)

 


ANIMATION:
Major difference from 2.49 NifTools:
Instead of old NifTool's logic with using F-Curves (or IPO in 2.49 terms), current scripts in 'POSE' mode moves through ALL bones and FRAMES with reading real matrixes and offsets of bone's position.
So with creating just a pose, you don't need to insert keyframes at all.
Why logic was changed?
If using constraints all affected by constraint bones DON'T have F-Curves (only constraint itself has), also they pose_bone's 'matrix_base' and 'location' properties stay unaffected.
Now you can implement ANY constraints for creating completely functional rigs, especially with implementing 'Inverse Kinematics' constraint.
Any rotations are allowed for any bone via constraints.
But there is a limitation in changing location:

  • At first, any location change (except ROOT bones) will deform body. For example, moving 'L Thigh' left/right/up/... will make from your character a cripple.
  • If you want to move bone anyway, move it directly, but not via constraint.
  • Or while export dialogue add to the field 'Moved bones' ones that scripts will recognize as allowed to be moved by constraints and calculate they offsets.
  • By default only 'NPC Root [Root]' and 'NPC COM [COM ]' are allowed. Use ',' as separator.
  • I added this field only for creature's skeletons, because they don't have 'NPC COM [COM ]' node, but they have 'Canine_COM", for example.


Don't care about added by you bones: Controllers, Drivers, Targets... Anyway hkxcmd will just ignore them while convertation.
BUT NEVER RENAME IMPORTED BONES.
Accepted ONLY 'LocRot' keyframes and they 'Visual' variants.
Scaling are not implemented at all. I don't see any reason to do it.

 

EXPORT:
'File->Export->Skyrim nif-format Data (.nif)'
Armature must to be selected and active.

  1. Simpliest but slow export method: Frame-by-frame. This mode not require additional preparations after creating animation. All frames and all bones are scanned and resulting .kf can have a huge size. About 'Moved bones' field, see ANIMATION' section.
  2. Fast 'F-Curve' method only for those who is familiar with Blender. Only real keyframes are exported to .kf, so before export you have to create 'Visual' keyframes for bones that not rotated directly by you, but with constraints.


UPDATE/UPGRADE:
Sometimes with upgrading to new version I have to change format of stored data. I'll try when able to give user an ability to update without loosing all work that have been done.
Select armature in 'object' or 'pose' mode, in Properties Panel goto Armature (to be more precisely in ObjectData Space).
At buttom of all panels you'll see 'io_nifdata' panel with 'update .blend file' button.
Click on it. But anyway, before upgrading make a copy of your file. And if something with old but updated work goes wrong, rollback,
restore file and finish your work using previous version of scripts.

 


PLANNED:
1. Nothing at current moment as I'm not playing Skyrim until....


CHANGES:

 

22 Nov 2017 v1.00 beta

- just reuploaded as zip-archive with proper folder location for being recognized by Blender.

- also for those who having troubles with installing Pyffi and Nifxml in description added steps for installation

 

09 May 2017 v1.00 beta
- Added patch from post
- Added option from post
- Added .kf animation import. see post for how-to

 

08 March 2017 v0.10beta
- Added. Import meshes
- From archive removed examples .blend files. With importing meshes added functionality i see no reason for them.

 

12 Feb 2017 v0.05beta:
- Added. Direct reading of F-Curve data. See this post.
11 Feb 2017 v0.04:
- Changed. Sequence of exporting bones is going from root to children. As result it's easy to find in exported .kf desired node for check/edit...
- Added. Bone priorities management. See EXPORT section.
- Instead of store data in textblocks of Blender file (which can be accidentally corrupted) all internal data are stored in properties of objects.
- Added. Update functional. Because data is moved, use UPDATE ability. See UPDATE section.

 

10 Feb 2017 v0.03:
- Fix. 'Import/Export scale correction' different from 1.0 settings don't causes error. Now editing F-Curves in 'Graph Editior' may be more comfortable.
09 Feb 2017 v0.02:
- Allowed to implement constraints for bones and create completely functional rigs. See ANIMATION section.
- Changed (is it really necessary?). With extracting vanilla Skyrim .hkx-es to .kf, user_version is dispayed as 11, i.e. 11/83, not 12/83 as for .nifs, so now 11/83 is used.
- Changed (is it really necessary?). With same tries in NiControllerSequence->Controlled Blocks->[block]->priority I always got 0, but NifTools means 26 as default. 0 now used.

 

Again and again, sorry for my English.

 

Kind Regards


Other Files from vpoteryaev


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use