[Bf-blender-cvs] [24c35bbf417] greasepencil-object: UI: Change interpolate panel header

Antonio Vazquez noreply at git.blender.org
Tue Jul 4 17:28:05 CEST 2017


Commit: 24c35bbf4170e9fd3243443182464c35aec1739a
Author: Antonio Vazquez
Date:   Tue Jul 4 17:27:51 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB24c35bbf4170e9fd3243443182464c35aec1739a

UI: Change interpolate panel header

Rename the header and add some options to make UI cleaner

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.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 ec32ee9d96a..ac6cd63a182 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -226,7 +226,7 @@ class GreasePencilStrokeEditPanel:
 
 class GreasePencilInterpolatePanel:
     bl_space_type = 'VIEW_3D'
-    bl_label = "Interpolate Strokes"
+    bl_label = "Grease Pencil"
     bl_category = "Animation"
     bl_region_type = 'TOOLS'
 
@@ -237,40 +237,50 @@ class GreasePencilInterpolatePanel:
         elif context.space_data.type != 'VIEW_3D':
             return False
 
-        gpd = context.gpencil_data
-        return bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
+        return True
 
     @staticmethod
     def draw(self, context):
         layout = self.layout
         settings = context.tool_settings.gpencil_interpolate
+        gpd = context.gpencil_data
+        is_edit = bool(context.editable_gpencil_strokes) and bool(gpd.use_stroke_edit_mode)
 
         col = layout.column(align=True)
-        col.operator("gpencil.interpolate", text="Interpolate")
-        col.operator("gpencil.interpolate_sequence", text="Sequence")
-        col.operator("gpencil.interpolate_reverse", text="Remove Breakdowns")
+        col.operator("gpencil.blank_frame_add", icon='NEW')
+        col.operator("gpencil.active_frames_delete_all", icon='X', text="Delete Frame(s)")
 
-        col = layout.column(align=True)
-        col.label(text="Options:")
-        col.prop(settings, "interpolate_all_layers")
-        col.prop(settings, "interpolate_selected_only")
+        col.separator()
+        col.prop(context.tool_settings, "use_gpencil_additive_drawing", text="Additive Drawing")
 
-        col = layout.column(align=True)
-        col.label(text="Sequence Options:")
-        col.prop(settings, "type")
-        if settings.type == 'CUSTOM':
-            box = layout.box()
-            # TODO: Options for loading/saving curve presets?
-            box.template_curve_mapping(settings, "interpolation_curve", brush=True)
-        elif settings.type != 'LINEAR':
-            col.prop(settings, "easing")
-
-            if settings.type == 'BACK':
-                layout.prop(settings, "back")
-            elif setting.type == 'ELASTIC':
-                sub = layout.column(align=True)
-                sub.prop(settings, "amplitude")
-                sub.prop(settings, "period")
+        if is_edit is True:
+            col = layout.column(align=True)
+            col.label("Interpolate Strokes")
+            col.operator("gpencil.interpolate", text="Interpolate")
+            col.operator("gpencil.interpolate_sequence", text="Sequence")
+            col.operator("gpencil.interpolate_reverse", text="Remove Breakdowns")
+
+            col = layout.column(align=True)
+            col.label(text="Options:")
+            col.prop(settings, "interpolate_all_layers")
+            col.prop(settings, "interpolate_selected_only")
+
+            col = layout.column(align=True)
+            col.label(text="Sequence Options:")
+            col.prop(settings, "type")
+            if settings.type == 'CUSTOM':
+                box = layout.box()
+                # TODO: Options for loading/saving curve presets?
+                box.template_curve_mapping(settings, "interpolation_curve", brush=True)
+            elif settings.type != 'LINEAR':
+                col.prop(settings, "easing")
+
+                if settings.type == 'BACK':
+                    layout.prop(settings, "back")
+                elif setting.type == 'ELASTIC':
+                    sub = layout.column(align=True)
+                    sub.prop(settings, "amplitude")
+                    sub.prop(settings, "period")
 
 
 class GreasePencilBrushPanel:
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 857b34a9aa2..09a4282e482 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -292,16 +292,6 @@ class VIEW3D_PT_tools_animation(View3DPanel, Panel):
         col.label(text="Action:")
         col.operator("nla.bake", text="Bake Action")
 
-        row = layout.row(align=True)
-        row.label("Grease Pencil:")
-        row = layout.row(align=True)
-        row.operator("gpencil.blank_frame_add", icon='NEW')
-        row.operator("gpencil.active_frames_delete_all", icon='X', text="Delete Frame(s)")
-
-        row.separator()
-        row = layout.row(align=True)
-        row.prop(context.tool_settings, "use_gpencil_additive_drawing", text="Additive Drawing")
-
 class VIEW3D_PT_tools_rigid_body(View3DPanel, Panel):
     bl_category = "Physics"
     bl_context = "objectmode"




More information about the Bf-blender-cvs mailing list