Created
January 5, 2023 00:20
-
-
Save blender8r/05c45eace1ce9e5db723aeb952bf003c to your computer and use it in GitHub Desktop.
Framework for accessing grease pencil data in Blender using Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bpy | |
| sel_obj = None | |
| sel_objs = bpy.context.selected_objects | |
| if sel_objs: | |
| sel_obj = sel_objs[0] | |
| if sel_obj and sel_obj.type=='GPENCIL': | |
| gpencil = sel_obj.data | |
| print(gpencil.is_stroke_vertex_mode) | |
| for gp_layer in gpencil.layers: | |
| for gp_frame in gp_layer.frames: | |
| for gp_stroke in gp_frame.strokes: | |
| for gp_point in gp_stroke.points: | |
| print(gp_point.co) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment