maps4fs 1.1.0__py3-none-any.whl → 1.1.6__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/background.py +3 -1
- maps4fs/generator/component.py +6 -1
- maps4fs/generator/game.py +1 -1
- maps4fs/generator/grle.py +11 -0
- maps4fs/generator/i3d.py +11 -0
- {maps4fs-1.1.0.dist-info → maps4fs-1.1.6.dist-info}/METADATA +20 -9
- {maps4fs-1.1.0.dist-info → maps4fs-1.1.6.dist-info}/RECORD +10 -10
- {maps4fs-1.1.0.dist-info → maps4fs-1.1.6.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.1.0.dist-info → maps4fs-1.1.6.dist-info}/WHEEL +0 -0
- {maps4fs-1.1.0.dist-info → maps4fs-1.1.6.dist-info}/top_level.txt +0 -0
maps4fs/generator/background.py
CHANGED
@@ -43,6 +43,7 @@ class Background(Component):
|
|
43
43
|
def preprocess(self) -> None:
|
44
44
|
"""Registers the DEMs for the background terrain."""
|
45
45
|
self.light_version = self.kwargs.get("light_version", False)
|
46
|
+
self.stl_preview_path: str | None = None
|
46
47
|
|
47
48
|
if self.rotation:
|
48
49
|
self.logger.debug("Rotation is enabled: %s.", self.rotation)
|
@@ -335,7 +336,8 @@ class Background(Component):
|
|
335
336
|
cv2.imwrite(background_dem_preview_path, background_dem_preview_image)
|
336
337
|
preview_paths.append(background_dem_preview_path)
|
337
338
|
|
338
|
-
|
339
|
+
if self.stl_preview_path:
|
340
|
+
preview_paths.append(self.stl_preview_path)
|
339
341
|
|
340
342
|
return preview_paths
|
341
343
|
|
maps4fs/generator/component.py
CHANGED
@@ -356,6 +356,7 @@ class Component:
|
|
356
356
|
offset = (self.map_size / 2) - (self.map_rotated_size / 2)
|
357
357
|
self.logger.debug("Translating the polygon by %s", offset)
|
358
358
|
polygon = translate(polygon, xoff=offset, yoff=offset)
|
359
|
+
self.logger.debug("Rotated and translated polygon.")
|
359
360
|
|
360
361
|
if margin:
|
361
362
|
polygon = polygon.buffer(margin, join_style="mitre")
|
@@ -367,12 +368,16 @@ class Component:
|
|
367
368
|
|
368
369
|
# Intersect the polygon with the bounds to fit it within the map
|
369
370
|
fitted_polygon = polygon.intersection(bounds)
|
371
|
+
self.logger.debug("Fitted the polygon into the bounds: %s", bounds)
|
370
372
|
|
371
373
|
if not isinstance(fitted_polygon, Polygon):
|
372
374
|
raise ValueError("The fitted polygon is not a valid polygon.")
|
373
375
|
|
374
376
|
# Return the fitted polygon points
|
375
|
-
|
377
|
+
as_list = list(fitted_polygon.exterior.coords)
|
378
|
+
if not as_list:
|
379
|
+
raise ValueError("The fitted polygon has no points.")
|
380
|
+
return as_list
|
376
381
|
|
377
382
|
def get_infolayer_path(self, layer_name: str) -> str | None:
|
378
383
|
"""Returns the path to the info layer file.
|
maps4fs/generator/game.py
CHANGED
maps4fs/generator/grle.py
CHANGED
@@ -108,6 +108,10 @@ class GRLE(Component):
|
|
108
108
|
self.game.weights_dir_path(self.map_directory), "infoLayer_farmlands.png"
|
109
109
|
)
|
110
110
|
|
111
|
+
self.logger.info(
|
112
|
+
"Adding farmlands to the InfoLayer PNG file: %s.", info_layer_farmlands_path
|
113
|
+
)
|
114
|
+
|
111
115
|
if not os.path.isfile(info_layer_farmlands_path):
|
112
116
|
self.logger.warning("InfoLayer PNG file %s not found.", info_layer_farmlands_path)
|
113
117
|
return
|
@@ -139,12 +143,19 @@ class GRLE(Component):
|
|
139
143
|
)
|
140
144
|
continue
|
141
145
|
|
146
|
+
self.logger.debug("Fitted field %s contains %s points.", farmland_id, len(fitted_field))
|
147
|
+
|
142
148
|
field_np = np.array(fitted_field, np.int32)
|
143
149
|
field_np = field_np.reshape((-1, 1, 2))
|
144
150
|
|
151
|
+
self.logger.debug(
|
152
|
+
"Created a numpy array and reshaped it. Number of points: %s", len(field_np)
|
153
|
+
)
|
154
|
+
|
145
155
|
# Infolayer image is 1/2 of the size of the map image, that's why we need to divide
|
146
156
|
# the coordinates by 2.
|
147
157
|
field_np = field_np // 2
|
158
|
+
self.logger.debug("Divided the coordinates by 2.")
|
148
159
|
|
149
160
|
# pylint: disable=no-member
|
150
161
|
try:
|
maps4fs/generator/i3d.py
CHANGED
@@ -9,6 +9,7 @@ from xml.etree import ElementTree as ET
|
|
9
9
|
from maps4fs.generator.component import Component
|
10
10
|
|
11
11
|
DEFAULT_HEIGHT_SCALE = 2000
|
12
|
+
DISPLACEMENT_LAYER_SIZE_FOR_BIG_MAPS = 32768
|
12
13
|
DEFAULT_MAX_LOD_DISTANCE = 10000
|
13
14
|
DEFAULT_MAX_LOD_OCCLUDER_DISTANCE = 10000
|
14
15
|
NODE_ID_STARTING_VALUE = 500
|
@@ -84,6 +85,15 @@ class I3d(Component):
|
|
84
85
|
|
85
86
|
self.logger.debug("TerrainTransformGroup element updated in I3D file.")
|
86
87
|
|
88
|
+
if self.map_size > 4096:
|
89
|
+
displacement_layer = terrain_elem.find(".//DisplacementLayer") # pylint: disable=W0631
|
90
|
+
|
91
|
+
if displacement_layer is not None:
|
92
|
+
displacement_layer.set("size", str(DISPLACEMENT_LAYER_SIZE_FOR_BIG_MAPS))
|
93
|
+
self.logger.debug(
|
94
|
+
"Map size is greater than 4096, DisplacementLayer size set to %s.",
|
95
|
+
)
|
96
|
+
|
87
97
|
tree.write(self._map_i3d_path) # type: ignore
|
88
98
|
self.logger.info("Map I3D file saved to: %s.", self._map_i3d_path)
|
89
99
|
|
@@ -116,6 +126,7 @@ class I3d(Component):
|
|
116
126
|
return
|
117
127
|
|
118
128
|
self.logger.info("Found %s fields in textures info layer.", len(fields))
|
129
|
+
self.logger.debug("Starging to add fields to the I3D file.")
|
119
130
|
|
120
131
|
root = tree.getroot()
|
121
132
|
gameplay_node = root.find(".//TransformGroup[@name='gameplay']")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.6
|
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
|
@@ -35,6 +35,7 @@ Requires-Dist: pympler
|
|
35
35
|
<a href="#How-To-Run">How-To-Run</a><br>
|
36
36
|
<a href="docs/FAQ.md">FAQ</a> •
|
37
37
|
<a href="docs/map_structure.md">Map Structure</a> •
|
38
|
+
<a href="docs/tips_and_hints.md">Tips and Hints</a> •
|
38
39
|
<a href="#Modder-Toolbox">Modder Toolbox</a><br>
|
39
40
|
<a href="#Supported-objects">Supported objects</a> •
|
40
41
|
<a href="#Generation-info">Generation info</a> •
|
@@ -44,7 +45,8 @@ Requires-Dist: pympler
|
|
44
45
|
<a href="#DDS-conversion">DDS conversion</a> •
|
45
46
|
<a href="#For-advanced-users">For advanced users</a> •
|
46
47
|
<a href="#Resources">Resources</a> •
|
47
|
-
<a href="#Bugs-and-feature-requests">Bugs and feature requests</a>
|
48
|
+
<a href="#Bugs-and-feature-requests">Bugs and feature requests</a><br>
|
49
|
+
<a href="#Special-thanks">Special thanks</a>
|
48
50
|
</p>
|
49
51
|
|
50
52
|
|
@@ -78,17 +80,16 @@ Requires-Dist: pympler
|
|
78
80
|
<p align="center">
|
79
81
|
<img src="https://github.com/user-attachments/assets/cf8f5752-9c69-4018-bead-290f59ba6976"><br>
|
80
82
|
🌎 Detailed terrain based on real-world data.<br><br>
|
81
|
-
<img src="https://github.com/user-attachments/assets/
|
82
|
-
🛰️ Realistic background terrain
|
83
|
+
<img src="https://github.com/user-attachments/assets/dc40d0bb-c20b-411c-8833-9925d0389452"><br>
|
84
|
+
🛰️ Realistic background terrain with satellite images.<br><br>
|
85
|
+
<img src="https://github.com/user-attachments/assets/6e3c0e99-2cce-46ac-82db-5cb60bba7a30"><br>
|
86
|
+
📐 Perfectly aligned background terrain.<br><br>
|
83
87
|
<img src="https://github.com/user-attachments/assets/80e5923c-22c7-4dc0-8906-680902511f3a"><br>
|
84
88
|
🗒️ True-to-life blueprints for fast and precise modding.<br><br>
|
85
89
|
<img width="480" src="https://github.com/user-attachments/assets/1a8802d2-6a3b-4bfa-af2b-7c09478e199b"><br>
|
86
90
|
🌾 Field generation with one click.<br><br>
|
87
91
|
<img width="480" src="https://github.com/user-attachments/assets/4d1fa879-5d60-438b-a84e-16883bcef0ec"><br>
|
88
92
|
🌽 Automatic farmlands generation based on the fields.<br><br>
|
89
|
-
<img src="https://github.com/user-attachments/assets/cce45575-c917-4a1b-bdc0-6368e32ccdff"><br>
|
90
|
-
📏 Almost any possible map sizes.
|
91
|
-
</p>
|
92
93
|
|
93
94
|
📹 A complete step-by-step video tutorial is here!
|
94
95
|
<a href="https://www.youtube.com/watch?v=Nl_aqXJ5nAk" target="_blank"><img src="https://github.com/user-attachments/assets/4845e030-0e73-47ab-a5a3-430308913060"/></a>
|
@@ -111,7 +112,7 @@ So, jump to [Docker version](#option-2-docker-version) to launch the tool with o
|
|
111
112
|
### 😎 For advanced users
|
112
113
|
**Option 2:** Run the Docker version in your browser. Launch the following command in your terminal:
|
113
114
|
```bash
|
114
|
-
docker run -d -p 8501:8501 iwatkot/maps4fs
|
115
|
+
docker run -d -p 8501:8501 --name maps4fs iwatkot/maps4fs
|
115
116
|
```
|
116
117
|
And open [http://localhost:8501](http://localhost:8501) in your browser.<br>
|
117
118
|
If you don't know how to use Docker, navigate to the [Docker version](#option-2-docker-version), it's really simple.<br>
|
@@ -174,7 +175,7 @@ You can launch the project with minimalistic UI in your browser using Docker. Fo
|
|
174
175
|
1. Install [Docker](https://docs.docker.com/get-docker/) for your OS.
|
175
176
|
2. Run the following command in your terminal:
|
176
177
|
```bash
|
177
|
-
docker run -d -p 8501:8501 iwatkot/maps4fs
|
178
|
+
docker run -d -p 8501:8501 --name maps4fs iwatkot/maps4fs
|
178
179
|
```
|
179
180
|
3. Open your browser and go to [http://localhost:8501](http://localhost:8501).
|
180
181
|
4. Fill in the required fields and click on the `Generate` button.
|
@@ -491,3 +492,13 @@ To create a basic map, you only need the Giants Editor. But if you want to creat
|
|
491
492
|
## Bugs and feature requests
|
492
493
|
➡️ Please, before creating an issue or asking some questions, check the [FAQ](docs/FAQ.md) section.<br>
|
493
494
|
If you find a bug or have an idea for a new feature, please create an issue [here](https://github.com/iwatkot/maps4fs/issues) or contact me directly on [Telegram](https://t.me/iwatkot) or on Discord: `iwatkot`.
|
495
|
+
|
496
|
+
## Special thanks
|
497
|
+
|
498
|
+
Of course, first of all, thanks to the direct [contributors](https://github.com/iwatkot/maps4fs/graphs/contributors) of the project.
|
499
|
+
|
500
|
+
But also, I want to thank the people who helped me with the project in some way, even if they didn't contribute directly. Here's the list of them:
|
501
|
+
|
502
|
+
- [Ka5tis](https://github.com/Ka5tis) - for investigating the issue with a "spiky terrain" and finding a solution - changing the `DisplacementLayer` size to a higher value.
|
503
|
+
- [Kalderone](https://www.youtube.com/@Kalderone_FS22) - for useful feedback, suggestions, expert advice on the map-making process and highlihting some important settings in the Giants Editor.
|
504
|
+
- [OneSunnySunday](https://www.artstation.com/onesunnysunday) - for expert advice on Blender, help in processing background terrain, and compiling detailed tutorials on how to prepare the OBJ files for use in Giants Editor.
|
@@ -1,21 +1,21 @@
|
|
1
1
|
maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
|
2
2
|
maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
|
3
3
|
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
-
maps4fs/generator/background.py,sha256=
|
5
|
-
maps4fs/generator/component.py,sha256=
|
4
|
+
maps4fs/generator/background.py,sha256=dnUkS1atEqqz_ryKkcfP_K9ZcwMHZVs97y-twZMpD44,15881
|
5
|
+
maps4fs/generator/component.py,sha256=sihh2S35q0o38leEU-dpi0is6kYCuxXiWUISAtiQErM,17351
|
6
6
|
maps4fs/generator/config.py,sha256=b7qY0luC-_WM_c72Ohtlf4FrB37X5cALInbestSdUsw,4382
|
7
7
|
maps4fs/generator/dem.py,sha256=rc7ADzjvlZzStOqagsWW0Vrm9-X86aPpoR1RhBF_-OE,16025
|
8
|
-
maps4fs/generator/game.py,sha256=
|
9
|
-
maps4fs/generator/grle.py,sha256=
|
10
|
-
maps4fs/generator/i3d.py,sha256=
|
8
|
+
maps4fs/generator/game.py,sha256=2oA77i9lyNYOlhtOZft6KiPTxgGJbX1Gam1TosMNLis,7407
|
9
|
+
maps4fs/generator/grle.py,sha256=IVbvzF_azItxLE_ZxaM_suQflEZjJuMgHmv1En51G7A,7592
|
10
|
+
maps4fs/generator/i3d.py,sha256=SzjAxYacbBQ030N2sHh9c-dhWoG3iADJqCrHBox6vWI,12268
|
11
11
|
maps4fs/generator/map.py,sha256=7UqLjDZgoY6M0ZxX5Q4Rjee2UGWZ64a3tGyr8B24UO0,4863
|
12
12
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
13
13
|
maps4fs/generator/texture.py,sha256=uSt563KomSVUndl25IgEIi0YuhBQbnhPIoQKa-4A3_E,26016
|
14
14
|
maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
15
15
|
maps4fs/toolbox/background.py,sha256=9BXWNqs_n3HgqDiPztWylgYk_QM4YgBpe6_ZNQAWtSc,2154
|
16
16
|
maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
|
17
|
-
maps4fs-1.1.
|
18
|
-
maps4fs-1.1.
|
19
|
-
maps4fs-1.1.
|
20
|
-
maps4fs-1.1.
|
21
|
-
maps4fs-1.1.
|
17
|
+
maps4fs-1.1.6.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
18
|
+
maps4fs-1.1.6.dist-info/METADATA,sha256=W5x23vIOjkx-xxq4L0VIWVIA9pCgOniTQvbFqiTUVFs,28942
|
19
|
+
maps4fs-1.1.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
20
|
+
maps4fs-1.1.6.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
21
|
+
maps4fs-1.1.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|