While in edit mode of a grease pencil object, the tooltip of "select all" says that the corresponding python command would be bpy.ops.gpencil.select_all(action='SELECT')
.
This is also confirmed by the Info Editor.
But when I try to run this command while in edit mode (either from the Python Console or in a script), it doesn't select anything.
For example this code doesn't work (if the vertices weren't already selected):
import bpy
# change to edit mode
bpy.ops.gpencil.editmode_toggle()
# select all vertices (doesn't work)
bpy.ops.gpencil.select_all(action="SELECT")
# move the selected vertices
bpy.ops.transform.translate(value=(-0.5, 0, 0), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)
What am I doing wrong?
I use blender 2.90.1 (same behavior occurred in blender 2.91.0 Alpha).
points
of a grease pencil's stroke using the API. $\endgroup$