FO4 Connect Points - BadDogSkyrim/PyNifly GitHub Wiki

Fallout 4 weapons, armor, and workshop build items use connect points to attach parts of the weapon or armor to each other, e.g. so you can have different stocks and scopes that attach to the same receiver on a weapon. PyNifly has special handling for them:

  • The parent object (e.g. the receiver) defines a set of parent connect points, which set the location and orientation of each part. The naming convention is "BSConnectPointParents::P-XXX", where "P-XXX" is the part. E.g. "BSConnectPointParents::P-Scope" defines where the scope goes. In Blender, the connect point is an EMPTY that follows this naming convention. "XXX" is the part of the name used in CK to associate the parts.
  • A parent connect point may optionally name an NiNode as its parent, and any transform associated with that node will be applied to the parent connect point. In Nifskope this is not reflected in the nif's tree structure, but when imported the object representing the NiNode will be made parent of the object representing the parent connect point.
  • It's possible that a connect point parent is a bone in an armature. In that case the connect point is parented to the bone. This is only possible in recent versions of Blender, so if it's not working you've gotta upgrade.
  • The child object defines a single "BSConnectPointChildren" node with no defined location. This node can have multiple names, which associate the part with the parent connect point. The names are stored in custom properties "PYN_CONNECT_CHILD_#". (The only use I've seen for multiple names is to handle misspellings, e.g. "C-Receiver" and "C-Reciever"). There's also a flag PYN_CONNECT_CHILD_SKINNED.

In game the part will be rendered at the location and orientation of the connect point defined in the parent. To make designing a weapon with multiple parts easier, the importer does the following:

  • Child connect points are represented as an EMPTY.
  • If a child connect point is defined in the nif, the entire contents of the nif are made children of the child connect point (so moving the connect point moves the entire contents of the nif).
  • If nothing is selected on import, the part is created at the origin and the child connect point is at the origin.
  • If a parent connect point is selected, the child connect point is constrained to the location and orientation of the parent connect point. Since everything else is parented to this point, that transforms the entire part to the location where it will be rendered in game.

On export, the part is exported relative to its child connect point.

So you can work with a weapon system by importing the parent, selecting a connect point, then importing the part that connects at that point. Repeat with all the parts you want to work with. You can then do whatever editing you like, and what you see will be what you get in game. (You can also select all the weapon parts and import them in one step. The importer will do its best to connect everything up correctly. But it will only handle one level of hierarchy correctly--receivers have barrels which have scopes--if the scope comes in first, the importer won't know where to put it.)

If working from scratch, position and orient the parent connect point as you like, duplicate it, and rename the copy to be the child connect point. Create the custom properties to define the name. Optionally change the "empty" shape to be a sphere so you can distinguish it from the parent connect point at the same place. Now make it the parent of all the meshes for the part. Export as usual.

To export a part, select the child connect point and all its children. To export the base, select everything that came in the base nif, including the parent connect points.