diff options
author | Rohan Rathi <rohanrathi08@gmail.com> | 2018-08-09 17:22:07 +0300 |
---|---|---|
committer | Rohan Rathi <rohanrathi08@gmail.com> | 2018-08-09 17:22:07 +0300 |
commit | 2b41b208c7e5e74a0a5fe043f4bfab2a122a9ed1 (patch) | |
tree | cc5c8948a12a73d3997f8323044d2c117a7af8df /release | |
parent | 85cac2221c543e67a9070c94d89d61bf27c7190f (diff) | |
parent | fea5f26ea56acd73d043e97a96d06067b24ef811 (diff) |
Merge branch 'soc-2018-bevel' into blender2.8
Diffstat (limited to 'release')
m--------- | release/datafiles/locale | 0 | ||||
m--------- | release/scripts/addons | 0 | ||||
m--------- | release/scripts/addons_contrib | 0 | ||||
-rw-r--r-- | release/scripts/modules/bpy_extras/keyconfig_utils.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/mesh.py | 50 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 24 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 24 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 21 |
8 files changed, 70 insertions, 50 deletions
diff --git a/release/datafiles/locale b/release/datafiles/locale -Subproject d3349b42856d00c278f72f2a5909a6c96b9cdb5 +Subproject 59495b4b59077aa1cc68fffbdae1463af980f08 diff --git a/release/scripts/addons b/release/scripts/addons -Subproject 371960484a38fc64e0a2635170a41a0d8ab2f6b +Subproject 27970761a18926abe1b0020aa350305e3109a53 diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib -Subproject 474702157831f1a58bb50f5240ab8b1b02b6ba3 +Subproject 6a4f93c9b8f36b19bd02087abf3d7f5983df035 diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 4e5cb7daad9..ec4db69986c 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -56,6 +56,7 @@ KM_HIERARCHY = [ ('Particle', 'EMPTY', 'WINDOW', []), ('Knife Tool Modal Map', 'EMPTY', 'WINDOW', []), + ('Custom Normals Modal Map', 'EMPTY', 'WINDOW', []), ('Paint Stroke Modal', 'EMPTY', 'WINDOW', []), ('Paint Curve', 'EMPTY', 'WINDOW', []), diff --git a/release/scripts/startup/bl_operators/mesh.py b/release/scripts/startup/bl_operators/mesh.py index a7475dcc6ef..1149d7a0dfb 100644 --- a/release/scripts/startup/bl_operators/mesh.py +++ b/release/scripts/startup/bl_operators/mesh.py @@ -205,57 +205,7 @@ class MeshSelectPrev(Operator): return {'FINISHED'} -# XXX This is hackish (going forth and back from Object mode...), to be redone once we have proper support of -# custom normals in BMesh/edit mode. -class MehsSetNormalsFromFaces(Operator): - """Set the custom vertex normals from the selected faces ones""" - bl_idname = "mesh.set_normals_from_faces" - bl_label = "Set Normals From Faces" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - return (context.mode == 'EDIT_MESH' and context.edit_object.data.polygons) - - def execute(self, context): - import mathutils - - bpy.ops.object.mode_set(mode='OBJECT') - obj = context.active_object - me = obj.data - - v2nors = {} - for p in me.polygons: - if not p.select: - continue - for lidx, vidx in zip(p.loop_indices, p.vertices): - assert(me.loops[lidx].vertex_index == vidx) - v2nors.setdefault(vidx, []).append(p.normal) - - for nors in v2nors.values(): - nors[:] = [sum(nors, mathutils.Vector((0, 0, 0))).normalized()] - - if not me.has_custom_normals: - me.create_normals_split() - me.calc_normals_split() - - normals = [] - for l in me.loops: - nor = v2nors.get(l.vertex_index, [None])[0] - if nor is None: - nor = l.normal - normals.append(nor.to_tuple()) - - me.normals_split_custom_set(normals) - - me.free_normals_split() - bpy.ops.object.mode_set(mode='EDIT') - - return {'FINISHED'} - - classes = ( - MehsSetNormalsFromFaces, MeshMirrorUV, MeshSelectNext, MeshSelectPrev, diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 9acc7996bb9..996a93ddac4 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -145,6 +145,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "use_only_vertices") col.prop(md, "use_clamp_overlap") col.prop(md, "loop_slide") + col.prop(md, "mark_seam") + col.prop(md, "mark_sharp") layout.label(text="Limit Method:") layout.row().prop(md, "limit_method", expand=True) @@ -157,6 +159,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.label(text="Width Method:") layout.row().prop(md, "offset_type", expand=True) + layout.label(text="Normal Mode") + layout.row().prop(md, "hnmode", expand=True) + layout.prop(md, "hn_strength") + layout.prop(md, "set_wn_strength") + + def BOOLEAN(self, layout, ob, md): split = layout.split() @@ -1567,6 +1575,22 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): if md.rest_source == 'BIND': layout.operator("object.correctivesmooth_bind", text="Unbind" if is_bind else "Bind") + def WEIGHTED_NORMAL(self, layout, ob, md): + 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") + + col = split.column(align=True) + row = col.row(align=True) + row.prop_search(md, "vertex_group", ob, "vertex_groups", text="") + row.active = bool(md.vertex_group) + row.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') + col.prop(md, "thresh", text="Threshold") + col.prop(md, "face_influence") + class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): bl_label = "Modifiers" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 1c345fd3f00..a26d99e9ae9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3051,6 +3051,30 @@ class VIEW3D_MT_edit_mesh_normals(Menu): layout.operator("mesh.flip_normals") layout.operator("mesh.set_normals_from_faces", text="Set From Faces") + layout.operator("transform.rotate_normal", text="Rotate Normal") + layout.operator("mesh.point_normals", text="Point normals to target") + + layout.operator("mesh.merge_normals", text="Merge") + layout.operator("mesh.split_normals", text="Split") + + layout.operator("mesh.average_normals", text="Average Normals") + + layout.label(text="Normal Vector") + + layout.operator("mesh.normals_tools", text="Copy").mode = 'COPY' + layout.operator("mesh.normals_tools", text="Paste").mode = 'PASTE' + + layout.operator("mesh.normals_tools", text="Multiply").mode = 'MULTIPLY' + layout.operator("mesh.normals_tools", text="Add").mode = 'ADD' + + layout.operator("mesh.normals_tools", text="Reset").mode = 'RESET' + + layout.operator("mesh.smoothen_normals", text="Smoothen") + + layout.label(text="Face Strength") + layout.operator("mesh.mod_weighted_strength", text="Face select", icon = "FACESEL").set = False + layout.operator("mesh.mod_weighted_strength", text="Set Strength", icon = "ZOOMIN").set = True + class VIEW3D_MT_edit_mesh_shading(Menu): bl_label = "Shading" diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index ca55429c929..66f15f6a8ce 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1349,6 +1349,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 object tool panels **************** # Grease Pencil drawing brushes @@ -1775,6 +1795,7 @@ classes = ( VIEW3D_PT_tools_grease_pencil_sculpt_appearance, VIEW3D_PT_tools_grease_pencil_weight_appearance, VIEW3D_PT_tools_grease_pencil_interpolate, + VIEW3D_PT_tools_normal, ) if __name__ == "__main__": # only for live edit. |