Cycles: tag shading nodes as being compatible with the old/new shading system,

so they only appear in the list when needed. Old shading nodes were previously
disabled entirely, breaking internal renderer compatibility.
This commit is contained in:
Brecht Van Lommel 2011-10-12 15:54:53 +00:00
parent c3c44f8736
commit aff03aa778
62 changed files with 136 additions and 30 deletions

@ -133,7 +133,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;
@ -236,6 +236,10 @@ typedef struct bNodeType {
#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
@ -394,6 +398,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 *************** */

@ -1752,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)
{
@ -1856,20 +1860,33 @@ static void registerShaderNodes(ListBase *ntypelist)
{
register_node_type_frame(ntypelist);
register_node_type_sh_group(ntypelist);
//register_node_type_sh_forloop(ntypelist);
//register_node_type_sh_whileloop(ntypelist);
register_node_type_sh_output(ntypelist);
register_node_type_sh_material(ntypelist);
register_node_type_sh_camera(ntypelist);
register_node_type_sh_value(ntypelist);
register_node_type_sh_rgb(ntypelist);
register_node_type_sh_mix_rgb(ntypelist);
register_node_type_sh_valtorgb(ntypelist);
register_node_type_sh_rgbtobw(ntypelist);
register_node_type_sh_texture(ntypelist);
register_node_type_sh_normal(ntypelist);
register_node_type_sh_geom(ntypelist);
register_node_type_sh_mapping(ntypelist);
register_node_type_sh_curve_vec(ntypelist);
register_node_type_sh_curve_rgb(ntypelist);
register_node_type_sh_math(ntypelist);
register_node_type_sh_vect_math(ntypelist);
register_node_type_sh_group(ntypelist);
// register_node_type_sh_forloop(ntypelist);
// register_node_type_sh_whileloop(ntypelist);
//register_node_type_sh_output(ntypelist);
register_node_type_sh_mix_rgb(ntypelist);
register_node_type_sh_rgbtobw(ntypelist);
register_node_type_sh_mapping(ntypelist);
//register_node_type_sh_texture(ntypelist);
register_node_type_sh_squeeze(ntypelist);
//register_node_type_sh_dynamic(ntypelist);
register_node_type_sh_material_ext(ntypelist);
register_node_type_sh_invert(ntypelist);
register_node_type_sh_seprgb(ntypelist);
register_node_type_sh_combrgb(ntypelist);
register_node_type_sh_hue_sat(ntypelist);
register_node_type_sh_attribute(ntypelist);
register_node_type_sh_geometry(ntypelist);
@ -1880,15 +1897,16 @@ static void registerShaderNodes(ListBase *ntypelist)
register_node_type_sh_background(ntypelist);
register_node_type_sh_bsdf_diffuse(ntypelist);
register_node_type_sh_bsdf_glass(ntypelist);
register_node_type_sh_bsdf_glossy(ntypelist);
register_node_type_sh_bsdf_glass(ntypelist);
//register_node_type_sh_bsdf_anisotropic(ntypelist);
register_node_type_sh_bsdf_translucent(ntypelist);
register_node_type_sh_bsdf_transparent(ntypelist);
register_node_type_sh_bsdf_velvet(ntypelist);
register_node_type_sh_emission(ntypelist);
register_node_type_sh_holdout(ntypelist);
register_node_type_sh_volume_transparent(ntypelist);
register_node_type_sh_volume_isotropic(ntypelist);
register_node_type_sh_holdout(ntypelist);
register_node_type_sh_mix_shader(ntypelist);
register_node_type_sh_add_shader(ntypelist);
@ -1897,19 +1915,16 @@ static void registerShaderNodes(ListBase *ntypelist)
//register_node_type_sh_output_texture(ntypelist);
register_node_type_sh_output_world(ntypelist);
register_node_type_sh_tex_blend(ntypelist);
register_node_type_sh_tex_clouds(ntypelist);
register_node_type_sh_tex_distnoise(ntypelist);
register_node_type_sh_tex_image(ntypelist);
register_node_type_sh_tex_environment(ntypelist);
register_node_type_sh_tex_sky(ntypelist);
register_node_type_sh_tex_voronoi(ntypelist);
register_node_type_sh_tex_blend(ntypelist);
register_node_type_sh_tex_magic(ntypelist);
register_node_type_sh_tex_marble(ntypelist);
register_node_type_sh_tex_musgrave(ntypelist);
register_node_type_sh_tex_noise(ntypelist);
register_node_type_sh_tex_sky(ntypelist);
register_node_type_sh_tex_stucci(ntypelist);
register_node_type_sh_tex_voronoi(ntypelist);
register_node_type_sh_tex_clouds(ntypelist);
register_node_type_sh_tex_wood(ntypelist);
register_node_type_sh_tex_musgrave(ntypelist);
}
static void registerTextureNodes(ListBase *ntypelist)

@ -171,10 +171,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;
ntree = snode->nodetree;
@ -182,6 +183,11 @@ static void node_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass)
uiItemS(layout);
return;
}
if(scene_use_new_shading_nodes(scene))
compatibility= NODE_NEW_SHADING;
else
compatibility= NODE_OLD_SHADING;
if (nodeclass==NODE_CLASS_GROUP) {
bNodeTree *ngroup;
@ -213,7 +219,7 @@ 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)
if(ntype->nclass==nodeclass && ntype->name && (ntype->compatibility&compatibility))
uiItemV(layout, ntype->name, 0, ntype->type);
}
}

@ -49,14 +49,29 @@ void register_node_type_sh_group(ListBase *lb);
void register_node_type_sh_forloop(ListBase *lb);
void register_node_type_sh_whileloop(ListBase *lb);
void register_node_type_sh_output(ListBase *lb);
void register_node_type_sh_material(ListBase *lb);
void register_node_type_sh_camera(ListBase *lb);
void register_node_type_sh_value(ListBase *lb);
void register_node_type_sh_rgb(ListBase *lb);
void register_node_type_sh_mix_rgb(ListBase *lb);
void register_node_type_sh_valtorgb(ListBase *lb);
void register_node_type_sh_rgbtobw(ListBase *lb);
void register_node_type_sh_texture(ListBase *lb);
void register_node_type_sh_normal(ListBase *lb);
void register_node_type_sh_geom(ListBase *lb);
void register_node_type_sh_mapping(ListBase *lb);
void register_node_type_sh_curve_vec(ListBase *lb);
void register_node_type_sh_curve_rgb(ListBase *lb);
void register_node_type_sh_math(ListBase *lb);
void register_node_type_sh_vect_math(ListBase *lb);
void register_node_type_sh_mix_rgb(ListBase *lb);
void register_node_type_sh_rgbtobw(ListBase *lb);
void register_node_type_sh_mapping(ListBase *lb);
void register_node_type_sh_texture(ListBase *lb);
void register_node_type_sh_squeeze(ListBase *lb);
void register_node_type_sh_dynamic(ListBase *lb);
void register_node_type_sh_material_ext(ListBase *lb);
void register_node_type_sh_invert(ListBase *lb);
void register_node_type_sh_seprgb(ListBase *lb);
void register_node_type_sh_combrgb(ListBase *lb);
void register_node_type_sh_hue_sat(ListBase *lb);
void register_node_type_sh_attribute(ListBase *lb);
void register_node_type_sh_geometry(ListBase *lb);

@ -977,6 +977,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);

@ -57,6 +57,7 @@ void register_node_type_sh_add_shader(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_ADD_SHADER, "Add Shader", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_add_shader_in, sh_node_add_shader_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -47,6 +47,7 @@ void register_node_type_sh_attribute(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_ATTRIBUTE, "Attribute", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_attribute_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -53,6 +53,7 @@ void register_node_type_sh_background(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BACKGROUND, "Background", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_background_in, sh_node_background_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -56,6 +56,7 @@ void register_node_type_sh_blend_weight(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BLEND_WEIGHT, "Blend Weight", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_blend_weight_in, sh_node_blend_weight_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -58,6 +58,7 @@ void register_node_type_sh_bsdf_anisotropic(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_ANISOTROPIC, "Glossy Anisotropic BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_anisotropic_in, sh_node_bsdf_anisotropic_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -56,6 +56,7 @@ void register_node_type_sh_bsdf_diffuse(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_DIFFUSE, "Diffuse BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_diffuse_in, sh_node_bsdf_diffuse_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -58,6 +58,7 @@ void register_node_type_sh_bsdf_glass(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_GLASS, "Glass BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_glass_in, sh_node_bsdf_glass_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -58,6 +58,7 @@ void register_node_type_sh_bsdf_glossy(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_GLOSSY, "Glossy BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_glossy_in, sh_node_bsdf_glossy_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -56,6 +56,7 @@ void register_node_type_sh_bsdf_translucent(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_TRANSLUCENT, "Translucent BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_translucent_in, sh_node_bsdf_translucent_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -56,6 +56,7 @@ void register_node_type_sh_bsdf_transparent(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_TRANSPARENT, "Transparent BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_transparent_in, sh_node_bsdf_transparent_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -57,6 +57,7 @@ void register_node_type_sh_bsdf_velvet(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_BSDF_VELVET, "Velvet BSDF", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_bsdf_velvet_in, sh_node_bsdf_velvet_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -64,6 +64,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);

@ -176,7 +176,7 @@ static int gpu_group_execute(GPUMaterial *mat, bNode *node, void *nodedata, GPUN
bNodeTreeExec *exec= (bNodeTreeExec*)nodedata;
group_gpu_copy_inputs(node, in, exec->stack);
ntreeExecGPUNodes(exec, NULL, mat, (node->flag & NODE_GROUP_EDIT));
ntreeExecGPUNodes(exec, mat, (node->flag & NODE_GROUP_EDIT));
group_gpu_move_outputs(node, out, exec->stack);
return 1;
@ -187,6 +187,7 @@ void register_node_type_sh_group(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, NODE_GROUP, "Group", NODE_CLASS_GROUP, NODE_OPTIONS|NODE_CONST_OUTPUT);
node_type_compatibility(&ntype, NODE_NEW_SHADING|NODE_OLD_SHADING);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@ -249,6 +250,7 @@ void register_node_type_sh_forloop(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, NODE_FORLOOP, "For", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);
@ -311,6 +313,7 @@ void register_node_type_sh_whileloop(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, NODE_WHILELOOP, "While", NODE_CLASS_GROUP, NODE_OPTIONS);
node_type_compatibility(&ntype, NODE_OLD_SHADING);
node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_label(&ntype, node_group_label);

@ -76,6 +76,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);
@ -130,6 +131,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);

@ -768,6 +768,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);
@ -783,6 +784,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);
}

@ -57,6 +57,7 @@ void register_node_type_sh_emission(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_EMISSION, "Emission", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_emission_in, sh_node_emission_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -56,6 +56,7 @@ void register_node_type_sh_fresnel(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_FRESNEL, "Fresnel", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_fresnel_in, sh_node_fresnel_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -141,6 +141,7 @@ void register_node_type_sh_geom(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_GEOM, "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);

@ -59,6 +59,7 @@ void register_node_type_sh_geometry(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_GEOMETRY, "Geometry", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_geometry_out);
node_type_size(&ntype, 120, 60, 200);
node_type_init(&ntype, NULL);

@ -51,6 +51,7 @@ void register_node_type_sh_holdout(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_holdout_in, sh_node_holdout_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -87,6 +87,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);

@ -79,6 +79,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);

@ -57,6 +57,7 @@ void register_node_type_sh_light_path(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_LIGHT_PATH, "Light Path", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_light_path_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -93,6 +93,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_NEW_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);

@ -307,6 +307,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);
@ -322,6 +323,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);

@ -243,6 +243,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_NEW_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);

@ -80,6 +80,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_NEW_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);

@ -58,6 +58,7 @@ void register_node_type_sh_mix_shader(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_MIX_SHADER, "Mix Shader", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_mix_shader_in, sh_node_mix_shader_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -86,6 +86,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);

@ -85,6 +85,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);

@ -46,6 +46,7 @@ void register_node_type_sh_output_lamp(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_OUTPUT_LAMP, "Lamp Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_lamp_in, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_init(&ntype, NULL);

@ -58,6 +58,7 @@ void register_node_type_sh_output_material(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_OUTPUT_MATERIAL, "Material Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_material_in, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_init(&ntype, NULL);

@ -63,6 +63,7 @@ void register_node_type_sh_output_texture(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_OUTPUT_TEXTURE, "Texture Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_texture_in, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_init(&ntype, NULL);

@ -46,6 +46,7 @@ void register_node_type_sh_output_world(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_OUTPUT_WORLD, "World Output", NODE_CLASS_OUTPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_output_world_in, NULL);
node_type_size(&ntype, 120, 60, 200);
node_type_init(&ntype, NULL);

@ -73,6 +73,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_NEW_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);

@ -63,6 +63,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);
@ -102,6 +103,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);

@ -69,6 +69,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);

@ -123,6 +123,7 @@ void register_node_type_sh_tex_blend(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_BLEND, "Blend Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_blend_in, sh_node_tex_blend_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_blend);

@ -106,6 +106,7 @@ void register_node_type_sh_tex_clouds(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_CLOUDS, "Clouds Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_clouds_in, sh_node_tex_clouds_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_clouds);

@ -63,6 +63,7 @@ void register_node_type_sh_tex_coord(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_COORD, "Texture Coordinate", NODE_CLASS_INPUT, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, NULL, sh_node_tex_coord_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -103,6 +103,7 @@ void register_node_type_sh_tex_distnoise(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_DISTNOISE, "Distorted Noise Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_distnoise_in, sh_node_tex_distnoise_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_distorted_noise);

@ -103,6 +103,7 @@ void register_node_type_sh_tex_environment(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_ENVIRONMENT, "Environment Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_environment_in, sh_node_tex_environment_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_environment);

@ -101,6 +101,7 @@ void register_node_type_sh_tex_image(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_IMAGE, "Image Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_image_in, sh_node_tex_image_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_image);

@ -157,6 +157,7 @@ void register_node_type_sh_tex_magic(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_MAGIC, "Magic Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_magic_in, sh_node_tex_magic_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_magic);

@ -111,6 +111,7 @@ void register_node_type_sh_tex_marble(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_MARBLE, "Marble Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_marble_in, sh_node_tex_marble_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_marble);

@ -276,6 +276,7 @@ void register_node_type_sh_tex_musgrave(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_MUSGRAVE, "Musgrave Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_musgrave_in, sh_node_tex_musgrave_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_musgrave);

@ -88,6 +88,7 @@ void register_node_type_sh_tex_noise(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_NOISE, "Noise Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_noise_in, sh_node_tex_noise_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -70,6 +70,7 @@ void register_node_type_sh_tex_sky(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_SKY, "Sky Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_sky_in, sh_node_tex_sky_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_sky);

@ -106,6 +106,7 @@ void register_node_type_sh_tex_stucci(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_STUCCI, "Stucci Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_stucci_in, sh_node_tex_stucci_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_stucci);

@ -152,6 +152,7 @@ void register_node_type_sh_tex_voronoi(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_VORONOI, "Voronoi Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_voronoi_in, sh_node_tex_voronoi_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_voronoi);

@ -113,6 +113,7 @@ void register_node_type_sh_tex_wood(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_TEX_WOOD, "Wood Texture", NODE_CLASS_TEXTURE, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_tex_wood_in, sh_node_tex_wood_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, node_shader_init_tex_wood);

@ -138,6 +138,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);

@ -78,6 +78,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);
@ -118,6 +119,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);

@ -73,6 +73,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_NEW_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);

@ -137,6 +137,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_NEW_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);

@ -46,7 +46,7 @@ static void node_shader_exec_volume_isotropic(void *UNUSED(data), bNode *UNUSED(
{
}
static int node_shader_gpu_volume_isotropic(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
static int node_shader_gpu_volume_isotropic(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out))
{
return 0;
}
@ -57,6 +57,7 @@ void register_node_type_sh_volume_isotropic(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_VOLUME_ISOTROPIC, "Isotropic Volume", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_volume_isotropic_in, sh_node_volume_isotropic_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);

@ -46,7 +46,7 @@ static void node_shader_exec_volume_transparent(void *UNUSED(data), bNode *UNUSE
{
}
static int node_shader_gpu_volume_transparent(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
static int node_shader_gpu_volume_transparent(GPUMaterial *UNUSED(mat), bNode *UNUSED(node), GPUNodeStack *UNUSED(in), GPUNodeStack *UNUSED(out))
{
return 0;
}
@ -57,6 +57,7 @@ void register_node_type_sh_volume_transparent(ListBase *lb)
static bNodeType ntype;
node_type_base(&ntype, SH_NODE_VOLUME_TRANSPARENT, "Transparent Volume", NODE_CLASS_SHADER, 0);
node_type_compatibility(&ntype, NODE_NEW_SHADING);
node_type_socket_templates(&ntype, sh_node_volume_transparent_in, sh_node_volume_transparent_out);
node_type_size(&ntype, 150, 60, 200);
node_type_init(&ntype, NULL);