[Bf-blender-cvs] [4d39da10601] blender2.8: Merge branch 'master' into blender2.8

Campbell Barton noreply at git.blender.org
Thu Jun 28 23:58:47 CEST 2018


Commit: 4d39da1060105210a665e083b8d035f18b989a9f
Author: Campbell Barton
Date:   Thu Jun 28 23:57:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4d39da1060105210a665e083b8d035f18b989a9f

Merge branch 'master' into blender2.8

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



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

diff --cc release/scripts/startup/bl_ui/space_topbar.py
index bb147dab6a6,00000000000..ece8666d398
mode 100644,000000..100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@@ -1,601 -1,0 +1,600 @@@
 +# ##### BEGIN GPL LICENSE BLOCK #####
 +#
 +#  This program is free software; you can redistribute it and/or
 +#  modify it under the terms of the GNU General Public License
 +#  as published by the Free Software Foundation; either version 2
 +#  of the License, or (at your option) any later version.
 +#
 +#  This program is distributed in the hope that it will be useful,
 +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +#  GNU General Public License for more details.
 +#
 +#  You should have received a copy of the GNU General Public License
 +#  along with this program; if not, write to the Free Software Foundation,
 +#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 +#
 +# ##### END GPL LICENSE BLOCK #####
 +
 +# <pep8 compliant>
 +import bpy
 +from bpy.types import Header, Menu, Panel
 +
 +
 +class TOPBAR_HT_upper_bar(Header):
 +    bl_space_type = 'TOPBAR'
 +
 +    def draw(self, context):
 +        region = context.region
 +
 +        if region.alignment == 'RIGHT':
 +            self.draw_right(context)
 +        else:
 +            self.draw_left(context)
 +
 +    def draw_left(self, context):
 +        layout = self.layout
 +
 +        window = context.window
 +        screen = context.screen
 +
 +        layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
 +
 +        INFO_MT_editor_menus.draw_collapsible(context, layout)
 +
 +        layout.separator()
 +
 +        if not screen.show_fullscreen:
 +            layout.template_ID_tabs(
 +                window, "workspace",
 +                new="workspace.workspace_add_menu",
 +                unlink="workspace.workspace_delete",
 +            )
 +        else:
 +            layout.operator(
 +                "screen.back_to_previous",
 +                icon='SCREEN_BACK',
 +                text="Back to Previous",
 +            )
 +
 +    def draw_right(self, context):
 +        layout = self.layout
 +
 +        window = context.window
 +        scene = window.scene
 +
 +        # Active workspace view-layer is retrieved through window, not through workspace.
 +        layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete")
 +
 +        row = layout.row(align=True)
 +        row.template_search(
 +            window, "view_layer",
 +            scene, "view_layers",
 +            new="scene.view_layer_add",
 +            unlink="scene.view_layer_remove")
 +
 +
 +class TOPBAR_HT_lower_bar(Header):
 +    bl_space_type = 'TOPBAR'
 +    bl_region_type = 'WINDOW'
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        region = context.region
 +
 +        if region.alignment == 'LEFT':
 +            self.draw_left(context)
 +        elif region.alignment == 'RIGHT':
 +            self.draw_right(context)
 +        else:
 +            self.draw_center(context)
 +
 +    def draw_left(self, context):
 +        layout = self.layout
 +        mode = context.mode
 +
 +        # Active Tool
 +        # -----------
 +        from .space_toolsystem_common import ToolSelectPanelHelper
 +        ToolSelectPanelHelper.draw_active_tool_header(context, layout)
 +
 +        # Object Mode Options
 +        # -------------------
 +
 +        # Example of how toolsettings can be accessed as pop-overs.
 +
 +        # TODO(campbell): editing options should be after active tool options
 +        # (obviously separated for from the users POV)
 +        draw_fn = getattr(_draw_left_context_mode, mode, None)
 +        if draw_fn is not None:
 +            draw_fn(context, layout)
 +
 +        # Note: general mode options should be added to 'draw_right'.
 +        if mode == 'SCULPT':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
 +        elif mode == 'PAINT_VERTEX':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
 +        elif mode == 'PAINT_WEIGHT':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
 +        elif mode == 'PAINT_TEXTURE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
 +        elif mode == 'EDIT_ARMATURE':
 +            pass
 +        elif mode == 'EDIT_CURVE':
 +            pass
 +        elif mode == 'EDIT_MESH':
 +            pass
 +        elif mode == 'POSE':
 +            pass
 +        elif mode == 'PARTICLE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
 +
 +    def draw_center(self, context):
 +        pass
 +
 +    def draw_right(self, context):
 +        layout = self.layout
 +
 +        # General options, note, these _could_ display at the RHS of the draw_left callback.
 +        # we just want them not to be confused with tool options.
 +        mode = context.mode
 +
 +        if mode == 'SCULPT':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".sculpt_mode", category="")
 +        elif mode == 'PAINT_VERTEX':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".vertexpaint", category="")
 +        elif mode == 'PAINT_WEIGHT':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".weightpaint", category="")
 +        elif mode == 'PAINT_TEXTURE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".imagepaint", category="")
 +        elif mode == 'EDIT_ARMATURE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".armature_edit", category="")
 +        elif mode == 'EDIT_CURVE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".curve_edit", category="")
 +        elif mode == 'EDIT_MESH':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".mesh_edit", category="")
 +        elif mode == 'POSE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".posemode", category="")
 +        elif mode == 'PARTICLE':
 +            layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="")
 +
 +
 +class _draw_left_context_mode:
 +    @staticmethod
 +    def SCULPT(context, layout):
 +        brush = context.tool_settings.sculpt.brush
 +        if brush is None:
 +            return
 +
 +        from .properties_paint_common import UnifiedPaintPanel
 +
 +        UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
 +        UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
 +        layout.prop(brush, "direction", text="", expand=True)
 +
 +    def PAINT_TEXTURE(context, layout):
 +        brush = context.tool_settings.vertex_paint.brush
 +        if brush is None:
 +            return
 +
 +        from .properties_paint_common import UnifiedPaintPanel
 +
 +        layout.prop(brush, "color", text="")
 +        UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
 +        UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
 +
 +    def PAINT_VERTEX(context, layout):
 +        brush = context.tool_settings.vertex_paint.brush
 +        if brush is None:
 +            return
 +
 +        from .properties_paint_common import UnifiedPaintPanel
 +
 +        layout.prop(brush, "color", text="")
 +        UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
 +        UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
 +
 +    def PAINT_WEIGHT(context, layout):
 +        brush = context.tool_settings.weight_paint.brush
 +        if brush is None:
 +            return
 +
 +        from .properties_paint_common import UnifiedPaintPanel
 +
 +        UnifiedPaintPanel.prop_unified_weight(layout, context, brush, "weight", slider=True, text="Weight")
 +        UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
 +        UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
 +
 +
 +class TOPBAR_PT_pivot_point(Panel):
 +    bl_space_type = 'TOPBAR'
 +    bl_region_type = 'HEADER'
 +    bl_label = "Pivot Point"
 +
 +    def draw(self, context):
 +        toolsettings = context.tool_settings
 +        obj = context.active_object
 +        mode = context.mode
 +
 +        layout = self.layout
 +        col = layout.column()
 +        col.label("Pivot Point")
 +        col.prop(toolsettings, "transform_pivot_point", expand=True)
 +
 +        col.separator()
 +
 +        if (obj is None) or (mode in {'OBJECT', 'POSE', 'WEIGHT_PAINT'}):
 +            col.prop(
 +                toolsettings,
 +                "use_transform_pivot_point_align",
 +                text="Center Points Only",
 +            )
 +
 +
 +class TOPBAR_PT_snapping(Panel):
 +    bl_space_type = 'TOPBAR'
 +    bl_region_type = 'HEADER'
 +    bl_label = "Snapping"
 +
 +    def draw(self, context):
 +        toolsettings = context.tool_settings
 +        snap_elements = toolsettings.snap_elements
 +        obj = context.active_object
 +        mode = context.mode
 +        object_mode = 'OBJECT' if obj is None else obj.mode
 +
 +        layout = self.layout
 +        col = layout.column()
 +        col.label("Snapping")
 +        col.prop(toolsettings, "snap_elements", expand=True)
 +
 +        col.separator()
 +        if 'INCREMENT' in snap_elements:
 +            col.prop(toolsettings, "use_snap_grid_absolute")
 +
 +        if snap_e

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list