Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-11-28 21:19:01 +0300
committerAntonioya <blendergit@gmail.com>2018-11-28 21:19:53 +0300
commit303b49ea37b7e1be96f357436428806b950897c1 (patch)
treeefbbab9298dd67125a5cd220fff0c1a6527c09d8 /release/scripts/startup/bl_ui/properties_grease_pencil_common.py
parent565de7750b95db4296c421de9e96a8d334319e03 (diff)
Add Onion Skin support to Annotations
The old onion skinning used in 2.7x has been ported and converted to 2.8. Only basic features have been included. For more advanced onion skin features, use grease pencil objects. Onion Skin is supported in View 3D and Sequencer.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_grease_pencil_common.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py48
1 files changed, 48 insertions, 0 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 b18254a9102..ff294e7d922 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -779,6 +779,54 @@ class AnnotationDataPanel:
row.operator("gpencil.active_frame_delete", text="", icon='X')
+class AnnotationOnionSkin:
+ bl_label = "Onion Skin"
+ bl_region_type = 'UI'
+ bl_options = {'DEFAULT_CLOSED'}
+
+ @classmethod
+ def poll(cls, context):
+ # Show this panel as long as someone that might own this exists
+ # AND the owner isn't an object (e.g. GP Object)
+ if context.gpencil_data_owner is None:
+ return False
+ elif type(context.gpencil_data_owner) is bpy.types.Object:
+ return False
+ else:
+ gpl = context.active_gpencil_layer
+ if gpl is None:
+ return False
+
+ return True
+
+ @staticmethod
+ def draw_header(self, context):
+ gpl = context.active_gpencil_layer
+ self.layout.prop(gpl, "use_annotation_onion_skinning", text="")
+
+ @staticmethod
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_decorate = False
+
+ gpl = context.active_gpencil_layer
+ col = layout.column()
+ split = col.split(factor=0.5)
+ split.active = gpl.use_annotation_onion_skinning
+
+ # - Before Frames
+ sub = split.column(align=True)
+ row = sub.row(align=True)
+ row.prop(gpl, "annotation_onion_before_color", text="")
+ sub.prop(gpl, "annotation_onion_before_range", text="Before")
+
+ # - After Frames
+ sub = split.column(align=True)
+ row = sub.row(align=True)
+ row.prop(gpl, "annotation_onion_after_color", text="")
+ sub.prop(gpl, "annotation_onion_after_range", text="After")
+
+
class GreasePencilOnionPanel:
@staticmethod
def draw_settings(layout, gp):