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:
authorCampbell Barton <campbell@blender.org>2022-02-15 12:07:54 +0300
committerCampbell Barton <campbell@blender.org>2022-02-15 12:13:00 +0300
commit07ed869b94fa8acf18d64864c6d8662bfbec33dd (patch)
tree8ff07b7983bb693c704550104fae0cc3c1a4dfde /source/blender/editors/curve
parent4637e83990babd208e932e7f7b09a86e1de2e4fd (diff)
RNA: add RNA_collection_is_empty & RNA_property_collection_is_empty
Some collections needed to be iterated over to count their length. Provide a function to check if the collection is empty to avoid this.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve_paint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index eee806898f6..0d6db8743af 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -577,7 +577,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
/* Using an empty stroke complicates logic later,
* it's simplest to disallow early on (see: T94085). */
- if (RNA_collection_length(op->ptr, "stroke") == 0) {
+ if (RNA_collection_is_empty(op->ptr, "stroke")) {
MEM_freeN(cdd);
BKE_report(op->reports, RPT_ERROR, "The \"stroke\" cannot be empty");
return false;