[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26855] trunk/blender/source/blender/ makesrna/intern/rna_mesh.c: Mesh selection totals in RNA (patch by Campbell )
Martin Poirier
theeth at yahoo.com
Fri Feb 12 23:03:23 CET 2010
Revision: 26855
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26855
Author: theeth
Date: 2010-02-12 23:03:23 +0100 (Fri, 12 Feb 2010)
Log Message:
-----------
Mesh selection totals in RNA (patch by Campbell)
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_mesh.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_mesh.c 2010-02-12 22:02:10 UTC (rev 26854)
+++ trunk/blender/source/blender/makesrna/intern/rna_mesh.c 2010-02-12 22:03:23 UTC (rev 26855)
@@ -990,6 +990,22 @@
return rna_CustomDataData_path(ptr, "string_layers", CD_MCOL);
}
+static int rna_Mesh_tot_vert_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->edit_mesh ? me->edit_mesh->totvertsel : 0;
+}
+static int rna_Mesh_tot_edge_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->edit_mesh ? me->edit_mesh->totedgesel: 0;
+}
+static int rna_Mesh_tot_face_get(PointerRNA *ptr)
+{
+ Mesh *me= (Mesh*)ptr->id.data;
+ return me->edit_mesh ? me->edit_mesh->totfacesel : 0;
+}
+
#else
static void rna_def_mvert_group(BlenderRNA *brna)
@@ -1809,6 +1825,23 @@
RNA_def_property_ui_icon(prop, ICON_FACESEL_HLT, 0);
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+
+ /* readonly editmesh info - use for extrude menu */
+ prop= RNA_def_property(srna, "total_vert_sel", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_tot_vert_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Selected Vert Total", "Selected vertex count in editmode");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ prop= RNA_def_property(srna, "total_edge_sel", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_tot_edge_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Selected Edge Total", "Selected edge count in editmode");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
+ prop= RNA_def_property(srna, "total_face_sel", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_funcs(prop, "rna_Mesh_tot_face_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Selected Face Total", "Selected face count in editmode");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
/* pointers */
rna_def_animdata_common(srna);
rna_def_texmat_common(srna, "rna_Mesh_texspace_editable");
More information about the Bf-blender-cvs
mailing list