[Bf-blender-cvs] [503dbb6] master: Fix T42760: Drag-to-add feature fails in a case.

Bastien Montagne noreply at git.blender.org
Sun Nov 30 17:22:07 CET 2014


Commit: 503dbb65c02b0cd0d80f0cbed6419285162b3262
Author: Bastien Montagne
Date:   Sun Nov 30 15:05:03 2014 +0100
Branches: master
https://developer.blender.org/rB503dbb65c02b0cd0d80f0cbed6419285162b3262

Fix T42760: Drag-to-add feature fails in a case.

We have to unset 'name' when we set 'filepath', and vice-versa.

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

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

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

diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 3c91b33..f4dc0c7 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -702,10 +702,12 @@ static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
 
 	if (id) {
 		RNA_string_set(drop->ptr, "name", id->name + 2);
+		RNA_struct_property_unset(drop->ptr, "filepath");
 	}
-	if (drag->path[0]) {
+	else if (drag->path[0]) {
 		RNA_string_set(drop->ptr, "filepath", drag->path);
-	}
+		RNA_struct_property_unset(drop->ptr, "name");
+}
 }
 
 /* this region dropbox definition */




More information about the Bf-blender-cvs mailing list