Page MenuHome
Paste P1113

Fix for T69799
ActivePublic

Authored by Campbell Barton (campbellbarton) on Sep 23 2019, 6:43 AM.
commit c768c318cbef764882fc75e17db0fd129159fd0c
Author: mano-wii <germano.costa@ig.com.br>
Date: Mon Sep 23 13:57:02 2019 +1000
Fix T69799: Glitch when moving an object the view is locked to
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index b90fff29a84..b0f329d0fdc 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -728,14 +728,18 @@ enum {
T_EDIT = 1 << 1,
T_POSE = 1 << 2,
T_TEXTURE = 1 << 3,
- /** Transforming the camera while in camera view. */
+ /**
+ * Transforming the 3D view.
+ * Either transforming the camera or when the view is locked to an object that's transformed.
+ */
T_CAMERA = 1 << 4,
/** Transforming the 3D cursor. */
T_CURSOR = 1 << 5,
/** Transform points, having no rotation/scale. */
T_POINTS = 1 << 6,
- /* empty slot - (1 << 7) */
+ /** Transforming the view (not in camera). */
+ T_CAMERA_XFORM = 1 << 7,
/** restrictions flags */
T_NO_CONSTRAINT = 1 << 8,
diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c
index 67bb132972e..d257af8c5ac 100644
--- a/source/blender/editors/transform/transform_convert.c
+++ b/source/blender/editors/transform/transform_convert.c
@@ -2724,6 +2724,9 @@ void createTransData(bContext *C, TransInfo *t)
t->flag |= T_CAMERA;
}
}
+ else if (v3d->ob_centre && v3d->ob_centre->id.tag & LIB_TAG_DOIT) {
+ t->flag |= T_CAMERA_XFORM;
+ }
}
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 76f699e3dc4..c813dfd73a4 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -2274,7 +2274,7 @@ void calculateCenter(TransInfo *t)
if ((t->flag & T_OBJECT) && (t->flag & T_OVERRIDE_CENTER) == 0) {
if (t->spacetype == SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) {
- if (t->flag & T_CAMERA) {
+ if (t->flag & (T_CAMERA | T_CAMERA_XFORM)) {
float axis[3];
/* persinv is nasty, use viewinv instead, always right */
copy_v3_v3(axis, t->viewinv[2]);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 571ce7a6bc2..4d710c99fe2 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -605,7 +605,7 @@ static void initSnappingMode(TransInfo *t)
}
if ((t->spacetype == SPACE_VIEW3D || t->spacetype == SPACE_IMAGE) && /* Only 3D view or UV */
- (t->flag & T_CAMERA) == 0) /* Not with camera selected in camera view */
+ (t->flag & (T_CAMERA | T_CAMERA_XFORM)) == 0) /* Not with camera selected in camera view */
{
setSnappingCallback(t);