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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user