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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-07-11 11:51:04 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-08-12 05:10:14 +0400
commit87f75299e1b07fd026ecdfa1c993130a60d65280 (patch)
tree28195cd6d00694f8a66a803f62126ae28e250e49 /source/blender/nodes
parentd956a074e31b278d06c6ee4841ee735b90ba22ea (diff)
Implemented a basic framework for node-based shaders.
Shader nodes will be used to define materials for stroke rendering, so as to allow users to interactively configure textures.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/CMakeLists.txt4
-rw-r--r--source/blender/nodes/SConscript3
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c11
3 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index e09a0892370..b485d7d86d2 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -277,4 +277,8 @@ if(WITH_COMPOSITOR)
add_definitions(-DWITH_COMPOSITOR)
endif()
+if(WITH_FREESTYLE)
+ add_definitions(-DWITH_FREESTYLE)
+endif()
+
blender_add_lib(bf_nodes "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript
index 683a1c475e4..becf6e79d44 100644
--- a/source/blender/nodes/SConscript
+++ b/source/blender/nodes/SConscript
@@ -72,6 +72,9 @@ if env['WITH_BF_COMPOSITOR']:
incs += ' ../compositor '
defs.append("WITH_COMPOSITOR")
+if env['WITH_BF_FREESTYLE']:
+ defs.append('WITH_FREESTYLE')
+
env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [190,105] )
env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] )
env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] )
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 4288b8fbcdc..629bd7eeea6 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -38,6 +38,7 @@
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_world_types.h"
+#include "DNA_linestyle_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
@@ -97,6 +98,16 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
}
}
}
+#ifdef WITH_FREESTYLE
+ else if (snode->shaderfrom == SNODE_SHADER_LINESTYLE) {
+ FreestyleLineStyle *linestyle = CTX_data_linestyle_from_scene(scene);
+ if (linestyle) {
+ *r_from = NULL;
+ *r_id = &linestyle->id;
+ *r_ntree = linestyle->nodetree;
+ }
+ }
+#endif
else { /* SNODE_SHADER_WORLD */
if (scene->world) {
*r_from = NULL;