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:
authorCampbell Barton <ideasman42@gmail.com>2015-09-10 20:35:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-10 21:29:31 +0300
commit477e81128d2fa0035d86690ce2a0027d31625769 (patch)
treea16a8a6984ec3e707cbc0b6f9a58f7a6549a6766 /source/blender/python/intern
parentd234bf21b97c4e31b963a18eb71012634b014b6f (diff)
Show correct syntax for id-properties
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy_rna.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index bd07c7370a4..662572cba61 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -988,15 +988,16 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self)
path = RNA_path_from_ID_to_property(&self->ptr, self->prop);
if (path) {
+ const char *data_delim = (path[0] == '[') ? "" : ".";
if (GS(id->name) == ID_NT) { /* nodetree paths are not accurate */
ret = PyUnicode_FromFormat("bpy.data...%s",
path);
}
else {
- ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s",
+ ret = PyUnicode_FromFormat("bpy.data.%s[%R]%s%s",
BKE_idcode_to_name_plural(GS(id->name)),
tmp_str,
- path);
+ data_delim, path);
}
MEM_freeN((void *)path);