patch [#20342] Notifier patch for modifier rename and particle system rename
authorMatt Ebb <matt@mke3.net>
Sun, 13 Dec 2009 23:51:41 +0000 (23:51 +0000)
committerMatt Ebb <matt@mke3.net>
Sun, 13 Dec 2009 23:51:41 +0000 (23:51 +0000)
by 'ThatHaze'. thanks!

14 files changed:
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_logic/space_logic.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_particle.c
source/blender/windowmanager/WM_types.h

index 0cbc2ce9078cbd041f3574b34e349db34827c07f..08ed44a54f91781e43d80a7f8341f828f2678bf7 100644 (file)
@@ -289,14 +289,15 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_KEYS:
                                        ED_region_tag_redraw(ar);
                                        break;
+                               case ND_MODIFIER:
+                                       if(wmn->action == NA_RENAME)
+                                               ED_region_tag_redraw(ar);
+                                       break;
                        }
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
                default:
                        if(wmn->data==ND_KEYS)
@@ -339,11 +340,8 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
                        }
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
                                
                default:
index f6b376f6e8ee93908384106af9cb3197b250538f..160343cf940117713ae1f8ee141d4ab2e3bd2869 100644 (file)
@@ -271,6 +271,9 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
                                case ND_BONE_ACTIVE:
                                case ND_BONE_SELECT:
                                case ND_MODIFIER:
+                                       if(wmn->action == NA_RENAME)
+                                               ED_area_tag_redraw(sa);
+                                       break;
                                case ND_CONSTRAINT:
                                        ED_area_tag_redraw(sa);
                                        break;
@@ -311,7 +314,7 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
                                ED_area_tag_redraw(sa);
                        break;
                case NC_ID:
-                       if(wmn->data == ND_ID_RENAME)
+                       if(wmn->action == NA_RENAME)
                                ED_area_tag_redraw(sa);
                        break;
        }
index d77caa4c0e3ca16470e18be6eb857ee1cf69d0a1..3023ec89258ffe5e693fc41fc3a4cd6b0532aa71 100644 (file)
@@ -398,6 +398,10 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_KEYS:
                                        ED_region_tag_redraw(ar);
                                        break;
+                               case ND_MODIFIER:
+                                       if(wmn->action == NA_RENAME)
+                                               ED_region_tag_redraw(ar);
+                                       break;
                        }
                        break;
                case NC_NODE:
@@ -408,11 +412,8 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
                        }
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
                default:
                        if(wmn->data==ND_KEYS)
index ed8c7f2e4e764ba206638300097071c5845221e2..c5b18d5b40ee55c1f81657ab6f316bd163ba5d39 100644 (file)
@@ -218,11 +218,8 @@ static void logic_listener(ARegion *ar, wmNotifier *wmn)
                case NC_OBJECT:
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
        }
 }
index 8aceb647fe2b727812079b9c6e5d309b6923de8b..a799e265b7214ca1d8e9c4220ae9c6d769ab0207 100644 (file)
@@ -423,11 +423,8 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
                        }
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
                default:
                        if(wmn->data==ND_KEYS)
@@ -459,12 +456,10 @@ static void nla_channel_area_listener(ARegion *ar, wmNotifier *wmn)
                        }
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
+
                default:
                        if(wmn->data==ND_KEYS)
                                ED_region_tag_redraw(ar);
index 64db1520ba11fbac35466a52fa04596ae524c551..dfdd4ea66575eed2f5c41100ddd82c8fa98fc633 100644 (file)
@@ -315,11 +315,8 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn)
                        ED_region_tag_redraw(ar);
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
        }
 }
index 750861ddace983810cd5adbce1d09b3330cb1d93..f3485328c52644b8c610add529b8abbf23a909a7 100644 (file)
@@ -4747,7 +4747,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
                                case ID_SCE:
                                        WM_event_add_notifier(C, NC_SCENE, NULL); break;
                                default:
-                                       WM_event_add_notifier(C, NC_ID|ND_ID_RENAME, NULL); break;
+                                       WM_event_add_notifier(C, NC_ID|NA_RENAME, NULL); break;
                        }                                       
                        /* Check the library target exists */
                        if (te->idcode == ID_LI) {
index 31de6839468ce54fb1b5bd975b55a293e7b3aa6f..469fe148b97a29442ff6e6c0f23fc7f5185624c7 100644 (file)
@@ -133,6 +133,10 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                case ND_TRANSFORM:
                                        ED_region_tag_redraw(ar);
                                        break;
+                               case ND_MODIFIER:
+                                       if(wmn->action == NA_RENAME)
+                                               ED_region_tag_redraw(ar);
+                                       break;
                        }
                case NC_GROUP:
                        /* all actions now, todo: check outliner view mode? */
@@ -148,9 +152,9 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                                break;
                case NC_ID:
-                       if(wmn->data == ND_ID_RENAME)
+                       if(wmn->action == NA_RENAME)
                                ED_region_tag_redraw(ar);
-                               break;
+                       break;
        }
        
 }
index 5be9fdee5a9ad2157b6527b9e4c9f4b7ead2035e..1e2fc1f59d313b50ce79d7038dc5731fc0616fb6 100644 (file)
@@ -242,11 +242,8 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
        }
 }
@@ -284,11 +281,8 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_ID:
-                       switch(wmn->data) {
-                               case ND_ID_RENAME:
-                                       ED_region_tag_redraw(ar);
-                                       break;
-                       }
+                       if(wmn->action == NA_RENAME)
+                               ED_region_tag_redraw(ar);
                        break;
        }
 }
index bd277f68513af74d65bf3ea90e4ef67e69251b7f..e65cb98e66501e3a9232894a058f36ea472ce9c2 100644 (file)
@@ -518,7 +518,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_ID:
-                       if(wmn->data == ND_ID_RENAME)
+                       if(wmn->action == NA_RENAME)
                                ED_region_tag_redraw(ar);
                        break;
        }
@@ -644,7 +644,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
                                ED_region_tag_redraw(ar);
                        break;
                case NC_ID:
-                       if(wmn->data == ND_ID_RENAME)
+                       if(wmn->action == NA_RENAME)
                                ED_region_tag_redraw(ar);
                        break;
        }
index ed73ddef3f5adc31da8a41fe52c81c4df6a22b9d..32b6de40a030308d644ae93abcc2ee4627a7da31 100644 (file)
@@ -356,7 +356,7 @@ static void rna_def_ID(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name.");
        RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set");
        RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2);
-       RNA_def_property_update(prop, NC_ID|ND_ID_RENAME, NULL);
+       RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL);
        RNA_def_struct_name_property(srna, prop);
 
        prop= RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED);
index aee2b048f6bd7f2e7024175f0c8d3195852d2805..2754341810ce784de5f973752a81167db9e16ef4 100644 (file)
@@ -2016,6 +2016,7 @@ void RNA_def_modifier(BlenderRNA *brna)
        prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Modifier_name_set");
        RNA_def_property_ui_text(prop, "Name", "Modifier name.");
+       RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
        RNA_def_struct_name_property(srna, prop);
        
        /* enums */
index 4ff42bbb7c2114ed7521dea32e8052d2aa918022..c5b1aafb1a3200a05e27cd1e759e2068f5bb2b09 100644 (file)
@@ -1904,6 +1904,7 @@ static void rna_def_particle_system(BlenderRNA *brna)
 
        prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
        RNA_def_property_ui_text(prop, "Name", "Particle system name.");
+       RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER|NA_RENAME, NULL);
        RNA_def_struct_name_property(srna, prop);
 
        /* access to particle settings is redirected through functions */
index 160f9cccf6cd6630136ab1115c41b27dc6f87e4d..2a742b29d1c556c3f14018627df0d014d73ca8d8 100644 (file)
@@ -218,10 +218,6 @@ typedef struct wmNotifier {
        /* NC_NODE Nodes */
 #define ND_NODE_SELECT                 (1<<16)
 
-       /* NC_ID IDs */
-#define ND_ID_RENAME                   (1<<16)
-
-
        /* NC_SPACE */
 #define ND_SPACE_CONSOLE               (1<<16) /* general redraw */
 #define ND_SPACE_CONSOLE_REPORT        (2<<16) /* update for reports, could specify type */
@@ -245,17 +241,17 @@ typedef struct wmNotifier {
 #define NOTE_SUBTYPE           0x0000FF00
 
 /* subtype scene mode */
-#define NS_MODE_OBJECT         (1<<8)
-
-#define NS_EDITMODE_MESH       (2<<8)
-#define NS_EDITMODE_CURVE      (3<<8)
-#define NS_EDITMODE_SURFACE    (4<<8)
-#define NS_EDITMODE_TEXT       (5<<8)
-#define NS_EDITMODE_MBALL      (6<<8)
-#define NS_EDITMODE_LATTICE    (7<<8)
+#define NS_MODE_OBJECT                 (1<<8)
+
+#define NS_EDITMODE_MESH               (2<<8)
+#define NS_EDITMODE_CURVE              (3<<8)
+#define NS_EDITMODE_SURFACE            (4<<8)
+#define NS_EDITMODE_TEXT               (5<<8)
+#define NS_EDITMODE_MBALL              (6<<8)
+#define NS_EDITMODE_LATTICE            (7<<8)
 #define NS_EDITMODE_ARMATURE   (8<<8)
-#define NS_MODE_POSE           (9<<8)
-#define NS_MODE_PARTICLE       (10<<8)
+#define NS_MODE_POSE                   (9<<8)
+#define NS_MODE_PARTICLE               (10<<8)
 
 
 /* action classification */
@@ -264,7 +260,7 @@ typedef struct wmNotifier {
 #define NA_EVALUATED           2
 #define NA_ADDED                       3
 #define NA_REMOVED                     4
-
+#define NA_RENAME                      5
 
 /* ************** Gesture Manager data ************** */