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:
authorMatt Ebb <matt@mke3.net>2011-01-06 05:20:30 +0300
committerMatt Ebb <matt@mke3.net>2011-01-06 05:20:30 +0300
commitaf5ed099e9f70cdf50f7fe138da6604963bc706d (patch)
treebc65e4fd04c4db273584d8cf233adb0b3ba94aa2
parent6247a110769976b887fc7270a706d6ddd23ef5d6 (diff)
Improve reliability when setting property editor context via rna
-rw-r--r--source/blender/makesrna/intern/rna_space.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 1752096d0aa..4a98d71a76a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -575,6 +575,14 @@ static void rna_SpaceProperties_pin_id_update(Main *bmain, Scene *scene, Pointer
}
+static void rna_SpaceProperties_context_set(PointerRNA *ptr, int value)
+{
+ SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+
+ sbuts->mainb= value;
+ sbuts->mainbuser = value;
+}
+
static void rna_SpaceProperties_align_set(PointerRNA *ptr, int value)
{
SpaceButs *sbuts= (SpaceButs*)(ptr->data);
@@ -1333,6 +1341,7 @@ static void rna_def_space_buttons(BlenderRNA *brna)
prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mainb");
RNA_def_property_enum_items(prop, buttons_context_items);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_context_set", NULL);
RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL);