complete first version
parent
12e8ab523c
commit
0b76c96175
|
@ -1,19 +1,42 @@
|
||||||
from gp_interpolate.interpolate_strokes import operators, properties
|
bl_info = {
|
||||||
|
"name": "gp interpolate",
|
||||||
|
"author": "Christophe Seux, Samuel Bernou",
|
||||||
|
"version": (0, 1, 0),
|
||||||
|
"blender": (3, 6, 0),
|
||||||
|
"location": "",
|
||||||
|
"description": "Interpolate Grease pencil strokes",
|
||||||
|
"warning": "",
|
||||||
|
"wiki_url": "",
|
||||||
|
"tracker_url": "",
|
||||||
|
"category": "Animation"}
|
||||||
|
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
import importlib
|
||||||
|
|
||||||
|
# Ensure the name of the module in python import
|
||||||
|
module_name = Path(__file__).parent.name
|
||||||
|
sys.modules.update({'gp_interpolate': importlib.import_module(module_name)})
|
||||||
|
|
||||||
|
|
||||||
|
from gp_interpolate import interpolate_strokes, ui
|
||||||
|
|
||||||
modules = (
|
modules = (
|
||||||
properties,
|
interpolate_strokes,
|
||||||
operators,
|
ui,
|
||||||
)
|
)
|
||||||
|
|
||||||
if "bpy" in locals():
|
# if "bpy" in locals():
|
||||||
import importlib
|
# import importlib
|
||||||
|
|
||||||
for mod in modules:
|
# for mod in modules:
|
||||||
importlib.reload(mod)
|
# importlib.reload(mod)
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
print('Register gp_interpolate')
|
||||||
for mod in modules:
|
for mod in modules:
|
||||||
mod.register()
|
mod.register()
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
from gp_interpolate.interpolate_strokes import operators, properties
|
||||||
|
|
||||||
|
modules = (
|
||||||
|
properties,
|
||||||
|
operators,
|
||||||
|
)
|
||||||
|
|
||||||
|
if "bpy" in locals():
|
||||||
|
import importlib
|
||||||
|
|
||||||
|
for mod in modules:
|
||||||
|
importlib.reload(mod)
|
||||||
|
|
||||||
|
import bpy
|
||||||
|
|
||||||
|
def register():
|
||||||
|
for mod in modules:
|
||||||
|
mod.register()
|
||||||
|
|
||||||
|
def unregister():
|
||||||
|
for mod in reversed(modules):
|
||||||
|
mod.unregister()
|
|
@ -0,0 +1,51 @@
|
||||||
|
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)
|
Loading…
Reference in New Issue