Difference between revisions of "NifSkope: Adding Collision Model"

no edit summary
imported>Entim
(removed from Tutorials category, added to Solutions; it seems people don't take the time to read Finessing Physics)
Tag: Manual revert
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The purpose of this article is to give a step by step guide to the [[Finessing Physics#Better Collision Modelling|Better Collision Modelling]] method described in [[Finessing Physics]] tutorial. The goal of the process is to create a simple model properly interacting with its environment.
'''Note to Blender users:'''
 
This guide is mostly deprecated for you.
The current Blender export scripts support the export of collision models.
See [http://niftools.sourceforge.net/wiki/Blender/Collision Blender/Collision] on the NifTools wiki.
However it can be useful to read the Refinig Collision Properties section of this guide.
The purpose of this article is to give a step by step guide to the [[Finessing Physics#Better Collision Modelling|Better Collision Modelling]] method described in [[Finessing Physics]] tutorial. The goal of the process is to create a simple model properly interacting with its environment. This method gives the most resource demanding type of collision model, but the easiest to create.


==Getting Started==
==Getting Started==
Line 6: Line 10:
===Required tools===
===Required tools===
*A BSA unpacker, for example [[BSA Commander]], [[BSA Unpacker]],or [[TES4BSA]] to unpack NIF files.
*A BSA unpacker, for example [[BSA Commander]], [[BSA Unpacker]],or [[TES4BSA]] to unpack NIF files.
*The latest version of [[NifSkope]] to edit the NIF files. The example screenshots of this guide were taken from the 0.9.3 version.
*The '''latest''' version of [[NifSkope]] to edit the NIF files. The example screenshots of this guide were taken from the 0.9.3 and 0.9.8 versions. Check the NifSkope download page once in a while.
*A 3D modeller software, for example [[Blender]].
*A 3D modeller software, for example [[Blender]].


Line 12: Line 16:
   
   
  TES4BSA: [[BSA Unpacker Tutorial]]
  TES4BSA: [[BSA Unpacker Tutorial]]
  NifSkope: [http://www.niftools.org/wiki/index.php/NifSkope NifSkope Documentation and Tutorials]
  NifSkope: [http://niftools.sourceforge.net/wiki/NifSkope/Documentation_And_Tutorials NifSkope Documentation & Tutorials]
  Blender: [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro Blender 3D: Noob to Pro], [http://www.niftools.org/wiki/index.php/Blender/Configuration NIF Scripts Configuration]
  Blender: [http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro Blender 3D:Noob to Pro], [http://niftools.sourceforge.net/wiki/Blender/Configuration#Oblivion Blender Configuration for Import & Export of Nifs]


===Preparation===
===Preparation===
*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://niftools.sourceforge.net/wiki/NifSkope/Mesh_import_export niftools.sourceforge.net:Mesh import export] for OBJ exporting help.
*Unpack ''\data\meshes\dungeons\ayleidruins\exterior\arstatue01.nif'' from ''\Oblivion\Data\meshes.bsa''.
*Unpack ''\data\meshes\dungeons\ayleidruins\exterior\arstatue01.nif'' from ''\Oblivion\Data\meshes.bsa''.
Example NIFs:
 
High-poly model: [http://www4.rapidupload.com/d.php?file=dl&filepath=25539 here]
Low-poly model: [http://www4.rapidupload.com/d.php?file=dl&filepath=25540 here]


==Adding Collision Model==
==Adding Collision Model==
Line 72: Line 73:
|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 88:
{|
{|
|-
|-
|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 115:
|[[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>Here comes the step which makes it worth to use this type of collision. Right-click on the '''bhkNiTriStripsShape''' block, and choose '''Havok -> Pack Strips'''. The bhkNiTriStripsShape block will be converted to a bhkPackedNiTriStripsShape. The NiTriStripsData becomes hkPackedNiTriStripsData. This feature introduced in the 0.9.7 version of NifSkope.
|[[Image:CollTut20.gif|100px|right|thumb]]
|-
|valign="top"|<font size=2>'''10.''' </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>'''11.''' </font>The collision data blocks must be in a specific order, which the hkPackedNiTriStripsData 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>'''12.''' </font>Save the NIF.
|}
|}
===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.
*Right-click in the Block List window, and choose '''Block''' -> '''Insert''' -> '''BHK''' -> '''bhkListShape'''.
*Set the '''bhkRigidBodyT''' block's '''Shape''' property to the reference number of the new bhkLishShape in the '''Block Details''' window. The bhkListShape 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.
*Reorder the havok blocks.
Example of the result NIF is [http://www4.rapidupload.com/d.php?file=dl&filepath=27622 here].




Line 143: Line 134:


[[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, arrow penetrability, and particle effect of the surface.
Select the '''bhkPackedNiTriStripsShape''' block. Expand the Sub Shapes array in the '''Block Details''' window. 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/doc/nif/HavokMaterial.html 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.
 


===Collision properties===
===Collision properties===


[[Image:CollTut12.gif|100px|right|thumb]]
[[Image:CollTut12.gif|100px|right|thumb]]
Select the '''5 bhkRigidBodyT''' block. Interesting properties are marked with red dots on the picture. A list of the available properties is [http://niftools.sourceforge.net/docsys/index.php?mode=list&table=attr&block_id=317&version=335544325 here]
Select the '''5 bhkRigidBodyT''' block. Interesting properties are marked with red dots on the picture. A list of the available properties is [http://niftools.sourceforge.net/doc/nif/bhkRigidBodyT.html here]


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 collision model's color in the '''CS''', and other properties as well, for example the NONCOLLIDABLE layer will make the collision body to behave like a harvestable object (no collision, but the activator icon shows up). 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.


Compare these properties to other NIFs, and change them accordingly.
Compare these properties to other NIFs, and change them accordingly.


Further information about the NIF format and NifSkope can be found at [http://www.niftools.org NifTools.org]. Information about NIF format/Havok system is [http://www.niftools.org/wiki/index.php/Category:NIF_Format here].
Further information about the NIF format and NifSkope can be found at [http://niftools.sourceforge.net/wiki/NifTools niftools.sourceforge.net]. Information about NIF format/Havok system is [http://niftools.sourceforge.net/wiki/Category:Nif_Format here].
 




==Troubleshoot==
==Troubleshoot==


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.bethsoft.com/bgsforums/index.php?showtopic=582114 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:Tutorials]]
[[Category:Modeling_and_Texturing_Tutorials]]
[[Category:NifSkope Tutorials]]
[[Category:Modeling Tutorials]]
Anonymous user