diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-24 19:03:25 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-24 21:26:21 +0300 |
commit | 31333fc193ce39015eab50734c0048f64423091e (patch) | |
tree | ae2f2d3559267ce9620aad9cf582b0bcf2bb0dd8 /source/blender/blenloader/intern/versioning_defaults.c | |
parent | 203f9a49e29c82458a49efe856eb58f938eb537b (diff) |
Viewport: Change default studiolight
Differential Revision: https://developer.blender.org/D4939
Diffstat (limited to 'source/blender/blenloader/intern/versioning_defaults.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index fdeb2997b05..44db1c424b6 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -425,6 +425,21 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) camera->dof.focus_distance = 10.0f; camera->dof.aperture_fstop = 2.8f; } + + for (Material *ma = bmain->materials.first; ma; ma = ma->id.next) { + /* Update default material to be a bit more rough. */ + ma->roughness = 0.4f; + + if (ma->nodetree) { + for (bNode *node = ma->nodetree->nodes.first; node; node = node->next) { + if (node->type == SH_NODE_BSDF_PRINCIPLED) { + bNodeSocket *roughness_socket = nodeFindSocket(node, SOCK_IN, "Roughness"); + bNodeSocketValueFloat *roughness_data = roughness_socket->default_value; + roughness_data->value = 0.4f; + } + } + } + } } for (bScreen *sc = bmain->screens.first; sc; sc = sc->id.next) { |