diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-10 20:35:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-10 21:29:31 +0300 |
commit | 477e81128d2fa0035d86690ce2a0027d31625769 (patch) | |
tree | a16a8a6984ec3e707cbc0b6f9a58f7a6549a6766 /source/blender/makesrna/intern/rna_access.c | |
parent | d234bf21b97c4e31b963a18eb71012634b014b6f (diff) |
Show correct syntax for id-properties
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 41bb0386ce6..b7478fd3311 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4720,6 +4720,7 @@ char *RNA_path_full_struct_py(struct PointerRNA *ptr) char *RNA_path_full_property_py(PointerRNA *ptr, PropertyRNA *prop, int index) { char *id_path; + const char *data_delim; char *data_path; char *ret; @@ -4733,13 +4734,15 @@ char *RNA_path_full_property_py(PointerRNA *ptr, PropertyRNA *prop, int index) data_path = RNA_path_from_ID_to_property(ptr, prop); + data_delim = (data_path && data_path[0] == '[') ? "" : "."; + if ((index == -1) || (RNA_property_array_check(prop) == false)) { - ret = BLI_sprintfN("%s.%s", - id_path, data_path); + ret = BLI_sprintfN("%s%s%s", + id_path, data_delim, data_path); } else { - ret = BLI_sprintfN("%s.%s[%d]", - id_path, data_path, index); + ret = BLI_sprintfN("%s%s%s[%d]", + id_path, data_delim, data_path, index); } MEM_freeN(id_path); if (data_path) { |