bone & object properties editing was broken.

This commit is contained in:
Campbell Barton
2009-11-18 14:00:23 +00:00
parent 6a357cabbf
commit 34edfb9710
3 changed files with 13 additions and 0 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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)