Blender V5.3
paint_vertex.cc File Reference
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "BLI_color.hh"
#include "BLI_color_mix.hh"
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_math_geom_c.hh"
#include "BLI_math_matrix.hh"
#include "BLI_task.hh"
#include "BLI_vector.hh"
#include "DNA_brush_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "RNA_access.hh"
#include "RNA_define.hh"
#include "BKE_attribute.h"
#include "BKE_attribute.hh"
#include "BKE_brush.hh"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_deform.hh"
#include "BKE_editmesh.hh"
#include "BKE_library.hh"
#include "BKE_mesh.hh"
#include "BKE_object.hh"
#include "BKE_object_types.hh"
#include "BKE_paint.hh"
#include "BKE_paint_types.hh"
#include "DEG_depsgraph.hh"
#include "WM_api.hh"
#include "WM_message.hh"
#include "WM_toolsystem.hh"
#include "WM_types.hh"
#include "ED_image.hh"
#include "ED_mesh.hh"
#include "ED_object.hh"
#include "ED_paint.hh"
#include "ED_screen.hh"
#include "ED_sculpt.hh"
#include "ED_view3d.hh"
#include "IMB_imbuf.hh"
#include "bmesh.hh"
#include "../paint_intern.hh"
#include "mesh_brush_common.hh"
#include "mesh_paint.hh"
#include "sculpt_automask.hh"
#include "sculpt_intern.hh"
#include "sculpt_pose.hh"
#include "vw_paint_intern.hh"

Go to the source code of this file.

Classes

struct  blender::VPaintAverageAccum< BlendType >
struct  blender::VPaintData
struct  blender::VertexPaintStroke

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ed
namespace  blender::ed::sculpt_paint
namespace  blender::ed::sculpt_paint::vwpaint

Enumerations

enum class  blender::AttrDomain

Functions

template<typename T>
static void blender::ed::sculpt_paint::fill_bm_face_or_corner_attribute (BMesh &bm, const T &value, const AttrDomain domain, const int cd_offset, const bool use_vert_sel, const bool only_visible=false)
template<typename T>
static void blender::ed::sculpt_paint::fill_mesh_face_or_corner_attribute (Mesh &mesh, const T &value, const AttrDomain domain, const MutableSpan< T > data, const bool use_vert_sel, const bool use_face_sel, const bool affect_alpha, const bool only_visible=false)
static void blender::ed::sculpt_paint::fill_mesh_color (Mesh &mesh, const ColorPaint4f &color, const StringRef name, const bool use_vert_sel, const bool use_face_sel, const bool affect_alpha, const bool only_visible=false)
static bool blender::ed::sculpt_paint::fill_active_color (Object &ob, ColorPaint4f fill_color, bool only_selected=true, bool affect_alpha=true, const bool only_visible=false)
bool blender::ed::sculpt_paint::object_active_color_init (Object &ob, const float fill_color[4])
Internal Utilities
static bool blender::isZero (ColorPaint4f c)
static bool blender::isZero (ColorPaint4b c)
template<typename Color>
static ColorPaint4f blender::toFloat (const Color &c)
template<typename Color>
static Color blender::fromFloat (const ColorPaint4f &c)
Shared vertex/weight paint code.
bool blender::ed::sculpt_paint::vwpaint::test_brush_angle_falloff (const Brush &brush, const float angle_cos)
bool blender::ed::sculpt_paint::vwpaint::use_normal (const VPaint &vp)
bool blender::ed::sculpt_paint::vwpaint::brush_use_accumulate_ex (const Brush &brush, const eObjectMode ob_mode)
bool blender::ed::sculpt_paint::vwpaint::brush_use_accumulate (const VPaint &vp)
void blender::ed::sculpt_paint::vwpaint::init_stroke (const wmOperator &op, Main &main, Paint &paint, Depsgraph &depsgraph, Object &ob)
void blender::ed::sculpt_paint::vwpaint::update_sculpt_normal (const Depsgraph &depsgraph, const Object &ob, const VPaint &vp, const Brush &brush, const IndexMask node_mask)
bool blender::ed::sculpt_paint::vwpaint::mode_toggle_poll_test (bContext *C)
void blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_off (Paint *paint, StrokeCache *cache)
StrokeToggleSettings blender::ed::sculpt_paint::vwpaint::create_toggle_settings (const wmOperator &op, Main &bmain, Paint &paint)
void blender::ed::sculpt_paint::vwpaint::update_cache_invariants (VPaint &vp, SculptSession &ss, wmOperator *op, const float mval[2])
void blender::ed::sculpt_paint::vwpaint::update_cache_variants (Depsgraph &depsgraph, ViewContext &vc, VPaint &vp, const PaintMode paint_mode, Object &ob, Base &base, const PaintStroke::StrokeStep &stroke_step)
void blender::ed::sculpt_paint::vwpaint::get_brush_alpha_data (const SculptSession &ss, const Paint &paint, const Brush &brush, float *r_brush_size_pressure, float *r_brush_alpha_value, float *r_brush_alpha_pressure)
void blender::ed::sculpt_paint::vwpaint::smooth_brush_toggle_on (Main *bmain, Paint *paint, StrokeToggleSettings &toggle_settings)
Vertex Paint Mode Poll & Sampling
bool blender::vertex_paint_mode_poll (bContext *C)
static bool blender::vertex_paint_poll_ex (bContext *C, bool check_tool)
bool blender::vertex_paint_poll (bContext *C)
bool blender::vertex_paint_poll_ignore_tool (bContext *C)
static ColorPaint4f blender::vpaint_get_current_col (VPaint &vp, bool secondary)
template<typename Color, typename Traits>
static Color blender::vpaint_blend (const VPaint &vp, Color color_curr, Color color_orig, Color color_paint, const typename Traits::ValueType alpha, const typename Traits::BlendType brush_alpha_value)
template<typename Color, typename Traits>
static Color blender::vpaint_blend_stroke (const VPaint &vp, MutableSpan< Color > prev_vertex_colors, MutableSpan< Color > vertex_colors, MutableSpan< Color > stroke_buffer, Color brush_mark_color, float brush_mark_alpha, float brush_strength, int index)
static void blender::paint_and_tex_color_alpha_intern (const VPaint &vp, const ViewContext *vc, const float3 &co, float4 &r_rgba)
Enter Vertex Paint Mode
void blender::ED_object_vpaintmode_enter_ex (Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
void blender::ED_object_vpaintmode_enter (bContext *C, Depsgraph &depsgraph)
Exit Vertex Paint Mode
void blender::ED_object_vpaintmode_exit_ex (Scene &scene, Object &ob)
void blender::ED_object_vpaintmode_exit (bContext *C)
Toggle Vertex Paint Operator
static wmOperatorStatus blender::vpaint_mode_toggle_exec (bContext *C, wmOperator *op)
void blender::PAINT_OT_vertex_paint_toggle (wmOperatorType *ot)
Vertex Paint Operator
template<typename Func>
static void blender::to_static_color_type (const bke::AttrType type, const Func &func)
static std::unique_ptr< VPaintData > blender::vpaint_init_vpaint (wmOperator *op, const ViewContext &vc, VPaint &vp, Mesh &mesh, const AttrDomain domain, const bke::AttrType type, const Brush &brush)
static void blender::init_session_data (Object &ob)
static void blender::filter_factors_with_selection (const Span< bool > select_vert, const Span< int > verts, const MutableSpan< float > factors)
static void blender::do_vpaint_brush_blur_loops (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, GMutableSpan attribute)
static void blender::do_vpaint_brush_blur_verts (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, GMutableSpan attribute)
static void blender::do_vpaint_brush_smear (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, GMutableSpan attribute)
static void blender::calculate_average_color (VPaintData &vpd, Object &ob, Mesh &mesh, const Brush &brush, const GSpan attribute, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask)
template<typename Color>
static float blender::paint_and_tex_color_alpha (const VPaint &vp, VPaintData &vpd, const float v_co[3], Color *r_color)
static float3 blender::get_brush_color (const Paint *paint, const Brush *brush, const StrokeCache &cache, const ColorPaint4f &paint_color)
static void blender::vpaint_do_draw (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, GMutableSpan attribute)
static void blender::vpaint_do_blur (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask, GMutableSpan attribute)
static void blender::vpaint_paint_leaves (const Depsgraph &depsgraph, const VPaint &vp, VPaintData &vpd, Object &ob, Mesh &mesh, GMutableSpan attribute, const Span< bke::pbvh::MeshNode > nodes, const IndexMask &node_mask)
static void blender::vpaint_do_paint (const Depsgraph &depsgraph, const Scene &scene, const Brush &brush, Object &ob, PaintModeData *paint_mode_data)
static wmOperatorStatus blender::vpaint_invoke (bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus blender::vpaint_exec (bContext *C, wmOperator *op)
static wmOperatorStatus blender::vpaint_modal (bContext *C, wmOperator *op, const wmEvent *event)
void blender::PAINT_OT_vertex_paint (wmOperatorType *ot)
Set Vertex Colors Operator
static wmOperatorStatus blender::vertex_color_set_exec (bContext *C, wmOperator *op)
void blender::PAINT_OT_vertex_color_set (wmOperatorType *ot)

Variables

static CLG_LogRef blender::LOG = {"paint.vertex"}

Detailed Description

Used for vertex color & weight paint and mode switching.

Note
This file is already big, use paint_vertex_color_ops.cc & paint_vertex_weight_ops.cc for general purpose operators.

Definition in file paint_vertex.cc.