[Bf-blender-cvs] [c31bc465eac] blender2.8: Revert previous commit and do proper fix for missing typeinfo in nodes.

Bastien Montagne noreply at git.blender.org
Mon Jun 11 17:39:48 CEST 2018


Commit: c31bc465eacd46725336792f120ad45a475e72bd
Author: Bastien Montagne
Date:   Mon Jun 11 17:39:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc31bc465eacd46725336792f120ad45a475e72bd

Revert previous commit and do proper fix for missing typeinfo in nodes.

===================================================================

M	source/blender/blenkernel/intern/node.c
M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 2031bb4e9d4..72a34d35715 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1684,7 +1684,7 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat
 	remove_animdata &= ntree && !(ntree->flag & NTREE_IS_LOCALIZED);
 	
 	/* extra free callback */
-	if (use_api_free_cb && node->typeinfo != NULL && node->typeinfo->freefunc_api) {
+	if (use_api_free_cb && node->typeinfo->freefunc_api) {
 		PointerRNA ptr;
 		RNA_pointer_create((ID *)ntree, &RNA_Node, node, &ptr);
 		
@@ -1711,7 +1711,7 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat
 			BKE_animdata_fix_paths_remove((ID *)ntree, prefix);
 		}
 
-		if (node->typeinfo != NULL && ntree->typeinfo->free_node_cache)
+		if (ntree->typeinfo->free_node_cache)
 			ntree->typeinfo->free_node_cache(ntree, node);
 		
 		/* texture node has bad habit of keeping exec data around */
@@ -1721,7 +1721,7 @@ static void node_free_node_ex(bNodeTree *ntree, bNode *node, bool remove_animdat
 		}
 	}
 
-	if (node->typeinfo != NULL && node->typeinfo->freefunc) {
+	if (node->typeinfo->freefunc) {
 		node->typeinfo->freefunc(node);
 	}
 
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a9f93dff9e6..6aeb3e0e0cd 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8833,6 +8833,7 @@ BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath)
 	/* Now that all our data-blocks are loaded, we can re-generate overrides from their references. */
 	if (fd->memfile == NULL) {
 		/* Do not apply in undo case! */
+		lib_verify_nodetree(bfd->main, true);  /* Needed to ensure we have typeinfo in nodes... */
 		BKE_main_override_static_update(bfd->main);
 		BKE_collections_after_lib_link(bfd->main);
 	}



More information about the Bf-blender-cvs mailing list