136 for (
int i = 0; i < 3; i++) {
146 for (
int i = 0; i < 1; i++) {
163 new_mesh->attributes_for_write().remove(
".sculpt_face_set");
166 new_mesh->attributes_for_write().remove(
".sculpt_mask");
175 ushort local_view_bits = 0;
217 bool keep_face =
true;
226 if (
mask < threshold) {
255 if (!
mesh->attributes().contains(
".sculpt_mask")) {
281 C, op,
e,
IFACE_(
"Create Mesh From Paint Mask"),
IFACE_(
"Extract"));
290 "Add an extra edge loop to better preserve the shape when applying a "
291 "subdivision surface modifier");
298 "Smooth iterations applied to the extracted mesh",
305 "Project the extracted mesh into the original sculpt");
310 "Extract the mask as a solid object with a solidify modifier");
315 ot->
name =
"Mask Extract";
316 ot->
description =
"Create a new mesh object from the current paint mask";
317 ot->
idname =
"SCULPT_OT_paint_mask_extract";
332 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
367 ot->
name =
"Face Set Extract";
368 ot->
description =
"Create a new mesh object from the selected face set";
369 ot->
idname =
"SCULPT_OT_face_set_extract";
393 bool keep_face =
true;
396 if (
mask < mask_threshold) {
406 keep_face = !keep_face;
420 "triangulate faces=%hf quad_method=%i ngon_method=%i",
428 "recalc_face_normals faces=%hf",
443 if (!
mesh->attributes().contains(
".sculpt_mask")) {
474 if (create_new_object) {
475 ushort local_view_bits = 0;
494 new_ob_mesh->attributes_for_write().remove(
".sculpt_mask");
496 Mesh *new_mesh = id_cast<Mesh *>(new_ob->
data);
509 if (
mesh->attributes().contains(
".sculpt_face_set")) {
514 if (!create_new_object) {
531 ot->
name =
"Mask Slice";
532 ot->
description =
"Slices the paint mask from the mesh";
533 ot->
idname =
"SCULPT_OT_paint_mask_slice";
547 "Minimum mask value to consider the vertex valid to extract a face from the original mesh",
551 ot->
srna,
"fill_holes",
true,
"Fill Holes",
"Fill holes after slicing the mask");
556 "Slice to New Object",
557 "Create a new object from the sliced mask");
CustomData interface, see also DNA_customdata_types.h.
Object is a sort of wrapper for general info.
Read Blender memory allocation and freeing.
#define BM_ELEM_CD_GET_FLOAT(ele, offset)
#define BM_ELEM_CD_GET_INT(ele, offset)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_flag_test_bool(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BMALLOC_TEMPLATE_FROM_ME(...)
#define BMO_FLAG_DEFAULTS
float2x2 invert(float2x2 mat)
ModifierData * modifier_add(ReportList *reports, Main *bmain, Scene *scene, Object *ob, const char *name, int type)
Object * add_type(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
void initialize_none_to_id(Mesh *mesh, int new_id)
int active_update_and_get(bContext *C, Object &ob, const float mval_fl[2])
int find_next_available_id(const Mesh &mesh)
void geometry_begin(const Scene &scene, Object &ob, const wmOperator *op)
void geometry_end(Object &ob)
void SCULPT_OT_paint_mask_slice(wmOperatorType *ot)
static void geometry_extract_tag_masked_faces(BMesh *bm, GeometryExtractParams *params)
static wmOperatorStatus paint_mask_extract_invoke(bContext *C, wmOperator *op, const wmEvent *e)
static bool geometry_extract_poll(bContext *C)
static constexpr int face_set_none_id
void(BMesh *, GeometryExtractParams *) GeometryExtractTagMeshFunc
static void geometry_extract_props(StructRNA *srna)
void object_sculpt_mode_exit(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
static wmOperatorStatus paint_mask_slice_exec(bContext *C, wmOperator *op)
static wmOperatorStatus geometry_extract_apply(bContext *C, wmOperator *op, GeometryExtractTagMeshFunc *tag_fn, GeometryExtractParams *params)
static wmOperatorStatus paint_mask_extract_exec(bContext *C, wmOperator *op)
static void slice_paint_mask(BMesh *bm, bool invert, bool fill_holes, float mask_threshold)
static wmOperatorStatus face_set_extract_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_paint_mask_extract(wmOperatorType *ot)
static void geometry_extract_tag_face_set(BMesh *bm, GeometryExtractParams *params)
void SCULPT_OT_face_set_extract(wmOperatorType *ot)
void BM_mesh_delete_hflag_context(BMesh *bm, const char hflag, const int type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BM_mesh_elem_hflag_enable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
ModifierData * BKE_modifiers_findby_name(const Object *ob, const char *name)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
bool EDBM_extrude_edges_indiv(BMesh *bm, wmOperator *op, char hflag, bool use_normal_flip)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, Mesh *mesh_dst, Object *ob, bool process_shape_keys=true)
Mesh * BKE_mesh_from_bmesh_nomain(BMesh *bm, const BMeshToMeshParams *params, const Mesh *me_settings)
int RNA_int_get(PointerRNA *ptr, const char *name)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
ATTR_WARN_UNUSED_RESULT const BMVert * v
void BKE_shrinkwrap_mesh_nearest_surface_deform(Depsgraph *depsgraph, Scene *scene, Object *ob_source, Object *ob_target)
void ED_undo_push_op(bContext *C, wmOperator *op)
bool BM_vert_is_boundary(const BMVert *v)
void BKE_sculptsession_free_pbvh(Object &object)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params)
Mesh -> BMesh.
PropertyRNA * RNA_def_float_factor(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void BM_mesh_edgenet(BMesh *bm, const bool use_edge_tag, const bool use_new_face_tag)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
MINLINE void mul_v3_v3(float r[3], const float a[3])
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_mesh_batch_cache_dirty_tag(Mesh *mesh, eMeshBatchDirtyMode mode)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, StringRef name)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BMO_op_callf(BMesh *bm, int flag, const char *fmt,...)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void BKE_id_free(Main *bmain, void *idv)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, wmOperator *op, const wmEvent *, std::optional< std::string > title, std::optional< std::string > confirm_text, const bool cancel_default, std::optional< std::string > message)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
Depsgraph * CTX_data_depsgraph_on_load(const bContext *C)
Main * CTX_data_main(const bContext *C)
void DEG_relations_tag_update(Main *bmain)
Scene * CTX_data_scene(const bContext *C)
@ OPTYPE_DEPENDS_ON_CURSOR
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
bool ED_operator_object_active_editable_mesh(bContext *C)
@ BKE_MESH_BATCH_DIRTY_ALL
bool EDBM_smooth_vert(BMesh *bm, wmOperator *op)
ID * BKE_id_copy(Main *bmain, const ID *id)
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
Object * CTX_data_active_object(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
float RNA_float_get(PointerRNA *ptr, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void BM_mesh_normals_update(BMesh *bm)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ObjectRuntime * runtime
unsigned short local_view_uid
SculptSession * sculpt_session
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports