Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2008-11-12 22:03:50 +0300
committerTon Roosendaal <ton@blender.org>2008-11-12 22:03:50 +0300
commit8030cb03fd41673b7d687128782a0e21417baaea (patch)
treeb2e25d9a91ecf3713c45a4263f88a934e973e593 /source/blender/blenkernel/intern/texture.c
parent3fd3a13efc81ce3eafadd5ab31a154bbc25d6e58 (diff)
Patch #7897 Texture Nodes!
Robin (Frrr) Allen did a decent job on this, so we can also welcome him as a member in the svn committers team to maintain it! I do the first commit with some minor fixes: - get Makefiles work - fix rounding issue with tiles on unit faces - removed UI includes from tex node A nice doc in wiki is here: http://wiki.blender.org/index.php/User:Frr/TexnodeManual On the todo for Robin is: - When using one or more Texture-input nodes, you cannot edit them by activating (as works now for Material nodes). - The new "output node" option fails on the default case, when only one output node is active. It then shows often a blank menu. Will get fixed asap. - When using a NodeTree-Texture as input node, the menu for 'active output' should not show. NodeTree should ignore other nodetrees to keep things sane for now. - On a future todo is proper usage of "Dxt" and "Dyt" texture vectors for superior antialising of checkers/bricks. General note; I know people are dying to get a full integrated shader system with nodes. In theory we could merge this with Material Nodetrees... but I rather wait for a solid and very well thought out design proposal for this, also including design ideas for unifying with a shader language (GPU, CPU). For the time being this is a nice extension of current textures. :)
Diffstat (limited to 'source/blender/blenkernel/intern/texture.c')
-rw-r--r--source/blender/blenkernel/intern/texture.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index ab9e6f9af41..52b88de06e0 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -421,6 +421,11 @@ void free_texture(Tex *tex)
BKE_previewimg_free(&tex->preview);
BKE_icon_delete((struct ID*)tex);
tex->id.icon_id = 0;
+
+ if(tex->nodetree) {
+ ntreeFreeTree(tex->nodetree);
+ MEM_freeN(tex->nodetree);
+ }
}
/* ------------------------------------------------------------------------- */
@@ -578,6 +583,11 @@ Tex *copy_texture(Tex *tex)
if(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview);
+ if(tex->nodetree) {
+ ntreeEndExecTree(tex->nodetree);
+ texn->nodetree= ntreeCopyTree(tex->nodetree, 0); /* 0 == full new tree */
+ }
+
return texn;
}
@@ -728,6 +738,10 @@ void autotexname(Tex *tex)
char di[FILE_MAXDIR], fi[FILE_MAXFILE];
if(tex) {
+ if(tex->use_nodes) {
+ new_id(&G.main->tex, (ID *)tex, "Noddy");
+ }
+ else
if(tex->type==TEX_IMAGE) {
ima= tex->ima;
if(ima) {