diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-04-18 11:47:25 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-04-18 11:49:42 +0300 |
commit | fda754145ae5a63c95942ded70e9713f06a48818 (patch) | |
tree | 912732d4259fdcf4c937e8bc913d534b526304a1 | |
parent | 62103e7d420f128ba397e7f2ff57e0adf75a4871 (diff) |
Annotations: Add Onion Skin support in VSE
This was removed in previous versions, but can be useful in some situations.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 29 |
2 files changed, 30 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 5647f35383a..0f6a51ad2d0 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -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 diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index f0190e9ee13..0e2af8f8f2f 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -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. |