UI: Improve default position of shader nodes in startup file
This is a follow up to #136926. Default values are changed for the existing materials of the default cube and the default World.
This commit is contained in:
@@ -672,12 +672,19 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
|
||||
|
||||
node->custom1 = SHD_GLOSSY_MULTI_GGX;
|
||||
node->custom2 = SHD_SUBSURFACE_RANDOM_WALK;
|
||||
|
||||
node->location[0] = -200.0f;
|
||||
node->location[1] = 100.0f;
|
||||
BKE_ntree_update_tag_node_property(ma->nodetree, node);
|
||||
}
|
||||
else if (node->type_legacy == SH_NODE_SUBSURFACE_SCATTERING) {
|
||||
node->custom1 = SHD_SUBSURFACE_RANDOM_WALK;
|
||||
BKE_ntree_update_tag_node_property(ma->nodetree, node);
|
||||
}
|
||||
else if (node->type_legacy == SH_NODE_OUTPUT_MATERIAL) {
|
||||
node->location[0] = 200.0f;
|
||||
node->location[1] = 100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -716,6 +723,18 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
|
||||
{
|
||||
LISTBASE_FOREACH (World *, world, &bmain->worlds) {
|
||||
SET_FLAG_FROM_TEST(world->flag, true, WO_USE_SUN_SHADOW);
|
||||
if (world->nodetree) {
|
||||
for (bNode *node : world->nodetree->all_nodes()) {
|
||||
if (node->type_legacy == SH_NODE_OUTPUT_WORLD) {
|
||||
node->location[0] = 200.0f;
|
||||
node->location[1] = 100.0f;
|
||||
}
|
||||
else if (node->type_legacy == SH_NODE_BACKGROUND) {
|
||||
node->location[0] = -200.0f;
|
||||
node->location[1] = 100.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user