Compare commits

...

2 Commits

Author SHA1 Message Date
pullusb d3e4072564 wip copy-move keys 2024-11-14 19:09:52 +01:00
pullusb 63f377d7d1 Fix material picker keymap 2024-11-14 18:02:24 +01:00
3 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,7 @@ class GPTB_OT_duplicate_send_to_layer(Operator) :
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
return context.object and context.object.type == 'GREASEPENCIL'\ 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) # 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): for f in reversed(to_replace):
target_layer.frames.remove(f) target_layer.frames.remove(f)
# FIXME : need to createa a dedicated function to copy a frame
## Copy original frames ## Copy original frames
for f in selected_frames: for f in selected_frames:
target_layer.frames.copy(f) target_layer.frames.copy(f)
@ -131,7 +132,7 @@ def unregister_keymaps():
def menu_duplicate_and_send_to_layer(self, context): 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_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='Move Keys To Layer').delete_source = True
self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer') self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer')

View File

@ -165,7 +165,7 @@ class GPTB_OT_move_material_to_layer(Operator) :
# def menu_duplicate_and_send_to_layer(self, context): # 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_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='Move Keys To Layer').delete_source = True
# self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer') # self.layout.operator('gp.duplicate_send_to_layer', text='Copy Keys To Layer')

View File

@ -290,9 +290,8 @@ class GP_OT_pick_closest_material(Operator):
addon_keymaps = [] addon_keymaps = []
def register_keymaps(): def register_keymaps():
addon = bpy.context.window_manager.keyconfigs.addon addon = bpy.context.window_manager.keyconfigs.addon
# km = addon.keymaps.new(name = "Grease Pencil Stroke Paint (Draw brush)", space_type = "EMPTY", region_type='WINDOW')
# km = addon.keymaps.new(name = "Grease Pencil Paint Mode", space_type = "EMPTY", region_type='WINDOW') # km = addon.keymaps.new(name = "Grease Pencil Paint Mode", space_type = "EMPTY", region_type='WINDOW')
km = addon.keymaps.new(name = "Grease Pencil Stroke Paint (Fill)", space_type = "EMPTY", region_type='WINDOW') km = addon.keymaps.new(name = "Grease Pencil Fill Tool", space_type = "EMPTY", region_type='WINDOW')
kmi = km.keymap_items.new( kmi = km.keymap_items.new(
# name="", # name="",
idname="gp.pick_closest_material", idname="gp.pick_closest_material",