gp_interpolate/properties.py

58 lines
1.8 KiB
Python
Raw Normal View History

import bpy
from bpy.props import EnumProperty, IntProperty, FloatProperty, BoolProperty, PointerProperty
from bpy.types import PropertyGroup
class GP_PG_interpolate_settings(PropertyGroup):
# check_only : BoolProperty(
# name="Dry run mode (Check only)",
# description="Do not change anything, just print the messages",
# default=False, options={'HIDDEN'})
search_range : FloatProperty(
name="Search Range",
description="Search range size when points are out of mesh",
default=0.05, precision=2, step=3, options={'HIDDEN'})
mode : EnumProperty(
name='Mode',
# Combined ?markers ?
items= (
('FRAME', 'Frame', 'prev/next scene frame depending on the padding options', 0),
('GPKEY', 'GP Key', 'prev/next Grease pencil key', 1) ,
('RIGKEY', 'Rig Key', 'prev/next armatures keys in targeted collection', 2),
),
default='FRAME',
description='Select how the previous or next frame should be chosen'
)
padding : IntProperty(name='Padding',
description='Number of frame to jump backward or forward',
default=2,
min=1)
target_collection : PointerProperty(
type=bpy.types.Collection,
description='Target collection to check armature keyframes from',
# placeholder='Collection'
)
classes = (
GP_PG_interpolate_settings,
)
def register():
for c in classes:
bpy.utils.register_class(c)
bpy.types.Scene.gp_interpo_settings = bpy.props.PointerProperty(type=GP_PG_interpolate_settings)
def unregister():
for c in reversed(classes):
bpy.utils.unregister_class(c)
del bpy.types.Scene.gp_interpo_settings
if __name__ == "__main__":
register()