bpy.context.active_gpencil_frame 属性表示当前活跃的 Grease Pencil 帧。
bpy.types.GPencilFrame
您可以使用以下代码来访问当前活跃的 Grease Pencil 帧:
active_frame = bpy.context.active_gpencil_frame
以下示例将当前活跃的 Grease Pencil 帧的持续时间设置为 50 帧:
import bpy
active_frame = bpy.context.active_gpencil_frame
active_frame.frame_duration = 50
bpy.context.scene.grease_pencil - 当前场景中的 Grease Pencil 对象。bpy.types.GPencilFrame.frame_duration - Grease Pencil 帧的持续时间。bpy.types.GPencilFrame.copy() - 将当前帧复制到另一个帧。bpy.types.GPencilFrame.delete() - 删除当前帧。bpy.types.GPencilFrame.duplicate() - 复制当前帧并将其插入到序列中。bpy.types.GPencilFrame.interpolate() - 在两帧之间插入一个新帧。bpy.types.GPencilFrame.keyframe_insert() - 插入一个关键帧。bpy.context.active_gpencil_frame 属性提供了快速访问当前活跃的 Grease Pencil 帧的方法,使您能够轻松地进行编辑和操作。