[Bf-blender-cvs] [001d70eb2bf] blender-v2.83-release: Fix T76277: Remove wrong cast in rna_NodeTree_update

Robert Guetzkow noreply at git.blender.org
Fri May 15 18:37:34 CEST 2020


Commit: 001d70eb2bfe94a48de6d104f9cc21de112d6ebe
Author: Robert Guetzkow
Date:   Fri May 15 18:17:38 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB001d70eb2bfe94a48de6d104f9cc21de112d6ebe

Fix T76277: Remove wrong cast in rna_NodeTree_update

This patch fixes T76277 by removing the incorrect cast from
`ptr->data` to `bNode`. The address of `ptr->owner_id` and
`ptr->data` both point to the node tree. Passing the node tree
incorrectly as a node into the `ED_node_tag_update_nodetree`
corrupts the data, because it attempts to set flags on the
node.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7747

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

M	source/blender/makesrna/intern/rna_nodetree.c

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

diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 5be3db37329..e9ad9d4b514 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -862,12 +862,11 @@ static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports)
 static void rna_NodeTree_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
 {
   bNodeTree *ntree = (bNodeTree *)ptr->owner_id;
-  bNode *node = (bNode *)ptr->data;
 
   WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
   WM_main_add_notifier(NC_SCENE | ND_NODES, &ntree->id);
 
-  ED_node_tag_update_nodetree(bmain, ntree, node);
+  ED_node_tag_update_nodetree(bmain, ntree, NULL);
 }
 
 static bNode *rna_NodeTree_node_new(bNodeTree *ntree,



More information about the Bf-blender-cvs mailing list