Skip to content

Commit 9111a34

Browse files
Candoran2neomonkeus
authored andcommitted
Temporarily moved penetration depth from collision modifier permeability to niftools collision property to fix error caused by changes in Blender 3.0 and later.
1 parent 5bccb70 commit 9111a34

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

io_scene_niftools/modules/nif_export/collision/havok.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def export_bhk_rigid_body(self, b_obj, n_col_obj):
173173
n_r_body.restitution = b_r_body.restitution
174174
n_r_body.max_linear_velocity = b_obj.nifcollision.max_linear_velocity
175175
n_r_body.max_angular_velocity = b_obj.nifcollision.max_angular_velocity
176-
n_r_body.penetration_depth = b_obj.collision.permeability
176+
n_r_body.penetration_depth = b_obj.nifcollision.penetration_depth
177177
n_r_body.motion_system = b_obj.nifcollision.motion_system
178178
n_r_body.deactivator_type = b_obj.nifcollision.deactivator_type
179179
n_r_body.solver_deactivation = b_obj.nifcollision.solver_deactivation

io_scene_niftools/modules/nif_import/collision/havok.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _import_bhk_rigid_body(self, bhkshape, collision_objs):
197197
b_r_body.deactivate_angular_velocity = mathutils.Vector([ang_vel.w, ang_vel.x, ang_vel.y, ang_vel.z]).magnitude
198198

199199
# Custom Niftools properties
200-
b_col_obj.collision.permeability = bhkshape.penetration_depth
200+
b_col_obj.nifcollision.penetration_depth = bhkshape.penetration_depth
201201
b_col_obj.nifcollision.deactivator_type = NifFormat.DeactivatorType._enumkeys[bhkshape.deactivator_type]
202202
b_col_obj.nifcollision.solver_deactivation = NifFormat.SolverDeactivation._enumkeys[bhkshape.solver_deactivation]
203203
b_col_obj.nifcollision.max_linear_velocity = bhkshape.max_linear_velocity

io_scene_niftools/properties/collision.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ class CollisionProperty(PropertyGroup):
8282
items=game_specific_col_layer_items,
8383
)
8484

85+
penetration_depth: FloatProperty(
86+
name='Penetration Depth',
87+
description='The maximum allowed penetration for this object.',
88+
default=0.15
89+
)
90+
8591
deactivator_type: EnumProperty(
8692
name='Deactivator Type',
8793
description='Motion deactivation setting',

0 commit comments

Comments
 (0)