53 lines
1.9 KiB
Python
53 lines
1.9 KiB
Python
import bpy
|
|
from bpy.props import FloatProperty, FloatVectorProperty, IntProperty, StringProperty
|
|
from .create_mesh_from_geotiff import OBJECT_OT_create_mesh_from_geotiff
|
|
from .import_geotiff_panel import OBJECT_PT_import_geotiff
|
|
from .select_geotiff_file import OBJECT_OT_select_geotiff_file
|
|
|
|
def init_scene_vars():
|
|
bpy.types.Scene.mapping_extension_geotiff_filename = StringProperty(
|
|
name="Geotiff filename",
|
|
description="Input GeoTIFF",
|
|
maxlen=1024, # Max length of the string.
|
|
options={'SKIP_SAVE'})
|
|
bpy.types.Scene.mapping_extension_map_origin = FloatVectorProperty(
|
|
name="Map origin",
|
|
description="The map coordinate that should map to the blender origin",
|
|
default=(0.0,0.0),
|
|
size=2,
|
|
options={'SKIP_SAVE'})
|
|
bpy.types.Scene.mapping_extension_map_scale = IntProperty(
|
|
name="Map Scale",
|
|
description="Denominator or map scale. E.g. for a 1:10,000 scale, set this to 10000",
|
|
default=10000,
|
|
min=1,
|
|
soft_max=1000000,
|
|
options={'SKIP_SAVE'})
|
|
bpy.types.Scene.mapping_extension_vertical_exaggeration = FloatProperty(
|
|
name="Map vertical exaggeration",
|
|
description="Scale applied to heights, on to of the map scale",
|
|
default=6.0,
|
|
min = 0.0,
|
|
soft_min = 1.0,
|
|
max = 1000000.0,
|
|
soft_max = 20.0,
|
|
options={'SKIP_SAVE'})
|
|
|
|
|
|
|
|
def del_scene_vars():
|
|
del bpy.types.Scene.mapping_extension_geotiff_filename
|
|
|
|
|
|
def register():
|
|
init_scene_vars()
|
|
bpy.utils.register_class(OBJECT_PT_import_geotiff)
|
|
bpy.utils.register_class(OBJECT_OT_create_mesh_from_geotiff)
|
|
bpy.utils.register_class(OBJECT_OT_select_geotiff_file)
|
|
|
|
def unregister():
|
|
del_scene_vars()
|
|
bpy.utils.unregister_class(OBJECT_PT_import_geotiff)
|
|
bpy.utils.unregister_class(OBJECT_OT_create_mesh_from_geotiff)
|
|
bpy.utils.unregister_class(OBJECT_OT_select_geotiff_file)
|