[Bf-blender-cvs] [14fc2216147] soc-2017-normal-tools: Tweaks to UI.
Bastien Montagne
noreply at git.blender.org
Wed Nov 8 13:25:02 CET 2017
Commit: 14fc22161478888b9b88b9e7afc88bc2e99bcb3b
Author: Bastien Montagne
Date: Wed Nov 8 13:05:28 2017 +0100
Branches: soc-2017-normal-tools
https://developer.blender.org/rB14fc22161478888b9b88b9e7afc88bc2e99bcb3b
Tweaks to UI.
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index ff359d8f2c9..3d4aa6cd3a7 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -1544,20 +1544,20 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind")
def WEIGHTED_NORMAL(self, layout, ob, md):
- has_vgroup = bool(md.vertex_group)
-
- col = layout.column()
- col.label("Weighting Mode:")
+ layout.label("Weighting Mode:")
+ split = layout.split(align=True)
+ col = split.column(align=True)
col.prop(md, "mode", text="")
+ col.prop(md, "weight", text="Weight")
+ col.prop(md, "keep_sharp")
- layout.prop(md, "weight", text="Weight")
- layout.prop(md, "thresh", text="Threshold")
- row = layout.row(align=True)
+ col = split.column(align=True)
+ row = col.row(align=True)
row.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
- row.active = has_vgroup
+ row.active = bool(md.vertex_group)
row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT')
- layout.prop(md, "keep_sharp")
- layout.prop(md, "face_influence")
+ col.prop(md, "thresh", text="Threshold")
+ col.prop(md, "face_influence")
classes = (
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index eceb5c4e5ab..ffef11982ab 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -441,60 +441,59 @@ class VIEW3D_PT_tools_shading(View3DPanel, Panel):
props.clear = True
row.operator("mesh.mark_sharp", text="Sharp").use_verts = True
+
+class VIEW3D_PT_tools_normal(View3DPanel, Panel):
+ bl_category = "Shading / UVs"
+ 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="Normals:")
+ col.label(text="Vertex Normals:")
col.operator("mesh.normals_make_consistent", text="Recalculate")
col.operator("mesh.flip_normals", text="Flip Direction")
+ layout.separator()
+ layout.label(text="Split Normals:")
-class VIEW3D_PT_tools_normal(View3DPanel, Panel):
- bl_category = "Shading / UVs"
- 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.operator("mesh.set_normals_from_faces", text="Set From Faces")
- col.operator("transform.rotate_normal", text="Rotate Normal")
- col.operator("mesh.point_normals")
-
- col = layout.column(align=True)
- col.label(text="Split/Merge: ")
-
- col.operator("mesh.merge_loop_normals", text="Merge Normals")
- col.operator("mesh.split_loop_normals", text="Split Normals")
-
- col = layout.column(align=True)
- col.label(text="Average by: ")
-
- col.operator_menu_enum("mesh.average_loop_normals", "average_type")
-
- col = layout.column(align=True)
- col.label(text="Normal Vector: ")
- col.operator("mesh.custom_normal_tools", text="Reset").mode = "Reset"
- col.prop(toolsettings, "normal_vector", text="")
-
- row = col.row(align=True)
- row.operator("mesh.custom_normal_tools", text="Copy").mode = "Copy"
- row.operator("mesh.custom_normal_tools", text="Paste").mode = "Paste"
-
- row = col.row(align=True)
- row.operator("mesh.custom_normal_tools", text="Multiply").mode = "Multiply"
- row.operator("mesh.custom_normal_tools", text="Add").mode = "Add"
-
- col = layout.column(align=True)
- col.operator("mesh.smoothen_custom_normals", text="Smoothen")
-
- col = layout.column(align=True)
- col.label(text="Face Strength")
- row = col.row(align=True)
-
- row.prop(toolsettings, "face_strength", text="")
- row.operator("mesh.mod_weighted_strength", text="", icon = "FACESEL").set = False
- row.operator("mesh.mod_weighted_strength", text="", icon = "ZOOMIN").set = True
+ col = layout.column(align=True)
+ col.operator("mesh.set_normals_from_faces", text="Set From Faces")
+ col.operator("transform.rotate_normal", text="Rotate")
+ col.operator("mesh.point_normals", text="Point To...")
+
+ row = layout.row(align=True)
+ row.operator("mesh.merge_loop_normals", text="Merge")
+ row.operator("mesh.split_loop_normals", text="Split")
+
+ col = layout.column(align=True)
+ col.operator_menu_enum("mesh.average_loop_normals", "average_type")
+
+ col = layout.column(align=True)
+ col.label(text="Normal Vector:")
+ col.prop(toolsettings, "normal_vector", text="")
+
+ row = col.row(align=True)
+ row.operator("mesh.custom_normal_tools", text="Copy").mode = "Copy"
+ row.operator("mesh.custom_normal_tools", text="Paste").mode = "Paste"
+
+ row = col.row(align=True)
+ row.operator("mesh.custom_normal_tools", text="Multiply").mode = "Multiply"
+ row.operator("mesh.custom_normal_tools", text="Add").mode = "Add"
+
+ col.operator("mesh.custom_normal_tools", text="Reset").mode = "Reset"
+
+ col = layout.column(align=True)
+ col.operator("mesh.smoothen_custom_normals", text="Smoothen")
+
+ col = layout.column(align=True)
+ col.label(text="Face Strength:")
+ row = col.row(align=True)
+ row.prop(toolsettings, "face_strength", text="")
+ row.operator("mesh.mod_weighted_strength", text="", icon = "FACESEL").set = False
+ row.operator("mesh.mod_weighted_strength", text="", icon = "ZOOMIN").set = True
class VIEW3D_PT_tools_uvs(View3DPanel, Panel):
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 5c2e0670ee5..5b7f1631522 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2884,7 +2884,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "edge_mode_live_unwrap", 1);
RNA_def_property_ui_text(prop, "Live Unwrap", "Changing edges seam re-calculates UV unwrap");
- prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "normal_vector", PROP_FLOAT, PROP_XYZ);
RNA_def_property_ui_text(prop, "Normal Vector", "Normal Vector used to copy, add or multiply");
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
More information about the Bf-blender-cvs
mailing list