[Bf-blender-cvs] [1ff51f30ad8] master: GPencil: Use stroke function for convert points
Antonio Vazquez
noreply at git.blender.org
Wed Oct 5 22:11:13 CEST 2022
Commit: 1ff51f30ad8c3a93bd4f1f6aefa87a0b2c18efe3
Author: Antonio Vazquez
Date: Wed Oct 5 17:13:41 2022 +0200
Branches: master
https://developer.blender.org/rB1ff51f30ad8c3a93bd4f1f6aefa87a0b2c18efe3
GPencil: Use stroke function for convert points
The stroke function is faster because the matrix
is inverted only once.
===================================================================
M source/blender/editors/gpencil/gpencil_paint.c
===================================================================
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)) {
More information about the Bf-blender-cvs
mailing list