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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-26 00:20:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-26 00:20:00 +0300
commit0bef9d9c926f682eb29a9c016346901784cb4cc5 (patch)
treee278469b9b7503ff351cb4fa32e2d55b14940301 /source/blender/editors
parent92bf8fa214e675b6ede0186cd15d07dd77f15700 (diff)
fix for camera rig that has locking on the camera but not the parent.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index bfc9f722994..1e3017214e2 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -2500,12 +2500,10 @@ static int flyApply(FlyInfo *fly)
interp_v3_v3v3(dvec, dvec_tmp, fly->dvec_prev, (1.0f/(1.0f+(time_redraw*5.0f))));
if (rv3d->persp==RV3D_CAMOB) {
- if (v3d->camera->protectflag & OB_LOCK_LOCX)
- dvec[0] = 0.0;
- if (v3d->camera->protectflag & OB_LOCK_LOCY)
- dvec[1] = 0.0;
- if (v3d->camera->protectflag & OB_LOCK_LOCZ)
- dvec[2] = 0.0;
+ Object *lock_ob= fly->root_parent ? fly->root_parent : fly->v3d->camera;
+ if (lock_ob->protectflag & OB_LOCK_LOCX) dvec[0] = 0.0;
+ if (lock_ob->protectflag & OB_LOCK_LOCY) dvec[1] = 0.0;
+ if (lock_ob->protectflag & OB_LOCK_LOCZ) dvec[2] = 0.0;
}
add_v3_v3v3(rv3d->ofs, rv3d->ofs, dvec);
@@ -2536,11 +2534,18 @@ static int flyApply(FlyInfo *fly)
mul_m4_m4m4(parent_mat, fly->root_parent->obmat, diff_mat);
object_apply_mat4(fly->root_parent, parent_mat);
- where_is_object(scene, fly->root_parent);
+ // where_is_object(scene, fly->root_parent);
+
+ Object *up= v3d->camera->parent;
+ while(up) {
+ DAG_id_flush_update(&up->id, OB_RECALC_OB);
+ up= up->parent;
+ }
copy_m4_m4(prev_view_mat, view_mat);
id_key= &fly->root_parent->id;
+
}
else {
float view_mat[4][4];