diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2015-08-13 19:12:08 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-08-13 19:12:08 +0300 |
commit | 3fa0a1a5bc0ff28328930ee12608497262b25912 (patch) | |
tree | ad87ae294bdfbc8e24add38f97dee41222a27ab0 /source/blender/editors/space_view3d | |
parent | d2383ec6c07a298a290b83ba8347618e3b46c9d9 (diff) |
Add real boundbox support to lattice, and update armature one.
* draw lattice boundingboxes in 3dView [if "show_bounds" is used -- an option previously pretty useless for lattices]
* give proper values for lattice objects ".bound_box" in bpy
* give proper values for armature objects ".bound_box" in bpy
* lets users use "Dimensions" [in 3dView Transform panel] on lattices and armatures
* remove redundant calculations in "boundbox_armature()"
Armatures boundingboxes were already drawn in 3dView, if "show_bounds" was used.
Based on report T45735: Lattice's bounding_box doesn't update,
and a comment in code by @campbellbarton ("later we may want to add dimensions for lattice, armature etc too").
Revision: https://developer.blender.org/D1460
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index f8af238de14..f5cce277da1 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -7233,6 +7233,9 @@ static void draw_bounding_volume(Object *ob, char type) else if (ob->type == OB_ARMATURE) { bb = BKE_armature_boundbox_get(ob); } + else if (ob->type == OB_LATTICE) { + bb = BKE_lattice_boundbox_get(ob); + } else { const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f}; bb = &bb_local; diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 1f8a69adba0..1a6bbfe77bb 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -992,9 +992,8 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) if (ptr->type == &RNA_Object) { Object *ob = ptr->data; - /* dimensions and material support just happen to be the same checks - * later we may want to add dimensions for lattice, armature etc too */ - if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) { + /* dimensions and editmode just happen to be the same checks */ + if (OB_TYPE_SUPPORT_EDITMODE(ob->type)) { uiItemR(layout, ptr, "dimensions", 0, NULL, ICON_NONE); } } |