105 .use_toolflags =
true,
111 .calc_face_normal =
true,
112 .calc_vert_normal =
true,
131 if (
params->add_boundary_loop) {
137 for (
int repeat = 0; repeat <
params->num_smooth_iterations; repeat++) {
142 for (
int i = 0; i < 3; i++) {
145 "smooth_vert verts=%hv factor=%f mirror_clip_x=%b mirror_clip_y=%b "
147 "clip_dist=%f use_axis_x=%b use_axis_y=%b use_axis_z=%b",
165 for (
int i = 0; i < 1; i++) {
168 "smooth_vert verts=%hv factor=%f mirror_clip_x=%b mirror_clip_y=%b "
170 "clip_dist=%f use_axis_x=%b use_axis_y=%b use_axis_z=%b",
191 .calc_object_remap =
false,
203 ushort local_view_bits = 0;
220 if (
params->apply_shrinkwrap) {
224 if (
params->add_solidify) {
228 new_ob,
"mask_extract_solidify");
253 bool keep_face =
true;
269 const int tag_face_set_id =
params->active_face_set;
314 "Add an extra edge loop to better preserve the shape when applying a "
315 "subdivision surface modifier");
322 "Smooth iterations applied to the extracted mesh",
329 "Project the extracted mesh into the original sculpt");
334 "Extract the mask as a solid object with a solidify modifier");
340 ot->
name =
"Mask Extract";
341 ot->
description =
"Create a new mesh object from the current paint mask";
342 ot->
idname =
"MESH_OT_paint_mask_extract";
358 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
375 switch (event->
type) {
391 const float mval[2] = {
event->xy[0] - region->
winrct.
xmin,
401 params.active_face_set = face_set_id;
402 params.num_smooth_iterations = 0;
403 params.add_boundary_loop =
false;
404 params.apply_shrinkwrap =
true;
405 params.add_solidify =
true;
424 ot->
name =
"Face Set Extract";
425 ot->
description =
"Create a new mesh object from the selected Face Set";
426 ot->
idname =
"MESH_OT_face_set_extract";
451 bool keep_face =
true;
454 if (
mask < mask_threshold) {
460 keep_face = !keep_face;
474 "triangulate faces=%hf quad_method=%i ngon_method=%i",
482 "recalc_face_normals faces=%hf",
507 .use_toolflags =
true,
513 .calc_face_normal =
true,
521 .calc_object_remap =
false,
527 ushort local_view_bits = 0;
538 .use_toolflags =
true,
544 .calc_face_normal =
true,
554 .calc_object_remap =
false,
597 ot->
idname =
"MESH_OT_paint_mask_slice";
612 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
616 ot->
srna,
"fill_holes",
true,
"Fill Holes",
"Fill holes after slicing the mask");
621 "Slice to New Object",
622 "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_data(BMEditMesh *em)
BMEditMesh * BKE_editmesh_create(BMesh *bm)
struct ID * BKE_id_copy(struct Main *bmain, const struct ID *id)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_mesh_copy_parameters_for_eval(struct Mesh *me_dst, const struct Mesh *me_src)
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_batch_cache_dirty_tag(struct Mesh *me, eMeshBatchDirtyMode mode)
@ 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 struct ARegion * BKE_screen_find_main_region_at_xy(struct bScreen *screen, int space_type, const int xy[2]) ATTR_NONNULL(1
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, int type, const char *name, const float loc[3], const float rot[3], bool enter_editmode, 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, int new_id)
int ED_sculpt_face_sets_active_update_and_get(struct bContext *C, struct Object *ob, const float mval_fl[2])
void ED_undo_push_op(struct bContext *C, struct wmOperator *op)
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)
#define BMALLOC_TEMPLATE_FROM_ME(...)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshParams *params)
void BM_mesh_normals_update(BMesh *bm)
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
#define BMO_FLAG_DEFAULTS
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
SyclQueue void void size_t num_bytes void
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,...)
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
void(* MEM_freeN)(void *vmemh)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
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
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))