Bugfix, irc report:
authorTon Roosendaal <ton@blender.org>
Fri, 17 Jun 2011 13:57:41 +0000 (13:57 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 17 Jun 2011 13:57:41 +0000 (13:57 +0000)
Adding new material in active node didn't update the material
properties buttons.

source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/space_node.c

index 46c66c55d51663296c5a151506e8689b02c8291d..71dd7b02e1cdbc6d9ab4d533e6c477f75619fbdb 100644 (file)
@@ -504,14 +504,7 @@ void node_set_active(SpaceNode *snode, bNode *node)
                                        ED_node_changed_update(snode->id, node);
                        }
 
-                       // XXX
-#if 0
-                       if(node->id)
-                               ; // XXX BIF_preview_changed(-1);       /* temp hack to force texture preview to update */
-                       
-                       // allqueue(REDRAWBUTSSHADING, 1);
-                       // allqueue(REDRAWIPO, 0);
-#endif
+                       WM_main_add_notifier(NC_MATERIAL|ND_NODES, node->id);
                }
                else if(snode->treetype==NTREE_COMPOSIT) {
                        Scene *scene= (Scene*)snode->id;
index 29316c5645ac1558ab2e64c99feece58b3daaf2f..029c55d08513aa085c29b5c6f4135a18200fd43b 100644 (file)
@@ -200,6 +200,9 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn)
                                        ED_area_tag_refresh(sa);
                                else if(wmn->data==ND_SHADING_DRAW)
                                        ED_area_tag_refresh(sa);
+                               else if(wmn->action==NA_ADDED && snode->edittree)
+                                       nodeSetActiveID(snode->edittree, ID_MA, wmn->reference);
+                                       
                        }
                        break;
                case NC_TEXTURE: