2.5 Texture paint:
[blender.git] / source / blender / editors / space_node / node_edit.c
index d19dc897a8922e822d6d80a456ee0e262237db39..d66cbb55baa4ce9a457ccbc50820ab43ed407904 100644 (file)
@@ -624,17 +624,18 @@ void snode_set_context(SpaceNode *snode, Scene *scene)
                }
                else {
                        MTex *mtex= NULL;
+                       Brush *brush= NULL;
                        
                        if(ob && ob->mode & OB_MODE_SCULPT) {
-                               Brush *brush = paint_brush(&scene->toolsettings->sculpt->paint);
+                               brush= paint_brush(&scene->toolsettings->sculpt->paint);
+                       }
+                       else
+                               brush= paint_brush(&scene->toolsettings->imapaint.paint);
+
+                       if(brush) {
                                if(brush && brush->texact != -1)
                                        mtex= brush->mtex[brush->texact];
                        }
-                       else {
-                               Brush *br= scene->toolsettings->imapaint.brush;
-                               if(br) 
-                                       mtex= br->mtex[br->texact];
-                       }
                        
                        if(mtex) {
                                snode->from= (ID *)scene;