Blender V4.3
sculpt_ops.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_array_utils.hh"
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_ghash.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_vector.hh"
#include "BLI_task.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "DNA_brush_types.h"
#include "DNA_listBase.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_attribute.hh"
#include "BKE_brush.hh"
#include "BKE_ccg.hh"
#include "BKE_context.hh"
#include "BKE_layer.hh"
#include "BKE_main.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_mirror.hh"
#include "BKE_multires.hh"
#include "BKE_object.hh"
#include "BKE_paint.hh"
#include "BKE_pbvh_api.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
#include "BKE_subdiv_ccg.hh"
#include "DEG_depsgraph.hh"
#include "IMB_colormanagement.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "ED_image.hh"
#include "ED_object.hh"
#include "ED_screen.hh"
#include "ED_sculpt.hh"
#include "mesh_brush_common.hh"
#include "paint_intern.hh"
#include "paint_mask.hh"
#include "sculpt_automask.hh"
#include "sculpt_color.hh"
#include "sculpt_dyntopo.hh"
#include "sculpt_face_set.hh"
#include "sculpt_flood_fill.hh"
#include "sculpt_intern.hh"
#include "sculpt_islands.hh"
#include "sculpt_undo.hh"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "CLG_log.h"
#include "bmesh.hh"
#include <cmath>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Classes

struct  blender::ed::sculpt_paint::mask::LocalData
 

Namespaces

namespace  blender
 
namespace  blender::ed
 
namespace  blender::ed::sculpt_paint
 
namespace  blender::ed::sculpt_paint::mask
 

Functions

void blender::ed::sculpt_paint::operatortypes_sculpt ()
 
void blender::ed::sculpt_paint::keymap_sculpt (wmKeyConfig *keyconf)
 
Set Persistent Base Operator
static int blender::ed::sculpt_paint::set_persistent_base_exec (bContext *C, wmOperator *)
 
static void blender::ed::sculpt_paint::SCULPT_OT_set_persistent_base (wmOperatorType *ot)
 
Optimize Operator
static int blender::ed::sculpt_paint::optimize_exec (bContext *C, wmOperator *)
 
static void blender::ed::sculpt_paint::SCULPT_OT_optimize (wmOperatorType *ot)
 
Symmetrize Operator
static bool blender::ed::sculpt_paint::no_multires_poll (bContext *C)
 
static int blender::ed::sculpt_paint::symmetrize_exec (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::SCULPT_OT_symmetrize (wmOperatorType *ot)
 
Sculpt Mode Toggle Operator
static void blender::ed::sculpt_paint::init_sculpt_mode_session (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
 
void blender::ed::sculpt_paint::ensure_valid_pivot (const Object &ob, Scene &scene)
 
void blender::ed::sculpt_paint::object_sculpt_mode_enter (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob, bool force_dyntopo, ReportList *reports)
 
void blender::ed::sculpt_paint::object_sculpt_mode_enter (bContext *C, Depsgraph &depsgraph, ReportList *reports)
 
void blender::ed::sculpt_paint::object_sculpt_mode_exit (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
 
void blender::ed::sculpt_paint::object_sculpt_mode_exit (bContext *C, Depsgraph &depsgraph)
 
static int blender::ed::sculpt_paint::sculpt_mode_toggle_exec (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::SCULPT_OT_sculptmode_toggle (wmOperatorType *ot)
 
Sample Color Operator
static int blender::ed::sculpt_paint::sample_color_invoke (bContext *C, wmOperator *op, const wmEvent *)
 
static void blender::ed::sculpt_paint::SCULPT_OT_sample_color (wmOperatorType *ot)
 

Mask By Color

#define MASK_BY_COLOR_SLOPE   0.25f
 
static float blender::ed::sculpt_paint::mask::color_delta_get (const float3 &color_a, const float3 &color_b, const float threshold, const bool invert)
 
static float blender::ed::sculpt_paint::mask::final_mask_get (const float current_mask, const float new_mask, const bool invert, const bool preserve_mask)
 
static void blender::ed::sculpt_paint::mask::mask_by_color_contiguous_mesh (const Depsgraph &depsgraph, Object &object, const int vert, const float threshold, const bool invert, const bool preserve_mask)
 
static void blender::ed::sculpt_paint::mask::mask_by_color_full_mesh (const Depsgraph &depsgraph, Object &object, const int vert, const float threshold, const bool invert, const bool preserve_mask)
 
static int blender::ed::sculpt_paint::mask::mask_by_color_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void blender::ed::sculpt_paint::mask::SCULPT_OT_mask_by_color (wmOperatorType *ot)
 

Mask from Cavity

enum class  blender::ed::sculpt_paint::mask::ApplyMaskMode : int8_t {
  blender::ed::sculpt_paint::mask::Mix , blender::ed::sculpt_paint::mask::Multiply , blender::ed::sculpt_paint::mask::Divide , blender::ed::sculpt_paint::mask::Add ,
  blender::ed::sculpt_paint::mask::Subtract
}
 
enum class  blender::ed::sculpt_paint::mask::MaskSettingsSource : int8_t { blender::ed::sculpt_paint::mask::Operator , blender::ed::sculpt_paint::mask::Scene , blender::ed::sculpt_paint::mask::Brush }
 
enum class  blender::ed::sculpt_paint::mask::MaskBoundaryMode : int8_t { blender::ed::sculpt_paint::mask::Mesh , blender::ed::sculpt_paint::mask::FaceSets }
 
static EnumPropertyItem blender::ed::sculpt_paint::mask::mix_modes []
 
static EnumPropertyItem blender::ed::sculpt_paint::mask::settings_sources []
 
static void blender::ed::sculpt_paint::mask::calc_new_masks (const ApplyMaskMode mode, const Span< float > node_mask, const MutableSpan< float > new_mask)
 
static void blender::ed::sculpt_paint::mask::apply_mask_mesh (const Depsgraph &depsgraph, const Object &object, const Span< bool > hide_vert, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const bool invert_automask, const bke::pbvh::MeshNode &node, LocalData &tls, const MutableSpan< float > mask)
 
static void blender::ed::sculpt_paint::mask::apply_mask_grids (const Depsgraph &depsgraph, Object &object, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const bool invert_automask, const bke::pbvh::GridsNode &node, LocalData &tls)
 
static void blender::ed::sculpt_paint::mask::apply_mask_bmesh (const Depsgraph &depsgraph, Object &object, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const float invert_automask, bke::pbvh::BMeshNode &node, LocalData &tls)
 
static void blender::ed::sculpt_paint::mask::apply_mask_from_settings (const Depsgraph &depsgraph, Object &object, bke::pbvh::Tree &pbvh, const IndexMask &node_mask, const auto_mask::Cache &automasking, const ApplyMaskMode mode, const float factor, const bool invert_automask)
 
static int blender::ed::sculpt_paint::mask::mask_from_cavity_exec (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::mask::mask_from_cavity_ui (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_cavity (wmOperatorType *ot)
 
static int blender::ed::sculpt_paint::mask::mask_from_boundary_exec (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::mask::mask_from_boundary_ui (bContext *C, wmOperator *op)
 
static void blender::ed::sculpt_paint::mask::SCULPT_OT_mask_from_boundary (wmOperatorType *ot)
 

Detailed Description

Implements the Sculpt Mode tools.

Definition in file sculpt_ops.cc.

Macro Definition Documentation

◆ MASK_BY_COLOR_SLOPE

#define MASK_BY_COLOR_SLOPE   0.25f

#sculpt_mask_by_color_delta_get returns values in the (0,1) range that are used to generate the mask based on the difference between two colors (the active color and the color of any other vertex). Ideally, a threshold of 0 should mask only the colors that are equal to the active color and threshold of 1 should mask all colors. In order to avoid artifacts and produce softer falloffs in the mask, the MASK_BY_COLOR_SLOPE defines the size of the transition values between masked and unmasked vertices. The smaller this value is, the sharper the generated mask is going to be.

Definition at line 684 of file sculpt_ops.cc.

Referenced by blender::ed::sculpt_paint::mask::color_delta_get().