I've been trying to add an empty keyframe to a grease pencil object using bpy.ops.gpencil.blank_frame_add
but I just can't make it work.
import bpy
bpy.ops.object.gpencil_add(align='WORLD', location=(0, 0, 0), scale=(1, 1, 1), type='EMPTY')
bpy.ops.gpencil.blank_frame_add(all_layers=True)
When I use the context menu draw>animation>Insert Blank Keyframe it works as it should, I only can't get it to work using the script.
What am I doing wrong?
Thanks!
bpy.ops.gpencil.active_frame_delete()
in the same structure work just fine. I've heard the bad habit part already, but as I am very new to scripting in Blender I started simple and dirty. Thank you for the suggestion, I'll try to dig deeper. $\endgroup$