diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-18 07:43:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-18 07:43:55 +0300 |
commit | cc10d8653575e0d299b330521c98027f1dc8da36 (patch) | |
tree | e48d07b85d634119b9b1c52fe8dc480949eba7ba /source/blender/blenkernel | |
parent | 4719e7ec7a9c3095117bd2b0b08aeb1d72c62d98 (diff) |
DNA: rename Object.size -> scale
Resolves a common cause of confusion.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mball_tessellate.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 32 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/smoke.c | 8 |
7 files changed, 29 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 7e9fca5dcfa..86c71b5a9fb 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -193,7 +193,7 @@ void BKE_object_tfm_restore(struct Object *ob, void *obtfm_pt); typedef struct ObjectTfmProtectedChannels { float loc[3], dloc[3]; - float size[3], dscale[3]; + float scale[3], dscale[3]; float rot[3], drot[3]; float quat[4], dquat[4]; float rotAxis[3], drotAxis[3]; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 3a501f5acdc..b22ffce5300 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1090,7 +1090,7 @@ static void trackto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *tar float size[3], vec[3]; float totmat[3][3]; - /* Get size property, since ob->size is only the object's own relative size, not its global one */ + /* Get size property, since ob->scale is only the object's own relative size, not its global one */ mat4_to_size(size, cob->matrix); /* Clear the object's rotation */ diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index a9958d3d2c0..83881b24750 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1851,8 +1851,8 @@ void BKE_curve_bevel_make( bevcu = cu->bevobj->data; if (bevcu->ext1 == 0.0f && bevcu->ext2 == 0.0f) { ListBase bevdisp = {NULL, NULL}; - facx = cu->bevobj->size[0]; - facy = cu->bevobj->size[1]; + facx = cu->bevobj->scale[0]; + facy = cu->bevobj->scale[1]; if (for_render) { if (BLI_linklist_index(ob_cyclic_list, cu->bevobj) == -1) { diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index f392d4dac1a..daadc2e1fad 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -5715,7 +5715,7 @@ static void dynamic_paint_generate_bake_data_cb( /* Prepare surface normal directional scale to easily convert * brush intersection amount between global and local space */ float scaled_nor[3]; - mul_v3_v3v3(scaled_nor, temp_nor, ob->size); + mul_v3_v3v3(scaled_nor, temp_nor, ob->scale); bData->bNormal[index].normal_scale = len_v3(scaled_nor); } mul_mat3_m4_v3(ob->obmat, temp_nor); @@ -5752,7 +5752,7 @@ static void dynamic_paint_generate_bake_data_cb( /* Prepare surface normal directional scale to easily convert * brush intersection amount between global and local space */ float scaled_nor[3]; - mul_v3_v3v3(scaled_nor, temp_nor, ob->size); + mul_v3_v3v3(scaled_nor, temp_nor, ob->scale); bData->bNormal[index].normal_scale = len_v3(scaled_nor); } mul_mat3_m4_v3(ob->obmat, temp_nor); diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index 1cef2fffdba..df62d8b1041 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -1249,9 +1249,9 @@ void BKE_mball_polygonize(Depsgraph *depsgraph, Scene *scene, Object *ob, ListBa /* don't polygonize metaballs with too high resolution (base mball to small) * note: Eps was 0.0001f but this was giving problems for blood animation for durian, using 0.00001f */ - if (ob->size[0] > 0.00001f * (process.allbb.max[0] - process.allbb.min[0]) || - ob->size[1] > 0.00001f * (process.allbb.max[1] - process.allbb.min[1]) || - ob->size[2] > 0.00001f * (process.allbb.max[2] - process.allbb.min[2])) + if (ob->scale[0] > 0.00001f * (process.allbb.max[0] - process.allbb.min[0]) || + ob->scale[1] > 0.00001f * (process.allbb.max[1] - process.allbb.min[1]) || + ob->scale[2] > 0.00001f * (process.allbb.max[2] - process.allbb.min[2])) { polygonize(&process); 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); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 7834403b74b..79fbe4c4c62 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -225,7 +225,7 @@ static void smoke_set_domain_from_mesh(SmokeDomainSettings *sds, Object *ob, Mes } /* apply object scale */ for (i = 0; i < 3; i++) { - size[i] = fabsf(size[i] * ob->size[i]); + size[i] = fabsf(size[i] * ob->scale[i]); } copy_v3_v3(sds->global_size, size); copy_v3_v3(sds->dp0, min); @@ -239,21 +239,21 @@ static void smoke_set_domain_from_mesh(SmokeDomainSettings *sds, Object *ob, Mes /* define grid resolutions from longest domain side */ if (size[0] >= MAX2(size[1], size[2])) { scale = res / size[0]; - sds->scale = size[0] / fabsf(ob->size[0]); + sds->scale = size[0] / fabsf(ob->scale[0]); sds->base_res[0] = res; sds->base_res[1] = max_ii((int)(size[1] * scale + 0.5f), 4); sds->base_res[2] = max_ii((int)(size[2] * scale + 0.5f), 4); } else if (size[1] >= MAX2(size[0], size[2])) { scale = res / size[1]; - sds->scale = size[1] / fabsf(ob->size[1]); + sds->scale = size[1] / fabsf(ob->scale[1]); sds->base_res[0] = max_ii((int)(size[0] * scale + 0.5f), 4); sds->base_res[1] = res; sds->base_res[2] = max_ii((int)(size[2] * scale + 0.5f), 4); } else { scale = res / size[2]; - sds->scale = size[2] / fabsf(ob->size[2]); + sds->scale = size[2] / fabsf(ob->scale[2]); sds->base_res[0] = max_ii((int)(size[0] * scale + 0.5f), 4); sds->base_res[1] = max_ii((int)(size[1] * scale + 0.5f), 4); sds->base_res[2] = res; |