[Bf-blender-cvs] [c87440c91b4] asset-engine: Fix linking from temp filebrowser.

Bastien Montagne noreply at git.blender.org
Mon Dec 4 15:48:24 CET 2017


Commit: c87440c91b411e2493a7bd972afca41ba30618ec
Author: Bastien Montagne
Date:   Mon Dec 4 15:45:55 2017 +0100
Branches: asset-engine
https://developer.blender.org/rBc87440c91b411e2493a7bd972afca41ba30618ec

Fix linking from temp filebrowser.

We should only set mouse coordinates when we are actually invoked to
link something, not when we are invoked to show filebrowser.

Else (filebrowser invoke case) we have a mouse coordinates sticking
around, which we try to use later in wrong context.

For some reasons, in master that was not an issue, but in 2.8
ED_view3d_give_base_under_cursor() will crash when context is wrong. :/

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

M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 19f86e0d225..7d610f366f0 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -116,9 +116,10 @@ static int wm_link_append_poll(bContext *C)
 
 static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
-	RNA_int_set_array(op->ptr, "mouse_coordinates", event->mval);
-
 	if (RNA_struct_property_is_set(op->ptr, "filepath")) {
+		if (ED_operator_region_view3d_active(C)) {
+			RNA_int_set_array(op->ptr, "mouse_coordinates", event->mval);
+		}
 		return WM_operator_call_notest(C, op);
 	}
 	else {



More information about the Bf-blender-cvs mailing list