diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-24 15:27:47 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-24 15:27:47 +0300 |
commit | 9b8262021b782361d82cd0e1f0f1e5711036c580 (patch) | |
tree | 48f31921865c823c7949861d9bb61e08bf239bc9 /source/blender/blenloader/intern | |
parent | c0a4c8c3fa68a7343a8444aaf4948f309adec4d6 (diff) |
Geometry Nodes: add versioning for attribute fill
The attribute domain of old nodes should be set to `ATTR_DOMAIN_AUTO`.
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 00f4c49fda9..31e4b659c2f 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -52,6 +52,7 @@ #include "BKE_animsys.h" #include "BKE_armature.h" +#include "BKE_attribute.h" #include "BKE_collection.h" #include "BKE_colortools.h" #include "BKE_cryptomatte.h" @@ -1905,6 +1906,25 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 293, 14)) { + if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "diff_fac")) { + LISTBASE_FOREACH (Light *, light, &bmain->lights) { + light->diff_fac = 1.0f; + light->volume_fac = 1.0f; + } + } + + LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) { + if (ntree->type == NTREE_GEOMETRY) { + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + if (node->type == GEO_NODE_ATTRIBUTE_FILL) { + node->custom2 = ATTR_DOMAIN_AUTO; + } + } + } + } + } + /** * Versioning code until next subversion bump goes here. * @@ -1916,12 +1936,5 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ - - if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "diff_fac")) { - LISTBASE_FOREACH (Light *, light, &bmain->lights) { - light->diff_fac = 1.0f; - light->volume_fac = 1.0f; - } - } } } |