diff options
author | Dalai Felinto <dalai@blender.org> | 2021-01-22 12:49:20 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2021-01-22 13:47:47 +0300 |
commit | 526373b89705b0401f41d31e7176498531f3f986 (patch) | |
tree | 5d17cb892cf1e89f634d2514ba217b15cd5e2a0c /source/blender/blenloader/intern/versioning_290.c | |
parent | d179e1c6e460474e398e2831ecfd3924a12f5210 (diff) |
Cleanup - Point Instance: Use own DNA struct
We will need to expand this node soon to add weight/count for different
elements inside the collection. For that it is better to have the node
to use its own DNA.
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 627eecddeaa..555b2453c62 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1611,6 +1611,24 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 293, 3)) { + FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + if (ntree->type != NTREE_GEOMETRY) { + continue; + } + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + if (node->type == GEO_NODE_POINT_INSTANCE && node->storage == NULL) { + NodeGeometryPointInstance *data = (NodeGeometryPointInstance *)MEM_callocN( + sizeof(NodeGeometryPointInstance), __func__); + data->instance_type = node->custom1; + data->flag = (node->custom2 ? 0 : GEO_NODE_POINT_INSTANCE_WHOLE_COLLECTION); + node->storage = data; + } + } + } + FOREACH_NODETREE_END; + } + /** * Versioning code until next subversion bump goes here. * |