120 .use_toolflags =
true,
126 .calc_face_normal =
true,
145 if (
params->add_boundary_loop) {
151 for (
int repeat = 0; repeat <
params->num_smooth_iterations; repeat++) {
156 for (
int i = 0; i < 3; i++) {
159 "smooth_vert verts=%hv factor=%f mirror_clip_x=%b mirror_clip_y=%b "
161 "clip_dist=%f use_axis_x=%b use_axis_y=%b use_axis_z=%b",
179 for (
int i = 0; i < 1; i++) {
182 "smooth_vert verts=%hv factor=%f mirror_clip_x=%b mirror_clip_y=%b "
184 "clip_dist=%f use_axis_x=%b use_axis_y=%b use_axis_z=%b",
205 .calc_object_remap =
false,
217 ushort local_view_bits = 0;
234 if (
params->apply_shrinkwrap) {
238 if (
params->add_solidify) {
242 new_ob,
"mask_extract_solidify");
261 const float threshold =
params->mask_threshold;
269 bool keep_face =
true;
274 if (
mask < threshold) {
285 const int tag_face_set_id =
params->active_face_set;
320 "Add an extra edge loop to better preserve the shape when applying a "
321 "subdivision surface modifier");
328 "Smooth iterations applied to the extracted mesh",
335 "Project the extracted mesh into the original sculpt");
340 "Extract the mask as a solid object with a solidify modifier");
346 ot->
name =
"Mask Extract";
347 ot->
description =
"Create a new mesh object from the current paint mask";
348 ot->
idname =
"MESH_OT_paint_mask_extract";
364 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
381 switch (event->
type) {
407 params.active_face_set = face_set_id;
408 params.num_smooth_iterations = 0;
409 params.add_boundary_loop =
false;
410 params.apply_shrinkwrap =
true;
411 params.add_solidify =
true;
430 ot->
name =
"Face Set Extract";
431 ot->
description =
"Create a new mesh object from the selected Face Set";
432 ot->
idname =
"MESH_OT_face_set_extract";
457 bool keep_face =
true;
460 if (
mask < mask_threshold) {
466 keep_face = !keep_face;
480 "triangulate faces=%hf quad_method=%i ngon_method=%i",
488 "recalc_face_normals faces=%hf",
513 .use_toolflags =
true,
519 .calc_face_normal =
true,
527 .calc_object_remap =
false,
533 ushort local_view_bits = 0;
544 .use_toolflags =
true,
550 .calc_face_normal =
true,
560 .calc_object_remap =
false,
605 ot->
idname =
"MESH_OT_paint_mask_slice";
620 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
624 ot->
srna,
"fill_holes",
true,
"Fill Holes",
"Fill holes after slicing the mask");
629 "Slice to New Object",
630 "Create a new object from the sliced mask");
struct Scene * CTX_data_scene(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_on_load(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
struct bScreen * CTX_wm_screen(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
const CustomData_MeshMasks CD_MASK_EVERYTHING
void CustomData_free_layers(struct CustomData *data, int type, int totelem)
void * CustomData_get_layer(const struct CustomData *data, int type)
int CustomData_get_offset(const struct CustomData *data, int type)
const CustomData_MeshMasks CD_MASK_MESH
void BKE_editmesh_free(BMEditMesh *em)
BMEditMesh * BKE_editmesh_create(BMesh *bm, const bool do_tessellate)
struct ID * BKE_id_copy(struct Main *bmain, const struct ID *id)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_mesh_nomain_to_mesh(struct Mesh *mesh_src, struct Mesh *mesh_dst, struct Object *ob, const struct CustomData_MeshMasks *mask, bool take_ownership)
struct Mesh * BKE_mesh_from_bmesh_nomain(struct BMesh *bm, const struct BMeshToMeshParams *params, const struct Mesh *me_settings)
void BKE_mesh_calc_normals(struct Mesh *me)
void BKE_mesh_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode)
void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src)
@ BKE_MESH_BATCH_DIRTY_ALL
struct ModifierData * BKE_modifiers_findby_name(const struct Object *ob, const char *name)
#define SCULPT_FACE_SET_NONE
int BKE_sculpt_mask_layers_ensure(struct Object *ob, struct MultiresModifierData *mmd)
struct ARegion * BKE_screen_find_main_region_at_xy(struct bScreen *screen, const int space_type, const int x, const int y)
void BKE_shrinkwrap_mesh_nearest_surface_deform(struct bContext *C, struct Object *ob_source, struct Object *ob_target)
MINLINE void mul_v3_v3(float r[3], const float a[3])
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
Object is a sort of wrapper for general info.
struct ModifierData * ED_object_modifier_add(struct ReportList *reports, struct Main *bmain, struct Scene *scene, struct Object *ob, const char *name, int type)
void ED_object_sculptmode_exit(struct bContext *C, struct Depsgraph *depsgraph)
struct Object * ED_object_add_type(struct bContext *C, const int type, const char *name, const float loc[3], const float rot[3], const bool enter_editmode, const unsigned short local_view_bits) ATTR_NONNULL(1) ATTR_RETURNS_NONNULL
bool ED_operator_object_active_editable_mesh(struct bContext *C)
void ED_workspace_status_text(struct bContext *C, const char *str)
int ED_sculpt_face_sets_find_next_available_id(struct Mesh *mesh)
void ED_sculpt_undo_geometry_begin(struct Object *ob, const char *name)
void ED_sculpt_undo_geometry_end(struct Object *ob)
void ED_sculpt_face_sets_initialize_none_to_id(struct Mesh *mesh, const int new_id)
int ED_sculpt_face_sets_active_update_and_get(struct bContext *C, struct Object *ob, const float mval[2])
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_ELEM_CD_GET_INT(ele, offset)
void BM_mesh_delete_hflag_context(BMesh *bm, const char hflag, const int type)
void BM_mesh_edgenet(BMesh *bm, const bool use_edge_tag, const bool use_new_face_tag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const struct BMeshCreateParams *params)
BMesh Make Mesh.
void BM_mesh_normals_update(BMesh *bm)
BMesh Compute Normals.
#define BMALLOC_TEMPLATE_FROM_ME(...)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshParams *params)
Mesh -> BMesh.
#define BMO_FLAG_DEFAULTS
bool BMO_op_callf(BMesh *bm, const int flag, const char *fmt,...)
bool BM_vert_is_boundary(const BMVert *v)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
const Depsgraph * depsgraph
bool edbm_extrude_edges_indiv(BMEditMesh *em, wmOperator *op, const char hflag, const bool use_normal_flip)
bool EDBM_op_callf(BMEditMesh *em, wmOperator *op, const char *fmt,...)
void(* MEM_freeN)(void *vmemh)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
int num_smooth_iterations
struct SculptSession * sculpt
unsigned short local_view_uuid
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
__forceinline const avxi abs(const avxi &a)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void WM_cursor_modal_set(wmWindow *win, int val)
void WM_cursor_modal_restore(wmWindow *win)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))