Here's My little tutorial on adding collision and physics to a custom nif file so that hopefull noone has to go through the same pain I did when was figuring this stuff out
Things you'll need:
- Blender 3.6 with Nif tools add-on
- Outfit Studio
- And lots of crossed fingers
Step 1: Assemble the Model in Outfit-Studio, texturing doesn't matter yet so don't bother
Step 2: In the Bones tab click the posing drop-down tab, play with the sliders to get the pose you want if your assembling a character model (Optional), then export the model as an Nif
Step 3: Open blender 3.6 and import your custom Nif using Niftools add-on, delete all of the pose bones under collection on the top right so there's no root folder
Step 4: Import an object with physics and collision:bottle, Paintjar etc, for our purposes we will use a beer bottle
Step 5: Under scene collection look for a tab that is prefixed by either convex,cube or cylinder; after you've selected it you should see a orange highlighted shape around your physics object
Step 6: Navigate to the bottom right of the screen where there are four blue tabs, click on the physics tab; after that there are several buttons the one we need to click is rigid body
Step 7: Under the rigid body tab set the type to passive, under nifttools collision bounds set the deactivator type to DEACTIVATOR_SPATIAL, the solver Deactivator to SOLVER_DEACTIVATION_LOW, the quality type to MO_QUAL_DEBRIS, the collision layer to OL_CLUTTER and motion system to MO_SYS_BOX_INERTIA
Step 8: Move and scale your collision shape so that it fits around your chosen custom Nif, you can delete any objects that came with your collision object all we needed was the collision box
step 9: Parent all of your custom geometry under your collision shape by holding left-shift while clicking and dragging your selected object (not your collision object btw) do this until all objects are connected to your collision shape
Step 10: Now that that's done you can move on to textures, on the bottom right there are two red tabs, click on the one that says materials
Step 11: In this tab on the top left is a plus and a minus symbol click the minus to remove any faulty texture rendering as we'll need to redo that anyway
Step 12: Click the button labeled new to create a new material node, next to base color is a yellow dot clicking on said dot brings up a menu, in the list click on image texture, then underneath it is a button labeled open use this to navigate to your texture that you want
Step 13: This is VERY important, underneath base color is a text box with the name of the texture you just selected rename it to base, then scroll down until you see the word normal just underneath alpha, click on the tab next to normal and in the list under geometry click the option labeled normal, if you don't do this step blender wont export your Nif for some reason, repeat this step for everything that needs a texture, now you can export your Nif
Step 14: Import your Nif into Nifskope, then look for and select the node BhkRigidBody until you see the collision parameters from step 7, make sure they match and don't say invalid or your physics won't work
Step 15: Also find and select the node NiMaterialProperty and scroll all the way down until you see alpha, if its set to 0 set it to 1
Step 16: Export your Nif with the save diskette at the top of the screen
and you're done you now have an Nif with physics and collision
I hope this helps someone in the future who's trying to do this, I spent the last two days trying to figure out how to do this so I could a tiny statuette of my grand champion that could be sold by merchants and whatnot and it was worth it in the end, so hopefully this will help in the future
P.S. this is not a guaranteed 100% solution its just what worked for me.