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:
authorAntonio Vazquez <blendergit@gmail.com>2022-03-29 12:25:18 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-03-29 17:27:01 +0300
commit343fc38b8d646735f42c88dd9de8a33feaf3cb7f (patch)
tree0d3461fc554eb8733d49e5796a1e4e0ac5d3887d
parent9f15ee3c7ae03c19a09f5a48e29960e18c6628c0 (diff)
Fix T96799: GPencil `weight_get` API cannot retrieve weights
The problem was when the stroke had less weights that the total number of vertex groups. The API checked the total number of groups, but this is not required because `BKE_defvert_find_index` returns NULL is the vertex group index does not exist.
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 3f380cd1830..63afff73e47 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -849,10 +849,10 @@ static float rna_GPencilStrokePoints_weight_get(bGPDstroke *stroke,
}
MDeformVert *pt_dvert = stroke->dvert + point_index;
- if ((pt_dvert) && (pt_dvert->totweight <= vertex_group_index || vertex_group_index < 0)) {
- BKE_report(reports, RPT_ERROR, "Groups: index out of range");
- return -1.0f;
- }
+ // if ((pt_dvert) && (pt_dvert->totweight <= vertex_group_index || vertex_group_index < 0)) {
+ // BKE_report(reports, RPT_ERROR, "Groups: index out of range");
+ // return -1.0f;
+ // }
MDeformWeight *dw = BKE_defvert_find_index(pt_dvert, vertex_group_index);
if (dw) {