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_armature.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_armature.c')
-rw-r--r--source/blender/makesrna/intern/rna_armature.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index b222dd9148b..fd151ccebb9 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -472,6 +472,12 @@ static void rna_Armature_bones_next(CollectionPropertyIterator *iter)
iter->valid = (internal->link != NULL);
}
+static int rna_Armature_is_editmode_get(PointerRNA *ptr)
+{
+ bArmature *arm = (bArmature *)ptr->id.data;
+ return (arm->edbo != NULL);
+}
+
#else
static int rna_matrix_dimsize_4x4[] = {4, 4};
@@ -1071,6 +1077,12 @@ static void rna_def_armature(BlenderRNA *brna)
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
/* XXX deprecated ....... old animviz for armatures only */
+
+
+ prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_funcs(prop, "rna_Armature_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");
}
void RNA_def_armature(BlenderRNA *brna)