Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_hash.h"
#include "BLI_math.h"
#include "BLI_task.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_mesh.h"
#include "BKE_mesh_mapping.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_pbvh.h"
#include "BKE_scene.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_message.h"
#include "WM_toolsystem.h"
#include "WM_types.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_sculpt.h"
#include "paint_intern.h"
#include "sculpt_intern.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "bmesh.h"
#include <math.h>
#include <stdlib.h>
Go to the source code of this file.
Classes | |
struct | DirtyMaskRangeData |
Typedefs | |
typedef enum eSculptMaskFilterTypes | eSculptMaskFilterTypes |
typedef struct DirtyMaskRangeData | DirtyMaskRangeData |
Enumerations | |
enum | eSculptMaskFilterTypes { MASK_FILTER_SMOOTH = 0 , MASK_FILTER_SHARPEN = 1 , MASK_FILTER_GROW = 2 , MASK_FILTER_SHRINK = 3 , MASK_FILTER_CONTRAST_INCREASE = 5 , MASK_FILTER_CONTRAST_DECREASE = 6 } |
Functions | |
static void | mask_filter_task_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls)) |
static int | sculpt_mask_filter_exec (bContext *C, wmOperator *op) |
void | SCULPT_mask_filter_smooth_apply (Sculpt *sd, Object *ob, PBVHNode **nodes, const int totnode, const int smooth_iterations) |
void | SCULPT_OT_mask_filter (struct wmOperatorType *ot) |
static float | neighbor_dirty_mask (SculptSession *ss, PBVHVertexIter *vd) |
static void | dirty_mask_compute_range_task_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls) |
static void | dirty_mask_compute_range_reduce (const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk) |
static void | dirty_mask_apply_task_cb (void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls)) |
static int | sculpt_dirty_mask_exec (bContext *C, wmOperator *op) |
void | SCULPT_OT_dirty_mask (struct wmOperatorType *ot) |
Variables | |
static EnumPropertyItem | prop_mask_filter_types [] |
typedef struct DirtyMaskRangeData DirtyMaskRangeData |
typedef enum eSculptMaskFilterTypes eSculptMaskFilterTypes |
Enumerator | |
---|---|
MASK_FILTER_SMOOTH | |
MASK_FILTER_SHARPEN | |
MASK_FILTER_GROW | |
MASK_FILTER_SHRINK | |
MASK_FILTER_CONTRAST_INCREASE | |
MASK_FILTER_CONTRAST_DECREASE |
Definition at line 50 of file sculpt_filter_mask.c.
|
static |
Definition at line 358 of file sculpt_filter_mask.c.
References BKE_pbvh_node_mark_update_mask(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, CLAMPIS, data, fminf, mask(), PBVHVertexIter::mask, max, min, neighbor_dirty_mask(), node, SculptSession::pbvh, and PBVH_ITER_UNIQUE.
Referenced by sculpt_dirty_mask_exec().
|
static |
Definition at line 348 of file sculpt_filter_mask.c.
References DirtyMaskRangeData::max, max_ff(), DirtyMaskRangeData::min, and min_ff().
Referenced by sculpt_dirty_mask_exec().
|
static |
Definition at line 330 of file sculpt_filter_mask.c.
References BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, data, DirtyMaskRangeData::max, max_ff(), DirtyMaskRangeData::min, min_ff(), neighbor_dirty_mask(), node, SculptSession::pbvh, and PBVH_ITER_UNIQUE.
Referenced by sculpt_dirty_mask_exec().
|
static |
Definition at line 77 of file sculpt_filter_mask.c.
References BKE_pbvh_node_mark_update_mask(), BKE_pbvh_vertex_iter_begin, BKE_pbvh_vertex_iter_end, clamp_f(), data, PBVHVertexIter::index, SculptVertexNeighborIter::index, PBVHVertexIter::mask, MASK_FILTER_CONTRAST_DECREASE, MASK_FILTER_CONTRAST_INCREASE, MASK_FILTER_GROW, MASK_FILTER_SHARPEN, MASK_FILTER_SHRINK, MASK_FILTER_SMOOTH, max, min, node, offset, SculptSession::pbvh, PBVH_ITER_UNIQUE, SCULPT_neighbor_mask_average(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, and update().
Referenced by sculpt_mask_filter_exec(), and SCULPT_mask_filter_smooth_apply().
|
static |
Definition at line 301 of file sculpt_filter_mask.c.
References add_v3_v3(), angle(), PBVHVertexIter::co, dot_v3v3(), PBVHVertexIter::fno, PBVHVertexIter::index, SculptVertexNeighborIter::index, max_ff(), mul_v3_fl(), PBVHVertexIter::no, normalize_v3(), normalized(), saacosf(), SCULPT_vertex_co_get(), SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN, SCULPT_VERTEX_NEIGHBORS_ITER_END, sub_v3_v3v3(), and zero_v3().
Referenced by dirty_mask_apply_task_cb(), and dirty_mask_compute_range_task_cb().
|
static |
Definition at line 391 of file sculpt_filter_mask.c.
References BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BKE_pbvh_update_vertex_data(), BKE_sculpt_update_object_for_edit(), BLI_task_parallel_range(), C, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), CTX_wm_region(), data, depsgraph, dirty_mask_apply_task_cb(), dirty_mask_compute_range_reduce(), dirty_mask_compute_range_task_cb(), ED_region_tag_redraw(), TaskParallelSettings::func_reduce, DirtyMaskRangeData::max, MEM_SAFE_FREE, DirtyMaskRangeData::min, NC_OBJECT, ND_DRAW, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, SculptSession::pbvh, PBVH_UpdateMask, SculptSession::pmap, wmOperator::ptr, RNA_boolean_get(), Object::sculpt, ToolSettings::sculpt, SCULPT_UNDO_MASK, SCULPT_undo_push_begin(), SCULPT_undo_push_end(), SCULPT_undo_push_node(), SCULPT_vertex_random_access_ensure(), TaskParallelSettings::userdata_chunk, TaskParallelSettings::userdata_chunk_size, and WM_event_add_notifier().
Referenced by SCULPT_OT_dirty_mask().
|
static |
Definition at line 173 of file sculpt_filter_mask.c.
References BKE_pbvh_parallel_range_settings(), BKE_pbvh_search_gather(), BKE_sculpt_update_object_for_edit(), BLI_task_parallel_range(), C, CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_tool_settings(), data, depsgraph, ELEM, MASK_FILTER_GROW, MASK_FILTER_SHRINK, mask_filter_task_cb(), MEM_freeN, MEM_mallocN, MEM_SAFE_FREE, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, SculptSession::pbvh, SculptSession::pmap, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), RNA_int_get(), Object::sculpt, ToolSettings::sculpt, SCULPT_tag_update_overlays(), SCULPT_UNDO_MASK, SCULPT_undo_push_begin(), SCULPT_undo_push_end(), SCULPT_undo_push_node(), SCULPT_vertex_count_get(), SCULPT_vertex_mask_get(), and SCULPT_vertex_random_access_ensure().
Referenced by SCULPT_OT_mask_filter().
void SCULPT_mask_filter_smooth_apply | ( | Sculpt * | sd, |
Object * | ob, | ||
PBVHNode ** | nodes, | ||
const int | totnode, | ||
const int | smooth_iterations | ||
) |
Definition at line 247 of file sculpt_filter_mask.c.
References BKE_pbvh_parallel_range_settings(), BLI_task_parallel_range(), data, MASK_FILTER_SMOOTH, and mask_filter_task_cb().
Referenced by sculpt_mask_expand_modal().
void SCULPT_OT_dirty_mask | ( | struct wmOperatorType * | ot | ) |
Definition at line 453 of file sculpt_filter_mask.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, ot, wmOperatorType::poll, RNA_def_boolean(), sculpt_dirty_mask_exec(), SCULPT_mode_poll(), and wmOperatorType::srna.
Referenced by ED_operatortypes_sculpt().
void SCULPT_OT_mask_filter | ( | struct wmOperatorType * | ot | ) |
Definition at line 264 of file sculpt_filter_mask.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, MASK_FILTER_SMOOTH, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, prop_mask_filter_types, RNA_def_boolean(), RNA_def_enum(), RNA_def_int(), sculpt_mask_filter_exec(), SCULPT_mode_poll(), and wmOperatorType::srna.
Referenced by ED_operatortypes_sculpt().
|
static |
Definition at line 59 of file sculpt_filter_mask.c.
Referenced by SCULPT_OT_mask_filter().