[Bf-blender-cvs] [35f153c] master: Fix T42928: Drag-drop of generated files to compo reloads them, loosing edits

Sergey Sharybin noreply at git.blender.org
Tue Dec 23 06:57:25 CET 2014


Commit: 35f153cdc3f04dbfc2752b818aba09b6c844364a
Author: Sergey Sharybin
Date:   Tue Dec 23 10:47:27 2014 +0500
Branches: master
https://developer.blender.org/rB35f153cdc3f04dbfc2752b818aba09b6c844364a

Fix T42928: Drag-drop of generated files to compo reloads them, loosing edits

Origins of this issue goes back to T33402, where compo wasn't sure what kind
of image it is working with (compo should know if it's multilayer or regular
image).

Now we only reload images when dar-dropping from outside of blender.

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

M	source/blender/editors/space_node/node_add.c

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

diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index c306443..8301522 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -334,9 +334,14 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
 	}
 	
 	node->id = (ID *)ima;
-	
-	BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
-	WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
+
+	/* When adding new image file via drag-drop we need to load imbuf in order
+	 * to get proper image source.
+	 */
+	if (RNA_struct_property_is_set(op->ptr, "filepath")) {
+		BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
+		WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima);
+	}
 
 	snode_notify(C, snode);
 	snode_dag_update(C, snode);




More information about the Bf-blender-cvs mailing list