80 convert_params.calc_vert_normal =
true;
81 convert_params.use_shapekey =
true;
82 convert_params.active_shapekey = ob.
shapenr;
132 &mesh->vert_data,
CD_PROP_BOOL,
".hide_vert", mesh->verts_num);
133 if (hide_vert !=
nullptr) {
134 memset(hide_vert, 0,
sizeof(
bool) * mesh->verts_num);
139 mesh->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY;
172 if (ss.
bm !=
nullptr) {
189 if (ss.
bm ==
nullptr) {
232 const char *msg_error =
RPT_(
"Attribute Data Detected");
233 const char *msg =
RPT_(
"Dyntopo will not preserve colors, UVs, or other attributes");
234 uiItemL(layout, msg_error, ICON_INFO);
235 uiItemL(layout, msg, ICON_NONE);
240 const char *msg_error =
RPT_(
"Generative Modifiers Detected!");
241 const char *msg =
RPT_(
242 "Keeping the modifiers will increase polycount when returning to object mode");
244 uiItemL(layout, msg_error, ICON_INFO);
245 uiItemL(layout, msg, ICON_NONE);
270 return std::all_of(layers.begin(), layers.end(), [&](
const CustomDataLayer &layer) {
271 return dyntopo_supports_layer(layer);
304 for (; md; md = md->
next) {
343 ot->
name =
"Dynamic Topology Toggle";
344 ot->
idname =
"SCULPT_OT_dynamic_topology_toggle";
345 ot->
description =
"Dynamic topology alters the mesh topology while sculpting";
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
void * CustomData_get_layer_named_for_write(CustomData *data, eCustomDataType type, blender::StringRef name, int totelem)
#define CD_TYPE_AS_MASK(_type)
void BKE_mesh_mselect_clear(Mesh *mesh)
bool BKE_modifier_is_enabled(const Scene *scene, ModifierData *md, int required_mode)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
ModifierData * BKE_modifiers_get_virtual_modifierlist(const Object *ob, VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
void BKE_sculptsession_bm_to_me(Object *ob, bool reorder)
void BKE_sculptsession_free_pbvh(Object &object)
void BKE_particlesystem_reset_all(struct Object *object)
A BVH for high poly meshes.
#define PTCACHE_RESET_OUTDATED
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
#define UNUSED_VARS_NDEBUG(...)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ME_SCULPT_DYNAMIC_TOPOLOGY
@ MOD_TRIANGULATE_QUAD_BEAUTY
@ MOD_TRIANGULATE_NGON_EARCLIP
UndoStack * ED_undo_stack_get()
Read Guarded memory(de)allocation.
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
void uiItemS(uiLayout *layout)
void uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
bool BM_data_layer_free_named(BMesh *bm, CustomData *data, const char *name)
void BM_data_layer_ensure_named(BMesh *bm, CustomData *data, int type, const char *name)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_log_free(BMLog *log)
BMLog * BM_log_create(BMesh *bm)
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
#define BMALLOC_TEMPLATE_FROM_ME(...)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params)
bool BM_attribute_stored_in_bmesh_builtin(const StringRef name)
void BM_mesh_normals_update(BMesh *bm)
void BM_mesh_triangulate(BMesh *bm, const int quad_method, const int ngon_method, const int min_vertices, const bool tag_only, BMOperator *op, BMOpSlot *slot_facemap_out, BMOpSlot *slot_facemap_double_out)
const Depsgraph * depsgraph
void enable_ex(Main &bmain, Depsgraph &depsgraph, Object &ob)
static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *)
void disable_with_undo(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
static void disable(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, undo::StepData *undo_step)
static bool dyntopo_supports_layer(const CustomDataLayer &layer)
static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum WarnFlag flag)
void triangulate(BMesh *bm)
WarnFlag check_attribute_warning(Scene &scene, Object &ob)
void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot)
static bool dyntopo_supports_customdata_layers(const Span< CustomDataLayer > layers)
static void enable_with_undo(Main &bmain, Depsgraph &depsgraph, const Scene &scene, Object &ob)
static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, const wmEvent *)
void push_end(Object &ob)
void push_node(const Depsgraph &depsgraph, const Object &object, const bke::pbvh::Node *node, Type type)
void push_begin_ex(const Scene &, Object &ob, const char *name)
void restore_from_bmesh_enter_geometry(const StepData &step_data, Mesh &mesh)
bool SCULPT_mode_poll(bContext *C)
struct ModifierData * next
struct SculptSession * sculpt
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_main_add_notifier(uint type, void *reference)