diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-09 14:45:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-09 14:45:11 +0400 |
commit | be3da5dfffd23b0dc2f9bffc2e7d2012f1c63494 (patch) | |
tree | 85fc976a65b541b020c758fce7b4ec0da3f211c3 | |
parent | 2226a5139a2ad78d4de2eaaf09e734adf1ce0ae4 (diff) |
3D View panels now show object and bone name again, not sure it
belongs here still, but this came up often, it avoids having to
switch tabs a lot when creating things.
Also renamed uiLayoutFreeBlock to uiLayoutAbsoluteBlock.
10 files changed, 96 insertions, 62 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5766fcfdb1f..adbfd731a09 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -614,7 +614,7 @@ uiLayout *uiLayoutListBox(uiLayout *layout); uiLayout *uiLayoutFree(uiLayout *layout, int align); uiLayout *uiLayoutSplit(uiLayout *layout, float percentage); -uiBlock *uiLayoutFreeBlock(uiLayout *layout); +uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout); /* templates */ void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index b0f93472240..233d3b214ae 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -96,7 +96,7 @@ typedef enum uiItemType { ITEM_LAYOUT_COLUMN_FLOW, ITEM_LAYOUT_ROW_FLOW, ITEM_LAYOUT_BOX, - ITEM_LAYOUT_FREE, + ITEM_LAYOUT_ABSOLUTE, ITEM_LAYOUT_SPLIT, ITEM_LAYOUT_ROOT @@ -290,7 +290,7 @@ static int ui_layout_local_dir(uiLayout *layout) case ITEM_LAYOUT_COLUMN: case ITEM_LAYOUT_COLUMN_FLOW: case ITEM_LAYOUT_SPLIT: - case ITEM_LAYOUT_FREE: + case ITEM_LAYOUT_ABSOLUTE: case ITEM_LAYOUT_BOX: default: return UI_LAYOUT_VERTICAL; @@ -1731,7 +1731,7 @@ static void ui_litem_layout_column_flow(uiLayout *litem) } /* free layout */ -static void ui_litem_estimate_free(uiLayout *litem) +static void ui_litem_estimate_absolute(uiLayout *litem) { uiItem *item; int itemx, itemy, itemw, itemh, minx, miny; @@ -1756,7 +1756,7 @@ static void ui_litem_estimate_free(uiLayout *litem) litem->h -= miny; } -static void ui_litem_layout_free(uiLayout *litem) +static void ui_litem_layout_absolute(uiLayout *litem) { uiItem *item; float scalex=1.0f, scaley=1.0f; @@ -1962,7 +1962,7 @@ uiLayout *uiLayoutFree(uiLayout *layout, int align) uiLayout *litem; litem= MEM_callocN(sizeof(uiLayout), "uiLayoutFree"); - litem->item.type= ITEM_LAYOUT_FREE; + litem->item.type= ITEM_LAYOUT_ABSOLUTE; litem->root= layout->root; litem->align= align; litem->active= 1; @@ -1975,7 +1975,7 @@ uiLayout *uiLayoutFree(uiLayout *layout, int align) return litem; } -uiBlock *uiLayoutFreeBlock(uiLayout *layout) +uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout) { uiBlock *block; @@ -2136,8 +2136,8 @@ static void ui_item_estimate(uiItem *item) case ITEM_LAYOUT_ROOT: ui_litem_estimate_root(litem); break; - case ITEM_LAYOUT_FREE: - ui_litem_estimate_free(litem); + case ITEM_LAYOUT_ABSOLUTE: + ui_litem_estimate_absolute(litem); break; case ITEM_LAYOUT_SPLIT: ui_litem_estimate_split(litem); @@ -2161,7 +2161,7 @@ static void ui_item_align(uiLayout *litem, int nr) if(!bitem->but->alignnr) bitem->but->alignnr= nr; } - else if(item->type == ITEM_LAYOUT_FREE); + else if(item->type == ITEM_LAYOUT_ABSOLUTE); else if(item->type == ITEM_LAYOUT_BOX) { box= (uiLayoutItemBx*)item; box->roundbox->alignnr= nr; @@ -2221,8 +2221,8 @@ static void ui_item_layout(uiItem *item) case ITEM_LAYOUT_ROOT: ui_litem_layout_root(litem); break; - case ITEM_LAYOUT_FREE: - ui_litem_layout_free(litem); + case ITEM_LAYOUT_ABSOLUTE: + ui_litem_layout_absolute(litem); break; case ITEM_LAYOUT_SPLIT: ui_litem_layout_split(litem); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 24bff19555f..7f768a42956 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -61,7 +61,7 @@ void uiTemplateHeader(uiLayout *layout, bContext *C, int menus) { uiBlock *block; - block= uiLayoutFreeBlock(layout); + block= uiLayoutAbsoluteBlock(layout); if(menus) ED_area_header_standardbuttons(C, block, 0); else ED_area_header_switchbutton(C, block, 0); } @@ -603,7 +603,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i } result= uiLayoutColumn(box, 0); - block= uiLayoutFreeBlock(box); + block= uiLayoutAbsoluteBlock(box); } if(md->error) { @@ -948,7 +948,7 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con) } else { box= uiLayoutBox(col); - block= uiLayoutFreeBlock(box); + block= uiLayoutAbsoluteBlock(box); switch (con->type) { #ifndef DISABLE_PYTHON @@ -1459,7 +1459,7 @@ void uiTemplateColorRamp(uiLayout *layout, PointerRNA *ptr, char *propname, int rect.xmin= 0; rect.xmax= 200; rect.ymin= 0; rect.ymax= 190; - block= uiLayoutFreeBlock(layout); + block= uiLayoutAbsoluteBlock(layout); colorband_buttons_layout(block, cptr.data, &rect, !expand, cb); MEM_freeN(cb); diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 09008f8d2d1..afc86309ffb 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -146,7 +146,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa) if(!graph_panel_context(C, &ale, &fcu)) return; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL); /* Info - Active F-Curve */ @@ -285,7 +285,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) driver= fcu->driver; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_graph_region_driver_buttons, NULL); /* general actions */ diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 67fb95b1f6b..e2990a6d919 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1105,7 +1105,7 @@ static void image_panel_uv(const bContext *C, Panel *pa) ARegion *ar= CTX_wm_region(C); uiBlock *block; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_image_panel_events, NULL); image_editvertex_buts(C, block); diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 304c3601cdd..5761432ee29 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -83,7 +83,7 @@ static void logic_panel_properties(const bContext *C, Panel *pa) // SpaceLogic *slogic= CTX_wm_space_logic(C); uiBlock *block; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_logic_panel_events, NULL); } @@ -93,7 +93,7 @@ static void logic_panel_view_properties(const bContext *C, Panel *pa) // SpaceLogic *slogic= CTX_wm_space_logic(C); uiBlock *block; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_logic_panel_events, NULL); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 33be0b83f20..42c664520fe 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -173,7 +173,7 @@ static void node_group_alone_cb(bContext *C, void *node_v, void *unused_v) static void node_buts_group(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; @@ -207,7 +207,7 @@ static void node_buts_group(uiLayout *layout, PointerRNA *ptr) static void node_buts_value(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; bNodeSocket *sock= node->outputs.first; /* first socket stores value */ @@ -219,7 +219,7 @@ static void node_buts_value(uiLayout *layout, PointerRNA *ptr) static void node_buts_rgb(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; bNodeSocket *sock= node->outputs.first; /* first socket stores value */ @@ -279,7 +279,7 @@ static void node_buts_time(uiLayout *layout, PointerRNA *ptr) static void node_buts_valtorgb(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; @@ -316,7 +316,7 @@ static void node_buts_curvecol(uiLayout *layout, PointerRNA *ptr) static void node_buts_normal(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; bNodeSocket *sock= node->outputs.first; /* first socket stores normal */ @@ -389,7 +389,7 @@ static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v) static void node_buts_texture(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -432,7 +432,7 @@ static void node_buts_texture(uiLayout *layout, PointerRNA *ptr) static void node_buts_math(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; uiBut *bt; @@ -544,7 +544,7 @@ static void node_texmap_cb(bContext *C, void *texmap_v, void *unused_v) static void node_shader_buts_material(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -616,7 +616,7 @@ static void node_shader_buts_material(uiLayout *layout, PointerRNA *ptr) static void node_shader_buts_mapping(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; TexMapping *texmap= node->storage; @@ -664,7 +664,7 @@ static void node_shader_buts_mapping(uiLayout *layout, PointerRNA *ptr) static void node_shader_buts_vect_math(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; uiBut *bt; @@ -675,7 +675,7 @@ static void node_shader_buts_vect_math(uiLayout *layout, PointerRNA *ptr) static void node_shader_buts_geometry(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; uiBut *but; @@ -694,7 +694,7 @@ static void node_shader_buts_geometry(uiLayout *layout, PointerRNA *ptr) static void node_shader_buts_dynamic(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -867,7 +867,7 @@ static void image_layer_cb(bContext *C, void *ima_v, void *iuser_v) static void node_composit_buts_image(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -1035,7 +1035,7 @@ static void node_browse_scene_cb(bContext *C, void *ntree_v, void *node_v) static void node_composit_buts_renderlayers(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -1402,7 +1402,7 @@ static void node_composit_buts_chroma_matte(uiLayout *layout, PointerRNA *ptr) uiItemR(col, NULL, 0, ptr, "gain", UI_ITEM_R_SLIDER); uiItemR(col, NULL, 0, ptr, "shadow_adjust", UI_ITEM_R_SLIDER); -// uiBlock *block= uiLayoutFreeBlock(layout); +// uiBlock *block= uiLayoutAbsoluteBlock(layout); // bNode *node= ptr->data; // rctf *butr= &node->butr; // short dx=(butr->xmax-butr->xmin)/2; @@ -1435,7 +1435,7 @@ static void node_composit_buts_color_matte(uiLayout *layout, PointerRNA *ptr) static void node_composit_buts_channel_matte(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; short sx= (butr->xmax-butr->xmin)/4; @@ -1492,7 +1492,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, PointerRNA *ptr) static void node_composit_buts_luma_matte(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; NodeChroma *c=node->storage; @@ -1519,7 +1519,7 @@ static void node_composit_buts_map_uv(uiLayout *layout, PointerRNA *ptr) static void node_composit_buts_id_mask(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; @@ -1554,7 +1554,7 @@ static void node_set_image_cb(bContext *C, void *ntree_v, void *node_v) static void node_composit_buts_file_output(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -1626,7 +1626,7 @@ static void node_scale_cb(bContext *C, void *node_v, void *unused_v) static void node_composit_buts_scale(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; uiBut *bt= uiDefButS(block, MENU, B_NODE_EXEC, "Relative %x0|Absolute %x1|Scene Size % %x2|", @@ -1799,7 +1799,7 @@ static void node_composit_set_butfunc(bNodeType *ntype) static void node_texture_buts_bricks(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; short w = butr->xmax-butr->xmin; @@ -1848,7 +1848,7 @@ static char* noisebasis_menu() static void node_texture_buts_proc(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; Tex *tex = (Tex *)node->storage; @@ -1927,7 +1927,7 @@ static void node_texture_buts_proc(uiLayout *layout, PointerRNA *ptr) static void node_texture_buts_image(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; bNodeTree *ntree= ptr->id.data; rctf *butr= &node->butr; @@ -1966,7 +1966,7 @@ static void node_texture_buts_image(uiLayout *layout, PointerRNA *ptr) static void node_texture_buts_output(uiLayout *layout, PointerRNA *ptr) { - uiBlock *block= uiLayoutFreeBlock(layout); + uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; uiBut *bt; diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index 72cbacd9b6d..70f3cc955b8 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -72,7 +72,7 @@ static void sequencer_panel_view_properties(const bContext *C, Panel *pa) { uiBlock *block; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL); } @@ -82,7 +82,7 @@ static void sequencer_panel_properties(const bContext *C, Panel *pa) { uiBlock *block; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_sequencer_panel_events, NULL); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 161b73032f5..2ce7da4c073 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -152,8 +152,9 @@ typedef struct { /* is used for both read and write... */ -static void v3d_editvertex_buts(const bContext *C, uiBlock *block, View3D *v3d, Object *ob, float lim) +static void v3d_editvertex_buts(const bContext *C, uiLayout *layout, View3D *v3d, Object *ob, float lim) { + uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL; MDeformVert *dvert=NULL; TransformProperties *tfp= v3d->properties_storage; float median[5], ve_median[5]; @@ -497,12 +498,15 @@ static void validate_bonebutton_cb(bContext *C, void *bonev, void *namev) } #endif -static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float lim) +static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { + uiBlock *block= uiLayoutGetBlock(layout); bArmature *arm; bPoseChannel *pchan; Bone *bone= NULL; TransformProperties *tfp= v3d->properties_storage; + PointerRNA pchanptr; + uiLayout *row; arm = ob->data; if (!arm || !ob->pose) return; @@ -516,7 +520,15 @@ static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float uiDefBut(block, LABEL, 0, "No Bone Active", 0, 240, 100, 20, 0, 0, 0, 0, 0, ""); return; } + else { + row= uiLayoutRow(layout, 0); + RNA_pointer_create(&ob->id, &RNA_PoseChannel, pchan, &pchanptr); + uiItemL(row, "", ICON_BONE_DATA); + uiItemR(row, "", 0, &pchanptr, "name", 0); + } + uiLayoutAbsoluteBlock(layout); + if (pchan->rotmode == ROT_MODE_AXISANGLE) { float quat[4]; /* convert to euler, passing through quats... */ @@ -587,11 +599,14 @@ void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev) WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix } -static void v3d_editarmature_buts(uiBlock *block, View3D *v3d, Object *ob, float lim) +static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { + uiBlock *block= uiLayoutGetBlock(layout); bArmature *arm= ob->data; EditBone *ebone; TransformProperties *tfp= v3d->properties_storage; + uiLayout *row; + PointerRNA eboneptr; ebone= arm->edbo->first; @@ -603,6 +618,13 @@ static void v3d_editarmature_buts(uiBlock *block, View3D *v3d, Object *ob, float if (!ebone) return; + row= uiLayoutRow(layout, 0); + RNA_pointer_create(&arm->id, &RNA_EditBone, ebone, &eboneptr); + uiItemL(row, "", ICON_BONE_DATA); + uiItemR(row, "", 0, &eboneptr, "name", 0); + + uiLayoutAbsoluteBlock(layout); + uiDefBut(block, LABEL, 0, "Head:", 0, 210, 100, 20, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); uiDefButF(block, NUM, B_ARMATUREPANEL1, "X:", 0, 190, 100, 19, ebone->head, -lim, lim, 10, 3, "X Location of the head end of the bone"); @@ -630,8 +652,9 @@ static void v3d_editarmature_buts(uiBlock *block, View3D *v3d, Object *ob, float } -static void v3d_editmetaball_buts(uiBlock *block, Object *ob, float lim) +static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim) { + uiBlock *block= uiLayoutAbsoluteBlock(layout); MetaElem *lastelem= NULL; // XXX if(lastelem) { @@ -1013,7 +1036,7 @@ static void view3d_panel_transform_spaces(const bContext *C, Panel *pa) int xco = 20, yco = 70; int index; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockBeginAlign(block); @@ -1095,6 +1118,8 @@ static void view3d_panel_object(const bContext *C, Panel *pa) //uiBut *bt; Object *ob= OBACT; TransformProperties *tfp; + PointerRNA obptr; + uiLayout *col, *row; float lim; if(ob==NULL) return; @@ -1104,9 +1129,6 @@ static void view3d_panel_object(const bContext *C, Panel *pa) v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties"); tfp= v3d->properties_storage; - block= uiLayoutFreeBlock(pa->layout); - uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); - // XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) { @@ -1120,17 +1142,29 @@ static void view3d_panel_object(const bContext *C, Panel *pa) lim= 10000.0f*MAX2(1.0, v3d->grid); + block= uiLayoutGetBlock(pa->layout); + uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); + + col= uiLayoutColumn(pa->layout, 0); + row= uiLayoutRow(col, 0); + RNA_id_pointer_create(&ob->id, &obptr); + uiItemL(row, "", ICON_OBJECT_DATA); + uiItemR(row, "", 0, &obptr, "name", 0); + if(ob==obedit) { - if(ob->type==OB_ARMATURE) v3d_editarmature_buts(block, v3d, ob, lim); - if(ob->type==OB_MBALL) v3d_editmetaball_buts(block, ob, lim); - else v3d_editvertex_buts(C, block, v3d, ob, lim); + if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, v3d, ob, lim); + if(ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob, lim); + else v3d_editvertex_buts(C, col, v3d, ob, lim); } else if(ob->mode & OB_MODE_POSE) { - v3d_posearmature_buts(block, v3d, ob, lim); + v3d_posearmature_buts(col, v3d, ob, lim); } else { BoundBox *bb = NULL; - + + uiLayoutAbsoluteBlock(col); + + block= uiLayoutAbsoluteBlock(col); uiDefBut(block, LABEL, 0, "Location:", 0, 300, 100, 20, 0, 0, 0, 0, 0, ""); uiBlockBeginAlign(block); uiDefButF(block, NUM, B_OBJECTPANEL, "X:", 0, 280, 120, 19, &(ob->loc[0]), -lim, lim, 100, 3, ""); @@ -1307,7 +1341,7 @@ static void view3d_panel_bonesketch_spaces(const bContext *C, Panel *pa) }; - block= uiLayoutFreeBlock(pa->layout); + block= uiLayoutAbsoluteBlock(pa->layout); uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); uiBlockBeginAlign(block); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 0d19a720cdb..a44e3743bb4 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1964,7 +1964,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) uiBlock *block; int a, xco=0, maxco=0, yco= 0; - block= uiLayoutFreeBlock(layout); + block= uiLayoutAbsoluteBlock(layout); uiBlockSetHandleFunc(block, do_view3d_header_buttons, NULL); if((sa->flag & HEADER_NO_PULLDOWN)==0) |