Merge branch 'blender-v3.2-release'

This commit is contained in:
Antonio Vazquez 2022-05-30 15:42:38 +02:00
commit a775389823
2 changed files with 9 additions and 2 deletions

View File

@ -867,7 +867,7 @@ bGPDstroke *BKE_gpencil_stroke_duplicate(bGPDstroke *gps_src,
if (dup_points) {
gps_dst->points = MEM_dupallocN(gps_src->points);
if ((gps_src->dvert != NULL) && (gps_src->dvert->totweight > 0)) {
if (gps_src->dvert != NULL) {
gps_dst->dvert = MEM_dupallocN(gps_src->dvert);
BKE_gpencil_stroke_weights_duplicate(gps_src, gps_dst);
}

View File

@ -4209,7 +4209,14 @@ bGPDstroke *BKE_gpencil_stroke_perimeter_from_view(struct RegionView3D *rv3d,
if (gps->totpoints == 0) {
return nullptr;
}
bGPDstroke *gps_temp = BKE_gpencil_stroke_duplicate(gps, true, false);
/* Duplicate only points and fill data. Weight and Curve are not needed. */
bGPDstroke *gps_temp = (bGPDstroke *)MEM_dupallocN(gps);
gps_temp->prev = gps_temp->next = nullptr;
gps_temp->triangles = (bGPDtriangle *)MEM_dupallocN(gps->triangles);
gps_temp->points = (bGPDspoint *)MEM_dupallocN(gps->points);
gps_temp->dvert = nullptr;
gps_temp->editcurve = nullptr;
const bool cyclic = ((gps_temp->flag & GP_STROKE_CYCLIC) != 0);
/* If Cyclic, add a new point. */