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>2013-07-04 02:57:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-07-04 02:57:00 +0400
commita0cfa3e42095e96af771f503335b0bf05bb26d63 (patch)
tree0356b3691615dfef6de1f8fd07ffc3b6b84b0204 /source/blender/makesrna/intern/rna_meta.c
parent374383997cc2dc36819eb0ec125d6a2d06809f71 (diff)
fix [#35984] no way to know if a datablock is in editmode
the report explains the issue in detail, but basically you couldn't know if a mesh was in editmode without checking all the objects that use it. add `is_editmode` readonly property for all datatypes which support editmode. also make rna fail to build on implicit function declarations.
Diffstat (limited to 'source/blender/makesrna/intern/rna_meta.c')
-rw-r--r--source/blender/makesrna/intern/rna_meta.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c
index f38151fd721..898825820ac 100644
--- a/source/blender/makesrna/intern/rna_meta.c
+++ b/source/blender/makesrna/intern/rna_meta.c
@@ -158,6 +158,12 @@ static void rna_MetaBall_elements_clear(MetaBall *mb)
}
}
+static int rna_Meta_is_editmode_get(PointerRNA *ptr)
+{
+ MetaBall *mb = ptr->id.data;
+ return (mb->editelems != NULL);
+}
+
#else
static void rna_def_metaelement(BlenderRNA *brna)
@@ -350,6 +356,11 @@ static void rna_def_metaball(BlenderRNA *brna)
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
+ prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Meta_is_editmode_get", NULL);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Is Editmode", "True when used in editmode");
+
/* anim */
rna_def_animdata_common(srna);