Starfield
0 of 0

File information

Last updated

Original upload

Created by

Snapdragon

Uploaded by

Snapdragon2

Virus scan

Safe to use

Tags for this mod

About this mod

A custom animation system for Starfield that can load and play GLTF animations.

Requirements
Permissions and credits
Changelogs


NAF adds a fully custom animation system to Starfield that can load and play the widely-supported GLTF animation format.

Requirements

Starfield Script Extender
Address Library for SFSE Plugins

Highly Recommended

Trainwreck Crash Logger
Trainwreck provides a lot of useful information if the game crashes. If you get a crash while using NAF, please post the crash log in the Bugs section with information on what you were doing before the crash occured, as well as any other mods you have installed.

How to Use

Creating Animations in Blender

Note #1: Steps 1 to 7 can be skipped if you download the Blender Scene file in the optional downloads.
Note #2: By default, NAF only comes with support for the Human skeleton. For information on adding other skeletons, see the "Adding Non-Human Skeletons" section.

1.) To start, you'll need the skeleton for the race you'd like to animate. This can be extracted from the game using NifSkope. Open one of Starfield's "Meshes" .ba2 files in NifSkope's archive browser and open the skeleton.nif file for the corresponding race. Then, go to File -> Export -> Export .glTF. Do the same for the meshes for the corresponding race, such as body, hands & head.

2.) Import the skeleton & meshes into Blender. You can delete the LOD1/LOD2/LOD3 versions of the meshes and just keep LOD0. The next step is to constrain the meshes' bones to the skeleton. To start, select the armature attached to one of the meshes you imported, then switch to Pose Mode at the top left.



Note: Steps 3 through 7 will not affect the final result, they just allow you to see the mesh moving in Blender instead of only the skeleton.

3.) Select the first bone attached to the mesh and copy its name.


4.) Select the Bone Constraint tab in the panel on the right.


5.) Add a new "Copy Transforms" constraint.


6.) Paste the name into the Target box and select the first option in the list that comes up.


7.) Repeat steps 3-6 for every bone attached to the imported meshes. Once done, moving the skeleton will now properly move the mesh(es).

8.) Switch from Pose Mode to Object Mode and animate the skeleton any way you'd like. There's nothing special to Starfield about this step, just normal Blender animation. There's a ton of videos on YouTube that explain how to animate in Blender in-depth.

9.) When you're ready to export your animation, right-click on the skeleton's Root node and choose Select Hierarchy. Then, go to File -> Export -> glTF 2.0.



10.) Copy the export settings in the images below. Both the .gltf and .glb formats are supported. The "Group by NLA Track" setting depends on how you made your animation. But if you're not sure what it means, leave it disabled. Optimize Animation Size can also be enabled, depending on preference.







10.) Save the file somewhere in the Starfield/Data/NAF folder. 

Playing Animations In-Game

NAF currently has two methods of starting animations in-game - with console commands, or through the cross-plugin API.
To start an animation with console commands, open the console in-game and select an actor, then enter one of the following commands:

naf play <file_path>
Plays a .gltf/.glb animation on the selected actor, looping until stopped. The file path is starting from the Starfield/Data/NAF folder.
i.e. if you have an animation at Starfield/Data/NAF/MyCoolAnimation.gltf, you would just enter MyCoolAnimation.gltf as the file path.

naf stop
Stops any .gltf/.glb animations currently playing on the selected actor.

If you are an SFSE plugin developer and would like to start NAF animations from your plugin, you can copy the API header available here into your project. The API automatically finds NAF's exported functions, so all you have to do is call them. Note: Make sure to not call any NAF API functions before the kPostLoad SFSE event, as the NAF dll might not be loaded before that point.

Adding Non-Human Skeletons/Extending Skeletons

NAF maps skeletons by race. You might've noticed that NAF comes with a HumanRace.json file in the Starfield/Data/NAF/Skeletons folder. This file lists out all of the nodes in the Human skeleton that animations can map to. The nodes don't need to be in any particular order, and if someone releases an extended skeleton, you can just add the node names here.

To add support for other races, copy the HumanRace.json file and rename it to the editor ID of the race you want to support (editor IDs can be viewed in xEdit). Then inside the new file, replace the list of nodes with the names of the nodes for the new race's skeleton. To find the names of the nodes, extract skeleton.nif for the corresponding race from the game's "Meshes" .ba2 files and open it in NifSkope. Starting from the Root node, all the names of the attached nodes are what you need. Once you've got them listed out, save the file and restart the game. NAF will automatically recognize the skeleton information.

Planned Features

- More API functions.
- Papyrus bindings once that becomes available in SFSE.
- Co-save serialization once that becomes available in SFSE.
- Synchronized animations with any number of actors.
- Root bone support. (Added in v1.0.3)

Limitations

NAF's animation system runs on top of the game's normal animation system. This means it can't replace vanilla animations, but it can override them if a NAF animation is started at the same time. Also, since SFSE doesn't have co-save serialization yet, NAF isn't able to remember which animations are playing between game sessions. If a NAF animation is playing and you save the game, that animation won't be playing when you reload that save.

Credits

Big thanks to maximusmaxy for sharing their Starfield RE findings.
The Starfield-Reverse-Engineering team for CommonLibSF.
meh321 for Address Library for SFSE Plugins.
Ian Patterson for Starfield Script Extender.

Links