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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-24 17:54:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-24 18:04:43 +0300
commit00d4e99955780b0186fedb61bb6c8cf009cd056b (patch)
tree634900b22ca8470b533c28291cecde45c73d6d79 /release/scripts
parent354dbdde0119122624a480ceab7daa164a637f0c (diff)
UI: move mesh-weights from panels to menus
Also de-duplicate edit/object mode menus.
Diffstat (limited to 'release/scripts')
m---------release/scripts/addons0
m---------release/scripts/addons_contrib0
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py13
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py40
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py44
5 files changed, 41 insertions, 56 deletions
diff --git a/release/scripts/addons b/release/scripts/addons
-Subproject 8d3301f66c77e7b5a1f310a311d2055dbd473e0
+Subproject 8f2fd7e23f0b5ce023440182f51c40e88d66332
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
-Subproject 8cd4e766fa881f98ad1261bcc3506524460261b
+Subproject 34a27a42d781d80f9f1833bad8cc5b2abcac293
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index fa9a9b8ab6f..b8257bb6158 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -100,6 +100,19 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
'POSE': [
*_tools_transform,
],
+ 'PAINT_WEIGHT': [
+ # TODO, override brush events
+ (
+ ("Linear Gradient", None, None, (
+ ("paint.weight_gradient", dict(type='LINEAR'),
+ dict(type='EVT_TWEAK_A', value='ANY')),
+ )),
+ ("Radial Gradient", None, None, (
+ ("paint.weight_gradient", dict(type='RADIAL'),
+ dict(type='EVT_TWEAK_A', value='ANY')),
+ )),
+ ),
+ ],
'EDIT_ARMATURE': [
*_tools_transform,
("Roll", None, None, (
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 380ce871642..69d8acec481 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1956,17 +1956,18 @@ class VIEW3D_MT_vertex_group(Menu):
class VIEW3D_MT_paint_weight(Menu):
bl_label = "Weights"
- def draw(self, context):
- layout = self.layout
+ @staticmethod
+ def draw_generic(layout, is_editmode=False):
- layout.menu("VIEW3D_MT_undo_redo")
+ if not is_editmode:
+ layout.menu("VIEW3D_MT_undo_redo")
- layout.separator()
+ layout.separator()
- layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
- layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
+ layout.operator("paint.weight_from_bones", text="Assign Automatic From Bones").type = 'AUTOMATIC'
+ layout.operator("paint.weight_from_bones", text="Assign From Bone Envelopes").type = 'ENVELOPES'
- layout.separator()
+ layout.separator()
layout.operator("object.vertex_group_normalize_all", text="Normalize All")
layout.operator("object.vertex_group_normalize", text="Normalize")
@@ -1983,16 +1984,22 @@ class VIEW3D_MT_paint_weight(Menu):
layout.operator("object.vertex_group_levels", text="Levels")
layout.operator("object.vertex_group_smooth", text="Smooth")
- props = layout.operator("object.data_transfer", text="Transfer Weights")
- props.use_reverse_transfer = True
- props.data_type = 'VGROUP_WEIGHTS'
+ if not is_editmode:
+ props = layout.operator("object.data_transfer", text="Transfer Weights")
+ props.use_reverse_transfer = True
+ props.data_type = 'VGROUP_WEIGHTS'
layout.operator("object.vertex_group_limit_total", text="Limit Total")
layout.operator("object.vertex_group_fix", text="Fix Deforms")
- layout.separator()
- layout.operator("paint.weight_set")
+ if not is_editmode:
+ layout.separator()
+
+ layout.operator("paint.weight_set")
+
+ def draw(self, context):
+ self.draw_generic(self.layout, is_editmode=False);
class VIEW3D_MT_sculpt(Menu):
@@ -2468,6 +2475,7 @@ class VIEW3D_MT_edit_mesh(Menu):
layout.separator()
layout.menu("VIEW3D_MT_edit_mesh_normals")
+ layout.menu("VIEW3D_MT_edit_mesh_weights")
layout.menu("VIEW3D_MT_edit_mesh_clean")
layout.separator()
@@ -2774,6 +2782,13 @@ class VIEW3D_MT_edit_mesh_normals(Menu):
layout.operator("mesh.flip_normals")
+class VIEW3D_MT_edit_mesh_weights(Menu):
+ bl_label = "Weights"
+
+ def draw(self, context):
+ VIEW3D_MT_paint_weight.draw_generic(self.layout, is_editmode=True)
+
+
class VIEW3D_MT_edit_mesh_clean(Menu):
bl_label = "Clean Up"
@@ -3886,6 +3901,7 @@ classes = (
VIEW3D_MT_edit_mesh_edges_data,
VIEW3D_MT_edit_mesh_faces,
VIEW3D_MT_edit_mesh_normals,
+ VIEW3D_MT_edit_mesh_weights,
VIEW3D_MT_edit_mesh_clean,
VIEW3D_MT_edit_mesh_delete,
VIEW3D_MT_edit_mesh_showhide,
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 0b61e315f47..9be36108efe 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -282,32 +282,6 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel):
col.operator("mesh.remove_doubles")
-class VIEW3D_PT_tools_meshweight(View3DPanel, Panel):
- bl_category = "Tools"
- bl_context = "mesh_edit"
- bl_label = "Weight Tools"
- bl_options = {'DEFAULT_CLOSED'}
-
- # Used for Weight-Paint mode and Edit-Mode
- @staticmethod
- def draw_generic(layout):
- col = layout.column()
- col.operator("object.vertex_group_normalize_all", text="Normalize All")
- col.operator("object.vertex_group_normalize", text="Normalize")
- col.operator("object.vertex_group_mirror", text="Mirror")
- col.operator("object.vertex_group_invert", text="Invert")
- col.operator("object.vertex_group_clean", text="Clean")
- col.operator("object.vertex_group_quantize", text="Quantize")
- col.operator("object.vertex_group_levels", text="Levels")
- col.operator("object.vertex_group_smooth", text="Smooth")
- col.operator("object.vertex_group_limit_total", text="Limit Total")
- col.operator("object.vertex_group_fix", text="Fix Deforms")
-
- def draw(self, context):
- layout = self.layout
- self.draw_generic(layout)
-
-
class VIEW3D_PT_tools_shading(View3DPanel, Panel):
bl_category = "Shading / UVs"
bl_context = "mesh_edit"
@@ -1579,22 +1553,6 @@ class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
# ********** default tools for weight-paint ****************
-class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
- bl_category = "Tools"
- bl_context = "weightpaint"
- bl_label = "Weight Tools"
-
- def draw(self, context):
- layout = self.layout
- VIEW3D_PT_tools_meshweight.draw_generic(layout)
-
- col = layout.column()
- col.operator("paint.weight_gradient")
- props = col.operator("object.data_transfer", text="Transfer Weights")
- props.use_reverse_transfer = True
- props.data_type = 'VGROUP_WEIGHTS'
-
-
class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
bl_category = "Tools"
bl_context = "weightpaint"
@@ -1909,7 +1867,6 @@ classes = (
VIEW3D_PT_tools_rigid_body,
VIEW3D_PT_tools_transform_mesh,
VIEW3D_PT_tools_meshedit,
- VIEW3D_PT_tools_meshweight,
VIEW3D_PT_tools_shading,
VIEW3D_PT_tools_uvs,
VIEW3D_PT_tools_meshedit_options,
@@ -1941,7 +1898,6 @@ classes = (
VIEW3D_PT_sculpt_options,
VIEW3D_PT_sculpt_symmetry,
VIEW3D_PT_tools_brush_appearance,
- VIEW3D_PT_tools_weightpaint,
VIEW3D_PT_tools_weightpaint_symmetry,
VIEW3D_PT_tools_weightpaint_options,
VIEW3D_PT_tools_vertexpaint,