diff --git a/ballance_blender_plugin/BMFILE_export.py b/ballance_blender_plugin/BMFILE_export.py index 1fdb6e3..2b44bf3 100644 --- a/ballance_blender_plugin/BMFILE_export.py +++ b/ballance_blender_plugin/BMFILE_export.py @@ -26,6 +26,12 @@ class BALLANCE_OT_export_bm(bpy.types.Operator, bpy_extras.io_utils.ExportHelper ) def execute(self, context): + # detect edit mode + in_edit_mode = False + if bpy.context.object and bpy.context.object.mode == "EDIT": + in_edit_mode = True + bpy.ops.object.editmode_toggle() + if ((self.export_mode == 'COLLECTION' and context.scene.BallanceBlenderPluginProperty.collection_picker is None) or (self.export_mode == 'OBJECT' and context.scene.BallanceBlenderPluginProperty.object_picker is None)): UTILS_functions.show_message_box(("No specific target", ), "Lost parameter", 'ERROR') @@ -40,6 +46,11 @@ class BALLANCE_OT_export_bm(bpy.types.Operator, bpy_extras.io_utils.ExportHelper export_bm(context, self.filepath, prefs.no_component_collection, self.export_mode, context.scene.BallanceBlenderPluginProperty.object_picker) + + # restore edit mode + if in_edit_mode: + bpy.ops.object.editmode_toggle() + return {'FINISHED'} def draw(self, context): diff --git a/ballance_blender_plugin/OBJS_add_components.py b/ballance_blender_plugin/OBJS_add_components.py index 2475f62..42363bd 100644 --- a/ballance_blender_plugin/OBJS_add_components.py +++ b/ballance_blender_plugin/OBJS_add_components.py @@ -55,7 +55,7 @@ class BALLANCE_OT_add_components(bpy.types.Operator): UTILS_functions.add_into_scene_and_move_to_cursor(obj) # extra duplication - if self.elements_type in self.canDuplicatedElements: + if (self.elements_type in self.canDuplicatedElements) and self.elements_duplicated: for i in range(self.elements_dup_times - 1): obj = bpy.data.objects.new(finalObjectName, loadedMesh) UTILS_functions.add_into_scene_and_move_to_cursor(obj) diff --git a/ballance_blender_plugin/OBJS_add_floors.py b/ballance_blender_plugin/OBJS_add_floors.py index 0b00f66..27a00e8 100644 --- a/ballance_blender_plugin/OBJS_add_floors.py +++ b/ballance_blender_plugin/OBJS_add_floors.py @@ -221,7 +221,7 @@ def _create_or_get_material(material_name, prefs_externalTexture): try_item['data']['ambient'], try_item['data']['diffuse'], try_item['data']['specular'], try_item['data']['emissive'], try_item['data']['power'], - False, False, False, False, + False, False, True, False, texture) ) break diff --git a/ballance_blender_plugin/UTILS_functions.py b/ballance_blender_plugin/UTILS_functions.py index cd29a99..c913bb6 100644 --- a/ballance_blender_plugin/UTILS_functions.py +++ b/ballance_blender_plugin/UTILS_functions.py @@ -105,7 +105,7 @@ def parse_material_nodes(mtl): # return value return (True, mtl_ambient, mtl_diffuse, mtl_specular, mtl_emissive, mtl_specularPower, - False, False, False, False, + False, False, True, False, mtl_texture ) diff --git a/ballance_blender_plugin/UTILS_virtools_prop.py b/ballance_blender_plugin/UTILS_virtools_prop.py index e34a571..3a24a68 100644 --- a/ballance_blender_plugin/UTILS_virtools_prop.py +++ b/ballance_blender_plugin/UTILS_virtools_prop.py @@ -53,7 +53,7 @@ class BALLANCE_PG_virtools_material(bpy.types.PropertyGroup): z_buffer: bpy.props.BoolProperty( name="Z Buffer", description="ZFunc: VXCMP_LESSEQUAL.", - default=False, + default=True, ) two_sided: bpy.props.BoolProperty(