52 lines
1.4 KiB
Python
52 lines
1.4 KiB
Python
|
import bpy
|
||
|
|
||
|
class GP_PT_interpolate(bpy.types.Panel):
|
||
|
bl_label = "Interpolate"
|
||
|
bl_category = "Gpencil"
|
||
|
bl_space_type = 'VIEW_3D'
|
||
|
bl_region_type = 'UI'
|
||
|
|
||
|
@classmethod
|
||
|
def poll(cls, context):
|
||
|
return context.object and context.object.type == 'GPENCIL'
|
||
|
|
||
|
def draw(self, context):
|
||
|
settings = bpy.context.scene.gp_interpo_settings
|
||
|
|
||
|
layout = self.layout
|
||
|
col = layout.column(align=False)
|
||
|
|
||
|
if settings.mode == 'FRAME':
|
||
|
prev_icon, next_icon = 'FRAME_PREV', 'FRAME_NEXT'
|
||
|
else:
|
||
|
prev_icon, next_icon = 'PREV_KEYFRAME', 'NEXT_KEYFRAME'
|
||
|
|
||
|
|
||
|
row = col.row(align=True)
|
||
|
row.scale_x = 3
|
||
|
row.operator("gp.interpolate_stroke", text="", icon=prev_icon).next = False
|
||
|
row.operator("gp.interpolate_stroke", text="", icon=next_icon).next = True
|
||
|
# col.separator()
|
||
|
|
||
|
col.prop(settings, 'target_collection', text='Collection')
|
||
|
col.prop(settings, 'search_range')
|
||
|
col = layout.column(align=True)
|
||
|
|
||
|
row = col.row(align=True)
|
||
|
row.prop(settings, 'mode', expand=True)
|
||
|
|
||
|
if settings.mode == 'FRAME':
|
||
|
col.prop(settings, 'padding')
|
||
|
|
||
|
classes = (
|
||
|
GP_PT_interpolate,
|
||
|
)
|
||
|
|
||
|
def register():
|
||
|
for c in classes:
|
||
|
bpy.utils.register_class(c)
|
||
|
|
||
|
def unregister():
|
||
|
for c in reversed(classes) :
|
||
|
bpy.utils.unregister_class(c)
|