diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-10 20:37:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-04-10 20:37:05 +0400 |
commit | 63e27638420c5b409c95c3d7ba3f8755429bf79d (patch) | |
tree | a1e1e5e4b394d198accd7ad4199d8d671a5b21e2 /source/blender/python | |
parent | a08fdf1f2a31a8107520ab7c7902d365d5cf3959 (diff) |
Fix #30698: python console nodetree paths were not accurate, now show ... like
in some other cases to at least show these are not accurate.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 38ee3cf8f0a..175aada5094 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -871,10 +871,17 @@ static PyObject *pyrna_struct_repr(BPy_StructRNA *self) const char *path; path = RNA_path_from_ID_to_struct(&self->ptr); if (path) { - ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s", - BKE_idcode_to_name_plural(GS(id->name)), - tmp_str, - path); + 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", + BKE_idcode_to_name_plural(GS(id->name)), + tmp_str, + path); + } + MEM_freeN((void *)path); } else { /* cant find, print something sane */ @@ -971,10 +978,17 @@ static PyObject *pyrna_prop_repr(BPy_PropertyRNA *self) path = RNA_path_from_ID_to_property(&self->ptr, self->prop); if (path) { - ret = PyUnicode_FromFormat("bpy.data.%s[%R].%s", - BKE_idcode_to_name_plural(GS(id->name)), - tmp_str, - path); + 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", + BKE_idcode_to_name_plural(GS(id->name)), + tmp_str, + path); + } + MEM_freeN((void *)path); } else { /* cant find, print something sane */ |