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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-19 17:37:59 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-19 17:37:59 +0400
commitadff6aeb1c749183921c0facd373972bbeb874b4 (patch)
tree07987d408713eee8a3dd8bb5cb4ecf3c112de654 /source/blender/editors/interface
parentd880257d165888638b7c924fb6ef7071343b783e (diff)
RNA: Generic Type Registration
The Python API to define Panels and Operators is based on subclassing, this makes that system more generic, and based on RNA. Hopefully that will make it easy to make various parts of Blender more extensible. * The system simply uses RNA properties and functions and marks them with REGISTER to make them part of the type registration process. Additionally, the struct must provide a register/unregister callback to create/free the PanelType or similar. * From the python side there were some small changes, mainly that registration now goes trough bpy.types.register instead of bpy.ui.addPanel. * Only Panels have been wrapped this way now. Check rna_ui.c to see how this code works. There's still some rough edges and possibilities to make it cleaner, though it works without any manual python code. * Started some docs here: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration * Also changed some RNA_property and RNA_struct functions to not require a PointerRNA anymore, where they were not required (which is actually the cause of most changed files).
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c62
-rw-r--r--source/blender/editors/interface/interface_anim.c4
-rw-r--r--source/blender/editors/interface/interface_layout.c24
-rw-r--r--source/blender/editors/interface/interface_panel.c4
-rw-r--r--source/blender/editors/interface/interface_regions.c10
-rw-r--r--source/blender/editors/interface/interface_utils.c22
6 files changed, 63 insertions, 63 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 47c73c3398d..eb4bd5f940b 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1127,8 +1127,8 @@ void ui_get_but_vectorf(uiBut *but, float *vec)
vec[0]= vec[1]= vec[2]= 0.0f;
- if(RNA_property_type(&but->rnapoin, prop) == PROP_FLOAT) {
- tot= RNA_property_array_length(&but->rnapoin, prop);
+ if(RNA_property_type(prop) == PROP_FLOAT) {
+ tot= RNA_property_array_length(prop);
tot= MIN2(tot, 3);
for(a=0; a<tot; a++)
@@ -1161,8 +1161,8 @@ void ui_set_but_vectorf(uiBut *but, float *vec)
if(but->rnaprop) {
prop= but->rnaprop;
- if(RNA_property_type(&but->rnapoin, prop) == PROP_FLOAT) {
- tot= RNA_property_array_length(&but->rnapoin, prop);
+ if(RNA_property_type(prop) == PROP_FLOAT) {
+ tot= RNA_property_array_length(prop);
tot= MIN2(tot, 3);
for(a=0; a<tot; a++)
@@ -1186,7 +1186,7 @@ int ui_is_but_float(uiBut *but)
if(but->pointype==FLO && but->poin)
return 1;
- if(but->rnaprop && RNA_property_type(&but->rnapoin, but->rnaprop) == PROP_FLOAT)
+ if(but->rnaprop && RNA_property_type(but->rnaprop) == PROP_FLOAT)
return 1;
return 0;
@@ -1203,21 +1203,21 @@ double ui_get_but_val(uiBut *but)
if(but->rnaprop) {
prop= but->rnaprop;
- switch(RNA_property_type(&but->rnapoin, prop)) {
+ switch(RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_boolean_get(&but->rnapoin, prop);
break;
case PROP_INT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_int_get(&but->rnapoin, prop);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex);
else
value= RNA_property_float_get(&but->rnapoin, prop);
@@ -1267,21 +1267,21 @@ void ui_set_but_val(uiBut *but, double value)
prop= but->rnaprop;
if(RNA_property_editable(&but->rnapoin, prop)) {
- switch(RNA_property_type(&but->rnapoin, prop)) {
+ switch(RNA_property_type(prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_boolean_set(&but->rnapoin, prop, value);
break;
case PROP_INT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_int_set(&but->rnapoin, prop, value);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(&but->rnapoin, prop))
+ if(RNA_property_array_length(prop))
RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value);
else
RNA_property_float_set(&but->rnapoin, prop, value);
@@ -1364,7 +1364,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
PropertyType type;
char *buf= NULL;
- type= RNA_property_type(&but->rnapoin, but->rnaprop);
+ type= RNA_property_type(but->rnaprop);
if(type == PROP_STRING) {
/* RNA string */
@@ -1375,7 +1375,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
PointerRNA ptr= RNA_property_pointer_get(&but->rnapoin, but->rnaprop);
PropertyRNA *nameprop;
- if(ptr.data && (nameprop = RNA_struct_name_property(&ptr)))
+ if(ptr.data && (nameprop = RNA_struct_name_property(ptr.type)))
buf= RNA_property_string_get_alloc(&ptr, nameprop, str, maxlen);
else
BLI_strncpy(str, "", maxlen);
@@ -1433,7 +1433,7 @@ static void ui_rna_ID_collection(bContext *C, uiBut *but, PointerRNA *ptr, Prope
/* look for collection property in Main */
RNA_pointer_create(NULL, &RNA_Main, CTX_data_main(C), ptr);
- iterprop= RNA_struct_iterator_property(ptr);
+ iterprop= RNA_struct_iterator_property(ptr->type);
RNA_property_collection_begin(ptr, iterprop, &iter);
*prop= NULL;
@@ -1441,10 +1441,10 @@ static void ui_rna_ID_collection(bContext *C, uiBut *but, PointerRNA *ptr, Prope
iprop= iter.ptr.data;
/* if it's a collection and has same pointer type, we've got it */
- if(RNA_property_type(ptr, iprop) == PROP_COLLECTION) {
- srna= RNA_property_pointer_type(ptr, iprop);
+ if(RNA_property_type(iprop) == PROP_COLLECTION) {
+ srna= RNA_property_pointer_type(iprop);
- if(RNA_property_pointer_type(&but->rnapoin, but->rnaprop) == srna) {
+ if(RNA_property_pointer_type(but->rnaprop) == srna) {
*prop= iprop;
break;
}
@@ -1475,7 +1475,7 @@ static void ui_rna_ID_autocomplete(bContext *C, char *str, void *arg_but)
/* loop over items in collection */
for(; iter.valid; RNA_property_collection_next(&iter)) {
- if(iter.ptr.data && (nameprop = RNA_struct_name_property(&iter.ptr))) {
+ if(iter.ptr.data && (nameprop = RNA_struct_name_property(iter.ptr.type))) {
name= RNA_property_string_get_alloc(&iter.ptr, nameprop, NULL, 0);
if(name) {
@@ -1496,7 +1496,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
if(RNA_property_editable(&but->rnapoin, but->rnaprop)) {
PropertyType type;
- type= RNA_property_type(&but->rnapoin, but->rnaprop);
+ type= RNA_property_type(but->rnaprop);
if(type == PROP_STRING) {
/* RNA string */
@@ -1593,7 +1593,7 @@ void ui_set_but_soft_range(uiBut *but, double value)
double softmin, softmax, step, precision;
if(but->rnaprop) {
- type= RNA_property_type(&but->rnapoin, but->rnaprop);
+ type= RNA_property_type(but->rnaprop);
if(type == PROP_INT) {
int imin, imax, istep;
@@ -1885,7 +1885,7 @@ void ui_check_but(uiBut *but)
}
if(but->rnaprop) {
- PropertySubType pstype = RNA_property_subtype(&but->rnapoin, but->rnaprop);
+ PropertySubType pstype = RNA_property_subtype(but->rnaprop);
if (pstype == PROP_PERCENTAGE)
strcat(but->drawstr, "%");
@@ -2243,7 +2243,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
prop= RNA_struct_find_property(ptr, propname);
if(prop) {
- proptype= RNA_property_type(ptr, prop);
+ proptype= RNA_property_type(prop);
/* use rna values if parameters are not specified */
if(!str) {
@@ -2255,7 +2255,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
RNA_property_enum_items(ptr, prop, &item, &totitem);
dynstr= BLI_dynstr_new();
- BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(ptr, prop));
+ BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop));
for(i=0; i<totitem; i++)
BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value);
str= BLI_dynstr_get_cstring(dynstr);
@@ -2273,10 +2273,10 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
str= (char*)item[i].name;
if(!str)
- str= (char*)RNA_property_ui_name(ptr, prop);
+ str= (char*)RNA_property_ui_name(prop);
}
else
- str= (char*)RNA_property_ui_name(ptr, prop);
+ str= (char*)RNA_property_ui_name(prop);
}
if(!tip) {
@@ -2297,7 +2297,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
}
if(!tip)
- tip= (char*)RNA_property_ui_description(ptr, prop);
+ tip= (char*)RNA_property_ui_description(prop);
if(min == max || a1 == -1 || a2 == -1) {
if(proptype == PROP_INT) {
@@ -2332,7 +2332,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
}
else if(proptype == PROP_STRING) {
min= 0;
- max= RNA_property_string_maxlength(ptr, prop);
+ max= RNA_property_string_maxlength(prop);
if(max == 0) /* interface code should ideally support unlimited length */
max= UI_MAX_DRAW_STR;
}
@@ -2348,7 +2348,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1,
but->rnapoin= *ptr;
but->rnaprop= prop;
- if(RNA_property_array_length(&but->rnapoin, but->rnaprop))
+ if(RNA_property_array_length(but->rnaprop))
but->rnaindex= index;
else
but->rnaindex= 0;
@@ -2767,7 +2767,7 @@ uiBut *uiDefMenuTogR(uiBlock *block, PointerRNA *ptr, char *propname, char *prop
prop= RNA_struct_find_property(ptr, propname);
if(prop) {
- type= RNA_property_type(ptr, prop);
+ type= RNA_property_type(prop);
if(type == PROP_BOOLEAN) {
if(RNA_property_boolean_get(ptr, prop))
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 3b89fbddebc..6775a639597 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -118,9 +118,9 @@ void ui_but_anim_menu(bContext *C, uiBut *but)
int length;
if(but->rnapoin.data && but->rnaprop) {
- head= uiPupMenuBegin(RNA_property_ui_name(&but->rnapoin, but->rnaprop), 0);
+ head= uiPupMenuBegin(RNA_property_ui_name(but->rnaprop), 0);
- length= RNA_property_array_length(&but->rnapoin, but->rnaprop);
+ length= RNA_property_array_length(but->rnaprop);
if(but->flag & UI_BUT_ANIMATED_KEY) {
if(length) {
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 795483ac177..7d27934f691 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -191,14 +191,14 @@ static void ui_item_array(uiBlock *block, uiItemRNA *rnaitem, int len, int x, in
int a;
/* retrieve type and subtype */
- type= RNA_property_type(&rnaitem->ptr, rnaitem->prop);
- subtype= RNA_property_subtype(&rnaitem->ptr, rnaitem->prop);
+ type= RNA_property_type(rnaitem->prop);
+ subtype= RNA_property_subtype(rnaitem->prop);
/* create label */
if(rnaitem->item.name)
name= (char*)rnaitem->item.name;
else
- name= (char*)RNA_property_ui_name(&rnaitem->ptr, rnaitem->prop);
+ name= (char*)RNA_property_ui_name(rnaitem->prop);
if(strcmp(name, "") != 0)
uiDefBut(block, LABEL, 0, name, x, y + h - EM_UNIT_Y, w, EM_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
@@ -289,7 +289,7 @@ static void ui_item_enum_row(uiBlock *block, uiItemRNA *rnaitem, int x, int y, i
int a, totitem, pos, itemw;
const char *propname;
- propname= RNA_property_identifier(&rnaitem->ptr, rnaitem->prop);
+ propname= RNA_property_identifier(rnaitem->prop);
RNA_property_enum_items(&rnaitem->ptr, rnaitem->prop, &item, &totitem);
uiBlockBeginAlign(block);
@@ -310,7 +310,7 @@ static void ui_item_with_label(uiBlock *block, uiItemRNA *rnaitem, int x, int y,
if(rnaitem->item.name)
name= (char*)rnaitem->item.name;
else
- name= (char*)RNA_property_ui_name(&rnaitem->ptr, rnaitem->prop);
+ name= (char*)RNA_property_ui_name(rnaitem->prop);
if(strcmp(name, "") != 0) {
w= w/2;
@@ -331,8 +331,8 @@ static void ui_item_buts(uiBlock *block, uiItem *item, int x, int y, int w, int
int len;
/* retrieve info */
- type= RNA_property_type(&rnaitem->ptr, rnaitem->prop);
- len= RNA_property_array_length(&rnaitem->ptr, rnaitem->prop);
+ type= RNA_property_type(rnaitem->prop);
+ len= RNA_property_array_length(rnaitem->prop);
/* array property */
if(rnaitem->index == RNA_NO_INDEX && len > 0)
@@ -416,9 +416,9 @@ static void ui_item_size(uiItem *item, int *r_w, int *r_h)
h= EM_UNIT_Y;
/* arbitrary extended width by type */
- type= RNA_property_type(&rnaitem->ptr, rnaitem->prop);
- subtype= RNA_property_subtype(&rnaitem->ptr, rnaitem->prop);
- len= RNA_property_array_length(&rnaitem->ptr, rnaitem->prop);
+ type= RNA_property_type(rnaitem->prop);
+ subtype= RNA_property_subtype(rnaitem->prop);
+ len= RNA_property_array_length(rnaitem->prop);
if(type == PROP_STRING)
w += 10*EM_UNIT_X;
@@ -506,7 +506,7 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname)
RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
prop= RNA_struct_find_property(&ptr, propname);
- if(prop && RNA_property_type(&ptr, prop) == PROP_ENUM) {
+ if(prop && RNA_property_type(prop) == PROP_ENUM) {
const EnumPropertyItem *item;
int totitem, i;
@@ -1214,7 +1214,7 @@ void uiRegionPanelLayout(const bContext *C, ARegion *ar, int vertical, char *con
if(!pt->context || strcmp(context, pt->context) != 0)
continue;
- if(pt->draw && (!pt->poll || pt->poll(C))) {
+ if(pt->draw && (!pt->poll || pt->poll(C, pt))) {
block= uiBeginBlock(C, ar, pt->idname, UI_EMBOSS);
panel= uiBeginPanel(ar, block, pt);
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 42033a40624..7d1f8d59552 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -158,8 +158,8 @@ static void ui_panel_copy_offset(Panel *pa, Panel *papar)
Panel *uiBeginPanel(ARegion *ar, uiBlock *block, PanelType *pt)
{
Panel *pa, *patab, *palast, *panext;
- char *panelname= pt->name;
- char *tabname= pt->name;
+ char *panelname= pt->label;
+ char *tabname= pt->label;
char *hookname= NULL;
int newpanel;
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 47afd03d051..73fdb7fd83c 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1861,7 +1861,7 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle,
else if(item->type==MENU_ITEM_RNA_BOOL) {
PropertyRNA *prop= RNA_struct_find_property(&item->rnapoin, item->propname);
- if(prop && RNA_property_type(&item->rnapoin, prop) == PROP_BOOLEAN) {
+ if(prop && RNA_property_type(prop) == PROP_BOOLEAN) {
icon= (RNA_property_boolean_get(&item->rnapoin, prop))? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
uiDefIconTextButR(block, TOG, 0, icon, NULL, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &item->rnapoin, item->propname, 0, 0, 0, 0, 0, NULL);
}
@@ -1876,7 +1876,7 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle,
else if(item->type==MENU_ITEM_RNA_ENUM) {
PropertyRNA *prop= RNA_struct_find_property(&item->rnapoin, item->propname);
- if(prop && RNA_property_type(&item->rnapoin, prop) == PROP_ENUM) {
+ if(prop && RNA_property_type(prop) == PROP_ENUM) {
icon= (RNA_property_enum_get(&item->rnapoin, prop) == item->enumval)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT;
uiDefIconTextButR(block, ROW, 0, icon, NULL, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &item->rnapoin, item->propname, 0, 0, item->enumval, 0, 0, NULL);
}
@@ -2074,7 +2074,7 @@ void uiMenuItemsEnumO(uiMenuItem *head, char *opname, char *propname)
RNA_pointer_create(NULL, ot->srna, NULL, &ptr);
prop= RNA_struct_find_property(&ptr, propname);
- if(prop && RNA_property_type(&ptr, prop) == PROP_ENUM) {
+ if(prop && RNA_property_type(prop) == PROP_ENUM) {
const EnumPropertyItem *item;
int totitem, i;
@@ -2112,7 +2112,7 @@ void uiMenuItemsEnumR(uiMenuItem *head, PointerRNA *ptr, char *propname)
prop= RNA_struct_find_property(ptr, propname);
- if(prop && RNA_property_type(ptr, prop) == PROP_ENUM) {
+ if(prop && RNA_property_type(prop) == PROP_ENUM) {
const EnumPropertyItem *item;
int totitem, i;
@@ -2156,7 +2156,7 @@ void uiMenuLevelEnumR(uiMenuItem *head, PointerRNA *ptr, char *propname)
item->type = MENU_ITEM_LEVEL_RNA_ENUM;
prop= RNA_struct_find_property(ptr, propname);
if(prop)
- BLI_strncpy(item->name, RNA_property_ui_name(ptr, prop), MAX_MENU_STR);
+ BLI_strncpy(item->name, RNA_property_ui_name(prop), MAX_MENU_STR);
item->rnapoin= *ptr;
item->propname= propname; // static!
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 884e5bee615..5ef1e68bd59 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -220,17 +220,17 @@ int UI_GetIconRNA(PointerRNA *ptr)
uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2)
{
uiBut *but=NULL;
- const char *propname= RNA_property_identifier(ptr, prop);
- int arraylen= RNA_property_array_length(ptr, prop);
+ const char *propname= RNA_property_identifier(prop);
+ int arraylen= RNA_property_array_length(prop);
- switch(RNA_property_type(ptr, prop)) {
+ switch(RNA_property_type(prop)) {
case PROP_BOOLEAN: {
int value, length;
if(arraylen && index == -1)
return NULL;
- length= RNA_property_array_length(ptr, prop);
+ length= RNA_property_array_length(prop);
if(length)
value= RNA_property_boolean_get_index(ptr, prop, index);
@@ -248,10 +248,10 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
case PROP_INT:
case PROP_FLOAT:
if(arraylen && index == -1) {
- if(RNA_property_subtype(ptr, prop) == PROP_COLOR)
+ if(RNA_property_subtype(prop) == PROP_COLOR)
but= uiDefButR(block, COL, 0, name, x1, y1, x2, y2, ptr, propname, 0, 0, 0, -1, -1, NULL);
}
- else if(RNA_property_subtype(ptr, prop) == PROP_PERCENTAGE)
+ else if(RNA_property_subtype(prop) == PROP_PERCENTAGE)
but= uiDefButR(block, NUMSLI, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
else
but= uiDefButR(block, NUM, 0, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
@@ -268,7 +268,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
pptr= RNA_property_pointer_get(ptr, prop);
if(!pptr.type)
- pptr.type= RNA_property_pointer_type(ptr, prop);
+ pptr.type= RNA_property_pointer_type(prop);
icon= UI_GetIconRNA(&pptr);
but= uiDefIconTextButR(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, propname, index, 0, 0, -1, -1, NULL);
@@ -300,20 +300,20 @@ int uiDefAutoButsRNA(const bContext *C, uiBlock *block, PointerRNA *ptr)
layout= uiLayoutBegin(UI_LAYOUT_VERTICAL, x, y, DEF_BUT_WIDTH*2, 20);
uiLayoutColumn(layout);
- uiItemL(layout, (char*)RNA_struct_ui_name(ptr), 0);
+ uiItemL(layout, (char*)RNA_struct_ui_name(ptr->type), 0);
- iterprop= RNA_struct_iterator_property(ptr);
+ iterprop= RNA_struct_iterator_property(ptr->type);
RNA_property_collection_begin(ptr, iterprop, &iter);
for(; iter.valid; RNA_property_collection_next(&iter)) {
prop= iter.ptr.data;
- if(strcmp(RNA_property_identifier(ptr, prop), "rna_type") == 0)
+ if(strcmp(RNA_property_identifier(prop), "rna_type") == 0)
continue;
uiLayoutSplit(layout, 2, 0);
- name= (char*)RNA_property_ui_name(ptr, prop);
+ name= (char*)RNA_property_ui_name(prop);
uiLayoutColumn(uiLayoutSub(layout, 0));
uiItemL(uiLayoutSub(layout, 0), name, 0);
uiLayoutColumn(uiLayoutSub(layout, 1));