diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-08 17:07:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-08 17:07:16 +0400 |
commit | 28ee0f92184af8ba6f44d08eda23ce5eb3815697 (patch) | |
tree | 6aada8d509c7470bd3bff6e52ba32e1fd54ef2ee /source/blender/editors/space_node/node_edit.c | |
parent | 19df3147f6920a2856bccb6e4601d57288119999 (diff) |
Texturing: texture and 3d view draw type changes, these should only have any
effect for a render engine using new shading nodes. In short:
* No longer uses images assigned to faces in the uv layer, rather the active
image texture node is what is edited/painted/drawn.
* Textured draw type now shows the active image texture node, with solid
lighting.
* Material draw mode shows GLSL shader of a simplified material node tree,
using solid lighting.
* Textures for modifiers, brushes, etc, are now available from a dropdown in
the texture tab in the properties editor. These do not use new shading nodes
yet.
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/TextureWorkflow
Diffstat (limited to 'source/blender/editors/space_node/node_edit.c')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index a1b705610f4..23855ff24e1 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -90,6 +90,8 @@ #include "RNA_enum_types.h" +#include "GPU_material.h" + #include "node_intern.h" static EnumPropertyItem socket_in_out_items[] = { @@ -598,6 +600,8 @@ static int has_nodetree(bNodeTree *ntree, bNodeTree *lookup) void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) { + int was_active_texture = (node->flag & NODE_ACTIVE_TEXTURE); + nodeSetActive(ntree, node); if(node->type!=NODE_GROUP) { @@ -621,6 +625,15 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) ED_node_generic_update(bmain, ntree, node); } + /* if active texture changed, free glsl materials */ + if((node->flag & NODE_ACTIVE_TEXTURE) && !was_active_texture) { + Material *ma; + + for(ma=bmain->mat.first; ma; ma=ma->id.next) + if(ma->nodetree && ma->use_nodes && has_nodetree(ma->nodetree, ntree)) + GPU_material_free(ma); + } + WM_main_add_notifier(NC_MATERIAL|ND_NODES, node->id); } else if(ntree->type==NTREE_COMPOSIT) { |