[Bf-blender-cvs] [fda754145ae] master: Annotations: Add Onion Skin support in VSE

Antonio Vazquez noreply at git.blender.org
Sat Apr 18 10:50:46 CEST 2020


Commit: fda754145ae5a63c95942ded70e9713f06a48818
Author: Antonio Vazquez
Date:   Sat Apr 18 10:47:25 2020 +0200
Branches: master
https://developer.blender.org/rBfda754145ae5a63c95942ded70e9713f06a48818

Annotations: Add Onion Skin support in VSE

This was removed in previous versions, but can be useful in some situations.

===================================================================

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_sequencer.py

===================================================================

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.



More information about the Bf-blender-cvs mailing list