[Bf-blender-cvs] [fff18e0] master: Text Editor: dropping id's now paste in Python data path (like pyconsole)

Campbell Barton noreply at git.blender.org
Sun Jun 15 04:16:28 CEST 2014


Commit: fff18e049abbb21b4521b538c321391955984436
Author: Campbell Barton
Date:   Sun Jun 15 12:09:18 2014 +1000
https://developer.blender.org/rBfff18e049abbb21b4521b538c321391955984436

Text Editor: dropping id's now paste in Python data path (like pyconsole)

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

M	source/blender/editors/space_text/space_text.c

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

diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 6e49569..fbca9bc 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -484,7 +484,13 @@ static int text_drop_paste_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent
 
 static void text_drop_paste(wmDrag *drag, wmDropBox *drop)
 {
-	RNA_string_set(drop->ptr, "text", ((ID *)drag->poin)->name + 2);
+	char *text;
+	ID *id = drag->poin;
+
+	/* copy drag path to properties */
+	text = RNA_path_full_ID_py(id);
+	RNA_string_set(drop->ptr, "text", text);
+	MEM_freeN(text);
 }
 
 /* this region dropbox definition */




More information about the Bf-blender-cvs mailing list