diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 32 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 4 |
7 files changed, 33 insertions, 20 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 3aa7148d821..31642dad60d 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -109,8 +109,8 @@ struct BoundBox *BKE_object_boundbox_get(struct Object *ob); void BKE_object_dimensions_get(struct Object *ob, float vec[3]); void BKE_object_dimensions_set(struct Object *ob, const float *value); void BKE_object_boundbox_flag(struct Object *ob, int flag, int set); -void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3]); -int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]); +void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3], const short use_hidden); +int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3], const short use_hidden); /* sometimes min-max isn't enough, we need to loop over each point */ void BKE_object_foreach_display_point(struct Object *ob, float obmat[4][4], diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 16edbc3f0a9..00130dd3583 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -3114,7 +3114,8 @@ static void clampto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar copy_v3_v3(ownLoc, obmat[3]); INIT_MINMAX(curveMin, curveMax); - BKE_object_minmax(ct->tar, curveMin, curveMax); + /* XXX - don't think this is good calling this here - campbell */ + BKE_object_minmax(ct->tar, curveMin, curveMax, TRUE); /* get targetmatrix */ if (cu->path && cu->path->data) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 4f4ee3f8433..914e19bd1dc 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2234,7 +2234,7 @@ void BKE_object_dimensions_set(Object *ob, const float *value) } } -void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3]) +void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const short use_hidden) { BoundBox bb; float vec[3]; @@ -2284,14 +2284,23 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3]) break; case OB_ARMATURE: if (ob->pose) { + bArmature *arm = ob->data; bPoseChannel *pchan; + for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { - mul_v3_m4v3(vec, ob->obmat, pchan->pose_head); - minmax_v3v3_v3(min_r, max_r, vec); - mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail); - minmax_v3v3_v3(min_r, max_r, vec); + + if ((use_hidden == FALSE) && (PBONE_VISIBLE(arm, pchan->bone) == FALSE)) { + /* pass */ + } + else { + mul_v3_m4v3(vec, ob->obmat, pchan->pose_head); + minmax_v3v3_v3(min_r, max_r, vec); + mul_v3_m4v3(vec, ob->obmat, pchan->pose_tail); + minmax_v3v3_v3(min_r, max_r, vec); + + change = TRUE; + } } - change = TRUE; } break; case OB_MESH: @@ -2331,9 +2340,9 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3]) } } -int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3]) +int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_max[3], const short use_hidden) { - int ok = 0; + int ok = FALSE; if ((ob->transflag & OB_DUPLI) == 0) { return ok; } @@ -2343,7 +2352,10 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma lb = object_duplilist(scene, ob); for (dob = lb->first; dob; dob = dob->next) { - if (dob->no_draw == 0) { + if ((use_hidden == FALSE) && (dob->no_draw != 0)) { + /* pass */ + } + else { BoundBox *bb = BKE_object_boundbox_get(dob->ob); if (bb) { @@ -2354,7 +2366,7 @@ int BKE_object_minmax_dupli(Scene *scene, Object *ob, float r_min[3], float r_ma minmax_v3v3_v3(r_min, r_max, vec); } - ok = 1; + ok = TRUE; } } } diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index f943c83f4ed..9129d651d4d 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -759,7 +759,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) float min[3], max[3]; /* only bounds support */ INIT_MINMAX(min, max); - BKE_object_minmax_dupli(scene, ob, min, max); + BKE_object_minmax_dupli(scene, ob, min, max, TRUE); mid_v3_v3v3(cent, min, max); invert_m4_m4(ob->imat, ob->obmat); mul_m4_v3(ob->imat, cent); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index d6cf46363d3..72d2d67e081 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4111,7 +4111,7 @@ int PE_minmax(Scene *scene, float min[3], float max[3]) } if (!ok) { - BKE_object_minmax(ob, min, max); + BKE_object_minmax(ob, min, max, TRUE); ok= 1; } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8b8adb193bf..310630a65ad 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2072,7 +2072,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in continue; } - BKE_object_minmax(base->object, min, max); + BKE_object_minmax(base->object, min, max, FALSE); } } if (!onedone) { @@ -2218,8 +2218,8 @@ static int viewselected_exec(bContext *C, wmOperator *UNUSED(op)) } /* account for duplis */ - if (BKE_object_minmax_dupli(scene, base->object, min, max) == 0) - BKE_object_minmax(base->object, min, max); /* use if duplis not found */ + if (BKE_object_minmax_dupli(scene, base->object, min, max, FALSE) == 0) + BKE_object_minmax(base->object, min, max, FALSE); /* use if duplis not found */ ok = 1; } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 693c7c5c95d..93d70004b18 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1409,7 +1409,7 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL } else { if (scene->obedit) { - BKE_object_minmax(scene->obedit, min, max); + BKE_object_minmax(scene->obedit, min, max, FALSE); ok = TRUE; @@ -1419,7 +1419,7 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL else { for (base = FIRSTBASE; base; base = base->next) { if (TESTBASE(v3d, base)) { - BKE_object_minmax(base->object, min, max); + BKE_object_minmax(base->object, min, max, FALSE); base->lay |= locallay; base->object->lay = base->lay; ok = TRUE; |