diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-05-30 16:42:38 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-05-30 16:42:38 +0300 |
commit | a775389823514c936726f26457b23cb9c6c02eea (patch) | |
tree | dd8fe218284e34404623ace9731c931cc11a85cd /source/blender/blenkernel/intern | |
parent | 6a59cf053091dc45e0f94b829bee6c34cf940534 (diff) | |
parent | 70171cdfdfd80329f31844bf2b31cfc4dc1376ca (diff) |
Merge branch 'blender-v3.2-release'
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.cc | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 35b514ac1a0..f86e947910b 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -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); } diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc index dd22d64aee1..792474d30ea 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.cc +++ b/source/blender/blenkernel/intern/gpencil_geom.cc @@ -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. */ |