Merge branch 'blender2.8' into soc-2018-bevel
[blender.git] / release / scripts / startup / bl_ui / space_view3d_toolbar.py
index 0842be91d382477dbcaeda77636fa7ed57679b93..a7469104b1755e84674c4c3976529fbd2b3b1658 100644 (file)
@@ -53,15 +53,21 @@ def draw_keyframing_tools(context, layout):
 
 # Used by vertex & weight paint
 def draw_vpaint_symmetry(layout, vpaint):
-    col = layout.column(align=True)
-    col.label(text="Mirror:")
-    row = col.row(align=True)
 
+    split = layout.split()
+
+    col = split.column()
+    col.alignment = 'RIGHT'
+    col.label(text="Mirror")
+
+    col = split.column()
+    row = col.row(align=True)
     row.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
     row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
     row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
 
     col = layout.column()
+    col.use_property_split = True
     col.prop(vpaint, "radial_symmetry", text="Radial")
 
 
@@ -604,6 +610,7 @@ class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
 
         toolsettings = context.tool_settings
         ipaint = toolsettings.image_paint
@@ -614,17 +621,23 @@ class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
         col.active = ipaint.use_stencil_layer
 
         stencil_text = mesh.uv_layer_stencil.name if mesh.uv_layer_stencil else ""
-        col.label("UV Map")
-        col.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
+        split = col.split(0.5)
+        colsub = split.column()
+        colsub.alignment = 'RIGHT'
+        colsub.label("UV Layer")
+        split.column().menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
 
-        col.label("Stencil Image:")
         # todo this should be combinded into a single row
-        col.template_ID(ipaint, "stencil_image", open="image.open")
-        col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
+        split = col.split(0.5)
+        colsub = split.column()
+        colsub.alignment = 'RIGHT'
+        colsub.label("Stencil Image")
+        colsub = split.column()
+        colsub.template_ID(ipaint, "stencil_image", open="image.open")
+        colsub.operator("image.new", text="New").gen_context = 'PAINT_STENCIL'
 
-        col.label("Visualization:")
         row = col.row(align=True)
-        row.prop(ipaint, "stencil_color", text="")
+        row.prop(ipaint, "stencil_color", text="Display Color")
         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
 
 
@@ -764,12 +777,11 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
 
         settings = self.paint_settings(context)
         brush = settings.brush
+        layout.use_property_split = True
 
         col = layout.column()
 
-        col.label(text="Stroke Method:")
-
-        col.prop(brush, "stroke_method", text="")
+        col.prop(brush, "stroke_method")
 
         if brush.use_anchor:
             col.separator()
@@ -799,12 +811,16 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
             if brush.sculpt_capabilities.has_jitter:
                 col.separator()
 
-                row = col.row(align=True)
+                colsub = col.split(0.5)
+                row = colsub.row(align=True)
+                row.alignment = 'RIGHT'
+                row.label("Jitter")
+                row = colsub.row(align=True)
                 row.prop(brush, "use_relative_jitter", icon_only=True)
                 if brush.use_relative_jitter:
-                    row.prop(brush, "jitter", slider=True)
+                    row.prop(brush, "jitter", slider=True, text="")
                 else:
-                    row.prop(brush, "jitter_absolute")
+                    row.prop(brush, "jitter_absolute", text="")
                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
             if brush.sculpt_capabilities.has_smooth_stroke:
@@ -894,6 +910,7 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
 
     def draw(self, context):
         layout = self.layout
+        layout.use_property_split = True
 
         toolsettings = context.tool_settings
         sculpt = toolsettings.sculpt
@@ -902,7 +919,8 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
 
         col = layout.column()
         col.active = context.sculpt_object.use_dynamic_topology_sculpting
-        sub = col.column(align=True)
+
+        sub = col.column()
         sub.active = (brush and brush.sculpt_tool != 'MASK')
         if (sculpt.detail_type_method == 'CONSTANT'):
             row = sub.row(align=True)
@@ -912,16 +930,18 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
             sub.prop(sculpt, "detail_percent")
         else:
             sub.prop(sculpt, "detail_size")
-        sub.prop(sculpt, "detail_refine_method", text="")
-        sub.prop(sculpt, "detail_type_method", text="")
-        col.separator()
+        sub.prop(sculpt, "detail_refine_method", text="Refine Method")
+        sub.prop(sculpt, "detail_type_method", text="Detailing")
+
         col.prop(sculpt, "use_smooth_shading")
-        col.operator("sculpt.optimize")
-        if (sculpt.detail_type_method == 'CONSTANT'):
-            col.operator("sculpt.detail_flood_fill")
+
         col.separator()
+
         col.prop(sculpt, "symmetrize_direction")
         col.operator("sculpt.symmetrize")
+        col.operator("sculpt.optimize")
+        if (sculpt.detail_type_method == 'CONSTANT'):
+            col.operator("sculpt.detail_flood_fill")
 
 
 # TODO, move to space_view3d.py
@@ -973,30 +993,50 @@ class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
 
         sculpt = context.tool_settings.sculpt
 
-        col = layout.column(align=True)
-        col.label(text="Mirror:")
+        split = layout.split()
+
+        col = split.column()
+        col.alignment = 'RIGHT'
+        col.label(text="Mirror")
+
+        col = split.column()
+
         row = col.row(align=True)
         row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
         row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
         row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
 
-        layout.column().prop(sculpt, "radial_symmetry", text="Radial")
-        layout.prop(sculpt, "use_symmetry_feather", text="Feather")
+        split = layout.split()
 
-        layout.label(text="Lock:")
+        col = split.column()
+        col.alignment = 'RIGHT'
+        col.label(text="Lock")
 
-        row = layout.row(align=True)
+        col = split.column()
+
+        row = col.row(align=True)
         row.prop(sculpt, "lock_x", text="X", toggle=True)
         row.prop(sculpt, "lock_y", text="Y", toggle=True)
         row.prop(sculpt, "lock_z", text="Z", toggle=True)
 
-        layout.label(text="Tiling:")
 
-        row = layout.row(align=True)
+        split = layout.split()
+
+        col = split.column()
+        col.alignment = 'RIGHT'
+        col.label(text="Tiling")
+
+        col = split.column()
+
+        row = col.row(align=True)
         row.prop(sculpt, "tile_x", text="X", toggle=True)
         row.prop(sculpt, "tile_y", text="Y", toggle=True)
         row.prop(sculpt, "tile_z", text="Z", toggle=True)
 
+        layout.use_property_split = True
+
+        layout.prop(sculpt, "use_symmetry_feather", text="Feather")
+        layout.column().prop(sculpt, "radial_symmetry", text="Radial")
         layout.column().prop(sculpt, "tile_offset", text="Tile Offset")
 
 
@@ -1156,7 +1196,14 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
         toolsettings = context.tool_settings
         ipaint = toolsettings.image_paint
 
-        col = layout.column(align=True)
+        split = layout.split()
+
+        col = split.column()
+        col.alignment = 'RIGHT'
+        col.label(text="Mirror")
+
+        col = split.column()
+
         row = col.row(align=True)
         row.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
         row.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
@@ -1298,6 +1345,26 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
             sub.prop(pe, "fade_frames", slider=True)
 
 
+class VIEW3D_PT_tools_normal(View3DPanel, Panel):
+    bl_category = ""
+    bl_context = ".mesh_edit"
+    bl_label = "Normal Tools"
+
+    def draw(self, context):
+        layout = self.layout
+        toolsettings = context.tool_settings
+
+        col = layout.column(align=True)
+        col.label(text="Normal Vector")
+        col.prop(toolsettings, "normal_vector", text="")
+
+        layout.separator()
+        layout.label(text="Face Strength")
+        layout.prop(toolsettings, "face_strength", text="")
+
+        col = layout.column(align=True)
+
+
 # Grease Pencil drawing tools
 class VIEW3D_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
     bl_space_type = 'VIEW_3D'
@@ -1364,6 +1431,7 @@ classes = (
     VIEW3D_PT_tools_grease_pencil_sculpt,
     VIEW3D_PT_tools_grease_pencil_brush,
     VIEW3D_PT_tools_grease_pencil_brushcurves,
+    VIEW3D_PT_tools_normal,
 )
 
 if __name__ == "__main__":  # only for live edit.