maps4fs 1.4.9__py3-none-any.whl → 1.5.1__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/map.py +33 -1
- {maps4fs-1.4.9.dist-info → maps4fs-1.5.1.dist-info}/METADATA +34 -26
- {maps4fs-1.4.9.dist-info → maps4fs-1.5.1.dist-info}/RECORD +6 -6
- {maps4fs-1.4.9.dist-info → maps4fs-1.5.1.dist-info}/LICENSE.md +0 -0
- {maps4fs-1.4.9.dist-info → maps4fs-1.5.1.dist-info}/WHEEL +0 -0
- {maps4fs-1.4.9.dist-info → maps4fs-1.5.1.dist-info}/top_level.txt +0 -0
maps4fs/generator/map.py
CHANGED
@@ -47,6 +47,19 @@ class SettingsModel(BaseModel):
|
|
47
47
|
|
48
48
|
return settings
|
49
49
|
|
50
|
+
@classmethod
|
51
|
+
def all_settings(cls) -> list[SettingsModel]:
|
52
|
+
"""Get all settings of the current class and its subclasses.
|
53
|
+
|
54
|
+
Returns:
|
55
|
+
list[SettingsModel]: List with settings of the current class and its subclasses.
|
56
|
+
"""
|
57
|
+
settings = []
|
58
|
+
for subclass in cls.__subclasses__():
|
59
|
+
settings.append(subclass())
|
60
|
+
|
61
|
+
return settings
|
62
|
+
|
50
63
|
|
51
64
|
class DEMSettings(SettingsModel):
|
52
65
|
"""Represents the advanced settings for DEM component.
|
@@ -117,7 +130,7 @@ class TextureSettings(SettingsModel):
|
|
117
130
|
skip_drains (bool): skip drains generation.
|
118
131
|
"""
|
119
132
|
|
120
|
-
dissolve: bool =
|
133
|
+
dissolve: bool = False
|
121
134
|
fields_padding: int = 0
|
122
135
|
skip_drains: bool = False
|
123
136
|
|
@@ -208,6 +221,25 @@ class Map:
|
|
208
221
|
os.makedirs(self.map_directory, exist_ok=True)
|
209
222
|
self.logger.debug("Map directory created: %s", self.map_directory)
|
210
223
|
|
224
|
+
settings = [
|
225
|
+
dem_settings,
|
226
|
+
background_settings,
|
227
|
+
grle_settings,
|
228
|
+
i3d_settings,
|
229
|
+
texture_settings,
|
230
|
+
spline_settings,
|
231
|
+
]
|
232
|
+
|
233
|
+
settings_json = {}
|
234
|
+
|
235
|
+
for setting in settings:
|
236
|
+
settings_json[setting.__class__.__name__] = setting.model_dump()
|
237
|
+
|
238
|
+
save_path = os.path.join(self.map_directory, "generation_settings.json")
|
239
|
+
|
240
|
+
with open(save_path, "w", encoding="utf-8") as file:
|
241
|
+
json.dump(settings_json, file, indent=4)
|
242
|
+
|
211
243
|
self.texture_custom_schema = kwargs.get("texture_custom_schema", None)
|
212
244
|
if self.texture_custom_schema:
|
213
245
|
save_path = os.path.join(self.map_directory, "texture_custom_schema.json")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.5.1
|
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
|
@@ -45,6 +45,7 @@ Requires-Dist: pydantic
|
|
45
45
|
<a href="#Overview-image">Overview image</a><br>
|
46
46
|
<a href="#DDS-conversion">DDS conversion</a> •
|
47
47
|
<a href="#Advanced-settings">Advanced settings</a> •
|
48
|
+
<a href="#Expert-settings">Expert settings</a> •
|
48
49
|
<a href="#Resources">Resources</a> •
|
49
50
|
<a href="#Bugs-and-feature-requests">Bugs and feature requests</a><br>
|
50
51
|
<a href="#Special-thanks">Special thanks</a>
|
@@ -256,18 +257,12 @@ Tools are divided into categories, which are listed below.
|
|
256
257
|
|
257
258
|
## Supported objects
|
258
259
|
The project is based on the [OpenStreetMap](https://www.openstreetmap.org/) data. So, refer to [this page](https://wiki.openstreetmap.org/wiki/Map_Features) to understand the list below.
|
259
|
-
|
260
|
-
|
261
|
-
-
|
262
|
-
-
|
263
|
-
|
264
|
-
-
|
265
|
-
- "natural": ["water"]
|
266
|
-
- "waterway": True
|
267
|
-
- "natural": ["wood", "tree_row"]
|
268
|
-
- "railway": True
|
269
|
-
|
270
|
-
The list will be updated as the project develops.
|
260
|
+
|
261
|
+
You can find the active schemas here:
|
262
|
+
- [FS25](/data/fs25-texture-schema.json)
|
263
|
+
- [FS22](/data/fs22-texture-schema.json)
|
264
|
+
|
265
|
+
Learn more how to work with the schema in the [Texture schema](#texture-schema) section. You can also use your own schema in the [Expert settings](#expert-settings) section.
|
271
266
|
|
272
267
|
## Generation info
|
273
268
|
The script will generate the `generation_info.json` file in the `output` folder. It is split into different sections, which represent the components of the map generator. You may need this information to use some other tools and services to obtain additional data for your map.<br>
|
@@ -478,46 +473,59 @@ You can also apply some advanced settings to the map generation process. Note th
|
|
478
473
|
|
479
474
|
### DEM Advanced settings
|
480
475
|
|
476
|
+
- Auto process: the tool will automatically try to find suitable multiplier. As a result, the DEM image WILL not match real world values. If this option is disabled, you'll probably see completely black DEM image, but it's not empty. It's just you can't see the values of 16-bit image by eye, because they're too small. Learn more what's DEM image and how to work with it in [docs](docs/dem.md). By default, it's set to True.
|
477
|
+
|
481
478
|
- Multiplier: the height of the map is multiplied by this value. So the DEM map is just a 16-bit grayscale image, which means that the maximum available value there is 65535, while the actual difference between the deepest and the highest point on Earth is about 20 km. Just note that this setting mostly does not matter, because you can always adjust it in the Giants Editor, learn more about the DEM file and the heightScale parameter in [docs](docs/dem.md). By default, it's set to 1.
|
482
479
|
|
483
480
|
- Blur radius: the radius of the Gaussian blur filter applied to the DEM map. By default, it's set to 21. This filter just makes the DEM map smoother, so the height transitions will be more natural. You can set it to 1 to disable the filter, but it will result in a Minecraft-like map.
|
484
481
|
|
485
|
-
- Plateau
|
482
|
+
- Plateau: this value will be added to each pixel of the DEM image, making it "higher". It's useful when you want to add some negative heights on the map, that appear to be in a "low" place. By default, it's set to 0.
|
486
483
|
|
487
484
|
- Water depth: this value will be subtracted from each pixel of the DEM image, where water resources are located. Pay attention that it's not in meters, instead it in the pixel value of DEM, which is 16 bit image with possible values from 0 to 65535. When this value is set, the same value will be added to the plateau setting to avoid negative heights.
|
488
485
|
|
489
|
-
###
|
486
|
+
### Background terrain Advanced settings
|
490
487
|
|
491
|
-
-
|
488
|
+
- Generate background - if enabled, the obj files for the background terrain 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.
|
492
489
|
|
493
|
-
-
|
490
|
+
- 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.
|
494
491
|
|
495
|
-
-
|
492
|
+
- 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.
|
496
493
|
|
497
|
-
###
|
494
|
+
### GRLE Advanced settings
|
498
495
|
|
499
496
|
- Farmlands margin - this value (in meters) will be applied to each farmland, making it bigger. You can use the value to adjust how much the farmland should be bigger than the actual field. By default, it's set to 3.
|
500
497
|
|
498
|
+
- Random plants - when adding decorative foliage, enabling this option will add different species of plants to the map. If unchecked only basic grass (smallDenseMix) will be added. Defaults to True.
|
499
|
+
|
501
500
|
- Add Farmyards - if enabled, the tool will create farmlands from the regions that are marked as farmyards in the OSM data. Those farmlands will not have fields and also will not be drawn on textures. By default, it's turned off.
|
502
501
|
|
503
|
-
###
|
502
|
+
### I3D Advanced settings
|
504
503
|
|
505
504
|
- Forest density - the density of the forest in meters. The lower the value, the lower the distance between the trees, which makes the forest denser. Note, that low values will lead to enormous number of trees, which may cause the Giants Editor to crash or lead to performance issues. By default, it's set to 10.
|
506
505
|
|
507
|
-
|
508
|
-
|
509
|
-
### Background terrain Advanced settings
|
506
|
+
### Texture Advanced settings
|
510
507
|
|
511
|
-
-
|
508
|
+
- Dissolve - if enabled, the values from one layer will be splitted between different layers of texture, making it look more natural. Warning: it's a time-consuming process, recommended to enable it, when you generating the final version of the map, not some test versions.
|
512
509
|
|
513
|
-
-
|
510
|
+
- Fields padding - this value (in meters) will be applied to each field, making it smaller. It's useful when the fields are too close to each other and you want to make them smaller. By default, it's set to 0.
|
514
511
|
|
515
|
-
-
|
512
|
+
- Skip drains - if enabled, the tool will not generate the drains and ditches on the map. By default, it's set to False. Use this if you don't need the drains on the map.
|
516
513
|
|
517
514
|
## Splines Advanced settings
|
518
515
|
|
519
516
|
- Splines density - number of points, which will be added (interpolate) between each pair of existing points. The higher the value, the denser the spline will be. It can smooth the splines, but high values can in opposite make the splines look unnatural.
|
520
517
|
|
518
|
+
## Expert Settings
|
519
|
+
The tool also supports the expert settings. Do not use them until you read the documentation and understand what they do. Here's the list of the expert settings:
|
520
|
+
|
521
|
+
- Enable debug logs - if enabled, the tool will print the debug logs to the console. It can be useful if you're using with a custom OSM map, have some issues with it and want to know what's wrong.
|
522
|
+
|
523
|
+
- Upload custom OSM file - you'll be able to upload your own OSM file. Before using it, carefully read the [Custom OSM](docs/custom_osm.md) documentation, otherwise, the tool will not work as expected.
|
524
|
+
|
525
|
+
- Show raw configuration - you'll be able to change all the settings in a single JSON file. It's useful if you want to save the configuration and use it later, without changing the settings in the UI. Be extremely careful with this setting, because you can break the tool with incorrect settings.
|
526
|
+
|
527
|
+
- Show schemas - you'll be able to edit or define your own texture or tree schemas. It's useful if you want to add some custom textures or trees to the map. Refer to the [Texture schema](#texture-schema) section to learn more about the schema structure. Any incorrect value here will lead to the completely broken map.
|
528
|
+
|
521
529
|
## Resources
|
522
530
|
In this section, you'll find a list of the resources that you need to create a map for the Farming Simulator.<br>
|
523
531
|
To create a basic map, you only need the Giants Editor. But if you want to create a background terrain - the world around the map, so it won't look like it's floating in the void - you also need Blender and the Blender Exporter Plugins. To create realistic textures for the background terrain, the QGIS is required to obtain high-resolution satellite images.<br>
|
@@ -8,14 +8,14 @@ maps4fs/generator/dem.py,sha256=MZf3ZjawJ977TxqB1q9nNpvPZUNwfmm2EaJDtVU-eCU,1593
|
|
8
8
|
maps4fs/generator/game.py,sha256=jjo7CTwHHSkRpeD_QgRXkhR_NxI09C4kMxz-nYOTM4A,7931
|
9
9
|
maps4fs/generator/grle.py,sha256=u8ZwSs313PIOkH_0B_O2tVTaZ-eYNkc30eKGtBxWzTM,17846
|
10
10
|
maps4fs/generator/i3d.py,sha256=qeZYqfuhbhRPlSAuQHXaq6RmIO7314oMN68Ivebp1YQ,24786
|
11
|
-
maps4fs/generator/map.py,sha256=
|
11
|
+
maps4fs/generator/map.py,sha256=jIdekpiymhHqKx4FaAwjtq3hMnRdKYo6TvJLX1fSD0k,12814
|
12
12
|
maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
|
13
13
|
maps4fs/generator/texture.py,sha256=sErusfv1AqQfP-veMrZ921Tz8DnGEhfB4ucggMmKrD4,31231
|
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.
|
18
|
-
maps4fs-1.
|
19
|
-
maps4fs-1.
|
20
|
-
maps4fs-1.
|
21
|
-
maps4fs-1.
|
17
|
+
maps4fs-1.5.1.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
|
18
|
+
maps4fs-1.5.1.dist-info/METADATA,sha256=DD8seU-Iy7cceJn9itoTArNDi0IOXHX13_KWBD_K2Yw,35026
|
19
|
+
maps4fs-1.5.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
20
|
+
maps4fs-1.5.1.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
21
|
+
maps4fs-1.5.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|