blender_niftools_addon icon indicating copy to clipboard operation
blender_niftools_addon copied to clipboard

Support for collision sub shapes (Fallout 3/NV)

Open FeuerTiger86 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. Fallout 3/NV collision meshes can have multiple sub shapes with different Havok Materials. I have recently helped updating a guide for FNV about making collision with Blender and NifSkope, after I found a way to make collision meshes with sub shapes (I'm Pherim on the Nexus). Version 0.1.0 of this plugin can export collision (with one minor issue), but if there are multiple collision meshes in blender, these are exported as separate bhkCollisionObjects. This works, however it means that some parts of the mesh won't show bullet holes when fired at, because additional bhkCollisionObjects are put in separate NiNodes and bullet holes only work on NiTriShapes/Strips in the same branch as the bhkCollisionObject, that means in the same node or a subordinated one.

Describe the solution you'd like If possible, multiple collision meshes should be combined into a single bhkCollisionObject with sub shapes.

Describe alternatives you've considered A workaround is grouping the collision mesh and the affected geometry in an empty object in Blender, so they are already in the same NiNode after export.

FeuerTiger86 avatar Jun 26 '23 07:06 FeuerTiger86

Could you attach a nif from the game that has the feature you describe?

Candoran2 avatar Jun 26 '23 16:06 Candoran2

Sure. Many of the larger meshes, especially buildings, have this. For example, barracks01.nif has three sub shapes: One for wood, which covers most of it, one for metal (the chimneys and power boxes), and one for glass (windows). To be able to see the individual sub shapes, you need NifSkope 2.0. Then, in the hkPackedNiTriStripsData you can select the sub shapes and they are highlighted in yellow if collision geometry is enabled. 2023-06-26 18 45 22 barracks01.zip

In the collision guide that is linked above is described how colliders with multiple sub shapes can be made with Blender and NifSkope, by exporting them as normal geometry and converting them into a single bhKPackedNiTriStripsShape. It works, but obviously it would be a lot more convenient if they could be exported directly from Blender as collision sub shapes.

It's just a suggestion, though, as the solution from the guide works, and I'm not really modding the game currently, so it's not like I need this feature.

FeuerTiger86 avatar Jun 26 '23 16:06 FeuerTiger86

Oblivion can also have multiple Sub Shapes.

Ideally Collision with Sub Shapes should just import as one mesh with multiple materials and exporting a mesh with multiple materials should export a collision with Sub Shapes.

Automatic combining of multiple meshes into Sub Shapes, as described in the original post, in my opinion isn't a good solution though.

ja231c avatar Jul 24 '24 19:07 ja231c