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
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-03-29 12:25:18 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-03-29 12:26:13 +0300
commit9450057b43cb278e6b8003f54ec0705dae599165 (patch)
tree3e1e04f7b964edfc2329d827258212a4d99ebb11 /source
parent31bcab0ecb2d1de74996bf1cc4bdec3eb78540c5 (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.
Diffstat (limited to 'source')
-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 ba94fbe88e5..aa17f6bc366 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -848,10 +848,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) {