InsideDarkWeb.com

How can I calculate global coordinates for GPencilStrokePoint in Blender 2.8 and Python?

I have already tried by calculating:

point_global_co = grease_pencil_object.matrix_world @ point.co

But it gives very odd results.

Blender Asked by user82670 on November 19, 2021

1 Answers

One Answer

The following script prints the global point coordinates for every grease pencil object in the scene. The coordinates seem to be accurate, judging from basic tests.

import bpy


for obj in bpy.data.objects:
    if obj.type == "GPENCIL":
        print(f"n{obj.name}")
        for layer in obj.data.layers:
            for frame in layer.frames:
                for stroke in frame.strokes:
                    for point in stroke.points:
                        print(obj.matrix_world @ point.co)

Answered by Robert Gützkow on November 19, 2021

Add your own answers!

Related Questions

Animation Deformity Not working Right

0  Asked on February 13, 2021 by benjamin-roope

 

Scale by Volume of Object in Blender

1  Asked on February 12, 2021 by joe-crozier

 

Meshed and skinned rag doll

0  Asked on February 11, 2021 by anonymousgoat

 

Why isn’t addons_contribmodule in sys.path? (2.90)

0  Asked on February 11, 2021 by jabberwock

     

Need help with Rigify in Blender v2.83 not working

1  Asked on February 8, 2021 by crystal-kaulbars

     

How can I have Alpha 0 but only shows highlight

1  Asked on February 8, 2021 by wes-lee

     

Particle on XY plane (Not Z)?

3  Asked on February 7, 2021 by naresh-vijh

 

Transparent menus

0  Asked on February 7, 2021 by derek-francis

 

Plank texture in mesh

1  Asked on February 6, 2021 by sigmundr

   

Mixamo Animation Doesn’t Play

0  Asked on February 5, 2021 by blenderartist

     

bpy.ops.fluid.bake_all() always overwrites

0  Asked on February 5, 2021 by s-dre-works

   

Why am I getting pinching on my mesh?

2  Asked on February 5, 2021 by tin-vojnovic

 

3D Cursor Rotation?

2  Asked on February 3, 2021

 

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.