Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_convert_object.c
| Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | if (ob->parent || constinv) { | ||||
| /* Get the effect of parenting, and/or certain constraints. | /* Get the effect of parenting, and/or certain constraints. | ||||
| * NOTE: some Constraints, and also Tracking should never get this | * NOTE: some Constraints, and also Tracking should never get this | ||||
| * done, as it doesn't work well. | * done, as it doesn't work well. | ||||
| */ | */ | ||||
| BKE_object_to_mat3(ob, obmtx); | BKE_object_to_mat3(ob, obmtx); | ||||
| copy_m3_m4(totmat, ob->obmat); | copy_m3_m4(totmat, ob->obmat); | ||||
| invert_m3_m3(obinv, totmat); | invert_m3_m3(obinv, totmat); | ||||
| mul_m3_m3m3(td->smtx, obmtx, obinv); | mul_m3_m3m3(td->smtx, obmtx, obinv); | ||||
| /* If the object scale is zero on any axis, this might result in a zero matrix. | |||||
| * In this case, the transformation would not do anything. This makes sure that | |||||
| * we can still perform the transformation, even if one of the axis of the scale | |||||
| * is zero. */ | |||||
| if (is_zero_m3(td->smtx)) { | |||||
| unit_m3(td->smtx); | |||||
| unit_m3(td->mtx); | |||||
| } | |||||
| else { | |||||
| invert_m3_m3(td->mtx, td->smtx); | invert_m3_m3(td->mtx, td->smtx); | ||||
| } | } | ||||
| } | |||||
| else { | else { | ||||
| /* no conversion to/from dataspace */ | /* no conversion to/from dataspace */ | ||||
| unit_m3(td->smtx); | unit_m3(td->smtx); | ||||
| unit_m3(td->mtx); | unit_m3(td->mtx); | ||||
| } | } | ||||
| } | } | ||||
| static void trans_object_base_deps_flag_prepare(ViewLayer *view_layer) | static void trans_object_base_deps_flag_prepare(ViewLayer *view_layer) | ||||
| ▲ Show 20 Lines • Show All 699 Lines • Show Last 20 Lines | |||||