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 <ideasman42@gmail.com>2018-12-17 10:15:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-17 23:36:29 +0300
commit54f9e142dfd38948b670acba9bf2e8571ab88d4a (patch)
tree16a516e6afb2db831adc2b2849ba81a7e9e5f6c3 /source/blender/makesrna/intern/rna_mesh_api.c
parent1eafa91f647143b565914b71480bb90cd941e0ed (diff)
RNA: Add Mesh.count_selected_items()
Needed for context menu checks.
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index a08555794d8..5f198d2e22e 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -222,6 +222,11 @@ static void rna_Mesh_update_gpu_tag(Mesh *mesh)
BKE_mesh_batch_cache_dirty_tag(mesh, BKE_MESH_BATCH_DIRTY_ALL);
}
+static void rna_Mesh_count_selected_items(Mesh *mesh, int r_count[3])
+{
+ BKE_mesh_count_selected_items(mesh, r_count);
+}
+
#else
@@ -332,6 +337,11 @@ void RNA_api_mesh(StructRNA *srna)
"invalid indices corrected (to default 0)");
parm = RNA_def_boolean(func, "result", 0, "Result", "");
RNA_def_function_return(func, parm);
+
+ func = RNA_def_function(srna, "count_selected_items", "rna_Mesh_count_selected_items ");
+ RNA_def_function_ui_description(func, "Return the number of selected items (vert, edge, face)");
+ parm = RNA_def_int_vector(func, "result", 3, NULL, 0, INT_MAX, "Result", NULL, 0, INT_MAX);
+ RNA_def_function_output(func, parm);
}
#endif