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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-03-01 12:25:14 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-03-01 12:25:14 +0300
commit2a731adae7d481b258e551db30c640660e81b4ea (patch)
tree26c78f27bc2273d8c391040aca8ada133089aba0 /source/blender/blenkernel/intern/object.c
parent0451043045bb2c9a0194546a5d528dfc832b3c8b (diff)
Fix T62015: Duplicating object, rotating, pivot point not used
Was caused by another fix in the area, and root to the wrong though that transformation is only initialized from a fully evaluated dependency graph. The latter one is not a case when changing transformation mode. Solved by copying transform to an evaluated object.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ddfed90fd97..3c57a5f7086 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1855,6 +1855,30 @@ void BKE_object_tfm_protected_restore(Object *ob,
}
}
+void BKE_object_tfm_copy(Object *object_dst, const Object *object_src)
+{
+#define TFMCPY(_v) (object_dst->_v = object_src->_v)
+#define TFMCPY3D(_v) copy_v3_v3(object_dst->_v, object_src->_v)
+#define TFMCPY4D(_v) copy_v4_v4(object_dst->_v, object_src->_v)
+
+ TFMCPY3D(loc);
+ TFMCPY3D(dloc);
+ TFMCPY3D(scale);
+ TFMCPY3D(dscale);
+ TFMCPY3D(rot);
+ TFMCPY3D(drot);
+ TFMCPY4D(quat);
+ TFMCPY4D(dquat);
+ TFMCPY3D(rotAxis);
+ TFMCPY3D(drotAxis);
+ TFMCPY(rotAngle);
+ TFMCPY(drotAngle);
+
+#undef TFMCPY
+#undef TFMCPY3D
+#undef TFMCPY4D
+}
+
void BKE_object_to_mat3(Object *ob, float mat[3][3]) /* no parent */
{
float smat[3][3];