Annotations: Add Onion Skin support in VSE

This was removed in previous versions, but can be useful in some situations.
This commit is contained in:
Antonio Vazquez 2020-04-18 10:47:25 +02:00
parent 62103e7d42
commit fda754145a
2 changed files with 30 additions and 1 deletions

View File

@ -520,7 +520,7 @@ class AnnotationOnionSkin:
if gpl is None:
return False
return True
return True
def draw_header(self, context):
gpl = context.active_annotation_layer

View File

@ -29,6 +29,7 @@ from bpy.app.translations import (
)
from bl_ui.properties_grease_pencil_common import (
AnnotationDataPanel,
AnnotationOnionSkin,
)
from bl_ui.space_toolsystem_common import (
ToolActivePanelHelper,
@ -2157,6 +2158,33 @@ class SEQUENCER_PT_annotation(AnnotationDataPanel, SequencerButtonsPanel_Output,
# But, it should only show up when there are images in the preview region
class SEQUENCER_PT_annotation_onion(AnnotationOnionSkin, SequencerButtonsPanel_Output, Panel):
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
bl_category = "View"
@staticmethod
def has_preview(context):
st = context.space_data
return st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}
@classmethod
def poll(cls, context):
if context.annotation_data_owner is None:
return False
elif type(context.annotation_data_owner) is bpy.types.Object:
return False
else:
gpl = context.active_annotation_layer
if gpl is None:
return False
return cls.has_preview(context)
# NOTE: this is just a wrapper around the generic GP Panel
# But, it should only show up when there are images in the preview region
class SEQUENCER_PT_custom_props(SequencerButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
_context_path = "scene.sequence_editor.active_strip"
@ -2230,6 +2258,7 @@ classes = (
SEQUENCER_PT_view_safe_areas_center_cut,
SEQUENCER_PT_annotation,
SEQUENCER_PT_annotation_onion,
)
if __name__ == "__main__": # only for live edit.