diff options
author | Jorge Bernal <jbernalmartinez@gmail.com> | 2015-01-29 08:03:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-01-29 08:43:20 +0300 |
commit | 072d80a9de3adef632b8637649b169c4a895c1b9 (patch) | |
tree | f3b82fe2120242a5ce636e0fa298bb058649e960 /source/blender/makesrna/intern/rna_property.c | |
parent | 65574b0b030fd1a893520fe967e580ed00308cb5 (diff) |
Fix T42858: Non uniform gamelogic names on copy
Use generic function for consistent behavior
D949 by @lordloki
Diffstat (limited to 'source/blender/makesrna/intern/rna_property.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_property.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_property.c b/source/blender/makesrna/intern/rna_property.c index c6b8e89c282..a2c19e55056 100644 --- a/source/blender/makesrna/intern/rna_property.c +++ b/source/blender/makesrna/intern/rna_property.c @@ -28,6 +28,11 @@ #include <stdlib.h> #include "DNA_property_types.h" +#include "DNA_object_types.h" + +#include "BLI_path_util.h" + +#include "BLF_translation.h" #include "RNA_define.h" #include "RNA_enum_types.h" @@ -97,9 +102,11 @@ static void rna_GameProperty_type_set(PointerRNA *ptr, int value) static void rna_GameProperty_name_set(PointerRNA *ptr, const char *value) { - bProperty *prop = (bProperty *)(ptr->data); + Object *ob = ptr->id.data; + bProperty *prop = ptr->data; BLI_strncpy_utf8(prop->name, value, sizeof(prop->name)); - BKE_bproperty_unique(NULL, prop, 1); + + BLI_uniquename(&ob->prop, prop, DATA_("Property"), '.', offsetof(bProperty, name), sizeof(prop->name)); } |