Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_console/space_console.c')
-rw-r--r--source/blender/editors/space_console/space_console.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 75add570708..be8febdab23 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -170,16 +170,13 @@ static int id_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event
static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- char text[64];
+ char *text;
ID *id = drag->poin;
- char id_esc[(sizeof(id->name) - 2) * 2];
-
- BLI_strescape(id_esc, id->name + 2, sizeof(id_esc));
-
- BLI_snprintf(text, sizeof(text), "bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id_esc);
/* copy drag path to properties */
+ text = RNA_path_from_ID_python(id);
RNA_string_set(drop->ptr, "text", text);
+ MEM_freeN(text);
}
static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event))