From b825e93ab9b1170cee0b8e409f07622bfa48cc44 Mon Sep 17 00:00:00 2001 From: mese79 Date: Thu, 29 Jun 2017 19:25:44 +0430 Subject: [PATCH] blender exporter invisible object bug --- .../blender/addons/io_three/exporter/api/object.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/exporters/blender/addons/io_three/exporter/api/object.py b/utils/exporters/blender/addons/io_three/exporter/api/object.py index 504b12942a..a31f8cca8e 100644 --- a/utils/exporters/blender/addons/io_three/exporter/api/object.py +++ b/utils/exporters/blender/addons/io_three/exporter/api/object.py @@ -115,7 +115,7 @@ def children(obj, valid_types): """ logger.debug('object.children(%s, %s)', obj, valid_types) for child in obj.children: - if child.type in valid_types: + if child.type in valid_types and child.THREE_export: yield child.name @@ -451,6 +451,10 @@ def extract_mesh(obj, options, recalculate=False): """ logger.debug('object.extract_mesh(%s, %s)', obj, options) + bpy.context.scene.objects.active = obj + hidden_state = obj.hide + obj.hide = False + apply_modifiers = options.get(constants.APPLY_MODIFIERS, True) if apply_modifiers: bpy.ops.object.mode_set(mode='OBJECT') @@ -466,8 +470,6 @@ def extract_mesh(obj, options, recalculate=False): opt_buffer = opt_buffer == constants.BUFFER_GEOMETRY prop_buffer = mesh_node.THREE_geometry_type == constants.BUFFER_GEOMETRY - bpy.context.scene.objects.active = obj - # if doing buffer geometry it is imperative to triangulate the mesh if opt_buffer or prop_buffer: original_mesh = obj.data @@ -476,8 +478,6 @@ def extract_mesh(obj, options, recalculate=False): original_mesh.name, mesh_node.name) - hidden_state = obj.hide - obj.hide = False bpy.ops.object.mode_set(mode='OBJECT') obj.select = True bpy.context.scene.objects.active = obj @@ -487,7 +487,6 @@ def extract_mesh(obj, options, recalculate=False): modifier='Triangulate') obj.data = original_mesh obj.select = False - obj.hide = hidden_state # split sharp edges original_mesh = obj.data @@ -499,6 +498,7 @@ def extract_mesh(obj, options, recalculate=False): bpy.context.object.modifiers['EdgeSplit'].use_edge_sharp = True bpy.ops.object.modifier_apply(apply_as='DATA', modifier='EdgeSplit') + obj.hide = hidden_state obj.select = False obj.data = original_mesh -- GitLab