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:
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/CMakeLists.txt22
-rw-r--r--source/blender/nodes/Makefile4
-rw-r--r--source/blender/nodes/SConscript32
-rw-r--r--source/blender/nodes/TEX_node.h2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_blur.c4
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_composite.c6
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_curves.c7
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_defocus.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_filter.c4
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_image.c7
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c4
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_normalize.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c26
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_texture.c10
-rw-r--r--source/blender/nodes/intern/CMP_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/CMP_util.h24
-rw-r--r--source/blender/nodes/intern/Makefile5
-rw-r--r--source/blender/nodes/intern/SHD_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c17
-rw-r--r--source/blender/nodes/intern/SHD_nodes/SHD_invert.c2
-rw-r--r--source/blender/nodes/intern/SHD_util.h26
-rw-r--r--source/blender/nodes/intern/TEX_nodes/Makefile2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_curves.c9
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_distance.c1
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_image.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_texture.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c2
-rw-r--r--source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c2
-rw-r--r--source/blender/nodes/intern/TEX_util.c14
-rw-r--r--source/blender/nodes/intern/TEX_util.h7
30 files changed, 116 insertions, 135 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 4e9e4c2f84f..1f76cd0b424 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -26,21 +26,15 @@
FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c intern/TEX_nodes/*.c)
SET(INC
- . ../../../intern/guardedalloc ../include ../blenlib ../makesdna
- ../python ../render/extern/include ../../../intern/decimation/extern
+ . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna
+ ../render/extern/include ../../../intern/decimation/extern
../imbuf ../avi ../../../intern/elbeem/extern
../../../intern/iksolver/extern ../blenloader ../quicktime
../blenkernel ../../../extern/glew/include ../gpu
${SDL_INC}
${ZLIB_INC}
- ${PYTHON_INC}
)
-IF(WITH_VERSE)
- ADD_DEFINITIONS(-DWITH_VERSE)
- SET(INC ${INC} ${VERSE_INC})
-ENDIF(WITH_VERSE)
-
IF(WITH_OPENEXR)
ADD_DEFINITIONS(-DWITH_OPENEXR)
ENDIF(WITH_OPENEXR)
@@ -55,13 +49,15 @@ IF(WITH_FFMPEG)
ADD_DEFINITIONS(-DWITH_FFMPEG)
ENDIF(WITH_FFMPEG)
-BLENDERLIB(bf_nodes "${SRC}" "${INC}")
-
-IF(WITH_VERSE)
- ADD_DEPENDENCIES(bf_nodes mkprot verse)
-ENDIF(WITH_VERSE)
+IF(WITH_PYTHON)
+ SET(INC ${INC} ../python ${PYTHON_INC})
+ELSE(WITH_PYTHON)
+ ADD_DEFINITIONS(-DDISABLE_PYTHON)
+ENDIF(WITH_PYTHON)
IF(WITH_INTERNATIONAL)
ADD_DEFINITIONS(-DWITH_FREETYPE2)
ENDIF(WITH_INTERNATIONAL)
+BLENDERLIB(bf_nodes "${SRC}" "${INC}")
+
diff --git a/source/blender/nodes/Makefile b/source/blender/nodes/Makefile
index 39d85d26fef..400064f24b8 100644
--- a/source/blender/nodes/Makefile
+++ b/source/blender/nodes/Makefile
@@ -1,5 +1,5 @@
#
-# $Id$
+# $Id: Makefile
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# The Original Code is Copyright (C) Blender Foundation.
# All rights reserved.
#
# The Original Code is: all of this file.
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index d38303d7d20..a9f303c8dd3 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -7,7 +7,7 @@ shdsources = env.Glob('intern/SHD_nodes/*.c')
texsources = env.Glob('intern/TEX_nodes/*.c')
incs = '. ./intern '
-incs += '#/intern/guardedalloc ../include ../blenlib ../makesdna'
+incs += '#/intern/guardedalloc ../editors/include ../blenlib ../makesdna'
incs += ' ../render/extern/include '
incs += ' ../imbuf ../avi '
incs += ' ../blenloader'
@@ -17,29 +17,31 @@ incs += ' ../gpu #/extern/glew/include '
incs += ' ' + env['BF_OPENGL_INC']
incs += ' ' + env['BF_ZLIB_INC']
-defs = ''
+defs = []
if env['WITH_BF_PYTHON']:
- incs += ' ' + env['BF_PYTHON_INC']
- incs += ' ../python'
+ incs += ' ' + env['BF_PYTHON_INC']
+ incs += ' ../python'
+ if env['BF_DEBUG']:
+ defs.append('_DEBUG')
else:
- defs += 'DISABLE_PYTHON'
+ defs.append('DISABLE_PYTHON')
if env['WITH_BF_INTERNATIONAL']:
- defs += ' WITH_FREETYPE2'
+ defs.append('WITH_FREETYPE2')
if env['WITH_BF_OPENEXR']:
- defs += ' WITH_OPENEXR'
+ defs.append('WITH_OPENEXR')
if env['WITH_BF_FFMPEG']:
- defs += ' WITH_FFMPEG'
- incs += ' ' + env['BF_FFMPEG_INC']
+ defs.append('WITH_FFMPEG')
+ incs += ' ' + env['BF_FFMPEG_INC']
if env['WITH_BF_QUICKTIME']:
- defs += ' WITH_QUICKTIME'
- incs += ' ' + env['BF_QUICKTIME_INC']
+ defs.append('WITH_QUICKTIME')
+ incs += ' ' + env['BF_QUICKTIME_INC']
-env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = Split(defs), libtype=['intern', 'core', 'player'], priority = [200, 200, 400] )
-env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = Split(defs), libtype=['intern', 'core', 'player'], priority = [200, 175, 300] )
-env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = Split(defs), libtype=['intern', 'core', 'player'], priority = [200, 175, 300] )
-env.BlenderLib ( libname = 'bf_texnodes', sources = texsources, includes = Split(incs), defines = Split(defs), libtype=['intern', 'core', 'player'], priority = [200, 175, 300] )
+env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [190] )
+env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
+env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
+env.BlenderLib ( libname = 'bf_texnodes', sources = texsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] )
diff --git a/source/blender/nodes/TEX_node.h b/source/blender/nodes/TEX_node.h
index c52fc757507..d298f062143 100644
--- a/source/blender/nodes/TEX_node.h
+++ b/source/blender/nodes/TEX_node.h
@@ -1,5 +1,5 @@
/**
- * $Id: CMP_node.h 12429 2007-10-29 14:37:19Z bebraw $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
index f9be9533658..a96f3489978 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
@@ -670,6 +670,8 @@ static void node_composit_exec_blur(void *data, bNode *node, bNodeStack **in, bN
if(img!=in[0]->data)
free_compbuf(img);
}
+
+ generate_preview(node, out[0]->data);
}
static void node_composit_init_blur(bNode* node)
@@ -682,7 +684,7 @@ bNodeType cmp_node_blur= {
/* type code */ CMP_NODE_BLUR,
/* name */ "Blur",
/* width+range */ 120, 80, 200,
- /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS,
+ /* class+opts */ NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_blur_in,
/* output sock */ cmp_node_blur_out,
/* storage */ "NodeBlurData",
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c
index 89bd8e43694..ee9545c3196 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_composite.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_composite.c
@@ -46,9 +46,11 @@ static void node_composit_exec_composite(void *data, bNode *node, bNodeStack **i
/* stack order input sockets: col, alpha, z */
if(node->flag & NODE_DO_OUTPUT) { /* only one works on out */
+ Scene *scene= (Scene *)node->id;
RenderData *rd= data;
- if(rd->scemode & R_DOCOMP) {
- RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); /* G.scene is WEAK! */
+
+ if(scene && (rd->scemode & R_DOCOMP)) {
+ RenderResult *rr= RE_GetResult(RE_GetRender(scene->id.name));
if(rr) {
CompBuf *outbuf, *zbuf=NULL;
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c
index 01af0e1db1d..3d536788263 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_curves.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_curves.c
@@ -40,11 +40,12 @@ static bNodeSocketType cmp_node_time_out[]= {
static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
+ RenderData *rd= data;
/* stack order output: fac */
float fac= 0.0f;
if(node->custom1 < node->custom2)
- fac= (G.scene->r.cfra - node->custom1)/(float)(node->custom2-node->custom1);
+ fac= (rd->cfra - node->custom1)/(float)(node->custom2-node->custom1);
fac= curvemapping_evaluateF(node->storage, 0, fac);
out[0]->vec[0]= CLAMPIS(fac, 0.0f, 1.0f);
@@ -53,8 +54,8 @@ static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack *
static void node_composit_init_curves_time(bNode* node)
{
- node->custom1= G.scene->r.sfra;
- node->custom2= G.scene->r.efra;
+ node->custom1= 1;
+ node->custom2= 250;
node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
index 6f175671296..b9a4f4c0cc5 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_defocus.c
@@ -253,7 +253,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf,
// get some required params from the current scene camera
// (ton) this is wrong, needs fixed
- Object* camob = G.scene->camera;
+ Object* camob = NULL; // XXX G.scene->camera;
if (camob && camob->type==OB_CAMERA) {
Camera* cam = (Camera*)camob->data;
cam_lens = cam->lens;
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_filter.c b/source/blender/nodes/intern/CMP_nodes/CMP_filter.c
index 6011ac3b58a..2c3b78e13a3 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_filter.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_filter.c
@@ -211,6 +211,8 @@ static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in,
}
out[0]->data= stackbuf;
+
+ generate_preview(node, out[0]->data);
}
}
@@ -220,7 +222,7 @@ bNodeType cmp_node_filter= {
/* type code */ CMP_NODE_FILTER,
/* name */ "Filter",
/* width+range */ 80, 40, 120,
- /* class+opts */ NODE_CLASS_OP_FILTER, NODE_OPTIONS,
+ /* class+opts */ NODE_CLASS_OP_FILTER, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_filter_in,
/* output sock */ cmp_node_filter_out,
/* storage */ "",
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
index be5a1d7241b..396df4ff402 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
@@ -330,11 +330,12 @@ void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStack **out
static void node_composit_exec_rlayers(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
{
- Scene *sce= node->id?(Scene *)node->id:G.scene; /* G.scene is WEAK! */
+ Scene *sce= (Scene *)node->id;
RenderData *rd= data;
- RenderResult *rr;
+ RenderResult *rr= NULL;
- rr= RE_GetResult(RE_GetRender(sce->id.name));
+ if(sce)
+ rr= RE_GetResult(RE_GetRender(sce->id.name));
if(rr) {
SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c
index 6a4916b3fac..ca6de027b1d 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_mixrgb.c
@@ -73,6 +73,8 @@ static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in,
composit3_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[2]->data, in[2]->vec, in[0]->data, fac, do_mix_rgb, CB_RGBA, CB_RGBA, CB_VAL);
out[0]->data= stackbuf;
+
+ generate_preview(node, out[0]->data);
}
}
@@ -82,7 +84,7 @@ bNodeType cmp_node_mix_rgb= {
/* type code */ CMP_NODE_MIX_RGB,
/* name */ "Mix",
/* width+range */ 110, 60, 120,
- /* class+opts */ NODE_CLASS_OP_COLOR, NODE_OPTIONS,
+ /* class+opts */ NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS,
/* input sock */ cmp_node_mix_rgb_in,
/* output sock */ cmp_node_mix_rgb_out,
/* storage */ "",
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c
index a62e4be4015..846aec490c2 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_normalize.c
@@ -1,5 +1,5 @@
/**
- * $Id: CMP_normalize.c,v 1.0 2007/03/24 06:57:29 scourage Exp $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
index 722b00d57a9..8c63c348b57 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
@@ -62,9 +62,9 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack *
}
}
- BKE_makepicstring(string, nif->name, rd->cfra, nif->imtype);
+ BKE_makepicstring((Scene *)node->id, string, nif->name, rd->cfra, nif->imtype);
- if(0 == BKE_write_ibuf(ibuf, string, nif->imtype, nif->subimtype, nif->imtype==R_OPENEXR?nif->codec:nif->quality))
+ if(0 == BKE_write_ibuf((Scene *)node->id, ibuf, string, nif->imtype, nif->subimtype, nif->imtype==R_OPENEXR?nif->codec:nif->quality))
printf("Cannot save Node File Output to %s\n", string);
else
printf("Saved: %s\n", string);
@@ -81,15 +81,19 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack *
static void node_composit_init_output_file(bNode *node)
{
- NodeImageFile *nif= MEM_callocN(sizeof(NodeImageFile), "node image file");
- node->storage= nif;
- BLI_strncpy(nif->name, G.scene->r.pic, sizeof(nif->name));
- nif->imtype= G.scene->r.imtype;
- nif->subimtype= G.scene->r.subimtype;
- nif->quality= G.scene->r.quality;
- nif->sfra= G.scene->r.sfra;
- nif->efra= G.scene->r.efra;
-};
+ Scene *scene= (Scene *)node->id;
+ NodeImageFile *nif= MEM_callocN(sizeof(NodeImageFile), "node image file");
+ node->storage= nif;
+
+ if(scene) {
+ BLI_strncpy(nif->name, scene->r.pic, sizeof(nif->name));
+ nif->imtype= scene->r.imtype;
+ nif->subimtype= scene->r.subimtype;
+ nif->quality= scene->r.quality;
+ nif->sfra= scene->r.sfra;
+ nif->efra= scene->r.efra;
+ }
+}
bNodeType cmp_node_output_file= {
/* *next,*prev */ NULL, NULL,
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
index c1f1948dba1..b4d04076032 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_texture.c
@@ -91,19 +91,13 @@ static void node_composit_exec_texture(void *data, bNode *node, bNodeStack **in,
if(node->id) {
RenderData *rd= data;
- RenderResult *rr= RE_GetResult(RE_GetRender(G.scene->id.name)); /* G.scene is WEAK! */
short sizex, sizey;
/* first make the preview image */
CompBuf *prevbuf= alloc_compbuf(140, 140, CB_RGBA, 1); /* alloc */
- if (rr) {
- sizex = rr->rectx;
- sizey = rr->recty;
- } else {
- sizex = rd->xsch;
- sizey = rd->ysch;
- }
+ sizex = rd->xsch;
+ sizey = rd->ysch;
prevbuf->rect_procedural= texture_procedural;
prevbuf->node= node;
diff --git a/source/blender/nodes/intern/CMP_nodes/Makefile b/source/blender/nodes/intern/CMP_nodes/Makefile
index 8a8d323ac5b..b70b591a588 100644
--- a/source/blender/nodes/intern/CMP_nodes/Makefile
+++ b/source/blender/nodes/intern/CMP_nodes/Makefile
@@ -39,7 +39,7 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../include
+CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I$(NAN_GLEW)/include
diff --git a/source/blender/nodes/intern/CMP_util.h b/source/blender/nodes/intern/CMP_util.h
index e111632a195..19e41f5c118 100644
--- a/source/blender/nodes/intern/CMP_util.h
+++ b/source/blender/nodes/intern/CMP_util.h
@@ -37,19 +37,14 @@
#include "MEM_guardedalloc.h"
#include "DNA_camera_types.h" /* qdn: defocus node, need camera info */
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_ID.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -65,17 +60,6 @@
#include "../CMP_node.h"
#include "node_util.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -84,18 +68,10 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
/* *************************** operations support *************************** */
/* general signal that's in output sockets, and goes over the wires */
diff --git a/source/blender/nodes/intern/Makefile b/source/blender/nodes/intern/Makefile
index 6167cf6bc72..04a00c1ac9a 100644
--- a/source/blender/nodes/intern/Makefile
+++ b/source/blender/nodes/intern/Makefile
@@ -39,9 +39,12 @@ CPPFLAGS += -I../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../makesdna
CPPFLAGS += -I../../blenlib
-CPPFLAGS += -I../../include
+CPPFLAGS += -I../../editors/include
CPPFLAGS += -I../../imbuf
CPPFLAGS += -I../../render/extern/include
CPPFLAGS += -I../../gpu
CPPFLAGS += -I$(NAN_GLEW)/include
CPPFLAGS += -I$(OPENGL_HEADERS)
+
+DIRS = SHD_nodes CMP_nodes TEX_nodes
+include nan_subdirs.mk
diff --git a/source/blender/nodes/intern/SHD_nodes/Makefile b/source/blender/nodes/intern/SHD_nodes/Makefile
index ae3cae029d2..1369d346fc6 100644
--- a/source/blender/nodes/intern/SHD_nodes/Makefile
+++ b/source/blender/nodes/intern/SHD_nodes/Makefile
@@ -41,7 +41,7 @@ CPPFLAGS += -I../../../blenkernel
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
CPPFLAGS += -I../../../makesdna
CPPFLAGS += -I../../../blenlib
-CPPFLAGS += -I../../../include
+CPPFLAGS += -I../../../editors/include
CPPFLAGS += -I../../../imbuf
CPPFLAGS += -I../../../render/extern/include
CPPFLAGS += -I../../../gpu
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
index 2065ac2ed33..fedca8f9086 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_dynamic.c
@@ -37,14 +37,19 @@
#include "BKE_text.h"
#include "BKE_utildefines.h"
+// XXX
+#if 0
#ifndef DISABLE_PYTHON
#include "api2_2x/Node.h"
#include "api2_2x/gen_utils.h"
#include "BPY_extern.h"
#endif
+#endif
#include "../SHD_util.h"
+// XXX
+#if 0
static void node_dynamic_setup(bNode *node);
static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out);
static void node_dynamic_free_storage_cb(bNode *node);
@@ -340,7 +345,11 @@ static void node_dynamic_pyerror_print(bNode *node)
PyGILState_STATE gilstate = PyGILState_Ensure();
fprintf(stderr, "\nError in dynamic node script \"%s\":\n", node->name);
- if (PyErr_Occurred()) { PyErr_Print(); }
+ if (PyErr_Occurred()) {
+ PyErr_Print();
+ PyErr_Clear();
+ PySys_SetObject("last_traceback", NULL);
+ }
else { fprintf(stderr, "Not a valid dynamic node Python script.\n"); }
PyGILState_Release(gilstate);
@@ -761,4 +770,10 @@ bNodeType node_dynamic_typeinfo = {
/* id */ NULL
};
+#else
+
+bNodeType node_dynamic_typeinfo = {NULL};
+
+#endif
+
diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
index 72ee1483ecf..fbab7f64cb3 100644
--- a/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
+++ b/source/blender/nodes/intern/SHD_nodes/SHD_invert.c
@@ -1,5 +1,5 @@
/**
- * $Id: SHD_math.c,v 1.4 2007/04/04 13:58:12 jesterking Exp $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/nodes/intern/SHD_util.h b/source/blender/nodes/intern/SHD_util.h
index eda985529c1..a6fe5f4e9cc 100644
--- a/source/blender/nodes/intern/SHD_util.h
+++ b/source/blender/nodes/intern/SHD_util.h
@@ -31,23 +31,19 @@
#define SHD_NODE_UTIL_H_
#include <math.h>
+#include <float.h>
#include <string.h>
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
-#include "DNA_ipo_types.h"
#include "DNA_ID.h"
#include "DNA_image_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -62,17 +58,6 @@
#include "../SHD_node.h"
#include "node_util.h"
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-#include "BIF_interface.h"
-#include "BIF_interface_icons.h"
-#include "BIF_language.h"
-#include "BIF_mywindow.h"
-#include "BIF_previewrender.h"
-#include "BIF_resources.h"
-#include "BIF_screen.h"
-#include "BIF_space.h"
-
#include "BLI_arithb.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -81,20 +66,11 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BSE_drawipo.h"
-#include "BSE_node.h"
-#include "BSE_view.h"
-
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "GPU_material.h"
-#include "butspace.h"
-#include "blendef.h"
-#include "mydevice.h"
-
-
/* ********* exec data struct, remains internal *********** */
typedef struct ShaderCallData {
diff --git a/source/blender/nodes/intern/TEX_nodes/Makefile b/source/blender/nodes/intern/TEX_nodes/Makefile
index 7fad19a772c..ac741280478 100644
--- a/source/blender/nodes/intern/TEX_nodes/Makefile
+++ b/source/blender/nodes/intern/TEX_nodes/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile 12796 2007-12-05 16:58:52Z sirdude $
+# $Id$
#
# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
#
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
index 8c86656b4f3..7d1366b5b18 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c
@@ -41,8 +41,9 @@ static void time_colorfn(float *out, float *coord, bNode *node, bNodeStack **in,
/* stack order output: fac */
float fac= 0.0f;
- if(node->custom1 < node->custom2)
- fac = (G.scene->r.cfra - node->custom1)/(float)(node->custom2-node->custom1);
+ // XXX SOLVE! these functions should get the TexCallData pointer
+// if(node->custom1 < node->custom2)
+// fac = (scene->r.cfra - node->custom1)/(float)(node->custom2-node->custom1);
fac = curvemapping_evaluateF(node->storage, 0, fac);
out[0] = CLAMPIS(fac, 0.0f, 1.0f);
@@ -56,8 +57,8 @@ static void time_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out
static void time_init(bNode* node)
{
- node->custom1= G.scene->r.sfra;
- node->custom2= G.scene->r.efra;
+ node->custom1= 1;
+ node->custom2= 250;
node->storage= curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
}
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
index ff9ec4db76b..d23eb6bc589 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c
@@ -44,7 +44,6 @@ static bNodeSocketType outputs[]= {
static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread)
{
float coord1[3], coord2[3];
- float x, y, z;
tex_input_vec(coord1, in[0], coord, thread);
tex_input_vec(coord2, in[1], coord, thread);
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
index f9477fef12b..b84088da154 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c
@@ -1,5 +1,5 @@
/**
- * $Id: TEX_image.c 10456 2007-04-04 13:58:12Z jesterking $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
index 884d2cd0eb6..30492b84764 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c
@@ -47,7 +47,7 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor
Tex *nodetex = (Tex *)node->id;
- if(node->custom2) {
+ if(node->custom2 || node->need_exec==0) {
/* this node refers to its own texture tree! */
QUATCOPY(
out,
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
index f63f5682030..0d24652a8f6 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c
@@ -45,7 +45,7 @@ static void normalfn(float *out, float *coord, bNode *node, bNodeStack **in, sho
float nabla = tex_input_value(in[1], coord, thread);
float val;
- float nor[2];
+ float nor[3];
val = tex_input_value(in[0], coord, thread);
diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
index ec59769fdfd..71d9cb07e18 100644
--- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
+++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c
@@ -1,5 +1,5 @@
/**
- * $Id: SHD_valToRgb.c 10456 2007-04-04 13:58:12Z jesterking $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c
index 562072328a8..867e754f960 100644
--- a/source/blender/nodes/intern/TEX_util.c
+++ b/source/blender/nodes/intern/TEX_util.c
@@ -34,6 +34,12 @@
obtain a colour value from this, a node further up the chain reads
the TexDelegate* from its input stack, and uses tex_call_delegate to
retrieve the colour from the delegate.
+
+ comments: (ton)
+
+ This system needs recode, a node system should rely on the stack, and
+ callbacks for nodes only should evaluate own node, not recursively go
+ over other previous ones.
*/
#include <assert.h>
@@ -43,7 +49,8 @@
void tex_call_delegate(TexDelegate *dg, float *out, float *coord, short thread)
{
- dg->fn(out, coord, dg->node, dg->in, thread);
+ if(dg->node->need_exec)
+ dg->fn(out, coord, dg->node, dg->in, thread);
}
void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread)
@@ -185,7 +192,7 @@ void ntreeTexCheckCyclics(struct bNodeTree *ntree)
}
}
-void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, Tex *tex, short which_output)
+void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, Tex *tex, short which_output, int cfra)
{
TexResult dummy_texres;
TexCallData data;
@@ -196,6 +203,7 @@ void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do
data.do_preview = do_preview;
data.thread = thread;
data.which_output = which_output;
+ data.cfra= cfra;
ntreeExecTree(nodes, &data, thread);
}
@@ -213,7 +221,7 @@ void ntreeTexUpdatePreviews(bNodeTree* nodetree)
dummy_texres.nor = 0;
ntreeBeginExecTree(nodetree);
- ntreeTexExecTree(nodetree, &dummy_texres, coord, 1, 0, tex, 0);
+ ntreeTexExecTree(nodetree, &dummy_texres, coord, 1, 0, tex, 0, 0);
ntreeEndExecTree(nodetree);
}
diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h
index 69cf20794c9..e560aa57921 100644
--- a/source/blender/nodes/intern/TEX_util.h
+++ b/source/blender/nodes/intern/TEX_util.h
@@ -34,7 +34,6 @@
#include "MEM_guardedalloc.h"
-#include "DNA_action_types.h"
#include "DNA_color_types.h"
#include "DNA_ipo_types.h"
#include "DNA_ID.h"
@@ -43,10 +42,7 @@
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
-#include "DNA_space_types.h"
-#include "DNA_screen_types.h"
#include "DNA_texture_types.h"
-#include "DNA_userdef_types.h"
#include "BKE_blender.h"
#include "BKE_colortools.h"
@@ -78,6 +74,7 @@ typedef struct TexCallData {
char do_preview;
short thread;
short which_output;
+ int cfra;
} TexCallData;
typedef void(*TexFn) (float *out, float *coord, bNode *node, bNodeStack **in, short thread);
@@ -99,6 +96,6 @@ void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn);
void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata);
void ntreeTexUpdatePreviews( bNodeTree* nodetree );
-void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, struct Tex *tex, short which_output);
+void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra);
#endif