Blender V4.3
paint_vertex_weight_ops.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_bitmap.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.h"
#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.hh"
#include "BKE_brush.hh"
#include "BKE_colortools.hh"
#include "BKE_context.hh"
#include "BKE_deform.hh"
#include "BKE_mesh.hh"
#include "BKE_mesh_iterators.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_object_deform.h"
#include "BKE_paint.hh"
#include "BKE_report.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "ED_armature.hh"
#include "ED_mesh.hh"
#include "ED_screen.hh"
#include "ED_view3d.hh"
#include "UI_interface.hh"
#include "UI_resources.hh"
#include "paint_intern.hh"

Go to the source code of this file.

Classes

struct  WPaintPrev
 
struct  WPGradient_vertStore
 
struct  WPGradient_vertStoreBase
 
struct  WPGradient_userData
 

Functions

Store Previous Weights

Use to avoid feedback loop w/ mirrored edits.

static void wpaint_prev_init (WPaintPrev *wpp)
 
static void wpaint_prev_create (WPaintPrev *wpp, MDeformVert *dverts, int dcount)
 
static void wpaint_prev_destroy (WPaintPrev *wpp)
 
Weight from Bones Operator
static bool weight_from_bones_poll (bContext *C)
 
static int weight_from_bones_exec (bContext *C, wmOperator *op)
 
void PAINT_OT_weight_from_bones (wmOperatorType *ot)
 
Sample Weight Operator
static int weight_sample_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void PAINT_OT_weight_sample (wmOperatorType *ot)
 
Weight Paint Sample Group Operator
static bool weight_paint_sample_mark_groups (const MDeformVert *dvert, blender::MutableSpan< bool > groups)
 
static int weight_sample_group_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void PAINT_OT_weight_sample_group (wmOperatorType *ot)
 
Weight Set Operator
static bool weight_paint_set (Object *ob, float paintweight)
 
static int weight_paint_set_exec (bContext *C, wmOperator *op)
 
void PAINT_OT_weight_set (wmOperatorType *ot)
 
Interactive Weight Gradient Operator
 ENUM_OPERATORS (WPGradient_vertStore::Flag, WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED)
 
static void gradientVert_update (WPGradient_userData *grad_data, int index)
 
static void gradientVertUpdate__mapFunc (void *user_data, int index, const float[3], const float[3])
 
static void gradientVertInit__mapFunc (void *user_data, int index, const float co[3], const float[3])
 
static int paint_weight_gradient_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int paint_weight_gradient_exec (bContext *C, wmOperator *op)
 
static int paint_weight_gradient_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
void PAINT_OT_weight_gradient (wmOperatorType *ot)
 

Function Documentation

◆ ENUM_OPERATORS()

◆ gradientVert_update()

◆ gradientVertInit__mapFunc()

◆ gradientVertUpdate__mapFunc()

static void gradientVertUpdate__mapFunc ( void * user_data,
int index,
const float [3],
const float [3] )
static

◆ PAINT_OT_weight_from_bones()

◆ PAINT_OT_weight_gradient()

◆ PAINT_OT_weight_sample()

◆ PAINT_OT_weight_sample_group()

◆ PAINT_OT_weight_set()

◆ paint_weight_gradient_exec()

◆ paint_weight_gradient_invoke()

◆ paint_weight_gradient_modal()

◆ weight_from_bones_exec()

◆ weight_from_bones_poll()

static bool weight_from_bones_poll ( bContext * C)
static

◆ weight_paint_sample_mark_groups()

static bool weight_paint_sample_mark_groups ( const MDeformVert * dvert,
blender::MutableSpan< bool > groups )
static

Samples cursor location, and gives menu with vertex groups to activate. This function fills in used vertex-groups.

Definition at line 299 of file paint_vertex_weight_ops.cc.

References MDeformWeight::def_nr, MDeformVert::dw, MDeformVert::totweight, and UNLIKELY.

Referenced by weight_sample_group_invoke().

◆ weight_paint_set()

◆ weight_paint_set_exec()

◆ weight_sample_group_invoke()

◆ weight_sample_invoke()

static int weight_sample_invoke ( bContext * C,
wmOperator * op,
const wmEvent * event )
static

Sets wp->weight to the closest weight value to vertex.

Note
we can't sample front-buffer, weight colors are interpolated too unpredictable.

Definition at line 168 of file paint_vertex_weight_ops.cc.

References ToolSettings::auto_normalize, BKE_brush_weight_set(), BKE_defvert_find_weight(), BKE_defvert_lock_relative_weight(), BKE_defvert_multipaint_collective_weight(), BKE_mesh_from_object(), BKE_object_defgroup_check_lock_relative(), BKE_object_defgroup_check_lock_relative_multi(), BKE_object_defgroup_lock_flags_get(), BKE_object_defgroup_mirror_selection(), BKE_object_defgroup_selected_get(), BKE_object_defgroup_split_locked_validmap(), BKE_object_defgroup_validmap_get(), BKE_paint_brush(), BKE_report(), BLI_listbase_count(), CLAMP, CTX_data_ensure_evaluated_depsgraph(), depsgraph, ED_MESH_PICK_DEFAULT_FACE_DIST, ED_MESH_PICK_DEFAULT_VERT_DIST, ED_mesh_pick_face(), ED_mesh_pick_face_vert(), ED_mesh_pick_vert(), ED_view3d_init_mats_rv3d(), ED_view3d_viewcontext_init(), ME_EDIT_PAINT_VERT_SEL, ME_USING_MIRROR_X_VERTEX_GROUPS, MEM_freeN(), MEM_SAFE_FREE, mesh, ToolSettings::multipaint, wmEvent::mval, NA_EDITED, NC_BRUSH, ViewContext::obact, OPERATOR_CANCELLED, OPERATOR_FINISHED, VPaint::paint, wmOperator::reports, RPT_WARNING, ViewContext::rv3d, ViewContext::scene, Scene::toolsettings, ViewContext::v3d, view3d_operator_needs_opengl(), WM_main_add_notifier(), ToolSettings::wpaint, and ToolSettings::wpaint_lock_relative.

Referenced by blender::ed::greasepencil::GREASE_PENCIL_OT_weight_sample(), and PAINT_OT_weight_sample().

◆ wpaint_prev_create()

static void wpaint_prev_create ( WPaintPrev * wpp,
MDeformVert * dverts,
int dcount )
static

◆ wpaint_prev_destroy()

static void wpaint_prev_destroy ( WPaintPrev * wpp)
static

◆ wpaint_prev_init()

static void wpaint_prev_init ( WPaintPrev * wpp)
static

Definition at line 66 of file paint_vertex_weight_ops.cc.

References WPaintPrev::tot, and WPaintPrev::wpaint_prev.

Referenced by wpaint_prev_create().