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.
This commit is contained in:
@@ -27,6 +27,7 @@ class NODE_HT_header(Header):
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
scene = context.scene
|
||||
snode = context.space_data
|
||||
snode_id = snode.id
|
||||
id_from = snode.id_from
|
||||
@@ -43,10 +44,14 @@ class NODE_HT_header(Header):
|
||||
layout.prop(snode, "tree_type", text="", expand=True)
|
||||
|
||||
if snode.tree_type == 'SHADER':
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_material", new="material.new")
|
||||
if snode_id:
|
||||
layout.prop(snode_id, "use_nodes")
|
||||
if scene.render.use_shading_nodes:
|
||||
layout.prop(snode, "shader_type", text="", expand=True)
|
||||
|
||||
if not scene.render.use_shading_nodes or snode.shader_type == 'OBJECT':
|
||||
if id_from:
|
||||
layout.template_ID(id_from, "active_material", new="material.new")
|
||||
if snode_id:
|
||||
layout.prop(snode_id, "use_nodes")
|
||||
|
||||
elif snode.tree_type == 'TEXTURE':
|
||||
layout.prop(snode, "texture_type", text="", expand=True)
|
||||
|
||||
@@ -2143,10 +2143,11 @@ class VIEW3D_PT_view3d_display(Panel):
|
||||
subsub.active = scene.unit_settings.system == 'NONE'
|
||||
subsub.prop(view, "grid_subdivisions", text="Subdivisions")
|
||||
|
||||
col = layout.column()
|
||||
col.label(text="Shading:")
|
||||
col.prop(gs, "material_mode", text="")
|
||||
col.prop(view, "show_textured_solid")
|
||||
if not scene.render.use_shading_nodes:
|
||||
col = layout.column()
|
||||
col.label(text="Shading:")
|
||||
col.prop(gs, "material_mode", text="")
|
||||
col.prop(view, "show_textured_solid")
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
@@ -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 *************** */
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
* \ingroup edrend
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -76,6 +75,7 @@
|
||||
|
||||
#include "ED_curve.h"
|
||||
#include "ED_mesh.h"
|
||||
#include "ED_node.h"
|
||||
#include "ED_render.h"
|
||||
#include "ED_screen.h"
|
||||
|
||||
@@ -363,16 +363,24 @@ void OBJECT_OT_material_slot_copy(wmOperatorType *ot)
|
||||
|
||||
static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
Material *ma= CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* add or copy material */
|
||||
if(ma)
|
||||
if(ma) {
|
||||
ma= copy_material(ma);
|
||||
else
|
||||
}
|
||||
else {
|
||||
ma= add_material("Material");
|
||||
|
||||
if(scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(scene, &ma->id);
|
||||
ma->use_nodes= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* hook into UI */
|
||||
uiIDContextProperty(C, &ptr, &prop);
|
||||
|
||||
@@ -455,16 +463,24 @@ void TEXTURE_OT_new(wmOperatorType *ot)
|
||||
|
||||
static int new_world_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
World *wo= CTX_data_pointer_get_type(C, "world", &RNA_World).data;
|
||||
PointerRNA ptr, idptr;
|
||||
PropertyRNA *prop;
|
||||
|
||||
/* add or copy world */
|
||||
if(wo)
|
||||
if(wo) {
|
||||
wo= copy_world(wo);
|
||||
else
|
||||
}
|
||||
else {
|
||||
wo= add_world("World");
|
||||
|
||||
if(scene_use_new_shading_nodes(scene)) {
|
||||
ED_node_shader_default(scene, &wo->id);
|
||||
wo->use_nodes= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* hook into UI */
|
||||
uiIDContextProperty(C, &ptr, &prop);
|
||||
|
||||
|
||||
@@ -46,9 +46,10 @@
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_screen.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_node.h"
|
||||
#include "BKE_scene.h"
|
||||
#include "BKE_screen.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
||||
@@ -168,10 +169,11 @@ static int node_tree_has_type(int treetype, int nodetype)
|
||||
static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
{
|
||||
Main *bmain= CTX_data_main(C);
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
SpaceNode *snode= CTX_wm_space_node(C);
|
||||
bNodeTree *ntree;
|
||||
int nodeclass= GET_INT_FROM_POINTER(arg_nodeclass);
|
||||
int event;
|
||||
int event, compatibility= 0;
|
||||
|
||||
ntree = snode->nodetree;
|
||||
|
||||
@@ -179,6 +181,13 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
uiItemS(layout);
|
||||
return;
|
||||
}
|
||||
|
||||
if(ntree->type == NTREE_SHADER) {
|
||||
if(scene_use_new_shading_nodes(scene))
|
||||
compatibility= NODE_NEW_SHADING;
|
||||
else
|
||||
compatibility= NODE_OLD_SHADING;
|
||||
}
|
||||
|
||||
if (nodeclass==NODE_CLASS_GROUP) {
|
||||
bNodeTree *ngroup;
|
||||
@@ -210,14 +219,16 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
|
||||
uiLayoutSetFunc(layout, do_node_add_static, NULL);
|
||||
|
||||
for (ntype=ntreeGetType(ntree->type)->node_types.first; ntype; ntype=ntype->next) {
|
||||
if(ntype->nclass==nodeclass && ntype->name)
|
||||
uiItemV(layout, ntype->name, 0, ntype->type);
|
||||
if (ntype->nclass==nodeclass && ntype->name)
|
||||
if (!compatibility || (ntype->compatibility & compatibility))
|
||||
uiItemV(layout, ntype->name, 0, ntype->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void node_menu_add(const bContext *C, Menu *menu)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
SpaceNode *snode= CTX_wm_space_node(C);
|
||||
uiLayout *layout= menu->layout;
|
||||
|
||||
@@ -227,11 +238,15 @@ static void node_menu_add(const bContext *C, Menu *menu)
|
||||
if(snode->treetype==NTREE_SHADER) {
|
||||
uiItemMenuF(layout, IFACE_("Input"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT));
|
||||
uiItemMenuF(layout, IFACE_("Output"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT));
|
||||
if(scene_use_new_shading_nodes(scene)) {
|
||||
uiItemMenuF(layout, IFACE_("Shader"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_SHADER));
|
||||
uiItemMenuF(layout, IFACE_("Texture"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE));
|
||||
}
|
||||
uiItemMenuF(layout, IFACE_("Color"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR));
|
||||
uiItemMenuF(layout, IFACE_("Vector"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR));
|
||||
uiItemMenuF(layout, IFACE_("Convertor"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR));
|
||||
uiItemMenuF(layout, IFACE_("Group"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP));
|
||||
uiItemMenuF(layout, IFACE_("Dynamic"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
|
||||
//uiItemMenuF(layout, IFACE_("Dynamic"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC));
|
||||
uiItemMenuF(layout, IFACE_("Layout"), 0, node_add_menu, SET_INT_IN_POINTER(NODE_CLASS_LAYOUT));
|
||||
}
|
||||
else if(snode->treetype==NTREE_COMPOSIT) {
|
||||
|
||||
@@ -372,6 +372,10 @@ static void rna_def_render_engine(BlenderRNA *brna)
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", RE_USE_POSTPROCESS);
|
||||
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
||||
|
||||
prop= RNA_def_property(srna, "bl_use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "type->flag", RE_USE_SHADING_NODES);
|
||||
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
|
||||
|
||||
RNA_define_verify_sdna(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -838,6 +838,12 @@ static int rna_RenderSettings_multiple_engines_get(PointerRNA *UNUSED(ptr))
|
||||
return (BLI_countlist(&R_engines) > 1);
|
||||
}
|
||||
|
||||
static int rna_RenderSettings_use_shading_nodes_get(PointerRNA *ptr)
|
||||
{
|
||||
Scene *scene= (Scene*)ptr->id.data;
|
||||
return scene_use_new_shading_nodes(scene);
|
||||
}
|
||||
|
||||
static int rna_RenderSettings_use_game_engine_get(PointerRNA *ptr)
|
||||
{
|
||||
RenderData *rd= (RenderData*)ptr->data;
|
||||
@@ -3227,6 +3233,11 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available");
|
||||
|
||||
prop= RNA_def_property(srna, "use_shading_nodes", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_shading_nodes_get", NULL);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_ui_text(prop, "Use Shading Nodes", "Active render engine uses new shading nodes system");
|
||||
|
||||
prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_funcs(prop, "rna_RenderSettings_use_game_engine_get", NULL);
|
||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
||||
|
||||
@@ -980,6 +980,7 @@ void register_node_type_frame(ListBase *lb)
|
||||
|
||||
node_type_base(ntype, NODE_FRAME, "Frame", NODE_CLASS_LAYOUT, NODE_BACKGROUND);
|
||||
node_type_size(ntype, 150, 100, 0);
|
||||
node_type_compatibility(ntype, NODE_OLD_SHADING|NODE_NEW_SHADING);
|
||||
|
||||
ntype->needs_free = 1;
|
||||
nodeRegisterType(lb, ntype);
|
||||
|
||||
@@ -62,6 +62,7 @@ void register_node_type_sh_camera(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_CAMERA, "Camera Data", NODE_CLASS_INPUT, 0);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, sh_node_camera_out);
|
||||
node_type_size(&ntype, 95, 95, 120);
|
||||
node_type_storage(&ntype, "node_camera", NULL, NULL);
|
||||
|
||||
@@ -74,6 +74,7 @@ void register_node_type_sh_curve_vec(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_CURVE_VEC, "Vector Curves", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_curve_vec_in, sh_node_curve_vec_out);
|
||||
node_type_size(&ntype, 200, 140, 320);
|
||||
node_type_init(&ntype, node_shader_init_curve_vec);
|
||||
@@ -128,6 +129,7 @@ void register_node_type_sh_curve_rgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_CURVE_RGB, "RGB Curves", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_curve_rgb_in, sh_node_curve_rgb_out);
|
||||
node_type_size(&ntype, 200, 140, 320);
|
||||
node_type_init(&ntype, node_shader_init_curve_rgb);
|
||||
|
||||
@@ -766,6 +766,7 @@ void register_node_type_sh_dynamic(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, NODE_OPTIONS, NULL, NULL);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_size(&ntype, 150, 60, 300);
|
||||
node_type_init(&ntype, node_dynamic_init_cb);
|
||||
node_type_storage(&ntype, "NodeScriptDict", node_dynamic_free_storage_cb, node_dynamic_copy_cb);
|
||||
@@ -781,6 +782,7 @@ void register_node_type_sh_dynamic(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, NODE_DYNAMIC, "Dynamic", NODE_CLASS_OP_DYNAMIC, 0);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
|
||||
nodeRegisterType(lb, &ntype);
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ void register_node_type_sh_geom(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_GEOMETRY, "Geometry", NODE_CLASS_INPUT, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, sh_node_geom_out);
|
||||
node_type_size(&ntype, 120, 80, 160);
|
||||
node_type_init(&ntype, node_shader_init_geometry);
|
||||
|
||||
@@ -85,6 +85,7 @@ void register_node_type_sh_hue_sat(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_HUE_SAT, "Hue Saturation Value", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_hue_sat_in, sh_node_hue_sat_out);
|
||||
node_type_size(&ntype, 150, 80, 250);
|
||||
node_type_exec(&ntype, node_shader_exec_hue_sat);
|
||||
|
||||
@@ -77,6 +77,7 @@ void register_node_type_sh_invert(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_INVERT, "Invert", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_invert_in, sh_node_invert_out);
|
||||
node_type_size(&ntype, 90, 80, 100);
|
||||
node_type_exec(&ntype, node_shader_exec_invert);
|
||||
|
||||
@@ -91,6 +91,7 @@ void register_node_type_sh_mapping(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_MAPPING, "Mapping", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_mapping_in, sh_node_mapping_out);
|
||||
node_type_size(&ntype, 240, 160, 320);
|
||||
node_type_init(&ntype, node_shader_init_mapping);
|
||||
|
||||
@@ -305,6 +305,7 @@ void register_node_type_sh_material(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_MATERIAL, "Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_material_in, sh_node_material_out);
|
||||
node_type_size(&ntype, 120, 80, 240);
|
||||
node_type_init(&ntype, node_shader_init_material);
|
||||
@@ -320,6 +321,7 @@ void register_node_type_sh_material_ext(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_MATERIAL_EXT, "Extended Material", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_material_ext_in, sh_node_material_ext_out);
|
||||
node_type_size(&ntype, 120, 80, 240);
|
||||
node_type_init(&ntype, node_shader_init_material);
|
||||
|
||||
@@ -241,6 +241,7 @@ void register_node_type_sh_math(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_MATH, "Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_math_in, sh_node_math_out);
|
||||
node_type_size(&ntype, 120, 110, 160);
|
||||
node_type_label(&ntype, node_math_label);
|
||||
|
||||
@@ -78,6 +78,7 @@ void register_node_type_sh_mix_rgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_mix_rgb_in, sh_node_mix_rgb_out);
|
||||
node_type_size(&ntype, 100, 60, 150);
|
||||
node_type_label(&ntype, node_blend_label);
|
||||
|
||||
@@ -84,6 +84,7 @@ void register_node_type_sh_normal(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_NORMAL, "Normal", NODE_CLASS_OP_VECTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_normal_in, sh_node_normal_out);
|
||||
node_type_init(&ntype, node_shader_init_normal);
|
||||
node_type_exec(&ntype, node_shader_exec_normal);
|
||||
|
||||
@@ -83,6 +83,7 @@ void register_node_type_sh_output(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_OUTPUT, "Output", NODE_CLASS_OUTPUT, NODE_PREVIEW);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_output_in, NULL);
|
||||
node_type_size(&ntype, 80, 60, 200);
|
||||
node_type_exec(&ntype, node_shader_exec_output);
|
||||
|
||||
@@ -71,6 +71,7 @@ void register_node_type_sh_rgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, sh_node_rgb_out);
|
||||
node_type_init(&ntype, node_shader_init_rgb);
|
||||
node_type_size(&ntype, 140, 80, 140);
|
||||
|
||||
@@ -61,6 +61,7 @@ void register_node_type_sh_seprgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_SEPRGB, "Separate RGB", NODE_CLASS_CONVERTOR, 0);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_seprgb_in, sh_node_seprgb_out);
|
||||
node_type_size(&ntype, 80, 40, 140);
|
||||
node_type_exec(&ntype, node_shader_exec_seprgb);
|
||||
@@ -100,6 +101,7 @@ void register_node_type_sh_combrgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_COMBRGB, "Combine RGB", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_combrgb_in, sh_node_combrgb_out);
|
||||
node_type_size(&ntype, 80, 40, 140);
|
||||
node_type_exec(&ntype, node_shader_exec_combrgb);
|
||||
|
||||
@@ -67,6 +67,7 @@ void register_node_type_sh_squeeze(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_SQUEEZE, "Squeeze Value", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_squeeze_in, sh_node_squeeze_out);
|
||||
node_type_size(&ntype, 120, 110, 160);
|
||||
node_type_storage(&ntype, "node_squeeze", NULL, NULL);
|
||||
|
||||
@@ -136,6 +136,7 @@ void register_node_type_sh_texture(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_TEXTURE, "Texture", NODE_CLASS_INPUT, NODE_OPTIONS|NODE_PREVIEW);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_texture_in, sh_node_texture_out);
|
||||
node_type_size(&ntype, 120, 80, 240);
|
||||
node_type_exec(&ntype, node_shader_exec_texture);
|
||||
|
||||
@@ -76,6 +76,7 @@ void register_node_type_sh_valtorgb(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_VALTORGB, "ColorRamp", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_valtorgb_in, sh_node_valtorgb_out);
|
||||
node_type_size(&ntype, 240, 200, 300);
|
||||
node_type_init(&ntype, node_shader_init_valtorgb);
|
||||
@@ -116,6 +117,7 @@ void register_node_type_sh_rgbtobw(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_RGBTOBW, "RGB to BW", NODE_CLASS_CONVERTOR, 0);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_rgbtobw_in, sh_node_rgbtobw_out);
|
||||
node_type_size(&ntype, 80, 40, 120);
|
||||
node_type_exec(&ntype, node_shader_exec_rgbtobw);
|
||||
|
||||
@@ -71,6 +71,7 @@ void register_node_type_sh_value(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_VALUE, "Value", NODE_CLASS_INPUT, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, NULL, sh_node_value_out);
|
||||
node_type_init(&ntype, node_shader_init_value);
|
||||
node_type_size(&ntype, 80, 50, 120);
|
||||
|
||||
@@ -135,6 +135,7 @@ void register_node_type_sh_vect_math(ListBase *lb)
|
||||
static bNodeType ntype;
|
||||
|
||||
node_type_base(&ntype, SH_NODE_VECT_MATH, "Vector Math", NODE_CLASS_CONVERTOR, NODE_OPTIONS);
|
||||
node_type_compatibility(&ntype, NODE_OLD_SHADING);
|
||||
node_type_socket_templates(&ntype, sh_node_vect_math_in, sh_node_vect_math_out);
|
||||
node_type_size(&ntype, 80, 75, 140);
|
||||
node_type_label(&ntype, node_vect_math_label);
|
||||
|
||||
@@ -51,6 +51,7 @@ struct Scene;
|
||||
#define RE_GAME 2
|
||||
#define RE_USE_PREVIEW 4
|
||||
#define RE_USE_POSTPROCESS 8
|
||||
#define RE_USE_SHADING_NODES 16
|
||||
|
||||
/* RenderEngine.flag */
|
||||
#define RE_ENGINE_ANIMATION 1
|
||||
|
||||
Reference in New Issue
Block a user