maps4fs 1.8.250__py3-none-any.whl → 1.8.251__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.
- maps4fs/generator/component/background.py +19 -0
- maps4fs/generator/settings.py +1 -0
- {maps4fs-1.8.250.dist-info → maps4fs-1.8.251.dist-info}/METADATA +3 -1
- {maps4fs-1.8.250.dist-info → maps4fs-1.8.251.dist-info}/RECORD +7 -7
- {maps4fs-1.8.250.dist-info → maps4fs-1.8.251.dist-info}/WHEEL +0 -0
- {maps4fs-1.8.250.dist-info → maps4fs-1.8.251.dist-info}/licenses/LICENSE.md +0 -0
- {maps4fs-1.8.250.dist-info → maps4fs-1.8.251.dist-info}/top_level.txt +0 -0
@@ -510,6 +510,18 @@ class Background(MeshComponent, ImageComponent):
|
|
510
510
|
cv2.imwrite(self.output_path, dem_image)
|
511
511
|
self.logger.debug("Water depth subtracted from DEM data: %s", self.output_path)
|
512
512
|
|
513
|
+
def _get_blur_power(self) -> int:
|
514
|
+
"""Returns the blur power for the water resources to apply Gaussian blur.
|
515
|
+
|
516
|
+
Returns:
|
517
|
+
int: The blur power for the water resources.
|
518
|
+
"""
|
519
|
+
blur_power = max(3, min(self.map.background_settings.water_blurriness, 99))
|
520
|
+
if blur_power % 2 == 0:
|
521
|
+
blur_power += 1
|
522
|
+
|
523
|
+
return blur_power
|
524
|
+
|
513
525
|
def generate_water_resources_obj(self) -> None:
|
514
526
|
"""Generates 3D obj files based on water resources data."""
|
515
527
|
if not os.path.isfile(self.water_resources_path):
|
@@ -533,6 +545,13 @@ class Background(MeshComponent, ImageComponent):
|
|
533
545
|
# Single channeled 16 bit DEM image of terrain.
|
534
546
|
background_dem = cv2.imread(self.not_substracted_path, cv2.IMREAD_UNCHANGED)
|
535
547
|
|
548
|
+
if self.map.background_settings.water_blurriness:
|
549
|
+
# Apply Gaussian blur to the background dem.
|
550
|
+
blur_power = self._get_blur_power()
|
551
|
+
background_dem = cv2.GaussianBlur(
|
552
|
+
background_dem, (blur_power, blur_power), sigmaX=blur_power, sigmaY=blur_power
|
553
|
+
)
|
554
|
+
|
536
555
|
# Remove all the values from the background dem where the plane_water is 0.
|
537
556
|
background_dem[plane_water == 0] = 0
|
538
557
|
|
maps4fs/generator/settings.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 1.8.
|
3
|
+
Version: 1.8.251
|
4
4
|
Summary: Generate map templates for Farming Simulator from real places.
|
5
5
|
Author-email: iwatkot <iwatkot@gmail.com>
|
6
6
|
License: MIT License
|
@@ -601,6 +601,8 @@ You can also apply some advanced settings to the map generation process.<br>
|
|
601
601
|
|
602
602
|
- Generate water - if enabled, the water planes obj files will be generated. You can turn it off if you already have those files or don't need them. By default, it's set to True.
|
603
603
|
|
604
|
+
- Water blurriness - used to make the water surface smoother. The higher the value, the more flat surface of the water planes will be. However, too high values can lead to the water planes mesh not matching the terrain.
|
605
|
+
|
604
606
|
- Resize factor - the factor by which the background terrain will be resized. It will be used as 1 / resize_factor while generating the models. Which means that the larger the value the more the terrain will be resized. The lowest value is 1, in this case background terrain will not be resized. Note, than low values will lead to long processing and enormous size of the obj files.
|
605
607
|
|
606
608
|
- Remove center - if enabled, the playable region (map terrain) will be removed from the background terrain. By default, it's set to True.
|
@@ -5,10 +5,10 @@ maps4fs/generator/dem.py,sha256=CDfdDGCWhFn2_QYY5TtxgsXm3lgJ4W4qD-46UU3u-ck,1320
|
|
5
5
|
maps4fs/generator/game.py,sha256=NZaxj5z7WzMiHzAvQyr-TvVjGoHgqGldM6ZsItuYyzA,11292
|
6
6
|
maps4fs/generator/map.py,sha256=64uIHCwfpFyFXZJSayB0tuRFn0LVuTwf0wrAi4KMv00,13600
|
7
7
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
8
|
-
maps4fs/generator/settings.py,sha256=
|
8
|
+
maps4fs/generator/settings.py,sha256=E5sfkfJgcjh9QHpa7ILlV_jnrF6USpsOFxkooVnxrbs,6968
|
9
9
|
maps4fs/generator/statistics.py,sha256=aynS3zbAtiwnU_YLKHPTiiaKW98_suvQUhy1SGBA6mc,2448
|
10
10
|
maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
|
11
|
-
maps4fs/generator/component/background.py,sha256=
|
11
|
+
maps4fs/generator/component/background.py,sha256=hsyNmHgi9NUcp3SoSawJeCDJY3tJNDMwmb_x1ovi0Fg,22852
|
12
12
|
maps4fs/generator/component/config.py,sha256=RitKgFDZPzjA1fi8GcEi1na75qqaueUvpcITHjBvCXc,3674
|
13
13
|
maps4fs/generator/component/grle.py,sha256=KlNbbYY4oyFfB_0qTInrweBTyLUW0koSSpqclkRw-Lk,19381
|
14
14
|
maps4fs/generator/component/i3d.py,sha256=iVXYYGzDpSp5J7vAo_LFnDA8GDAy43Y6aUIf7yP_ZTI,23101
|
@@ -54,8 +54,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
|
|
54
54
|
maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
|
55
55
|
maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
|
56
56
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
57
|
-
maps4fs-1.8.
|
58
|
-
maps4fs-1.8.
|
59
|
-
maps4fs-1.8.
|
60
|
-
maps4fs-1.8.
|
61
|
-
maps4fs-1.8.
|
57
|
+
maps4fs-1.8.251.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
58
|
+
maps4fs-1.8.251.dist-info/METADATA,sha256=UtavrpUygqDfTGLz7iH0Yz2QDhh_xKWRpC4JxqTmkt4,47443
|
59
|
+
maps4fs-1.8.251.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
60
|
+
maps4fs-1.8.251.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
61
|
+
maps4fs-1.8.251.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|