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.
This commit is contained in:
Sergey Sharybin 2014-12-23 10:47:27 +05:00
parent 646a96bf8e
commit 35f153cdc3
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #42928, Unsaved baked image cannot be used in node editors.
1 changed files with 8 additions and 3 deletions

View File

@ -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);