Merge branch 'master' into blender2.8
[blender.git] / source / blender / blenkernel / intern / node.c
index 6e5eeda64407733c1865d316de46377974250a67..bb918ab71eb49346013d4ed5577c30d5bd602f8a 100644 (file)
@@ -3588,6 +3588,8 @@ static void registerShaderNodes(void)
 
        register_node_type_sh_output_lamp();
        register_node_type_sh_output_material();
+       register_node_type_sh_output_metallic();
+       register_node_type_sh_output_specular();
        register_node_type_sh_output_world();
        register_node_type_sh_output_linestyle();
 
@@ -3777,3 +3779,20 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
 
        return true;
 }
+
+/* -------------------------------------------------------------------- */
+/* NodeTree kernel functions */
+
+void BKE_nodetree_remove_layer_n(bNodeTree *ntree, Scene *scene, const int layer_index)
+{
+       for (bNode *node = ntree->nodes.first; node; node = node->next) {
+               if (node->type == CMP_NODE_R_LAYERS && (Scene *)node->id == scene) {
+                       if (node->custom1 == layer_index) {
+                               node->custom1 = 0;
+                       }
+                       else if (node->custom1 > layer_index) {
+                               node->custom1--;
+                       }
+               }
+       }
+}