diff --git a/addons/io_scene_swbf_msh/__init__.py b/addons/io_scene_swbf_msh/__init__.py index 68ede4f..02c376c 100644 --- a/addons/io_scene_swbf_msh/__init__.py +++ b/addons/io_scene_swbf_msh/__init__.py @@ -1,8 +1,8 @@ bl_info = { 'name': 'SWBF .msh Import-Export', 'author': 'Will Snyder, PrismaticFlower', - "version": (1, 3, 2), - 'blender': (2, 80, 0), + "version": (1, 3, 3), + 'blender': (3, 0, 0), 'location': 'File > Import-Export', 'description': 'Export as SWBF .msh file', 'warning': '', diff --git a/addons/io_scene_swbf_msh/msh_model_gather.py b/addons/io_scene_swbf_msh/msh_model_gather.py index 2d57040..4e1c117 100644 --- a/addons/io_scene_swbf_msh/msh_model_gather.py +++ b/addons/io_scene_swbf_msh/msh_model_gather.py @@ -215,10 +215,11 @@ def create_mesh_geometry(mesh: bpy.types.Mesh, valid_vgroup_indices: Set[int]) - yield mesh.uv_layers.active.data[loop_index].uv.y if segment.colors is not None: - data_type = mesh.color_attributes.active_color.data_type - if data_type == "FLOAT_COLOR" or data_type == "BYTE_COLOR": - for v in mesh.color_attributes.active_color.data[vertex_index].color: - yield v + active_color = mesh.color_attributes.active_color + data_index = loop_index if active_color.domain == "CORNER" else vertex_index + + for v in mesh.color_attributes.active_color.data[data_index].color: + yield v if segment.weights is not None: for v in mesh.vertices[vertex_index].groups: @@ -247,9 +248,10 @@ def create_mesh_geometry(mesh: bpy.types.Mesh, valid_vgroup_indices: Set[int]) - segment.texcoords.append(mesh.uv_layers.active.data[loop_index].uv.copy()) if segment.colors is not None: - data_type = mesh.color_attributes.active_color.data_type - if data_type == "FLOAT_COLOR" or data_type == "BYTE_COLOR": - segment.colors.append(list(mesh.color_attributes.active_color.data[vertex_index].color)) + active_color = mesh.color_attributes.active_color + data_index = loop_index if active_color.domain == "CORNER" else vertex_index + + segment.colors.append(list(active_color.data[data_index].color)) if segment.weights is not None: groups = mesh.vertices[vertex_index].groups