|
3 | 3 | from io_soulworker.core.binary_reader import BinaryReader |
4 | 4 | from io_soulworker.core.binary_writer import BinaryWriter |
5 | 5 | from io_soulworker.core.data_exchange import DataExchange_cl |
| 6 | +from io_soulworker.unit_scale import BLENDER_TO_GAME, GAME_TO_BLENDER |
6 | 7 | from io_soulworker.core.utility import indices_to_face |
7 | 8 | from io_soulworker.core.vis_chunk_id import VisChunkId |
8 | 9 | from io_soulworker.core.vis_index_format import VisIndexFormat |
@@ -126,7 +127,13 @@ def read(self, reader: BinaryReader) -> None: |
126 | 127 | reader.seek(t + off) |
127 | 128 |
|
128 | 129 | pos = reader.read_vector3() |
129 | | - self.vertices.append([pos.x, pos.y, pos.z]) |
| 130 | + self.vertices.append( |
| 131 | + [ |
| 132 | + pos.x * GAME_TO_BLENDER, |
| 133 | + pos.y * GAME_TO_BLENDER, |
| 134 | + pos.z * GAME_TO_BLENDER, |
| 135 | + ] |
| 136 | + ) |
130 | 137 |
|
131 | 138 | if self.descriptor.has_component(self.descriptor.normal_offset): |
132 | 139 |
|
@@ -279,7 +286,14 @@ def __write_vertices(self, writer: BinaryWriter, vertex_count: int) -> None: |
279 | 286 |
|
280 | 287 | off = self.descriptor.offset_of(self.descriptor.pos_offset) |
281 | 288 | x, y, z = self.__vector3_at(self.vertices, index) |
282 | | - pack_into("<fff", raw, off, x, y, z) |
| 289 | + pack_into( |
| 290 | + "<fff", |
| 291 | + raw, |
| 292 | + off, |
| 293 | + x * BLENDER_TO_GAME, |
| 294 | + y * BLENDER_TO_GAME, |
| 295 | + z * BLENDER_TO_GAME, |
| 296 | + ) |
283 | 297 |
|
284 | 298 | if self.descriptor.has_component(self.descriptor.normal_offset): |
285 | 299 |
|
|
0 commit comments