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:
authorTon Roosendaal <ton@blender.org>2006-06-14 12:50:41 +0400
committerTon Roosendaal <ton@blender.org>2006-06-14 12:50:41 +0400
commit8988a0de38dcf545447649ac778b145b2fb5e14a (patch)
tree494955a23de806932ba57a62ddd0585a3a3ad2cf /source/blender/blenkernel
parent4ed583ea8ab29bcfd421dbf694737abfad44eac0 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_object.h1
-rw-r--r--source/blender/blenkernel/intern/object.c18
2 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 37398ca3fcb..bbaf42a91b1 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -95,6 +95,7 @@ void where_is_object_simul(struct Object *ob);
void what_does_parent(struct Object *ob);
struct BoundBox *unit_boundbox(void);
void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
+struct BoundBox *object_get_boundbox(struct Object *ob);
void minmax_object(struct Object *ob, float *min, float *max);
void solve_tracking (struct Object *ob, float targetmat[][4]);
void solve_constraints (struct Object *ob, short obtype, void *obdata, float ctime);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index d4aa87ec87a..fdae3ca2667 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1753,6 +1753,22 @@ void boundbox_set_from_min_max(BoundBox *bb, float min[3], float max[3])
bb->vec[1][2]=bb->vec[2][2]=bb->vec[5][2]=bb->vec[6][2]= max[2];
}
+BoundBox *object_get_boundbox(Object *ob)
+{
+ BoundBox *bb= NULL;
+
+ 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;
+ }
+ return bb;
+}
+
void minmax_object(Object *ob, float *min, float *max)
{
BoundBox bb;
@@ -1768,7 +1784,7 @@ void minmax_object(Object *ob, float *min, float *max)
case OB_SURF:
cu= ob->data;
- if(cu->bb==0) tex_space_curve(cu);
+ if(cu->bb==NULL) tex_space_curve(cu);
bb= *(cu->bb);
for(a=0; a<8; a++) {