diff --git a/tools/io_mesh_qfmdl/export_mdl.py b/tools/io_mesh_qfmdl/export_mdl.py index 6b7237c4f..8391baeb9 100644 --- a/tools/io_mesh_qfmdl/export_mdl.py +++ b/tools/io_mesh_qfmdl/export_mdl.py @@ -344,8 +344,10 @@ def export_mdl( ): obj = context.active_object - #mesh = obj.to_mesh(context.scene, True, 'PREVIEW') #wysiwyg? - mesh = obj.to_mesh(context.depsgraph, True, calc_undeformed=False) + obj.update_from_editmode() + depsgraph = context.evaluated_depsgraph_get() + ob_eval = obj.evaluated_get(depsgraph) + mesh = ob_eval.to_mesh() #if not check_faces(mesh): # operator.report({'ERROR'}, # "Mesh has faces with more than 3 vertices.") @@ -377,7 +379,10 @@ def export_mdl( if not mdl.frames: for fno in range(context.scene.frame_start, context.scene.frame_end + 1): context.scene.frame_set(fno) - mesh = obj.to_mesh(context.depsgraph, True, calc_undeformed=False) #wysiwyg? + obj.update_from_editmode() + depsgraph = context.evaluated_depsgraph_get() + ob_eval = obj.evaluated_get(depsgraph) + mesh = ob_eval.to_mesh() if xform: mesh.transform(mdl.obj.matrix_world) mdl.frames.append(make_frame(mesh, vertmap, fno)) diff --git a/tools/io_mesh_qfmdl/import_mdl.py b/tools/io_mesh_qfmdl/import_mdl.py index 1eb057b68..adfa8f610 100644 --- a/tools/io_mesh_qfmdl/import_mdl.py +++ b/tools/io_mesh_qfmdl/import_mdl.py @@ -87,7 +87,7 @@ def load_skins(mdl): p[l + 2] = c[2] / 255.0 p[l + 3] = 1.0 img.pixels[:] = p[:] - img.pack(as_png=True) + img.pack() img.use_fake_user = True mdl.images=[] @@ -101,7 +101,7 @@ def load_skins(mdl): def setup_main_material(mdl): mat = bpy.data.materials.new(mdl.name) mat.blend_method = 'OPAQUE' - mat.diffuse_color = (1, 1, 1) + mat.diffuse_color = (1, 1, 1, 1) mat.metallic = 1 mat.roughness = 1 mat.specular_intensity = 0