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>2019-02-18 07:43:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-18 07:43:55 +0300
commitcc10d8653575e0d299b330521c98027f1dc8da36 (patch)
treee48d07b85d634119b9b1c52fe8dc480949eba7ba /source/blender/blenkernel/intern/object.c
parent4719e7ec7a9c3095117bd2b0b08aeb1d72c62d98 (diff)
DNA: rename Object.size -> scale
Resolves a common cause of confusion.
Diffstat (limited to 'source/blender/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 65883d48bf7..617b5f580b1 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -151,7 +151,7 @@ void BKE_object_workob_clear(Object *workob)
{
memset(workob, 0, sizeof(Object));
- workob->size[0] = workob->size[1] = workob->size[2] = 1.0f;
+ workob->scale[0] = workob->scale[1] = workob->scale[2] = 1.0f;
workob->dscale[0] = workob->dscale[1] = workob->dscale[2] = 1.0f;
workob->rotmode = ROT_MODE_EUL;
}
@@ -816,7 +816,7 @@ void BKE_object_init(Object *ob)
ob->col[0] = ob->col[1] = ob->col[2] = 1.0;
ob->col[3] = 1.0;
- ob->size[0] = ob->size[1] = ob->size[2] = 1.0;
+ ob->scale[0] = ob->scale[1] = ob->scale[2] = 1.0;
ob->dscale[0] = ob->dscale[1] = ob->dscale[2] = 1.0;
/* objects should default to having Euler XYZ rotations,
@@ -1306,7 +1306,7 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
copy_v3_v3(ob_tar->rotAxis, ob_src->rotAxis);
ob_tar->rotAngle = ob_src->rotAngle;
ob_tar->rotmode = ob_src->rotmode;
- copy_v3_v3(ob_tar->size, ob_src->size);
+ copy_v3_v3(ob_tar->scale, ob_src->scale);
}
/**
@@ -1712,7 +1712,7 @@ void BKE_object_obdata_size_init(struct Object *ob, const float size)
void BKE_object_scale_to_mat3(Object *ob, float mat[3][3])
{
float vec[3];
- mul_v3_v3v3(vec, ob->size, ob->dscale);
+ mul_v3_v3v3(vec, ob->scale, ob->dscale);
size_to_mat3(mat, vec);
}
@@ -1809,7 +1809,7 @@ void BKE_object_tfm_protected_backup(const Object *ob,
TFMCPY3D(loc);
TFMCPY3D(dloc);
- TFMCPY3D(size);
+ TFMCPY3D(scale);
TFMCPY3D(dscale);
TFMCPY3D(rot);
TFMCPY3D(drot);
@@ -1839,7 +1839,7 @@ void BKE_object_tfm_protected_restore(Object *ob,
}
if (protectflag & (OB_LOCK_SCALEX << i)) {
- ob->size[i] = obtfm->size[i];
+ ob->scale[i] = obtfm->scale[i];
ob->dscale[i] = obtfm->dscale[i];
}
@@ -1870,7 +1870,7 @@ void BKE_object_to_mat3(Object *ob, float mat[3][3]) /* no parent */
float rmat[3][3];
/*float q1[4];*/
- /* size */
+ /* scale */
BKE_object_scale_to_mat3(ob, smat);
/* rot */
@@ -2326,19 +2326,19 @@ void BKE_object_apply_mat4_ex(Object *ob, float mat[4][4], Object *parent, float
mul_m4_m4m4(rmat, imat, mat); /* get the parent relative matrix */
/* same as below, use rmat rather than mat */
- mat4_to_loc_rot_size(ob->loc, rot, ob->size, rmat);
+ mat4_to_loc_rot_size(ob->loc, rot, ob->scale, rmat);
}
else {
- mat4_to_loc_rot_size(ob->loc, rot, ob->size, mat);
+ mat4_to_loc_rot_size(ob->loc, rot, ob->scale, mat);
}
BKE_object_mat3_to_rot(ob, rot, use_compat);
sub_v3_v3(ob->loc, ob->dloc);
- if (ob->dscale[0] != 0.0f) ob->size[0] /= ob->dscale[0];
- if (ob->dscale[1] != 0.0f) ob->size[1] /= ob->dscale[1];
- if (ob->dscale[2] != 0.0f) ob->size[2] /= ob->dscale[2];
+ if (ob->dscale[0] != 0.0f) ob->scale[0] /= ob->dscale[0];
+ if (ob->dscale[1] != 0.0f) ob->scale[1] /= ob->dscale[1];
+ if (ob->dscale[2] != 0.0f) ob->scale[2] /= ob->dscale[2];
/* BKE_object_mat3_to_rot handles delta rotations */
}
@@ -2491,7 +2491,7 @@ void BKE_object_dimensions_set(Object *ob, const float value[3], int axis_mask)
for (int i = 0; i < 3; i++) {
if (((1 << i) & axis_mask) == 0) {
if (len[i] > 0.0f) {
- ob->size[i] = copysignf(value[i] / len[i], ob->size[i]);
+ ob->scale[i] = copysignf(value[i] / len[i], ob->scale[i]);
}
}
}
@@ -2563,7 +2563,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
if (changed == false) {
float size[3];
- copy_v3_v3(size, ob->size);
+ copy_v3_v3(size, ob->scale);
if ((ob->type == OB_EMPTY) || (ob->type == OB_GPENCIL)) {
mul_v3_fl(size, ob->empty_drawsize);
}
@@ -2752,7 +2752,7 @@ void *BKE_object_tfm_backup(Object *ob)
copy_v3_v3(obtfm->loc, ob->loc);
copy_v3_v3(obtfm->dloc, ob->dloc);
copy_v3_v3(obtfm->orig, ob->orig);
- copy_v3_v3(obtfm->size, ob->size);
+ copy_v3_v3(obtfm->size, ob->scale);
copy_v3_v3(obtfm->dscale, ob->dscale);
copy_v3_v3(obtfm->rot, ob->rot);
copy_v3_v3(obtfm->drot, ob->drot);
@@ -2776,7 +2776,7 @@ void BKE_object_tfm_restore(Object *ob, void *obtfm_pt)
copy_v3_v3(ob->loc, obtfm->loc);
copy_v3_v3(ob->dloc, obtfm->dloc);
copy_v3_v3(ob->orig, obtfm->orig);
- copy_v3_v3(ob->size, obtfm->size);
+ copy_v3_v3(ob->scale, obtfm->size);
copy_v3_v3(ob->dscale, obtfm->dscale);
copy_v3_v3(ob->rot, obtfm->rot);
copy_v3_v3(ob->drot, obtfm->drot);