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>2009-11-18 17:00:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-11-18 17:00:23 +0300
commit34edfb97107943c87df4b39ccbfe9d95498029d3 (patch)
tree6da78a264d4c0c548c5a27c6f48ce8ccced3c731 /source/blender
parent6a357cabbfd7b2d8856f7f39eb9001a475252260 (diff)
bone & object properties editing was broken.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_utils.c7
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c5
3 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index f24ae62db8f..c78a5a46add 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -46,8 +46,15 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
{
uiBut *but=NULL;
const char *propname= RNA_property_identifier(prop);
+ char prop_item[sizeof(((IDProperty *)NULL)->name)+4]; /**/
int arraylen= RNA_property_array_length(ptr, prop);
+ /* support for custom props */
+ if(RNA_property_is_idprop(prop)) {
+ sprintf(prop_item, "[\"%s\"]", propname);
+ propname= prop_item;
+ }
+
switch(RNA_property_type(prop)) {
case PROP_BOOLEAN: {
int value, length;
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index a8c567dccf4..d60713aa817 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -816,6 +816,7 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name);
/* check if the idproperty exists, for operators */
int RNA_property_is_set(PointerRNA *ptr, const char *name);
+int RNA_property_is_idprop(PropertyRNA *prop);
/* python compatible string representation of this property, (must be freed!) */
char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index d9ef58058b0..f163dee0e4c 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2911,6 +2911,11 @@ int RNA_property_is_set(PointerRNA *ptr, const char *name)
}
}
+int RNA_property_is_idprop(PropertyRNA *prop)
+{
+ return (prop->magic!=RNA_MAGIC);
+}
+
/* string representation of a property, python
* compatible but can be used for display too*/
char *RNA_pointer_as_string(PointerRNA *ptr)