Difference between revisions of "NifSkope: Adding Collision Model"

fixing up the material setting part
imported>Entim
m (minor fixes)
imported>Entim
(fixing up the material setting part)
Line 59: Line 59:


===Preparing the low-poly model===
===Preparing the low-poly model===
Note:
Instead of the low-poly model, you can use a '''NiTriShape''' or '''NiTriStrips''' block from any NIF (including the high-poly model!).


*Switch to the instance of NifSkope where you loaded your low-poly model.
*Switch to the instance of NifSkope where you loaded your low-poly model.
Line 66: Line 69:
*Right-click on the '''NiTriShape''' block again, and choose '''Mesh -> Strippify''' from the menu. This converts the the geometry from triangles to strips. Strippifying is needed becouse the collision geometry of ''arstatue01.nif'' was built from strips, and the low-poly model's geometry is going to replace it.
*Right-click on the '''NiTriShape''' block again, and choose '''Mesh -> Strippify''' from the menu. This converts the the geometry from triangles to strips. Strippifying is needed becouse the collision geometry of ''arstatue01.nif'' was built from strips, and the low-poly model's geometry is going to replace it.
*Reset the '''Translation''' in the '''Block Details''' window if it is not zero.
*Reset the '''Translation''' in the '''Block Details''' window if it is not zero.


===Importing the new data===
===Importing the new data===
Line 88: Line 90:
*Select the '''4 bhkNiTriStripsShape'''. Double-click on the '''Value''' of the '''Strips Data''' entry in the '''Block Details''' window, and enter the reference number of the new NiTriStripsData ('''1'''). The low-poly model's geometry data is now linked to the collision shape.
*Select the '''4 bhkNiTriStripsShape'''. Double-click on the '''Value''' of the '''Strips Data''' entry in the '''Block Details''' window, and enter the reference number of the new NiTriStripsData ('''1'''). The low-poly model's geometry data is now linked to the collision shape.
[[Image:CollTut15.gif|100px|right|thumb]]
[[Image:CollTut15.gif|100px|right|thumb]]
*The collision data blocks must be in a specific order, which the NiTriStripsData doesn't fit in yet. Right-click on the '''1 NiTriStripsData''' block, and choose '''Block -> Move Down'''. Notice the reference number has changed to '''2'''. Repeat the '''Move Down''', so the number becomes '''3'''.
*The collision data blocks must be in a specific order, which the NiTriStripsData doesn't fit in yet. Choose '''Reorder Havok Blocks''' from the '''Spells''' -> '''Sanitize''' menu. To reorder the blocks manually, right-click on the '''1 NiTriStripsData''' block, and choose '''Block -> Move Down'''. Notice the reference number has changed to '''2'''. Repeat the '''Move Down''', so the number becomes '''3'''.
*Save the NIF.
*Save the NIF.


Line 94: Line 96:




===Fixing up===


NIFs created by this method appearanly always act like stone, no matter what their Material property is set to.


You have to insert a bhkListShape to solve this problem.
*Righ-click on the '''5 bhkRigidBodyT''' block. Choose '''Block''' -> '''Insert''' -> '''BHK''' -> '''bhkListShape'''.
*Set the '''bhkRigidBodyT''' block's '''Shape''' property to the reference number of the new bhkLishShape ('''6''') in the '''Block Details''' window. BhkLinkShape is now linked to the bhkRigidBodyT block.
*Set the '''bhkListShape''' block's '''Num Sub Shapes''' property to 1. Update the '''Sub Shapes''' array, just as you did when linked the high-poly model's NiTriShape to the NiNode.
*Expand the '''Sub Shapes''' array, and enter the reference number of the bhkNiTriStripsShape ('''4''').
*Reorder the havok blocks.
Example of the result NIF is [http://www4.rapidupload.com/d.php?file=dl&filepath=27622 here].




Line 105: Line 116:


[[Image:CollTut13.gif|100px|right|thumb]]
[[Image:CollTut13.gif|100px|right|thumb]]
Select '''4 bhkNiTriStripsShape''' block. Double-click on the '''Value''' of the '''Material''' property (currently '''HAV_MAT_STONE'''). You get a drop-down list of available materials. This list with some explanation is available as tooltip (hold your mouse over the '''Type''' field of the Material property). Choose the material from the dropdown list, or enter the appropriate number which can be found [http://niftools.sourceforge.net/docsys/index.php?mode=list&table=attr&block_id=383&version=335544325 here] as well. This setting controls the hit sound, step sound, and arrow penetrability of the surface.
*Select '''4 bhkNiTriStripsShape''' block. Double-click on the '''Value''' of the '''Material''' property (currently '''HAV_MAT_STONE'''). You get a drop-down list of available materials. This list with some explanation is available as tooltip (hold your mouse over the '''Type''' field of the Material property). Choose the material from the dropdown list, or enter the appropriate number which can be found [http://niftools.sourceforge.net/docsys/index.php?mode=list&table=attr&block_id=383&version=335544325 here] as well. This setting controls the hit sound, step sound, arrow penetrability, and particle effect of the surface.
 
*If you inserted a '''bhkListShape''' block, click on it, and notice that it also has a '''Material''' property. You can tweak the arrow penetration, particle effect, and sound by the material settings of the bhkListShape and the bhkNiTriStripsShape blocks. Arrows will only penetrate if both block's material is penetrable.
 
 
 
 
 




Anonymous user