Page 4 of 4
Re: NIF to FBX?
Posted: Sun Apr 02, 2023 1:21 am
by 05SpeedMaster
Does not matter the file format. One needs to understand the basics of Parent-Child relationship in skeletal structures.
There is also the GrandParent-Partent-Child and such! And in some systems? Each bone desendent of a Parent Bone needs to be accounted for.
So if an Arm bone goes up? Any Bone attached needs to account for that.
In some cases? The animation information found in a file does not account for the computational differences.
So a strict export of an animation file may show as a screwed up animation with a subpar exporter.
So say I have an animation that the arm is raised. Now in the Game Engine the rest of the arm follows.
Upon export of the animation information? The animation can be screwed up since computational movement is in the Engine itself.
It is rare but I have seen it and have Game source code that proves it.
It is easy to see the effect if you use 3dMax and know how to create a Biped with given bone information.
Re: NIF to FBX?
Posted: Sun Apr 02, 2023 6:27 am
by shakotay2
xandro wrote: ↑Sat Apr 01, 2023 5:37 pmI only found those `Compact Control Points` which has some numbers Im not sure what they mean, on the other hand I don't see any floats values.
Once you've found out what they mean you'll be king.
But before reinventing the wheel I'd suggest to check
Nif.xml for example (just a wild guess, type is float here, while your CCPs are integers):
Code: Select all
<niobject name="NiBSplineInterpolator" abstract="1" inherit="NiInterpolator">
For interpolators storing data via a B-spline.
<add name="Start Time" type="float">Animation start time.</add>
<add name="Stop Time" type="float">Animation stop time.</add>
<add name="Spline Data" type="Ref" template="NiBSplineData">Refers to NiBSplineData.</add>
<add name="Basis Data" type="Ref" template="NiBSplineBasisData">Refers to NiBSPlineBasisData.</add>
</niobject>
I don't have any idea:
Code: Select all
29616 32769 31611 29616 32769 32018 29616 32769 32509 29616 32769 32767 29616 32769 32556 29616
32769 32048 29616 32769 31584 29616 32769 31421 29616 32769 31482 29616 32769 31809 29616 32769
32339 29616 32769 32731 29616 32769 32655 29616 32769 32192 29616 32769 31683 29616 32769 31466
29616 32769 31523 29616 32769 31544 32770 32766 32814 32770 32766 32814 32770 32766 32814 32769
32766 32814 32770 32766 32814 32770 32766 32814 32770 32766 32814 32770 32766 32814 32770 32766
32814 32770 32766 32814 32770 32766 32814 32770 32765 32814 32770 32766 32814 32770 32766 32814
32770 32766 32814 32770 32766 32814 32770 32766 32814 32770 32766 32814 32770 43162 32770 43118
32770 43019 32770 42848 32770 42677 32770 42523 32770 42410 32770 42353 32770 42382 32770 42492
32770 42649 32770 42828 32770 43000 32770 43135 32770 43208 32770 43242 32770 43241 32770 43204
32770 43127 32770 42987 32770 42814 32770 42636 32770 42481 32770 42376 32770 42354 32770 42426
32770 42562 32770 42733 32770 42913 32770 43068 32770 43182 32770 43208 32770 43202 32770 43178
32770 43162 32770 43162 62554 32784 62474 32807 62305 32861 62030 32956 61746 33054 61467 33144
61202 33213 60969 33252 60774 33244 60644 33189 60541 33109 60449 33016 60384 32927 60347 32856
60348 32817 60393 32795 60493 32791 60647 32804 60887 32835 61232 32898 61645 32981 62107 33070
62588 33152 63063 33212 63506 33232 63884 33203 64178 33140 64334 33053 64370 32958 64300 32869
64169 32805 63950 32778 63475 32769 62965 32777 62675 32783 62573 32783 33752 43532 33713 43505
33624 43441 33452 43305 33257 43135 33053 42942 32875 42760 32769 42647 32824 42707 33008 42898
33223 43104 33431 43287 33605 43426 33729 43517 33792 43560 33821 43579 33820 43579 33789 43558
33722 43512 33593 43417 33416 43275 33206 43089 32991 42881 32814 42696 32771 42649 32903 42791
33108 42996 33325 43196 33519 43359 33670 43474 33770 43545 33792 43560 33787 43557 33766 43542
33752 43532 33753 43532 48368 33314 48368 33613 48368 34301 48368 35611 48368 37088 48368 38621
48368 39947 48368 40725 48368 40321 48368 38957 48368 37345 48368 35771 48368 34449 48368 33488
48368 33010 48368 32769 48368 32781 48368 33036 48368 33544 48368 34542 48368 35886 48368 37471
48368 39079 48368 40393 48368 40715 48368 39733 48368 38209 48368 36577 48368 35110 48368 33940
48368 33196 48368 32963 48368 33028 48368 33218 48368 33306 48368 33311 870 36588 846 36424
791 36046 689 35345 579 34576 468 33799 376 33145 323 32769 351 32964 445 33632
560 34443 677 35260 779 35966 856 36492 895 36756 915 36891 914 36884 893 36742
851 36461 772 35916 668 35200 550 34379 436 33571 346 32929 324 32775 391 33249
497 34005 616 34839 727 35611 820 36243 880 36653 899 36783 894 36747 878 36641
871 36593 870 36590 31148 33512 31185 33493 31269 33448 31431 33343 31616 33204 31809 33036
31977 32873 32076 32769 32025 32824 31852 32997 31648 33177 31451 33329 31287 33437 31170 33502
Some values (say 32769 or 32770) appear and repeat in a strange manner. I thought 29616 to be "reliable" but it has 18 occurences only.
edit: after having had a closer look into the NifSkope source code I'd suggest to download and compile it (Qt required with the version I have).
There's void doKeyframes() in Skeleton.cpp. It should be possible to patch that code for logging the frames.
Also I overread this:
xandro wrote: ↑Thu Mar 30, 2023 5:32 pmAlso I remember nifskope could export nif skeleton to fbx.
Could you tell which NifSkope version you used for this?
Re: NIF to FBX?
Posted: Sun Apr 02, 2023 10:45 am
by xandro
Sorry

I wanted to say Noesis not nifSkope.
I will download a source code and try to modify some things.
I also asked a couple of people on discord server called "Nif Mania" I hope someone will respond.
edit : someone told me the frames in kf file depends on the type of interpolator, some int/short values represent floats in smaller range like 0 to 1 or -1 to 1
They also told me about rotations : "If you want to get the rotations, you use the rotation handle as the offset in the Compact Control Points array of the NiBSplineData. You take element size as 4. You then get from that array the Num Control Points elements that you have in NiBSplineBasisData"
When I asked about keyframes they told me this :
"I assume you mean the times associated with that, they are uniform between the start and stop time"
Here is how pyffi calculates them :
https://prnt.sc/4vHpP9RF7dKT