Difference between revisions of "NifSkope: Adding Collision Model"

fixed/clarified some parts
imported>Entim
(removed from Tutorials category, added to Solutions; it seems people don't take the time to read Finessing Physics)
imported>Entim
(fixed/clarified some parts)
Line 18: Line 18:
*Make your model in your 3D modeller application.
*Make your model in your 3D modeller application.
*Create the low-poly version of the model without any texturing or material settings.
*Create the low-poly version of the model without any texturing or material settings.
*Export these models in NIF or OBJ format. Pay attention to remove duplicated vertices before exporting!
*Export these models in NIF or OBJ format.
**See [[NIF Importers and Exporters]] for import and export plugins.
**See [[NIF Importers and Exporters]] for import and export plugins.
**See [http://www.niftools.org/wiki/index.php/NifSkope/Mesh_import_export NifTools.org: Mesh import export] for OBJ exporting help.
**See [http://www.niftools.org/wiki/index.php/NifSkope/Mesh_import_export NifTools.org: Mesh import export] for OBJ exporting help.
Line 72: Line 72:
|valign="top"|<font size=2>'''1.''' </font>Switch to the instance of NifSkope where you loaded your low-poly model.
|valign="top"|<font size=2>'''1.''' </font>Switch to the instance of NifSkope where you loaded your low-poly model.
|-
|-
|valign="top"|<font size=2>'''2.''' </font>Expand the '''0 NiNode''' block. If you exported only the geometry of the model, it contains one '''NiTriShape''' and one '''NiTriShapeData''' block. Right-click on the '''NiTriShape''' block, and choose '''Mesh -> Face Normals''' from the menu. (Before NifSkope version 0.9.4: '''Make Normals'''.)
|valign="top"|<font size=2>'''2.''' </font>Expand the '''0 NiNode''' block. If you exported only the geometry of the model, it contains one '''NiTriShape''' and one '''NiTriShapeData''' block. To be sure you don't have duplicated vertices in your model, right-click on the '''NiTriShape''' block, and choose '''Mesh -> Remove Doublicated Vertices'''.
|-
|valign="top"|<font size=2>'''3.''' </font>Right-click on the '''NiTriShape''' block, and choose '''Mesh -> Face Normals''' from the menu. (Before NifSkope version 0.9.4: '''Make Normals'''.)
|[[Image:CollTut07.gif|100px|thumb]]
|[[Image:CollTut07.gif|100px|thumb]]
|-
|-
|valign="top"|<font size=2>'''3.''' </font>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.
|valign="top"|<font size=2>'''4.''' </font>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.
|[[Image:CollTut08.gif|100px|thumb]]
|[[Image:CollTut08.gif|100px|thumb]]
|-
|valign="top"|<font size=2>'''4.''' </font>Reset the '''Translation''' in the '''Block Details''' window if it is not zero.
|}
|}


Line 87: Line 87:
{|
{|
|-
|-
|valign="top"|<font size=2>'''1.''' </font>Switch to your high-poly model. Select the '''NiTriShape''' block. Reset the '''Translation''' in the '''Block Details''' window if it is not zero. Right-click on the '''NiTriShape''' block, and choose '''Block -> Copy Branch''' from the menu.
|valign="top"|<font size=2>'''1.''' </font>Switch to your high-poly model. Right-click on the '''NiTriShape''' block, and choose '''Block -> Copy Branch''' from the menu.
|[[Image:CollTut03.gif|100px|right|thumb]]
|[[Image:CollTut03.gif|100px|right|thumb]]
|-
|-
Line 114: Line 114:
|[[Image:CollTut11.gif|100px|right|thumb]]
|[[Image:CollTut11.gif|100px|right|thumb]]
|-
|-
|valign="top"|<font size=2>'''9.''' </font>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'''.
|valign="top"|<font size=2>'''9.''' </font>The meshes may not line up at all at this point. Select '''5 bhkRigidBodyT''' block in the '''Block List''' window, and double-click on the '''Value''' of the '''Translation''' in the '''Block Details''' window. Play with x, y, and z until the collision geometry lines up with the mesh.
|-
|valign="top"|<font size=2>'''10.''' </font>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'''. See [[Finessing_Physics#Simple_Collision_Modelling|Finessing Physics]] tutorial's explanation of the correct block order.
|[[Image:CollTut15.gif|100px|right|thumb]]
|[[Image:CollTut15.gif|100px|right|thumb]]
|-
|-
|valign="top"|<font size=2>'''10.''' </font>Save the NIF.
|valign="top"|<font size=2>'''11.''' </font>Save the NIF.
|}
|}


Line 145: Line 147:
*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.
*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.
*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.
Note: The hit sound, and particle effect of melee weapon hit is controlled by the bhkListShape's material. Hit sound, and particle effect of arrow hit is controlled by the material of the bhkNiTriStripsShape.


===Collision properties===
===Collision properties===
Line 152: Line 155:


Most important properties:
Most important properties:
*The '''layer''' settings control the mesh color in '''CS''', wheather it behaves like a harvestable object like plants (no collision, but the activator icon shows up), and arrow penetrability. The list of layers with some explanation is also available as tooltip.
*The '''layer''' settings control the mesh color in '''CS''', whether it behaves like a harvestable object like plants (no collision, but the activator icon shows up), and arrow penetrability. The list of layers with some explanation is also available as tooltip.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile. See [[Finessing_Physics#The_Main_Blocks|Finessing Physics]] tutorial's bhkRigidBody explanation.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile. See [[Finessing_Physics#The_Main_Blocks|Finessing Physics]] tutorial's bhkRigidBody explanation.


Line 165: Line 168:
If you encounter any problems, please read the guide's [http://www.elderscrolls.com/forums/index.php?showtopic=582114&st=0 thread] at the CS forum. Post there, or at this article's Discussion Page if you can't find the solution.
If you encounter any problems, please read the guide's [http://www.elderscrolls.com/forums/index.php?showtopic=582114&st=0 thread] at the CS forum. Post there, or at this article's Discussion Page if you can't find the solution.


[[User:Entim|Entim]] 17:24, 30 October 2006 (EST)


[[Category:Solutions]]
[[Category:Solutions]]
[[Category:Modeling_and_Texturing_Tutorials]]
[[Category:Modeling_and_Texturing_Tutorials]]
Anonymous user