-
Notifications
You must be signed in to change notification settings - Fork 0
/
open_map_scene.py
35 lines (24 loc) · 917 Bytes
/
open_map_scene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import bpy
import os
from bpy.props import StringProperty, BoolProperty
from bpy_extras.io_utils import ImportHelper
from .utils import export_import_utils
from . import map_scene_data
class OpenMapScene(bpy.types.Operator):
bl_idname = "dsc.open_map_scene"
bl_label = "确定"
bl_options = {'REGISTER'}
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
filter_glob: StringProperty(
default='*.json; *.xodr',
options={'HIDDEN'} )
@classmethod
def poll(cls, context):
return context.area.type == 'VIEW_3D'
def execute(self, context):
export_import_utils.reload_map_scene(context, self.filepath)
export_import_utils.set_current_opened_map_scene_file(self.filepath)
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}