maps4fs 2.8.3__py3-none-any.whl → 2.8.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of maps4fs might be problematic. Click here for more details.
- maps4fs/generator/component/base/component_mesh.py +3 -1
- maps4fs/generator/component/config.py +64 -1
- maps4fs/generator/game.py +20 -0
- maps4fs/generator/settings.py +3 -0
- {maps4fs-2.8.3.dist-info → maps4fs-2.8.4.dist-info}/METADATA +1 -1
- {maps4fs-2.8.3.dist-info → maps4fs-2.8.4.dist-info}/RECORD +9 -9
- {maps4fs-2.8.3.dist-info → maps4fs-2.8.4.dist-info}/WHEEL +0 -0
- {maps4fs-2.8.3.dist-info → maps4fs-2.8.4.dist-info}/licenses/LICENSE.md +0 -0
- {maps4fs-2.8.3.dist-info → maps4fs-2.8.4.dist-info}/top_level.txt +0 -0
|
@@ -241,7 +241,9 @@ class MeshComponent(Component):
|
|
|
241
241
|
cube_mesh = trimesh.creation.box([remove_size, remove_size, z_size * 4])
|
|
242
242
|
|
|
243
243
|
return trimesh.boolean.difference(
|
|
244
|
-
[mesh_copy, cube_mesh],
|
|
244
|
+
[mesh_copy, cube_mesh],
|
|
245
|
+
check_volume=False,
|
|
246
|
+
engine="blender",
|
|
245
247
|
)
|
|
246
248
|
|
|
247
249
|
@staticmethod
|
|
@@ -6,11 +6,13 @@ import os
|
|
|
6
6
|
|
|
7
7
|
import cv2
|
|
8
8
|
|
|
9
|
+
from maps4fs.generator.component.base.component_image import ImageComponent
|
|
9
10
|
from maps4fs.generator.component.base.component_xml import XMLComponent
|
|
11
|
+
from maps4fs.generator.settings import Parameters
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
# pylint: disable=R0903
|
|
13
|
-
class Config(XMLComponent):
|
|
15
|
+
class Config(XMLComponent, ImageComponent):
|
|
14
16
|
"""Component for map settings and configuration.
|
|
15
17
|
|
|
16
18
|
Arguments:
|
|
@@ -36,6 +38,8 @@ class Config(XMLComponent):
|
|
|
36
38
|
if self.game.fog_processing:
|
|
37
39
|
self._adjust_fog()
|
|
38
40
|
|
|
41
|
+
self._set_overview()
|
|
42
|
+
|
|
39
43
|
def _set_map_size(self) -> None:
|
|
40
44
|
"""Edits map.xml file to set correct map size."""
|
|
41
45
|
tree = self.get_tree()
|
|
@@ -213,3 +217,62 @@ class Config(XMLComponent):
|
|
|
213
217
|
)
|
|
214
218
|
|
|
215
219
|
return dem_maximum_meter, dem_minimum_meter
|
|
220
|
+
|
|
221
|
+
def _set_overview(self) -> None:
|
|
222
|
+
"""Generates and sets the overview image for the map."""
|
|
223
|
+
try:
|
|
224
|
+
overview_image_path = self.game.overview_file_path(self.map_directory)
|
|
225
|
+
except NotImplementedError:
|
|
226
|
+
self.logger.warning(
|
|
227
|
+
"Game does not support overview image file, overview generation will be skipped."
|
|
228
|
+
)
|
|
229
|
+
return
|
|
230
|
+
|
|
231
|
+
satellite_component = self.map.get_satellite_component()
|
|
232
|
+
if not satellite_component:
|
|
233
|
+
self.logger.warning(
|
|
234
|
+
"Satellite component not found, overview generation will be skipped."
|
|
235
|
+
)
|
|
236
|
+
return
|
|
237
|
+
|
|
238
|
+
if not satellite_component.assets.overview or not os.path.isfile(
|
|
239
|
+
satellite_component.assets.overview
|
|
240
|
+
):
|
|
241
|
+
self.logger.warning(
|
|
242
|
+
"Satellite overview image not found, overview generation will be skipped."
|
|
243
|
+
)
|
|
244
|
+
return
|
|
245
|
+
|
|
246
|
+
satellite_images_directory = os.path.dirname(satellite_component.assets.overview)
|
|
247
|
+
overview_image = cv2.imread(satellite_component.assets.overview, cv2.IMREAD_UNCHANGED)
|
|
248
|
+
|
|
249
|
+
if overview_image is None:
|
|
250
|
+
self.logger.warning(
|
|
251
|
+
"Failed to read satellite overview image, overview generation will be skipped."
|
|
252
|
+
)
|
|
253
|
+
return
|
|
254
|
+
|
|
255
|
+
resized_overview_image = cv2.resize(
|
|
256
|
+
overview_image,
|
|
257
|
+
(Parameters.OVERVIEW_IMAGE_SIZE, Parameters.OVERVIEW_IMAGE_SIZE),
|
|
258
|
+
interpolation=cv2.INTER_LINEAR,
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
resized_overview_path = os.path.join(
|
|
262
|
+
satellite_images_directory,
|
|
263
|
+
f"{Parameters.OVERVIEW_IMAGE_FILENAME}.png",
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
cv2.imwrite(resized_overview_path, resized_overview_image)
|
|
267
|
+
self.logger.info("Overview image saved to: %s", resized_overview_path)
|
|
268
|
+
|
|
269
|
+
if os.path.isfile(overview_image_path):
|
|
270
|
+
try:
|
|
271
|
+
os.remove(overview_image_path)
|
|
272
|
+
self.logger.debug("Old overview image removed: %s", overview_image_path)
|
|
273
|
+
except Exception as e:
|
|
274
|
+
self.logger.warning("Failed to remove old overview image: %s", e)
|
|
275
|
+
return
|
|
276
|
+
|
|
277
|
+
self.convert_png_to_dds(resized_overview_path, overview_image_path)
|
|
278
|
+
self.logger.info("Overview image converted and saved to: %s", overview_image_path)
|
maps4fs/generator/game.py
CHANGED
|
@@ -254,6 +254,16 @@ class Game:
|
|
|
254
254
|
str: The path to the i3d file."""
|
|
255
255
|
raise NotImplementedError
|
|
256
256
|
|
|
257
|
+
def overview_file_path(self, map_directory: str) -> str:
|
|
258
|
+
"""Returns the path to the overview image file.
|
|
259
|
+
|
|
260
|
+
Arguments:
|
|
261
|
+
map_directory (str): The path to the map directory.
|
|
262
|
+
|
|
263
|
+
Returns:
|
|
264
|
+
str: The path to the overview image file."""
|
|
265
|
+
raise NotImplementedError
|
|
266
|
+
|
|
257
267
|
@property
|
|
258
268
|
def i3d_processing(self) -> bool:
|
|
259
269
|
"""Returns whether the i3d file should be processed.
|
|
@@ -437,3 +447,13 @@ class FS25(Game):
|
|
|
437
447
|
Returns:
|
|
438
448
|
str: The path to the environment xml file."""
|
|
439
449
|
return os.path.join(map_directory, "map", "config", "environment.xml")
|
|
450
|
+
|
|
451
|
+
def overview_file_path(self, map_directory: str) -> str:
|
|
452
|
+
"""Returns the path to the overview image file.
|
|
453
|
+
|
|
454
|
+
Arguments:
|
|
455
|
+
map_directory (str): The path to the map directory.
|
|
456
|
+
|
|
457
|
+
Returns:
|
|
458
|
+
str: The path to the overview image file."""
|
|
459
|
+
return os.path.join(map_directory, "map", "overview.dds")
|
maps4fs/generator/settings.py
CHANGED
|
@@ -2,15 +2,15 @@ maps4fs/__init__.py,sha256=5ixsCA5vgcIV0OrF9EJBm91Mmc_KfMiDRM-QyifMAvo,386
|
|
|
2
2
|
maps4fs/logger.py,sha256=6sem0aFKQqtVjQ_yNu9iGcc-hqzLQUhfxco05K6nqow,763
|
|
3
3
|
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
|
4
4
|
maps4fs/generator/config.py,sha256=KwYYWM5wrMB_tKn3Fls6WpEurZJxmrBH5AgAXPGHTJE,7122
|
|
5
|
-
maps4fs/generator/game.py,sha256=
|
|
5
|
+
maps4fs/generator/game.py,sha256=axi-h2wmLZHMu5xdzFq4BEYjofJHmMNiGjmw5AA36JA,15421
|
|
6
6
|
maps4fs/generator/map.py,sha256=ZZRU8x0feGbgeJgxc0D3N-mfiasyFXxj6gbGyl-WRzE,14528
|
|
7
7
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
|
8
|
-
maps4fs/generator/settings.py,sha256=
|
|
8
|
+
maps4fs/generator/settings.py,sha256=OSwnkvaF9O2nh0khQ9u9RS4pomXsywTUGyqZOUcUk2Y,13299
|
|
9
9
|
maps4fs/generator/statistics.py,sha256=Dp1-NS-DWv0l0UdmhOoXeQs_N-Hs7svYUnmziSW5Z9I,2098
|
|
10
10
|
maps4fs/generator/utils.py,sha256=ugdQ8C22NeiZLIlldLoEKCc7ioOefz4W-8qF2eOy9qU,4834
|
|
11
11
|
maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
|
|
12
12
|
maps4fs/generator/component/background.py,sha256=tFWdYASUUZsJ8QiQrxxba-6aMECD3hvpd0pMm_UdrH8,46151
|
|
13
|
-
maps4fs/generator/component/config.py,sha256=
|
|
13
|
+
maps4fs/generator/component/config.py,sha256=yujW_FF-0mbJ_5PuSeFC45hHb5MOoPAJYdISPQvmtRQ,11118
|
|
14
14
|
maps4fs/generator/component/dem.py,sha256=FPqcXmFQg5MPaGuy4g5kxzvY1wbhozeCf-aNMCj5eaU,11687
|
|
15
15
|
maps4fs/generator/component/grle.py,sha256=0PC1K829wjD4y4d9qfIbnU29ebjflIPBbwIZx8FXwc8,27242
|
|
16
16
|
maps4fs/generator/component/i3d.py,sha256=RvpiW9skkZ6McyahC-AeIdPuSQjpXiFs1l0xOioJAu4,26638
|
|
@@ -20,10 +20,10 @@ maps4fs/generator/component/texture.py,sha256=gXZgr73ehT3_qjuIku0j7N7exloywtmmEQ
|
|
|
20
20
|
maps4fs/generator/component/base/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
|
21
21
|
maps4fs/generator/component/base/component.py,sha256=-7H3donrH19f0_rivNyI3fgLsiZkntXfGywEx4tOnM4,23924
|
|
22
22
|
maps4fs/generator/component/base/component_image.py,sha256=GXFkEFARNRkWkDiGSjvU4WX6f_8s6R1t2ZYqZflv1jk,9626
|
|
23
|
-
maps4fs/generator/component/base/component_mesh.py,sha256=
|
|
23
|
+
maps4fs/generator/component/base/component_mesh.py,sha256=S5M_SU-FZz17-LgzTIM935ms1Vc4O06UQNTEN4e0INU,24729
|
|
24
24
|
maps4fs/generator/component/base/component_xml.py,sha256=MT-VhU2dEckLFxAgmxg6V3gnv11di_94Qq6atfpOLdc,5342
|
|
25
|
-
maps4fs-2.8.
|
|
26
|
-
maps4fs-2.8.
|
|
27
|
-
maps4fs-2.8.
|
|
28
|
-
maps4fs-2.8.
|
|
29
|
-
maps4fs-2.8.
|
|
25
|
+
maps4fs-2.8.4.dist-info/licenses/LICENSE.md,sha256=Ptw8AkqJ60c4tRts6yuqGP_8B0dxwOGmJsp6YJ8dKqM,34328
|
|
26
|
+
maps4fs-2.8.4.dist-info/METADATA,sha256=YQl9Cryl9G4MFtHX-Lt_FQSLzx5eGnbggY7QvISISdg,10042
|
|
27
|
+
maps4fs-2.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
maps4fs-2.8.4.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
|
29
|
+
maps4fs-2.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|