From fd0ba8720b05428112b7b7b3cad16d8cf7f1e301 Mon Sep 17 00:00:00 2001 From: SleepKiller Date: Wed, 13 Nov 2019 16:38:55 +1300 Subject: [PATCH] apply modifiers during export --- addons/io_scene_swbf_msh/msh_model_gather.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/io_scene_swbf_msh/msh_model_gather.py b/addons/io_scene_swbf_msh/msh_model_gather.py index e1aa472..21e058b 100644 --- a/addons/io_scene_swbf_msh/msh_model_gather.py +++ b/addons/io_scene_swbf_msh/msh_model_gather.py @@ -15,14 +15,17 @@ def gather_models() -> List[Model]: """ Gathers the Blender objects from the current scene and returns them as a list of Model objects. """ + depsgraph = bpy.context.evaluated_depsgraph_get() parents = create_parents_set() models_list: List[Model] = [] - for obj in bpy.context.scene.objects: - if obj.type in SKIPPED_OBJECT_TYPES and obj.name not in parents: + for uneval_obj in bpy.context.scene.objects: + if uneval_obj.type in SKIPPED_OBJECT_TYPES and uneval_obj.name not in parents: continue + obj = uneval_obj.evaluated_get(depsgraph) + model = Model() model.name = obj.name model.model_type = get_model_type(obj)