From addb1a5c9a91c3b4428a8d0548815632fa608e36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 2 Jul 2021 12:11:54 +1000 Subject: Cleanup: spelling in comments --- source/blender/modifiers/intern/MOD_weightvgproximity.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index cd03175f16c..b0d2f52f78c 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -174,7 +174,7 @@ static void get_vert2geom_distance(int numVerts, BVHTreeFromMesh treeData_f = {NULL}; if (dist_v) { - /* Create a bvh-tree of the given target's verts. */ + /* Create a BVH-tree of the given target's verts. */ BKE_bvhtree_from_mesh_get(&treeData_v, target, BVHTREE_FROM_VERTS, 2); if (treeData_v.tree == NULL) { OUT_OF_MEMORY(); @@ -182,7 +182,7 @@ static void get_vert2geom_distance(int numVerts, } } if (dist_e) { - /* Create a bvh-tree of the given target's edges. */ + /* Create a BVH-tree of the given target's edges. */ BKE_bvhtree_from_mesh_get(&treeData_e, target, BVHTREE_FROM_EDGES, 2); if (treeData_e.tree == NULL) { OUT_OF_MEMORY(); @@ -190,7 +190,7 @@ static void get_vert2geom_distance(int numVerts, } } if (dist_f) { - /* Create a bvh-tree of the given target's faces. */ + /* Create a BVH-tree of the given target's faces. */ BKE_bvhtree_from_mesh_get(&treeData_f, target, BVHTREE_FROM_LOOPTRI, 2); if (treeData_f.tree == NULL) { OUT_OF_MEMORY(); -- cgit v1.2.3 From 3b6ee8cee7080af200e25e944fe30d310240e138 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 13 Jul 2021 12:10:34 -0400 Subject: Refactor: Move vertex group names to object data This commit moves the storage of `bDeformGroup` and the active index to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility functions are added to allow easy access to the vertex groups given an object or an ID. As explained in T88951, the list of vertex group names is currently stored separately per object, even though vertex group data is stored on the geometry. This tends to complicate code and cause bugs, especially as geometry is created procedurally and tied less closely to an object. The "Copy Vertex Groups to Linked" operator is removed, since they are stored on the geometry anyway. This patch leaves the object-level python API for vertex groups in place. Creating a geometry-level RNA API can be a separate step; the changes in this commit are invasive enough as it is. Note that opening a file saved in 3.0 in an earlier version means the vertex groups will not be available. Differential Revision: https://developer.blender.org/D11689 --- source/blender/modifiers/intern/MOD_weightvgproximity.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index b0d2f52f78c..6e78774269a 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -468,7 +468,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* Check if we can just return the original mesh. * Must have verts and therefore verts assigned to vgroups to do anything useful! */ - if ((numVerts == 0) || BLI_listbase_is_empty(&ctx->object->defbase)) { + if ((numVerts == 0) || BLI_listbase_is_empty(&mesh->vertex_group_names)) { return mesh; } @@ -479,11 +479,10 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * } /* Get vgroup idx from its name. */ - defgrp_index = BKE_object_defgroup_name_index(ob, wmd->defgrp_name); + defgrp_index = BKE_id_defgroup_name_index(&mesh->id, wmd->defgrp_name); if (defgrp_index == -1) { return mesh; } - const bool has_mdef = CustomData_has_layer(&mesh->vdata, CD_MDEFORMVERT); /* If no vertices were ever added to an object's vgroup, dvert might be NULL. */ /* As this modifier never add vertices to vgroup, just return. */ -- cgit v1.2.3