Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-08-05 23:29:21 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-05 23:29:21 +0300
commit59861db763ebb8d031bd768504fbd485da7ea75f (patch)
tree1a5f2b4a34898e6cba8c866d3485937396eab0c0 /source/blender/blenkernel/intern/material.c
parent29ef7142ddd8d505aafbae35e646739e70117242 (diff)
Fix T77517 EEVEE: Collection Holdout doesn't work in 2.90
The default material was missing its init code.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 34835fd1e35..b0b542f6000 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1719,6 +1719,29 @@ static void material_default_volume_init(Material *ma)
nodeSetActive(ntree, output);
}
+static void material_default_holdout_init(Material *ma)
+{
+ bNodeTree *ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname);
+ ma->nodetree = ntree;
+ ma->use_nodes = true;
+
+ bNode *holdout = nodeAddStaticNode(NULL, ntree, SH_NODE_HOLDOUT);
+ bNode *output = nodeAddStaticNode(NULL, ntree, SH_NODE_OUTPUT_MATERIAL);
+
+ nodeAddLink(ntree,
+ holdout,
+ nodeFindSocket(holdout, SOCK_OUT, "Holdout"),
+ output,
+ nodeFindSocket(output, SOCK_IN, "Surface"));
+
+ holdout->locx = 10.0f;
+ holdout->locy = 300.0f;
+ output->locx = 300.0f;
+ output->locy = 300.0f;
+
+ nodeSetActive(ntree, output);
+}
+
Material *BKE_material_default_empty(void)
{
return &default_material_empty;
@@ -1764,6 +1787,7 @@ void BKE_materials_init(void)
material_default_surface_init(&default_material_surface);
material_default_volume_init(&default_material_volume);
+ material_default_holdout_init(&default_material_holdout);
material_default_gpencil_init(&default_material_gpencil);
}