|
22 | 22 |
|
23 | 23 | import bpy |
24 | 24 | from bpy.types import Operator, OperatorFileListElement, AddonPreferences |
25 | | -from bpy.props import StringProperty, BoolProperty, CollectionProperty |
| 25 | +from bpy.props import StringProperty, BoolProperty, CollectionProperty, FloatProperty |
26 | 26 | from bpy_extras.io_utils import ImportHelper |
27 | 27 |
|
28 | 28 | from .A3D import A3D |
@@ -112,6 +112,7 @@ class ImportBattleMap(Operator, ImportHelper): |
112 | 112 | import_collision_geom: BoolProperty(name="Import collision geometry", description="Collision geometry defines the geometry used for collision checks and cannot normally be seen by players", default=False) |
113 | 113 | import_spawn_points: BoolProperty(name="Import spawn points", description="Places a marker at locations where tanks can spawn", default=False) |
114 | 114 | import_lightmapdata: BoolProperty(name="Import lighting information", description="Loads the lightmapdata file which stores information about the sun, ambient lighting and shadow settings. Only works on remaster maps.", default=True) |
| 115 | + map_scale_factor: FloatProperty(name="Map scale", description="Sets the map's default scale, maps and models are at a 100x scale so this allows you to directly import the map in the right size.", default=0.01, min=0.0, soft_max=1.0) |
115 | 116 |
|
116 | 117 | def draw(self, context): |
117 | 118 | import_panel_options_battlemap(self.layout, self) |
@@ -139,7 +140,7 @@ def execute(self, context): |
139 | 140 |
|
140 | 141 | # Import data into blender |
141 | 142 | preferences = context.preferences.addons[__package__].preferences # TODO: check if this is set before proceeding |
142 | | - mapImporter = BattleMapBlenderImporter(mapData, lightmapData, preferences.propLibrarySourcePath, self.import_static_geom, self.import_collision_geom, self.import_spawn_points, self.import_lightmapdata) |
| 143 | + mapImporter = BattleMapBlenderImporter(mapData, lightmapData, preferences.propLibrarySourcePath, self.map_scale_factor, self.import_static_geom, self.import_collision_geom, self.import_spawn_points, self.import_lightmapdata) |
143 | 144 | objects = mapImporter.importData() |
144 | 145 |
|
145 | 146 | # Link objects |
@@ -171,6 +172,7 @@ def import_panel_options_battlemap(layout, operator): |
171 | 172 | body.prop(operator, "import_collision_geom") |
172 | 173 | body.prop(operator, "import_spawn_points") |
173 | 174 | body.prop(operator, "import_lightmapdata") |
| 175 | + body.prop(operator, "map_scale_factor") |
174 | 176 |
|
175 | 177 | def menu_func_import_a3d(self, context): |
176 | 178 | self.layout.operator(ImportA3D.bl_idname, text="Alternativa3D HTML5 (.a3d)") |
|
0 commit comments