Cleanup: add missing use_nodes in default materials with nodetrees

This didn't break anything, but could in the future.
This commit is contained in:
Brecht Van Lommel 2020-02-27 14:56:01 +01:00
parent 41dbb06b76
commit 74b0edce74
1 changed files with 2 additions and 0 deletions

View File

@ -1608,6 +1608,7 @@ static void material_default_surface_init(Material *ma)
{
bNodeTree *ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname);
ma->nodetree = ntree;
ma->use_nodes = true;
bNode *principled = nodeAddStaticNode(NULL, ntree, SH_NODE_BSDF_PRINCIPLED);
bNodeSocket *base_color = nodeFindSocket(principled, SOCK_IN, "Base Color");
@ -1633,6 +1634,7 @@ static void material_default_volume_init(Material *ma)
{
bNodeTree *ntree = ntreeAddTree(NULL, "Shader Nodetree", ntreeType_Shader->idname);
ma->nodetree = ntree;
ma->use_nodes = true;
bNode *principled = nodeAddStaticNode(NULL, ntree, SH_NODE_VOLUME_PRINCIPLED);
bNode *output = nodeAddStaticNode(NULL, ntree, SH_NODE_OUTPUT_MATERIAL);