Bugfix #4329
New "Dimension" button: when using TAB to cycle over buttons, the dimension event was sent multiple times, accumulating scaling. The code was also not prepared to handle multiple changes at one event. Also: added object_get_boundbox(Object *ob) in BKE_object.h, so the code now really supports most primitives in Blender.
This commit is contained in:
@@ -3346,20 +3346,11 @@ static void draw_box(float vec[8][3])
|
||||
glEnd();
|
||||
}
|
||||
|
||||
/* uses boundbox, function used by Ketsji */
|
||||
void get_local_bounds(Object *ob, float *centre, float *size)
|
||||
{
|
||||
BoundBox *bb= NULL;
|
||||
/* uses boundbox, function used by Ketsji */
|
||||
BoundBox *bb= object_get_boundbox(ob);
|
||||
|
||||
if(ob->type==OB_MESH) {
|
||||
bb = mesh_get_bb(ob->data);
|
||||
}
|
||||
else if ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT) {
|
||||
bb= ( (Curve *)ob->data )->bb;
|
||||
}
|
||||
else if(ob->type==OB_MBALL) {
|
||||
bb= ob->bb;
|
||||
}
|
||||
if(bb==NULL) {
|
||||
centre[0]= centre[1]= centre[2]= 0.0;
|
||||
VECCOPY(size, ob->size);
|
||||
|
||||
Reference in New Issue
Block a user