diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-10-05 18:13:41 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-10-05 23:11:08 +0300 |
commit | 1ff51f30ad8c3a93bd4f1f6aefa87a0b2c18efe3 (patch) | |
tree | 8f61455122ad13bb3405aa8efa5eff22f8d42b78 /source/blender | |
parent | bfeb64d62047008f145a5e347bead34995e6be81 (diff) |
GPencil: Use stroke function for convert points
The stroke function is faster because the matrix
is inverted only once.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 2680c4e91f7..ae971dcb2ed 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1134,11 +1134,9 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* reproject to plane (only in 3d space) */ gpencil_reproject_toplane(p, gps); - pt = gps->points; - for (int i = 0; i < gps->totpoints; i++, pt++) { - /* if parented change position relative to parent object */ - gpencil_world_to_object_space_point(depsgraph, obact, gpl, pt); - } + + /* Change position relative to object. */ + gpencil_world_to_object_space(depsgraph, obact, gpl, gps); /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ if ((!is_depth) && @@ -1301,7 +1299,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* reproject to plane (only in 3d space) */ gpencil_reproject_toplane(p, gps); - /* change position relative to parent object */ + /* Change position relative to parent object. */ gpencil_world_to_object_space(depsgraph, obact, gpl, gps); /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ if ((!is_depth) && (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera)) { |