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>2009-11-17 19:53:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-17 19:53:52 +0300
commitd438ec30809862d70700b91eeeae6f117fc25583 (patch)
tree90c940ac6b06afe97bf9214031df7f233ccfa612 /source/blender/makesrna/intern/rna_access.c
parent4076572874357e887d2d07325a1a5d2a6687a510 (diff)
adjusting generic props in the UI refreshes the depgraph, this is weak but allows custom props to be used as drivers
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 01b7b9cd353..8da5f7c2480 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -45,6 +45,11 @@
#include "RNA_define.h"
#include "RNA_types.h"
+/* flush updates */
+#include "DNA_object_types.h"
+#include "BKE_depsgraph.h"
+#include "WM_types.h"
+
#include "rna_internal.h"
/* Init/Exit */
@@ -886,12 +891,21 @@ int RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
{
+ int is_rna = (prop->magic == RNA_MAGIC);
prop= rna_ensure_property(prop);
- if(prop->update)
- prop->update(C, ptr);
- if(prop->noteflag)
- WM_event_add_notifier(C, prop->noteflag, ptr->id.data);
+ if(is_rna) {
+ if(prop->update)
+ prop->update(C, ptr);
+ if(prop->noteflag)
+ WM_event_add_notifier(C, prop->noteflag, ptr->id.data);
+ }
+ else {
+ /* WARNING! This is so property drivers update the display!
+ * not especially nice */
+ DAG_id_flush_update(ptr->id.data, OB_RECALC_OB);
+ WM_event_add_notifier(C, NC_WINDOW, NULL);
+ }
}
/* Property Data */