Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 4df681002a0..9aded9137ec 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -1428,5 +1428,26 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ FOREACH_NODETREE_BEGIN (bmain, ntree, id) {
+ if (ntree->type == NTREE_GEOMETRY) {
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (node->type == GEO_NODE_ATTRIBUTE_MATH && node->storage == NULL) {
+ const int old_use_attibute_a = (1 << 0);
+ const int old_use_attibute_b = (1 << 1);
+ NodeAttributeMath *data = MEM_callocN(sizeof(NodeAttributeMath), "NodeAttributeMath");
+ data->operation = NODE_MATH_ADD;
+ data->input_type_a = (node->custom2 & old_use_attibute_a) ?
+ GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE :
+ GEO_NODE_ATTRIBUTE_INPUT_FLOAT;
+ data->input_type_b = (node->custom2 & old_use_attibute_b) ?
+ GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE :
+ GEO_NODE_ATTRIBUTE_INPUT_FLOAT;
+ node->storage = data;
+ }
+ }
+ }
+ }
+ FOREACH_NODETREE_END;
}
}