Difference between revisions of "NifSkope: Adding Collision Model"

added missing steps (really sorry about that), example NIFs, some additional info
imported>Entim
m (fixed typo)
imported>Entim
(added missing steps (really sorry about that), example NIFs, some additional info)
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 it's environment.
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.




Line 5: Line 5:


===Required tools===
===Required tools===
*A BSA unpacker, for example [[BSA Commander]] 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 version.
*A 3D modeller software, for example [[Blender]].
*A 3D modeller software, for example [[Blender]].
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_Importers_and_Exporters|NIF]] or [http://www.niftools.org/wiki/index.php/NifSkope/Mesh_import_export OBJ] format.
*Export these models in NIF or OBJ format.
**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.
*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 69: Line 74:
[[Image:CollTut04.gif|100px|right|thumb]]
[[Image:CollTut04.gif|100px|right|thumb]]
[[Image:CollTut05.gif|100px|right|thumb]]
[[Image:CollTut05.gif|100px|right|thumb]]
*Switch back to the cleaned NIF (which was ''arstatue01.nif''). Right-click on '''0 NiNode''' and choose '''Block -> Paste Branch'''. NifSkope will probably argue about NIF versions, choose '''Continue'''. The geometry, texture, material data of the high-poly model is pasted in now.
*Switch back to the cleaned NIF (which was ''arstatue01.nif''). Right-click on '''0 NiNode''' and choose '''Block -> Paste Branch'''. NifSkope will probably argue about NIF versions, choose '''Continue'''. The high-poly model's NiTriShape, which contains geometry, texture, material data, is pasted in now.
[[Image:CollTut14.gif|100px|right|thumb]]
*Double-click on the '''Value''' of '''Num Children''' attribute in the '''Block Details''' window. This number controls how many child objects the NiNode has. Set it to 1. Expand '''Children'''. The list of the NiNode's children is not updated automatically, it still contains six references. The five Children with ''None'' value were the NiTriShapes you have removed, the sixth is the NiTriShape you have just pasted.
[[Image:CollTut16.gif|100px|right|thumb]]
*Right click on the '''Children''' attribute, and choose '''Array -> Update'''. This updates the size of the Children list according to Num Children.
[[Image:CollTut17.gif|100px|right|thumb]]
*Expand '''Children''', and set its child's '''Value''' to the refernce number of your NiTriShape ('''6'''). The high-poly model's NiTriShape is linked correctly to the NiNode now.
[[Image:CollTut09.gif|100px|right|thumb]]
[[Image:CollTut09.gif|100px|right|thumb]]
*Switch to your low-poly model. Right-click on the '''NiTriStripsData''' block, and choose '''Block -> Copy'''.
*Switch to your low-poly model. Right-click on the '''NiTriStripsData''' block, and choose '''Block -> Copy'''.
[[Image:CollTut10.gif|100px|right|thumb]]
[[Image:CollTut10.gif|100px|right|thumb]]
*Switch back to the cleaned NIF. Right-click on the '''0 NiNode''' block, and choose '''Block -> Paste'''. Choose Continue again if NifSkope argues about the NIF version.
*Switch back to the cleaned NIF. Right-click on the '''0 NiNode''' block, and choose '''Block -> Paste'''. Choose Continue again if NifSkope argues about the NIF version.
*Select '''5 bhkRigidBodyT''' block in the '''Block List''' window, and double-click on the '''Value''' of the '''Translation''' in the '''Block Details''' window. Set x, y, and z to zero. This positions the collision geometry to the origo.
[[Image:CollTut11.gif|100px|right|thumb]]
[[Image:CollTut11.gif|100px|right|thumb]]
*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.
Line 94: Line 106:


[[Image:CollTut13.gif|100px|right|thumb]]
[[Image:CollTut13.gif|100px|right|thumb]]
Select '''4 bhkNiTriStripsShape''' block. Double-click on the '''Value''' of the '''Material''' entry (currently '''HAV_MAT_STONE'''). You get a drop-down list of available materials. Choose the material from the 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]. 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, and arrow penetrability of the surface.




Line 106: Line 118:


[[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 all 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/docsys/index.php?mode=list&table=attr&block_id=317&version=335544325 here]


Most important properties:
Most important properties:
*The '''layer''' settings control the mesh color in '''CS''', wheather the activator icon shows up when the player is close enough, wheather it behaves like a harvestable object like plants (no collision, but the activator icon shows up).
*The '''layer''' settings control the mesh color in '''CS''', wheather the activator icon shows up when the player is close enough, 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.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile.
*'''Motion System''', '''Unknown Byte 1''' and '''2''', '''Quality Type''' controls wheather the object is static or mobile.


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/Havok system can be found at [http://www.niftools.org/wiki/index.php/Category:NIF_Format NifTools.org].
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].
 


--[[User:Entim|Entim]] 17:44, 18 September 2006 (EDT)
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Modeling_and_Texturing_Tutorials]]
[[Category:Modeling_and_Texturing_Tutorials]]
Anonymous user