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>2014-09-01 14:09:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-01 15:01:11 +0400
commite8f3fa99de8196a36736381b03015689492137bd (patch)
treef02e6a039cf55792053999a41220fbcbc8eaec59 /source/blender/blenkernel/intern/mball.c
parentd91916725d0d20f95c6d4c069428bd1076680087 (diff)
Support more object types scene-scale (on creation)
- lamp - camera - font - empty & effector Also fix inconsistency with apply transform (modified shape-keys for meshes but not curve/lattice)
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r--source/blender/blenkernel/intern/mball.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 5a045606d15..453c6df6e3b 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -2442,6 +2442,30 @@ bool BKE_mball_center_bounds(MetaBall *mb, float r_cent[3])
return 0;
}
+void BKE_mball_transform(MetaBall *mb, float mat[4][4])
+{
+ MetaElem *me;
+ float quat[4];
+ const float scale = mat4_to_scale(mat);
+ const float scale_sqrt = sqrtf(scale);
+
+ mat4_to_quat(quat, mat);
+
+ for (me = mb->elems.first; me; me = me->next) {
+ mul_m4_v3(mat, &me->x);
+ mul_qt_qtqt(me->quat, quat, me->quat);
+ me->rad *= scale;
+ /* hrmf, probably elems shouldn't be
+ * treating scale differently - campbell */
+ if (!MB_TYPE_SIZE_SQUARED(me->type)) {
+ mul_v3_fl(&me->expx, scale);
+ }
+ else {
+ mul_v3_fl(&me->expx, scale_sqrt);
+ }
+ }
+}
+
void BKE_mball_translate(MetaBall *mb, const float offset[3])
{
MetaElem *ml;