@@ -21,7 +21,7 @@ class MetaData():
2121 hasNormals = False
2222 maxVertexCount = 0
2323 maxIndiceCount = 0
24- maxBounds = [0 ,0 ,0 ,0 ,0 ,0 ]
24+ minMaxBounds = [0 ,0 ,0 ,0 ,0 ,0 ]
2525 textureWidth = 0
2626 textureHeight = 0
2727 textureSizeDDS = 0
@@ -44,7 +44,7 @@ def get_as_dict(self):
4444 "hasNormals" : self .hasNormals ,
4545 "maxVertexCount" : self .maxVertexCount ,
4646 "maxIndiceCount" : self .maxIndiceCount ,
47- "maxBounds" : self .maxBounds ,
47+ "maxBounds" : self .minMaxBounds ,
4848 "textureWidth" : self .textureWidth ,
4949 "textureHeight" : self .textureHeight ,
5050 "textureSizeDDS" : self .textureSizeDDS ,
@@ -71,12 +71,16 @@ def set_metadata_Model(self, vertexCount, indiceCount, headerSize, bounds, geome
7171 self .maxIndiceCount = indiceCount
7272
7373 for maxBound in range (3 ):
74- if self .maxBounds [maxBound ] < bounds .max ()[maxBound ]:
75- self .maxBounds [maxBound ] = bounds .max ()[maxBound ]
74+ if self .minMaxBounds [maxBound ] < bounds .max ()[maxBound ]:
75+ self .minMaxBounds [maxBound ] = bounds .max ()[maxBound ]
7676
7777 for minBound in range (3 ):
78- if self .maxBounds [minBound + 3 ] > bounds .min ()[minBound ]:
79- self .maxBounds [minBound + 3 ] = bounds .min ()[minBound ]
78+ if self .minMaxBounds [minBound + 3 ] > bounds .min ()[minBound ]:
79+ self .minMaxBounds [minBound + 3 ] = bounds .min ()[minBound ]
80+
81+ # Flip bounds x axis, as we also flip the model's x axis to match Unity's coordinate system
82+ self .minMaxBounds [0 ] *= - 1 # Min X
83+ self .minMaxBounds [3 ] *= - 1 # Max X
8084
8185 self .headerSizes [listIndex ] = headerSize
8286 self .verticeCounts [listIndex ] = vertexCount
0 commit comments