Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_generics.c
| Show First 20 Lines • Show All 2,139 Lines • ▼ Show 20 Lines | for (int i = 0; i < tc->data_len; i++) { | ||||
| } | } | ||||
| else { | else { | ||||
| add_v3_v3(partial, tc->data[i].center); | add_v3_v3(partial, tc->data[i].center); | ||||
| } | } | ||||
| total++; | total++; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| for (int i = 0; i < tc->mirror.data_len; i++) { | |||||
| if (tc->mirror.data[i].flag & TD_SELECTED) { | |||||
| if (!(tc->mirror.data[i].flag & TD_NOCENTER)) { | |||||
| if (tc->use_local_mat) { | |||||
| float v[3]; | |||||
| mul_v3_m4v3(v, tc->mat, tc->mirror.data[i].center); | |||||
| add_v3_v3(partial, v); | |||||
| } | |||||
| else { | |||||
| add_v3_v3(partial, tc->mirror.data[i].center); | |||||
| } | |||||
| total++; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| if (total) { | if (total) { | ||||
| mul_v3_fl(partial, 1.0f / (float)total); | mul_v3_fl(partial, 1.0f / (float)total); | ||||
| } | } | ||||
| copy_v3_v3(r_center, partial); | copy_v3_v3(r_center, partial); | ||||
| } | } | ||||
| void calculateCenterBound(TransInfo *t, float r_center[3]) | void calculateCenterBound(TransInfo *t, float r_center[3]) | ||||
| Show All 12 Lines | for (int i = 0; i < tc->data_len; i++) { | ||||
| } | } | ||||
| else { | else { | ||||
| minmax_v3v3_v3(min, max, tc->data[i].center); | minmax_v3v3_v3(min, max, tc->data[i].center); | ||||
| } | } | ||||
| changed = true; | changed = true; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| for (int i = 0; i < tc->mirror.data_len; i++) { | |||||
| if (tc->mirror.data[i].flag & TD_SELECTED) { | |||||
| if (!(tc->mirror.data[i].flag & TD_NOCENTER)) { | |||||
| if (tc->use_local_mat) { | |||||
| float v[3]; | |||||
| mul_v3_m4v3(v, tc->mat, tc->mirror.data[i].center); | |||||
| minmax_v3v3_v3(min, max, v); | |||||
| } | |||||
| else { | |||||
| minmax_v3v3_v3(min, max, tc->mirror.data[i].center); | |||||
| } | |||||
| changed = true; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| if (changed) { | if (changed) { | ||||
| mid_v3_v3v3(r_center, min, max); | mid_v3_v3v3(r_center, min, max); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * \param select_only: only get active center from data being transformed. | * \param select_only: only get active center from data being transformed. | ||||
| ▲ Show 20 Lines • Show All 390 Lines • Show Last 20 Lines | |||||