Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_data.c
| Show First 20 Lines • Show All 1,349 Lines • ▼ Show 20 Lines | if (!gpf_dst) { | ||||
| BLI_ghash_insert(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum), gpf_dst); | BLI_ghash_insert(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum), gpf_dst); | ||||
| } | } | ||||
| } | } | ||||
| /* Read all frames from merge layer and add strokes. */ | /* Read all frames from merge layer and add strokes. */ | ||||
| LISTBASE_FOREACH (bGPDframe *, gpf_src, &gpl_src->frames) { | LISTBASE_FOREACH (bGPDframe *, gpf_src, &gpl_src->frames) { | ||||
| /* Try to find frame in destination layer hash table. */ | /* Try to find frame in destination layer hash table. */ | ||||
| bGPDframe *gpf_dst = BLI_ghash_lookup(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum)); | bGPDframe *gpf_dst = BLI_ghash_lookup(gh_frames_dst, POINTER_FROM_INT(gpf_src->framenum)); | ||||
| /* Apply layer transformation. */ | |||||
| LISTBASE_FOREACH (bGPDstroke *, gps_src, &gpf_src->strokes) { | |||||
| for (int p = 0; p < gps_src->totpoints; p++) { | |||||
| bGPDspoint *pt = &gps_src->points[p]; | |||||
| mul_v3_m4v3(&pt->x, gpl_src->layer_mat, &pt->x); | |||||
| } | |||||
| } | |||||
| /* Add to tail all strokes. */ | /* Add to tail all strokes. */ | ||||
| if (gpf_dst) { | if (gpf_dst) { | ||||
| BLI_movelisttolist(&gpf_dst->strokes, &gpf_src->strokes); | BLI_movelisttolist(&gpf_dst->strokes, &gpf_src->strokes); | ||||
| } | } | ||||
| } | } | ||||
| /* Add Masks to destination layer. */ | /* Add Masks to destination layer. */ | ||||
| LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl_src->mask_layers) { | LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl_src->mask_layers) { | ||||
| ▲ Show 20 Lines • Show All 2,496 Lines • Show Last 20 Lines | |||||