From 99530ef4ed70a479523d8e99a40fce24eb9ba658 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Sat, 21 Mar 2020 23:24:53 +0100 Subject: Sculpt: Face Sets Init operator This operator initializes all face sets in the sculpt at once using different mesh properties. It can create face sets by mesh connectivity, material slots, face normals, UV seams, creases, sharp edges, bevel weights and face maps. For properties that are already in the faces, this is implemented as a loop. Properties that depend on edge attributes use a similar operation to sculpt flood fill, but using face adjacency instead of edge vertex connectivity. As Multires also stores the face sets in the base mesh, this should work in the face sets Multires implementation without any changes. This is implemented as a separate operator as this resets the visibility and creates all face sets at once, while the create face set operator creates a single face sets, leaving the rest of the face sets in the mesh as they are. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D7209 --- release/scripts/startup/bl_ui/space_view3d.py | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 4f4272c879a..db128c14cf9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3135,6 +3135,10 @@ class VIEW3D_MT_face_sets(Menu): op = layout.operator("sculpt.face_sets_create", text='Face Set From Visible') op.mode = 'VISIBLE' + layout.separator() + + layout.menu("VIEW3D_MT_face_sets_init", text="Init Face Sets") + layout.separator() op = layout.operator("sculpt.face_set_change_visibility", text='Invert Visible Face Sets') @@ -3169,6 +3173,37 @@ class VIEW3D_MT_sculpt_set_pivot(Menu): props = layout.operator("sculpt.set_pivot_position", text="Pivot to Surface Under Cursor") props.mode = 'SURFACE' +class VIEW3D_MT_face_sets_init(Menu): + bl_label = "Face Sets Init" + + def draw(self, _context): + layout = self.layout + + op = layout.operator("sculpt.face_sets_init", text='By Loose Parts') + op.mode = 'LOOSE_PARTS' + + op = layout.operator("sculpt.face_sets_init", text='By Materials') + op.mode = 'MATERIALS' + + op = layout.operator("sculpt.face_sets_init", text='By Normals') + op.mode = 'NORMALS' + + op = layout.operator("sculpt.face_sets_init", text='By UV Seams') + op.mode = 'UV_SEAMS' + + op = layout.operator("sculpt.face_sets_init", text='By Edge Creases') + op.mode = 'CREASES' + + op = layout.operator("sculpt.face_sets_init", text='By Edge Bevel Weight') + op.mode = 'BEVEL_WEIGHT' + + op = layout.operator("sculpt.face_sets_init", text='By Sharp Edges') + op.mode = 'SHARP_EDGES' + + op = layout.operator("sculpt.face_sets_init", text='By Face Maps') + op.mode = 'FACE_MAPS' + + class VIEW3D_MT_particle(Menu): bl_label = "Particle" @@ -7335,6 +7370,7 @@ classes = ( VIEW3D_MT_sculpt_set_pivot, VIEW3D_MT_mask, VIEW3D_MT_face_sets, + VIEW3D_MT_face_sets_init, VIEW3D_MT_particle, VIEW3D_MT_particle_context_menu, VIEW3D_MT_particle_showhide, -- cgit v1.2.3