diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-02 23:24:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-02 23:24:30 +0400 |
commit | ac52c79cb19ac85e06651a7b9af2e54efcd45a97 (patch) | |
tree | c0366c96ed66c6899af093cc0194ab572b9df750 /source/blender/blenkernel | |
parent | 30f1f28a8af3b393608b5869512a8823111294ad (diff) |
RenderEngine/Nodes: system to check for shading nodes compatibility
* Scene.use_shading_nodes property to check if RenderEngine is using new shading
nodes system, and RenderEngine.bl_use_shading_nodes to set this.
* Add mechanism for tagging nodes as being compatible with the old/new system.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 9 |
4 files changed, 24 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index a819a464d3f..7509205e968 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -130,7 +130,7 @@ typedef struct bNodeType { char name[32]; float width, minwidth, maxwidth; float height, minheight, maxheight; - short nclass, flag; + short nclass, flag, compatibility; /* templates for static sockets */ bNodeSocketTemplate *inputs, *outputs; @@ -230,8 +230,13 @@ typedef struct bNodeType { #define NODE_CLASS_PARTICLES 25 #define NODE_CLASS_TRANSFORM 30 #define NODE_CLASS_COMBINE 31 +#define NODE_CLASS_SHADER 40 #define NODE_CLASS_LAYOUT 100 +/* nodetype->compatibility */ +#define NODE_OLD_SHADING 1 +#define NODE_NEW_SHADING 2 + /* enum values for input/output */ #define SOCK_IN 1 #define SOCK_OUT 2 @@ -388,6 +393,7 @@ void node_type_exec_new(struct bNodeType *ntype, void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **)); void node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out)); void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out)); +void node_type_compatibility(struct bNodeType *ntype, short compatibility); /* ************** COMMON NODES *************** */ diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 5c214b2892a..45ee6fd4ebd 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -98,6 +98,8 @@ int get_render_child_particle_number(struct RenderData *r, int num); int get_render_shadow_samples(struct RenderData *r, int samples); float get_render_aosss_error(struct RenderData *r, float error); +int scene_use_new_shading_nodes(struct Scene *scene); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 824e59a82c5..f35f034387b 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -43,10 +43,11 @@ #include <string.h> #include <limits.h> +#include "DNA_action_types.h" #include "DNA_anim_types.h" #include "DNA_node_types.h" +#include "DNA_node_types.h" #include "DNA_scene_types.h" -#include "DNA_action_types.h" #include "BLI_string.h" #include "BLI_math.h" @@ -1751,6 +1752,10 @@ void node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMate ntype->gpuextfunc = gpuextfunc; } +void node_type_compatibility(struct bNodeType *ntype, short compatibility) +{ + ntype->compatibility = compatibility; +} static bNodeType *is_nodetype_registered(ListBase *typelist, int type) { diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 6b3786663df..c902bee80a8 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -72,6 +72,8 @@ #include "BKE_sound.h" +#include "RE_engine.h" + //XXX #include "BIF_previewrender.h" //XXX #include "BIF_editseq.h" @@ -1127,3 +1129,10 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base) return NULL; } + +int scene_use_new_shading_nodes(Scene *scene) +{ + RenderEngineType *type= RE_engines_find(scene->r.engine); + return (type->flag & RE_USE_SHADING_NODES); +} + |