From d3e4072564f9c18f1725016170ff6aae409893c8 Mon Sep 17 00:00:00 2001 From: pullusb Date: Thu, 14 Nov 2024 19:09:52 +0100 Subject: [PATCH] wip copy-move keys --- OP_key_duplicate_send.py | 5 +++-- OP_material_move_to_layer.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OP_key_duplicate_send.py b/OP_key_duplicate_send.py index 95e6095..6be3e62 100644 --- a/OP_key_duplicate_send.py +++ b/OP_key_duplicate_send.py @@ -41,7 +41,7 @@ class GPTB_OT_duplicate_send_to_layer(Operator) : @classmethod def poll(cls, context): return context.object and context.object.type == 'GREASEPENCIL'\ - and context.space_data.bl_rna.identifier == 'SpaceDopeSheetEditor' and context.space_data.ui_mode == 'GREASEPENCIL' + and context.space_data.bl_rna.identifier == 'SpaceDopeSheetEditor' and context.space_data.ui_mode == 'GPENCIL' # history : bpy.props.StringProperty(default='', options={'SKIP_SAVE'}) # need to have a variable to store (to get it in self) @@ -67,6 +67,7 @@ class GPTB_OT_duplicate_send_to_layer(Operator) : for f in reversed(to_replace): target_layer.frames.remove(f) + # FIXME : need to createa a dedicated function to copy a frame ## Copy original frames for f in selected_frames: target_layer.frames.copy(f) @@ -131,7 +132,7 @@ def unregister_keymaps(): def menu_duplicate_and_send_to_layer(self, context): - if context.space_data.ui_mode == 'GREASEPENCIL': + if context.space_data.ui_mode == 'GPENCIL': self.layout.operator_context = 'INVOKE_REGION_WIN' self.layout.operator('gp.duplicate_send_to_layer', text='Move Keys To Layer').delete_source = True self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer') diff --git a/OP_material_move_to_layer.py b/OP_material_move_to_layer.py index dcbd719..a82e0e6 100644 --- a/OP_material_move_to_layer.py +++ b/OP_material_move_to_layer.py @@ -165,7 +165,7 @@ class GPTB_OT_move_material_to_layer(Operator) : # def menu_duplicate_and_send_to_layer(self, context): -# if context.space_data.ui_mode == 'GREASEPENCIL': +# if context.space_data.ui_mode == 'GPENCIL': # self.layout.operator_context = 'INVOKE_REGION_WIN' # self.layout.operator('gp.duplicate_send_to_layer', text='Move Keys To Layer').delete_source = True # self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer')