From 351d239ac7cdc028549ae84f2ff1acd594570a07 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Sun, 24 Jan 2010 04:26:01 +0000 Subject: [PATCH] View3d transform was sending a too-general notifier to redraw, causing several animation editors and the property editor to redraw too, which can really slow things down. added a more specific ND_VIEW3D_TRANSFORM notifier to solve this. --- source/blender/editors/space_action/space_action.c | 3 ++- source/blender/editors/space_buttons/space_buttons.c | 2 ++ source/blender/editors/space_graph/space_graph.c | 2 ++ source/blender/editors/space_nla/space_nla.c | 3 ++- source/blender/editors/space_outliner/space_outliner.c | 1 + source/blender/editors/space_view3d/space_view3d.c | 3 +++ source/blender/editors/transform/transform.c | 2 +- source/blender/windowmanager/WM_types.h | 1 + 8 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 05801d5efbe..2cf21186233 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -386,7 +386,8 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) saction->flag |= SACTION_TEMP_NEEDCHANSYNC; ED_area_tag_refresh(sa); break; - + case ND_VIEW3D_TRANSFORM: + break; /*do nothing*/ default: /* just redrawing the view will do */ ED_area_tag_redraw(sa); break; diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 8d35e6ed69e..0acdd2825f5 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -303,6 +303,8 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) /* currently works by redraws... if preview is set, it (re)starts job */ sbuts->preview= 1; break; + case ND_VIEW3D_TRANSFORM: + break; /*do nothing*/ default: /* Not all object RNA props have a ND_ notifier (yet) */ ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index bd37eb996ce..4e12b850729 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -462,6 +462,8 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn) sipo->flag |= SIPO_TEMP_NEEDCHANSYNC; ED_area_tag_refresh(sa); break; + case ND_VIEW3D_TRANSFORM: + break; /*do nothing*/ default: /* just redrawing the view will do */ ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index b384a30de56..f3001d4a258 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -491,7 +491,8 @@ static void nla_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_refresh(sa); break; }*/ - ED_area_tag_refresh(sa); + if (wmn->data != ND_VIEW3D_TRANSFORM) + ED_area_tag_refresh(sa); break; case NC_SPACE: if(wmn->data == ND_SPACE_NLA) diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 469fe148b97..21bc602dcac 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -131,6 +131,7 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_TRANSFORM: + case ND_VIEW3D_TRANSFORM: ED_region_tag_redraw(ar); break; case ND_MODIFIER: diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index b3bd31d53ac..23003790dc3 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -454,6 +454,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) switch(wmn->data) { case ND_FRAME: case ND_TRANSFORM: + case ND_VIEW3D_TRANSFORM: case ND_OB_ACTIVE: case ND_OB_SELECT: case ND_LAYER: @@ -470,6 +471,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_TRANSFORM: + case ND_VIEW3D_TRANSFORM: case ND_POSE: case ND_DRAW: case ND_MODIFIER: @@ -636,6 +638,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_TRANSFORM: + case ND_VIEW3D_TRANSFORM: case ND_POSE: case ND_DRAW: case ND_KEYS: diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 864c816a8f4..5ace57e36d8 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -302,7 +302,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t) if (t->spacetype == SPACE_VIEW3D) { /* Do we need more refined tags? */ - WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL); + WM_event_add_notifier(C, NC_OBJECT|ND_VIEW3D_TRANSFORM, NULL); /* for realtime animation record - send notifiers recognised by animation editors */ if ((t->animtimer) && IS_AUTOKEY_ON(t->scene)) diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 4caa4b973f1..1f5465b9730 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -188,6 +188,7 @@ typedef struct wmNotifier { #define ND_CONSTRAINT (24<<16) /* constraints edited */ #define ND_PARTICLE_DATA (25<<16) /* particles edited */ #define ND_PARTICLE_SELECT (26<<16) /* particles selecting change */ +#define ND_VIEW3D_TRANSFORM (27<<16) /* NC_MATERIAL Material */ #define ND_SHADING (30<<16)