Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/object/object_transform.c
| Show First 20 Lines • Show All 1,388 Lines • ▼ Show 20 Lines | #endif | ||||
| float diff_mat[4][4]; | float diff_mat[4][4]; | ||||
| float inverse_diff_mat[4][4]; | float inverse_diff_mat[4][4]; | ||||
| /* recalculate all strokes | /* recalculate all strokes | ||||
| * (all layers are considered without evaluating lock attributes) */ | * (all layers are considered without evaluating lock attributes) */ | ||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| /* calculate difference matrix */ | /* calculate difference matrix */ | ||||
| BKE_gpencil_parent_matrix_get(depsgraph, obact, gpl, diff_mat); | BKE_gpencil_layer_transform_matrix_get(depsgraph, obact, gpl, diff_mat); | ||||
| /* undo matrix */ | /* undo matrix */ | ||||
| invert_m4_m4(inverse_diff_mat, diff_mat); | invert_m4_m4(inverse_diff_mat, diff_mat); | ||||
| LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | ||||
| LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { | ||||
| for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { | for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { | ||||
| float mpt[3]; | float mpt[3]; | ||||
| mul_v3_m4v3(mpt, inverse_diff_mat, &pt->x); | mul_v3_m4v3(mpt, inverse_diff_mat, &pt->x); | ||||
| sub_v3_v3(mpt, offset_local); | sub_v3_v3(mpt, offset_local); | ||||
| ▲ Show 20 Lines • Show All 658 Lines • Show Last 20 Lines | |||||