[Bf-blender-cvs] [2e47506f8c0] greasepencil-object: UI: Move Multiframe ON/OFF to Topbar
Antonio Vazquez
noreply at git.blender.org
Thu May 31 16:02:58 CEST 2018
Commit: 2e47506f8c0307af064273ea9d532d0138702b8d
Author: Antonio Vazquez
Date: Thu May 31 16:02:49 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2e47506f8c0307af064273ea9d532d0138702b8d
UI: Move Multiframe ON/OFF to Topbar
Before it was inside the panel.
Thanks Pablo Vazquez for his help.
===================================================================
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/space_topbar.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 d4e8d942071..09e181b316c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -293,42 +293,6 @@ class GreasePencilStrokeSculptPanel:
layout.prop(brush, "affect_pressure")
-# Grease Pencil multiframe falloff tools
-class GreasePencilMultiFramePanel:
- bl_label = "Multi Frame"
-
- # @classmethod
- # def poll(cls, context):
- # if context.gpencil_data is None:
- # return False
- #
- # gpd = context.gpencil_data
- # if context.editable_gpencil_strokes:
- # is_3d_view = context.space_data.type == 'VIEW_3D'
- # if is_3d_view:
- # return bool(gpd.use_stroke_edit_mode or
- # gpd.is_stroke_sculpt_mode or
- # gpd.is_stroke_weight_mode)
- #
- # return False
-
- @staticmethod
- def draw(self, context):
- gpd = context.gpencil_data
- settings = context.tool_settings.gpencil_sculpt
-
- layout = self.layout
- layout.prop(gpd, "use_multiedit")
- if gpd.use_multiedit is True:
- col = layout.column(align=True)
- col.prop(gpd, "show_multiedit_line_only", text="Display only edit lines")
- col.prop(settings, "use_multiframe_falloff")
-
- # Falloff curve
- if gpd.use_multiedit and settings.use_multiframe_falloff:
- layout.template_curve_mapping(settings, "multiframe_falloff_curve", brush=True)
-
-
class GreasePencilAppearancePanel:
bl_label = "Brush Appearance"
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 5a3fe2ae60d..0ae83a09780 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -103,6 +103,23 @@ class TOPBAR_HT_lower_bar(Header):
layout.template_header_3D_mode()
+ # graese pencil multiedit
+ gpd = context.gpencil_data
+ if gpd and (gpd.use_stroke_edit_mode or
+ gpd.is_stroke_sculpt_mode or
+ gpd.is_stroke_weight_mode):
+ row = layout.row(align=True)
+ row.prop(gpd, "use_multiedit", text="", icon="PARTICLE_POINT")
+
+ sub = row.row(align=True)
+ sub.active = gpd.use_multiedit
+ sub.popover(
+ space_type='TOPBAR',
+ region_type='HEADER',
+ panel_type="TOPBAR_PT_GreasePencilMultiFrame",
+ text="Multiframe"
+ )
+
def draw_center(self, context):
layout = self.layout
mode = context.mode
@@ -398,6 +415,27 @@ class TOPBAR_PT_snapping(Panel):
col.prop(toolsettings, "use_mesh_automerge", icon='AUTOMERGE_ON')
+# Grease Pencil multiframe falloff tools
+class TOPBAR_PT_GreasePencilMultiFrame(Panel):
+ bl_space_type = 'TOPBAR'
+ bl_region_type = 'HEADER'
+ bl_label = "Multi Frame"
+
+ @staticmethod
+ def draw(self, context):
+ gpd = context.gpencil_data
+ settings = context.tool_settings.gpencil_sculpt
+
+ layout = self.layout
+ col = layout.column(align=True)
+ col.prop(gpd, "show_multiedit_line_only", text="Display only edit lines")
+ col.prop(settings, "use_multiframe_falloff")
+
+ # Falloff curve
+ if gpd.use_multiedit and settings.use_multiframe_falloff:
+ layout.template_curve_mapping(settings, "multiframe_falloff_curve", brush=True)
+
+
class INFO_MT_editor_menus(Menu):
bl_idname = "INFO_MT_editor_menus"
bl_label = ""
@@ -694,6 +732,7 @@ classes = (
TOPBAR_HT_lower_bar,
TOPBAR_PT_pivot_point,
TOPBAR_PT_snapping,
+ TOPBAR_PT_GreasePencilMultiFrame,
INFO_MT_editor_menus,
INFO_MT_file,
INFO_MT_file_import,
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 25110c61344..4ceffa869fa 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -22,7 +22,6 @@ from bpy.types import Menu, Panel, UIList
from .properties_grease_pencil_common import (
GreasePencilStrokeEditPanel,
GreasePencilStrokeSculptPanel,
- GreasePencilMultiFramePanel,
GreasePencilAppearancePanel,
GreasePencilAnimationPanel
)
@@ -1605,24 +1604,6 @@ class VIEW3D_PT_tools_grease_pencil_weight_tools(Panel):
col.operator("gpencil.vertex_group_smooth", text="Smooth")
-# Grease Pencil multiframe falloff tools (one for each mode)
-class VIEW3D_PT_tools_grease_pencil_edit_falloff(GreasePencilMultiFramePanel, View3DPanel, Panel):
- bl_context = ".greasepencil_edit"
- bl_category = "Tools"
- bl_label = "Multi Frame"
-
-
-class VIEW3D_PT_tools_grease_pencil_sculpt_falloff(GreasePencilMultiFramePanel, View3DPanel, Panel):
- bl_context = ".greasepencil_sculpt"
- bl_category = "Tools"
- bl_label = "Multi Frame"
-
-
-class VIEW3D_PT_tools_grease_pencil_weight_falloff(GreasePencilMultiFramePanel, View3DPanel, Panel):
- bl_context = ".greasepencil_weight"
- bl_category = "Tools"
- bl_label = "Multi Frame"
-
# Grease Pencil Brush Appeareance (one for each mode)
class VIEW3D_PT_tools_grease_pencil_paint_appearance(GreasePencilAppearancePanel, View3DPanel, Panel):
bl_context = ".greasepencil_paint"
@@ -1688,9 +1669,6 @@ classes = (
VIEW3D_PT_tools_grease_pencil_sculpt,
VIEW3D_PT_tools_grease_pencil_weight_paint,
VIEW3D_PT_tools_grease_pencil_weight_tools,
- VIEW3D_PT_tools_grease_pencil_edit_falloff,
- VIEW3D_PT_tools_grease_pencil_sculpt_falloff,
- VIEW3D_PT_tools_grease_pencil_weight_falloff,
VIEW3D_PT_tools_grease_pencil_paint_appearance,
VIEW3D_PT_tools_grease_pencil_sculpt_appearance,
VIEW3D_PT_tools_grease_pencil_weight_appearance,
More information about the Bf-blender-cvs
mailing list