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

Namespaces

namespace  detail_size
 

Classes

struct  DyntopoDetailSizeEditCustomData
 
struct  SculptDetailRaycastData
 

Enumerations

enum  WarnFlag { VDATA = (1 << 0) , EDATA = (1 << 1) , LDATA = (1 << 2) , MODIFIER = (1 << 3) }
 

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 int sculpt_dynamic_topology_toggle_exec (bContext *C, wmOperator *)
 
static int dyntopo_warning_popup (bContext *C, wmOperatorType *ot, enum WarnFlag flag)
 
static bool dyntopo_supports_layer (const CustomDataLayer &layer)
 
static bool dyntopo_supports_customdata_layers (const Span< CustomDataLayer > layers)
 
WarnFlag check_attribute_warning (Scene &scene, Object &ob)
 
static int sculpt_dynamic_topology_toggle_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
void SCULPT_OT_dynamic_topology_toggle (wmOperatorType *ot)
 
 ENUM_OPERATORS (WarnFlag, MODIFIER)
 
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 int 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 *tmin)
 
static void sample_detail_dyntopo (bContext *C, ViewContext *vc, const int mval[2])
 
static int sample_detail (bContext *C, const int event_xy[2], const SampleDetailModeType mode)
 
static int sculpt_sample_detail_size_exec (bContext *C, wmOperator *op)
 
static int sculpt_sample_detail_size_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static int 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 int 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 int 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 445 of file sculpt_detail.cc.

◆ SampleDetailModeType

Enumerator
Dyntopo 
Voxel 

Definition at line 189 of file sculpt_detail.cc.

◆ WarnFlag

Enumerator
VDATA 
EDATA 
LDATA 
MODIFIER 

Definition at line 26 of file sculpt_dyntopo.hh.

Function Documentation

◆ check_attribute_warning()

◆ disable() [1/2]

void blender::ed::sculpt_paint::dyntopo::disable ( bContext * C,
undo::StepData * undo_step )

◆ 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()

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

Definition at line 801 of file sculpt_detail.cc.

References blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::active_object, Brush::add_col, BKE_brush_size_get(), BKE_paint_brush(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::brush_radius, copy_m4_m4(), copy_v3_v3(), copy_v4_v4(), CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::current_value, SculptSession::cursor_location, SculptSession::cursor_normal, SculptSession::cursor_radius, SculptSession::cursor_sampled_normal, wmOperator::customdata, DEG2RAD, depsgraph, DETAILING_MODE_BRUSH_PERCENT, DETAILING_MODE_DETAIL_SIZE, DETAILING_MODE_RESOLUTION, SculptSession::draw_faded_cursor, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::draw_handle, dyntopo_detail_size_bounds(), dyntopo_detail_size_edit_draw(), dyntopo_detail_size_initial_value(), dyntopo_detail_size_update_header(), ED_region_draw_cb_activate(), ED_region_tag_redraw(), ED_view3d_viewcontext_init(), ED_workspace_status_text(), 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, is_zero_v3(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::mode, mul_m4_m4_post(), OPERATOR_RUNNING_MODAL, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::outline_col, Sculpt::paint, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::pixel_radius, blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::preview_tri, quat_to_mat4(), blender::ed::sculpt_paint::dyntopo::DyntopoDetailSizeEditCustomData::radius, REGION_DRAW_POST_VIEW, rotate_v2_v2fl(), rotation_between_vecs_to_quat(), Object::sculpt, ToolSettings::sculpt, blender::ed::sculpt_paint::sculpt_calc_radius(), SCULPT_DYNTOPO_DETAIL_BRUSH, SCULPT_DYNTOPO_DETAIL_CONSTANT, SCULPT_DYNTOPO_DETAIL_MANUAL, SCULPT_vertex_random_access_ensure(), translate_m4(), WM_event_add_modal_handler(), and zero_v3().

Referenced by SCULPT_OT_dyntopo_detail_size_edit().

◆ dyntopo_detail_size_edit_modal()

◆ dyntopo_detail_size_initial_value()

static float blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_initial_value ( const Sculpt * sd,
const eDyntopoDetailingMode mode )
static

◆ dyntopo_detail_size_parallel_lines_draw()

◆ dyntopo_detail_size_sample_from_surface()

◆ dyntopo_detail_size_update_from_mouse_delta()

◆ dyntopo_detail_size_update_header()

◆ dyntopo_supports_customdata_layers()

static bool blender::ed::sculpt_paint::dyntopo::dyntopo_supports_customdata_layers ( const Span< CustomDataLayer > layers)
static

Definition at line 268 of file sculpt_dyntopo.cc.

Referenced by check_attribute_warning().

◆ dyntopo_supports_layer()

static bool blender::ed::sculpt_paint::dyntopo::dyntopo_supports_layer ( const CustomDataLayer & layer)
static

◆ dyntopo_warning_popup()

static int blender::ed::sculpt_paint::dyntopo::dyntopo_warning_popup ( bContext * C,
wmOperatorType * ot,
enum WarnFlag flag )
static

◆ enable_ex()

◆ enable_with_undo()

◆ ENUM_OPERATORS()

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

◆ sample_detail()

◆ sample_detail_dyntopo()

◆ sample_detail_voxel()

◆ sculpt_and_constant_or_manual_detail_poll()

static bool blender::ed::sculpt_paint::dyntopo::sculpt_and_constant_or_manual_detail_poll ( bContext * C)
static

◆ sculpt_and_dynamic_topology_poll()

static bool blender::ed::sculpt_paint::dyntopo::sculpt_and_dynamic_topology_poll ( bContext * C)
static

◆ sculpt_detail_flood_fill_exec()

◆ sculpt_dynamic_topology_toggle_exec()

◆ sculpt_dynamic_topology_toggle_invoke()

static int blender::ed::sculpt_paint::dyntopo::sculpt_dynamic_topology_toggle_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ 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()

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

◆ sculpt_sample_detail_size_invoke()

static int blender::ed::sculpt_paint::dyntopo::sculpt_sample_detail_size_invoke ( bContext * C,
wmOperator * op,
const wmEvent *  )
static

◆ sculpt_sample_detail_size_modal()

◆ stroke_is_dyntopo()

bool blender::ed::sculpt_paint::dyntopo::stroke_is_dyntopo ( const Object & object,
const Brush & brush )

Returns true if the stroke will use dynamic topology, false otherwise.

Factors: some brushes like grab cannot do dynamic topology. Others, like smooth, are better without. Same goes for alt-key smoothing.

Definition at line 829 of file sculpt.cc.

References blender::ed::sculpt_paint::StrokeCache::alt_smooth, blender::bke::pbvh::BMesh, BRUSH_ANCHORED, BRUSH_DRAG_DOT, SculptSession::cache, Brush::flag, blender::bke::object::pbvh_get(), Brush::sculpt_brush_type, SCULPT_BRUSH_TYPE_HAS_DYNTOPO, and blender::bke::pbvh::Tree::type().

Referenced by blender::ed::sculpt_paint::calc_area_center(), and blender::ed::sculpt_paint::auto_mask::is_enabled().

◆ triangulate()

void blender::ed::sculpt_paint::dyntopo::triangulate ( BMesh * bm)

Variable Documentation

◆ LOG

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

Definition at line 61 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},
}
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int

Definition at line 194 of file sculpt_detail.cc.

Referenced by SCULPT_OT_sample_detail_size().