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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-24 19:53:26 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-02-24 19:53:26 +0400
commitcf092e5a2f8f785189e7c35cafd15bd6ab2f40ec (patch)
tree3190236c62bad3c2957bbcf92c0f718626cfe99d /source/blender/makesrna/intern/rna_mesh.c
parentf4bb31f26ba9a17c0f7dce1812f0227d3daea84c (diff)
Python: add MeshLoop.index, same as already existed for vert/edge/face/poly.
Diffstat (limited to 'source/blender/makesrna/intern/rna_mesh.c')
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 7cb1fc4a9ff..217d65c3fa8 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -942,6 +942,13 @@ static int rna_MeshPolygon_index_get(PointerRNA *ptr)
return (int)(mpoly - me->mpoly);
}
+static int rna_MeshLoop_index_get(PointerRNA *ptr)
+{
+ Mesh *me = rna_mesh(ptr);
+ MLoop *mloop= (MLoop*)ptr->data;
+ return (int)(mloop - me->mloop);
+}
+
/* path construction */
static char *rna_VertexGroupElement_path(PointerRNA *ptr)
@@ -1426,6 +1433,11 @@ static void rna_def_mloop(BlenderRNA *brna)
prop= RNA_def_property(srna, "edge_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "e");
RNA_def_property_ui_text(prop, "Edge", "Edge index");
+
+ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_int_funcs(prop, "rna_MeshLoop_index_get", NULL, NULL);
+ RNA_def_property_ui_text(prop, "Index", "Index number of the loop");
}
static void rna_def_mpolygon(BlenderRNA *brna)