93 int cd_node_layer_index;
95 char layer_id[] =
"_dyntopo_node_id";
98 if (cd_node_layer_index == -1) {
112 if (cd_node_layer_index == -1) {
143 .use_toolflags =
false,
149 .calc_face_normal = true,
150 .calc_vert_normal = true,
151 .use_shapekey = true,
152 .active_shapekey = ob->shapenr,
220 for (
int i = 0; i < me->
totpoly; i++) {
226 for (
int i = 0; i < me->
totvert; i++) {
331 const char *msg_error =
TIP_(
"Vertex Data Detected!");
332 const char *msg =
TIP_(
"Dyntopo will not preserve vertex colors, UVs, or other customdata");
333 uiItemL(layout, msg_error, ICON_INFO);
334 uiItemL(layout, msg, ICON_NONE);
339 const char *msg_error =
TIP_(
"Generative Modifiers Detected!");
340 const char *msg =
TIP_(
341 "Keeping the modifiers will increase polycount when returning to object mode");
343 uiItemL(layout, msg_error, ICON_INFO);
344 uiItemL(layout, msg, ICON_NONE);
384 for (; md; md = md->
next) {
423 ot->
name =
"Dynamic Topology Toggle";
424 ot->
idname =
"SCULPT_OT_dynamic_topology_toggle";
425 ot->
description =
"Dynamic topology alters the mesh topology while sculpting";
struct Scene * CTX_data_scene(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void CustomData_free(struct CustomData *data, int totelem)
void CustomData_copy(const struct CustomData *source, struct CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
bool CustomData_has_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name)
int CustomData_get_layer_index(const struct CustomData *data, int type)
void * CustomData_get_layer(const struct CustomData *data, int type)
void * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
int CustomData_get_n_offset(const struct CustomData *data, int type, int n)
const CustomData_MeshMasks CD_MASK_MESH
void BKE_mesh_update_customdata_pointers(struct Mesh *me, bool do_ensure_tess_cd)
void BKE_mesh_mselect_clear(struct Mesh *me)
const ModifierTypeInfo * BKE_modifier_get_info(ModifierType type)
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
@ eModifierTypeType_Constructive
General operations, lookup, etc. for blender objects.
void BKE_object_free_derived_caches(struct Object *ob)
void BKE_sculptsession_bm_to_me(struct Object *ob, bool reorder)
void BKE_particlesystem_reset_all(struct Object *object)
A BVH for high poly meshes.
void BKE_pbvh_free(PBVH *pbvh)
#define PTCACHE_RESET_OUTDATED
int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode)
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain)
#define UNUSED_VARS_NDEBUG(...)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
@ ME_SCULPT_DYNAMIC_TOPOLOGY
@ MOD_TRIANGULATE_NGON_EARCLIP
@ MOD_TRIANGULATE_QUAD_BEAUTY
@ SCULPT_DYNTOPO_SMOOTH_SHADING
struct UndoStack * ED_undo_stack_get(void)
Read Guarded memory(de)allocation.
void uiItemL(uiLayout *layout, const char *name, int icon)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemS(uiLayout *layout)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
void BM_data_layer_add_named(BMesh *bm, CustomData *data, int type, const char *name)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMLog * BM_log_create(BMesh *bm)
void BM_log_free(BMLog *log)
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)
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
bool SCULPT_mode_poll(bContext *C)
static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(op))
static void SCULPT_dynamic_topology_disable_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob, SculptUndoNode *unode)
enum eDynTopoWarnFlag SCULPT_dynamic_topology_check(Scene *scene, Object *ob)
void SCULPT_pbvh_clear(Object *ob)
void SCULPT_OT_dynamic_topology_toggle(wmOperatorType *ot)
static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, enum eDynTopoWarnFlag flag)
void sculpt_dynamic_topology_disable_with_undo(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
void SCULPT_dynamic_topology_disable(bContext *C, SculptUndoNode *unode)
void SCULPT_dynamic_topology_enable_ex(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
static int sculpt_dynamic_topology_toggle_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void SCULPT_dyntopo_node_layers_add(SculptSession *ss)
void SCULPT_dynamic_topology_triangulate(BMesh *bm)
static void sculpt_dynamic_topology_enable_with_undo(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
void SCULPT_undo_push_begin(struct Object *ob, const char *name)
void SCULPT_undo_push_end(struct Object *ob)
SculptUndoNode * SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type)
@ SCULPT_UNDO_DYNTOPO_END
@ SCULPT_UNDO_DYNTOPO_BEGIN
int face_sets_color_default
struct ModifierData * next
struct SculptSession * sculpt
struct ToolSettings * toolsettings
struct MeshElemMap * pmap
SculptUndoNodeGeometry geometry_bmesh_enter
int(* invoke)(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 wmOperatorType * type
void WM_cursor_wait(bool val)
void WM_main_add_notifier(unsigned int type, void *reference)