Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@nesnausk.org>2022-06-19 17:39:54 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-06-19 17:39:54 +0300
commit91b52545989ce29c6cd350a99191accf23d3d9dd (patch)
tree1cc11f454e1781bb8063c65ff528fa6df09047d3 /source/blender/io/wavefront_obj/importer/obj_import_mesh.hh
parentcf8922ef577083668a22d52b9b01fc545bafd206 (diff)
Fix T98874: new obj importer missing an option to import vertex groups
The old Python OBJ importer had a (somewhat confusingly named) "Keep Vertex Order -> Poly Groups" option, that imported OBJ groups as "vertex groups" on the resulting mesh. All vertices of any face were assigned the vertex group, with a 1.0 weight. The new C++ importer did not have this option. It was trying to do something with vertex groups, but failing to actually achieve anything :) -- the vertex groups were created on the wrong object (later on overwritten by "nomain mesh to main mesh" operation); vertex weights were set to 1.0/vertex_count, and each vertex was only set to be in one group, even when it belongs to multiple faces from different groups. End result was that to the user, vertex groups were not visible/present at all (see T98874). This patch adds the import option (named "Vertex Groups"), which is off by default, and fixes the import code logic to actually do the right thing. Tested on file from T98874; vertex groups are imported just like with the Python importer. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D15200
Diffstat (limited to 'source/blender/io/wavefront_obj/importer/obj_import_mesh.hh')
-rw-r--r--source/blender/io/wavefront_obj/importer/obj_import_mesh.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh b/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh
index 216717f3578..c6773cfa0cb 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh
+++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.hh
@@ -45,10 +45,9 @@ class MeshFromGeometry : NonMovable, NonCopyable {
void fixup_invalid_faces();
void create_vertices(Mesh *mesh);
/**
- * Create polygons for the Mesh, set smooth shading flags, deform group names,
- * Materials.
+ * Create polygons for the Mesh, set smooth shading flags, Materials.
*/
- void create_polys_loops(Object *obj, Mesh *mesh);
+ void create_polys_loops(Object *obj, Mesh *mesh, bool use_vertex_groups);
/**
* Add explicitly imported OBJ edges to the mesh.
*/
@@ -66,6 +65,7 @@ class MeshFromGeometry : NonMovable, NonCopyable {
Object *obj);
void create_normals(Mesh *mesh);
void create_colors(Mesh *mesh);
+ void create_vertex_groups(Object *obj);
};
} // namespace blender::io::obj