Skip to content

Commit

Permalink
ms2 - flip hitcheck tris for correct normals
Browse files Browse the repository at this point in the history
  • Loading branch information
HENDRIX-ZT2 committed Nov 12, 2023
1 parent 12d4300 commit 134afdc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions plugin/modules_export/collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def export_meshbv(b_obj, hitcheck, corrector):
for face_i, face in enumerate(eval_me.polygons):
coll.data.triangles[face_i, :] = face.vertices
assert len(face.vertices) == 3
coll.data.triangles = np.flip(coll.data.triangles, axis=-1)
# print(coll)
# print(coll.data)

Expand Down
7 changes: 4 additions & 3 deletions plugin/modules_import/collision.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import bpy
import mathutils
import numpy as np

from generated.formats.ms2.compounds.packing_utils import unpack_swizzle, unpack_swizzle_collision
from generated.formats.ms2.enums.CollisionType import CollisionType
Expand Down Expand Up @@ -152,10 +153,10 @@ def import_cylinderbv(cylinder, hitcheck_name):


def import_meshbv(coll, hitcheck_name, corrector):
print(coll)
print(coll.data)
# print(coll)
# print(coll.data)
scene = bpy.context.scene
tris = coll.data.triangles
tris = np.flip(coll.data.triangles, axis=-1)
if coll.is_optimized:
good_tris = []
optimizer = coll.data.optimizer
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7803b0393 - Sun Nov 12 15:42:50 2023 +0100
12d43006d - Sun Nov 12 17:20:20 2023 +0100

0 comments on commit 134afdc

Please sign in to comment.