Blender V5.3
blender::ed::sculpt_paint::dyntopo Namespace Reference

Namespaces

namespace  detail_size

Classes

struct  SculptDetailRaycastData
struct  DyntopoDetailSizeEditCustomData

Enumerations

enum  WarnFlag { OKAY = 0 , ATTRIBUTES = (1 << 1) , MODIFIER = (1 << 2) }

Functions

bool stroke_is_dyntopo (const Object &object, const Brush &brush)
void triangulate (BMesh *bm)
void enable_ex (Main &bmain, Depsgraph &depsgraph, Object &ob)
static void disable (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, undo::StepData *undo_step)
void disable (bContext *C, undo::StepData *undo_step)
void disable_with_undo (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
static void enable_with_undo (Main &bmain, Depsgraph &depsgraph, const Scene &scene, Object &ob)
static wmOperatorStatus sculpt_dynamic_topology_toggle_exec (bContext *C, wmOperator *)
static bool dyntopo_supports_layer (const bke::AttributeIter &iter)
WarnFlag check_attribute_warning (Scene &scene, Object &ob)
static wmOperatorStatus sculpt_dynamic_topology_toggle_invoke (bContext *C, wmOperator *op, const wmEvent *)
void SCULPT_OT_dynamic_topology_toggle (wmOperatorType *ot)
 ENUM_OPERATORS (WarnFlag)
Internal Utilities
static bool sculpt_and_constant_or_manual_detail_poll (bContext *C)
static bool sculpt_and_dynamic_topology_poll (bContext *C)
Detail Flood Fill
static wmOperatorStatus sculpt_detail_flood_fill_exec (bContext *C, wmOperator *op)
void SCULPT_OT_detail_flood_fill (wmOperatorType *ot)

Variables

static CLG_LogRef LOG = {"sculpt.detail"}

Sample Detail Size

enum class  SampleDetailModeType { Dyntopo = 0 , Voxel = 1 }
static EnumPropertyItem prop_sculpt_sample_detail_mode_types []
static bool sample_detail_voxel (bContext *C, ViewContext *vc, const int mval[2])
static void sculpt_raycast_detail_cb (bke::pbvh::BMeshNode &node, SculptDetailRaycastData &srd, float *distance)
static void sample_detail_dyntopo (bContext *C, ViewContext *vc, const int mval[2])
static wmOperatorStatus sample_detail (bContext *C, const int event_xy[2], const SampleDetailModeType mode)
static wmOperatorStatus sculpt_sample_detail_size_exec (bContext *C, wmOperator *op)
static wmOperatorStatus sculpt_sample_detail_size_invoke (bContext *C, wmOperator *op, const wmEvent *)
static wmOperatorStatus sculpt_sample_detail_size_modal (bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_sample_detail_size (wmOperatorType *ot)

Dyntopo Detail Size Edit Operator

enum  eDyntopoDetailingMode { DETAILING_MODE_RESOLUTION = 0 , DETAILING_MODE_BRUSH_PERCENT = 1 , DETAILING_MODE_DETAIL_SIZE = 2 }
static void dyntopo_detail_size_parallel_lines_draw (uint pos3d, DyntopoDetailSizeEditCustomData *cd, const float start_co[3], const float end_co[3], bool flip, const float angle)
static void dyntopo_detail_size_edit_draw (const bContext *, ARegion *, void *arg)
static void dyntopo_detail_size_edit_cancel (bContext *C, wmOperator *op)
static void dyntopo_detail_size_bounds (DyntopoDetailSizeEditCustomData *cd)
static void dyntopo_detail_size_sample_from_surface (Object &ob, DyntopoDetailSizeEditCustomData *cd)
static void dyntopo_detail_size_update_from_mouse_delta (DyntopoDetailSizeEditCustomData *cd, const wmEvent *event)
static void dyntopo_detail_size_update_header (bContext *C, const DyntopoDetailSizeEditCustomData *cd)
static wmOperatorStatus dyntopo_detail_size_edit_modal (bContext *C, wmOperator *op, const wmEvent *event)
static float dyntopo_detail_size_initial_value (const Sculpt *sd, const eDyntopoDetailingMode mode)
static wmOperatorStatus dyntopo_detail_size_edit_invoke (bContext *C, wmOperator *op, const wmEvent *event)
void SCULPT_OT_dyntopo_detail_size_edit (wmOperatorType *ot)

Enumeration Type Documentation

◆ eDyntopoDetailingMode

Enumerator
DETAILING_MODE_RESOLUTION 
DETAILING_MODE_BRUSH_PERCENT 
DETAILING_MODE_DETAIL_SIZE 

Definition at line 458 of file sculpt_detail.cc.

◆ SampleDetailModeType

Enumerator
Dyntopo 
Voxel 

Definition at line 195 of file sculpt_detail.cc.

◆ WarnFlag

Enumerator
OKAY 
ATTRIBUTES 
MODIFIER 

Definition at line 28 of file sculpt_dyntopo.hh.

Function Documentation

◆ check_attribute_warning()

◆ disable() [1/2]

◆ disable() [2/2]

◆ disable_with_undo()

◆ dyntopo_detail_size_bounds()

◆ dyntopo_detail_size_edit_cancel()

◆ dyntopo_detail_size_edit_draw()

◆ dyntopo_detail_size_edit_invoke()

wmOperatorStatus blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Definition at line 821 of file sculpt_detail.cc.

References blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::active_object, blender::BKE_brush_radius_get(), blender::BKE_paint_brush(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::brush_radius, C, blender::copy_m4_m4(), blender::copy_v3_v3(), blender::copy_v4_v4(), blender::CTX_data_active_object(), blender::CTX_data_ensure_evaluated_depsgraph(), blender::CTX_data_tool_settings(), blender::CTX_wm_region(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::current_value, blender::SculptSession::cursor_location, blender::SculptSession::cursor_normal, blender::SculptSession::cursor_radius, blender::SculptSession::cursor_sampled_normal, blender::wmOperator::customdata, DEG2RAD, DETAILING_MODE_BRUSH_PERCENT, DETAILING_MODE_DETAIL_SIZE, DETAILING_MODE_RESOLUTION, blender::SculptSession::draw_faded_cursor, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::draw_handle, dyntopo_detail_size_bounds(), dyntopo_detail_size_edit_draw(), dyntopo_detail_size_edit_invoke(), dyntopo_detail_size_initial_value(), dyntopo_detail_size_update_header(), blender::ED_region_draw_cb_activate(), blender::ED_region_tag_redraw(), blender::ED_view3d_viewcontext_init(), blender::ED_workspace_status_text(), blender::Sculpt::flags, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::gizmo_mat, IFACE_, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::init_mval, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::init_value, blender::MEM_new_zeroed(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::mode, blender::mul_m4_m4_post(), blender::ed::sculpt_paint::object_space_radius_get(), blender::OPERATOR_RUNNING_MODAL, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::outline_col, blender::Sculpt::paint, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::pixel_radius, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::preview_tri, blender::quat_to_mat4(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::radius, REGION_DRAW_POST_VIEW, blender::rotate_v2_v2fl(), blender::rotation_between_vecs_to_quat(), blender::ARegion::runtime, blender::Object::runtime, blender::ToolSettings::sculpt, blender::SCULPT_DYNTOPO_DETAIL_BRUSH, blender::SCULPT_DYNTOPO_DETAIL_CONSTANT, blender::SCULPT_DYNTOPO_DETAIL_MANUAL, blender::bke::ObjectRuntime::sculpt_session, blender::translate_m4(), blender::bke::ARegionRuntime::type, blender::ed::sculpt_paint::vert_random_access_ensure(), blender::WM_event_add_modal_handler(), and blender::zero_v3().

Referenced by dyntopo_detail_size_edit_invoke(), and SCULPT_OT_dyntopo_detail_size_edit().

◆ dyntopo_detail_size_edit_modal()

wmOperatorStatus blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_modal ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Definition at line 740 of file sculpt_detail.cc.

References C, blender::Sculpt::constant_detail, blender::CTX_data_active_object(), blender::CTX_data_tool_settings(), blender::CTX_wm_area(), blender::CTX_wm_region(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::current_value, blender::wmOperator::customdata, blender::Sculpt::detail_percent, blender::Sculpt::detail_size, DETAILING_MODE_BRUSH_PERCENT, DETAILING_MODE_RESOLUTION, blender::SculptSession::draw_faded_cursor, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::draw_handle, dyntopo_detail_size_edit_cancel(), dyntopo_detail_size_edit_modal(), dyntopo_detail_size_sample_from_surface(), dyntopo_detail_size_update_from_mouse_delta(), dyntopo_detail_size_update_header(), blender::ED_area_status_text(), blender::ED_region_draw_cb_exit(), blender::ED_region_tag_redraw(), blender::ED_workspace_status_text(), ELEM, blender::EVT_ESCKEY, blender::EVT_LEFTCTRLKEY, blender::EVT_PADENTER, blender::EVT_RETKEY, blender::EVT_RIGHTCTRLKEY, blender::KM_PRESS, blender::KM_RELEASE, blender::LEFTMOUSE, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::mode, blender::OPERATOR_FINISHED, blender::OPERATOR_RUNNING_MODAL, blender::RIGHTMOUSE, blender::ARegion::runtime, blender::Object::runtime, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::sample_mode, blender::ToolSettings::sculpt, blender::bke::ObjectRuntime::sculpt_session, blender::bke::ARegionRuntime::type, blender::wmEvent::type, and blender::wmEvent::val.

Referenced by dyntopo_detail_size_edit_modal(), and SCULPT_OT_dyntopo_detail_size_edit().

◆ dyntopo_detail_size_initial_value()

◆ dyntopo_detail_size_parallel_lines_draw()

void blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_parallel_lines_draw ( uint pos3d,
DyntopoDetailSizeEditCustomData * cd,
const float start_co[3],
const float end_co[3],
bool flip,
const float angle )
static

◆ dyntopo_detail_size_sample_from_surface()

◆ dyntopo_detail_size_update_from_mouse_delta()

◆ dyntopo_detail_size_update_header()

◆ dyntopo_supports_layer()

bool blender::ed::sculpt_paint::dyntopo::dyntopo_supports_layer ( const bke::AttributeIter & iter)
static

◆ enable_ex()

◆ enable_with_undo()

◆ ENUM_OPERATORS()

blender::ed::sculpt_paint::dyntopo::ENUM_OPERATORS ( WarnFlag )

◆ sample_detail()

◆ sample_detail_dyntopo()

◆ sample_detail_voxel()

◆ sculpt_and_constant_or_manual_detail_poll()

◆ sculpt_and_dynamic_topology_poll()

◆ sculpt_detail_flood_fill_exec()

wmOperatorStatus blender::ed::sculpt_paint::dyntopo::sculpt_detail_flood_fill_exec ( bContext * C,
wmOperator * op )
static

Definition at line 104 of file sculpt_detail.cc.

References blender::bke::pbvh::all_leaf_nodes(), blender::BKE_base_is_visible(), blender::BKE_pbvh_node_mark_topology_update(), blender::BKE_sculptsession_free_pbvh(), blender::BLI_time_now_seconds(), blender::SculptSession::bm, blender::SculptSession::bm_log, blender::bke::pbvh::bmesh_update_topology(), blender::bke::pbvh::bounds_get(), C, CLOG_DEBUG, blender::Sculpt::constant_detail, blender::CTX_data_active_base(), blender::CTX_data_active_object(), blender::CTX_data_depsgraph_pointer(), blender::CTX_data_scene(), blender::CTX_data_tool_settings(), blender::CTX_wm_view3d(), blender::DEG_id_tag_update(), blender::ed::sculpt_paint::dyntopo::detail_size::EDGE_LENGTH_MIN_FACTOR, blender::index_mask::IndexMask::foreach_index(), blender::Object::id, blender::ID_RECALC_GEOMETRY, LOG, blender::mat4_to_scale(), blender::math::midpoint(), NC_OBJECT, ND_DRAW, blender::OPERATOR_CANCELLED, blender::OPERATOR_FINISHED, blender::PBVH_Collapse, blender::bke::object::pbvh_get(), blender::PBVH_Subdivide, blender::ed::sculpt_paint::undo::Position, blender::ed::sculpt_paint::undo::push_begin(), blender::ed::sculpt_paint::undo::push_end(), blender::ed::sculpt_paint::undo::push_node(), blender::math::reduce_max(), blender::Object::runtime, blender::ToolSettings::sculpt, sculpt_detail_flood_fill_exec(), blender::bke::ObjectRuntime::sculpt_session, and blender::WM_event_add_notifier().

Referenced by sculpt_detail_flood_fill_exec(), and SCULPT_OT_detail_flood_fill().

◆ sculpt_dynamic_topology_toggle_exec()

◆ sculpt_dynamic_topology_toggle_invoke()

◆ SCULPT_OT_detail_flood_fill()

◆ SCULPT_OT_dynamic_topology_toggle()

◆ SCULPT_OT_dyntopo_detail_size_edit()

◆ SCULPT_OT_sample_detail_size()

◆ sculpt_raycast_detail_cb()

◆ sculpt_sample_detail_size_exec()

wmOperatorStatus blender::ed::sculpt_paint::dyntopo::sculpt_sample_detail_size_exec ( bContext * C,
wmOperator * op )
static

◆ sculpt_sample_detail_size_invoke()

◆ sculpt_sample_detail_size_modal()

◆ stroke_is_dyntopo()

◆ triangulate()

Variable Documentation

◆ LOG

CLG_LogRef blender::ed::sculpt_paint::dyntopo::LOG = {"sculpt.detail"}
static

Definition at line 67 of file sculpt_detail.cc.

Referenced by sculpt_detail_flood_fill_exec().

◆ prop_sculpt_sample_detail_mode_types

EnumPropertyItem blender::ed::sculpt_paint::dyntopo::prop_sculpt_sample_detail_mode_types[]
static
Initial value:
= {
{int(SampleDetailModeType::Dyntopo), "DYNTOPO", 0, "Dyntopo", "Sample dyntopo detail"},
{int(SampleDetailModeType::Voxel), "VOXEL", 0, "Voxel", "Sample mesh voxel size"},
{0, nullptr, 0, nullptr, nullptr},
}

Definition at line 200 of file sculpt_detail.cc.

Referenced by SCULPT_OT_sample_detail_size().