Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "DNA_armature_types.h"
#include "DNA_mesh_types.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
#include "DNA_brush_types.h"
#include "DNA_object_types.h"
#include "DNA_meshdata_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "BKE_DerivedMesh.h"
#include "BKE_armature.h"
#include "BKE_action.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_deform.h"
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_mesh.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "paint_intern.h"
Go to the source code of this file.
Classes | |
struct | WeightPaintInfo |
struct | WPaintData |
struct | VPaintData |
Typedefs | |
typedef struct WeightPaintInfo | WeightPaintInfo |
typedef struct VPaintData | VPaintData |
Functions | |
int | vertex_paint_mode_poll (bContext *C) |
int | vertex_paint_poll (bContext *C) |
int | weight_paint_mode_poll (bContext *C) |
int | weight_paint_poll (bContext *C) |
static VPaint * | new_vpaint (int wpaint) |
static int * | get_indexarray (Mesh *me) |
static unsigned int | rgba_to_mcol (float r, float g, float b, float a) |
unsigned int | vpaint_get_current_col (VPaint *vp) |
static void | do_shared_vertexcol (Mesh *me) |
static void | make_vertexcol (Object *ob) |
static int | wpaint_mirror_vgroup_ensure (Object *ob, const int vgroup_active) |
static void | copy_vpaint_prev (VPaint *vp, unsigned int *mcol, int tot) |
static void | copy_wpaint_prev (VPaint *wp, MDeformVert *dverts, int dcount) |
void | vpaint_fill (Object *ob, unsigned int paintcol) |
void | wpaint_fill (VPaint *wp, Object *ob, float paintweight) |
static unsigned int | mcol_blend (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | mcol_add (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | mcol_sub (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | mcol_mul (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | mcol_lighten (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | mcol_darken (unsigned int col1, unsigned int col2, int fac) |
static unsigned int | vpaint_blend_tool (const int tool, const unsigned int col, const unsigned int paintcol, const int alpha_i) |
static unsigned int | vpaint_blend (VPaint *vp, unsigned int col, unsigned int colorig, const unsigned int paintcol, const int alpha_i, const int brush_alpha_value_i) |
static int | sample_backbuf_area (ViewContext *vc, int *indexar, int totface, int x, int y, float size) |
static float | calc_vp_strength_dl (VPaint *vp, ViewContext *vc, const float *vert_nor, const float mval[2], const float brush_size_pressure) |
static float | calc_vp_alpha_dl (VPaint *vp, ViewContext *vc, float vpimat[][3], const float *vert_nor, const float mval[2], const float brush_size_pressure, const float brush_alpha_pressure) |
static float | wpaint_blend_tool (const int tool, const float weight, const float paintval, const float alpha) |
static float | wpaint_blend (VPaint *wp, float weight, float weight_prev, const float alpha, float paintval, const float brush_alpha_value, const short do_flip, const short do_multipaint_totsel) |
static int | weight_sample_invoke (bContext *C, wmOperator *op, wmEvent *event) |
void | PAINT_OT_weight_sample (wmOperatorType *ot) |
static EnumPropertyItem * | weight_paint_sample_enum_itemf (bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free) |
static int | weight_sample_group_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_weight_sample_group (wmOperatorType *ot) |
static void | do_weight_paint_normalize_all (MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap) |
static void | do_weight_paint_normalize_all_active (MDeformVert *dvert, const int defbase_tot, const char *vgroup_validmap, const int vgroup_active) |
static char | has_locked_group (MDeformVert *dvert, const int defbase_tot, const char *bone_groups, const char *lock_flags) |
static char * | gen_lock_flags (Object *ob, int defbase_tot) |
static int | has_locked_group_selected (int defbase_tot, const char *defbase_sel, const char *lock_flags) |
static void | multipaint_selection (MDeformVert *dvert, const int defbase_tot, float change, const char *defbase_sel) |
static float | redistribute_change (MDeformVert *ndv, const int defbase_tot, char *change_status, const char change_me, int changeto, float totchange, float total_valid, char do_auto_normalize) |
static float | get_mp_change (MDeformVert *odv, const int defbase_tot, const char *defbase_sel, float brush_change) |
static void | enforce_locks (MDeformVert *odv, MDeformVert *ndv, const int defbase_tot, const char *defbase_sel, const char *lock_flags, const char *vgroup_validmap, char do_auto_normalize, char do_multipaint) |
static void | defvert_reset_to_prev (MDeformVert *dv_prev, MDeformVert *dv) |
static void | clamp_weights (MDeformVert *dvert) |
static int | apply_mp_locks_normalize (Mesh *me, const WeightPaintInfo *wpi, const unsigned int index, MDeformWeight *dw, MDeformWeight *tdw, float change, float oldChange, float oldw, float neww) |
static int | get_first_selected_nonzero_weight (MDeformVert *dvert, const int defbase_tot, const char *defbase_sel) |
static char * | wpaint_make_validmap (Object *ob) |
static void | do_weight_paint_vertex (VPaint *wp, Object *ob, const WeightPaintInfo *wpi, const unsigned int index, float alpha, float paintweight) |
static int | set_wpaint (bContext *C, wmOperator *UNUSED(op)) |
static int | paint_poll_test (bContext *C) |
void | PAINT_OT_weight_paint_toggle (wmOperatorType *ot) |
static int | wpaint_stroke_test_start (bContext *C, wmOperator *op, wmEvent *UNUSED(event)) |
static void | wpaint_stroke_update_step (bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) |
static void | wpaint_stroke_done (bContext *C, struct PaintStroke *stroke) |
static int | wpaint_invoke (bContext *C, wmOperator *op, wmEvent *event) |
static int | wpaint_cancel (bContext *C, wmOperator *op) |
void | PAINT_OT_weight_paint (wmOperatorType *ot) |
static int | weight_paint_set_exec (bContext *C, wmOperator *UNUSED(op)) |
void | PAINT_OT_weight_set (wmOperatorType *ot) |
static int | set_vpaint (bContext *C, wmOperator *op) |
void | PAINT_OT_vertex_paint_toggle (wmOperatorType *ot) |
static int | vpaint_stroke_test_start (bContext *C, struct wmOperator *op, wmEvent *UNUSED(event)) |
static void | vpaint_paint_face (VPaint *vp, VPaintData *vpd, Object *ob, const unsigned int index, const float mval[2], const float brush_size_pressure, const float brush_alpha_pressure, int UNUSED(flip)) |
static void | vpaint_stroke_update_step (bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) |
static void | vpaint_stroke_done (bContext *C, struct PaintStroke *stroke) |
static int | vpaint_invoke (bContext *C, wmOperator *op, wmEvent *event) |
static int | vpaint_cancel (bContext *C, wmOperator *op) |
void | PAINT_OT_vertex_paint (wmOperatorType *ot) |
static int | weight_from_bones_poll (bContext *C) |
static int | weight_from_bones_exec (bContext *C, wmOperator *op) |
void | PAINT_OT_weight_from_bones (wmOperatorType *ot) |
Definition in file paint_vertex.c.
typedef struct VPaintData VPaintData |
typedef struct WeightPaintInfo WeightPaintInfo |
static int apply_mp_locks_normalize | ( | Mesh * | me, |
const WeightPaintInfo * | wpi, | ||
const unsigned int | index, | ||
MDeformWeight * | dw, | ||
MDeformWeight * | tdw, | ||
float | change, | ||
float | oldChange, | ||
float | oldw, | ||
float | neww | ||
) | [static] |
Definition at line 1531 of file paint_vertex.c.
References clamp_weights(), MDeformWeight::def_nr, WeightPaintInfo::defbase_sel, WeightPaintInfo::defbase_tot, WeightPaintInfo::defbase_tot_sel, WeightPaintInfo::do_auto_normalize, WeightPaintInfo::do_multipaint, do_weight_paint_normalize_all(), Mesh::dvert, MDeformVert::dw, enforce_locks(), FALSE, MDeformVert::flag, has_locked_group_selected(), WeightPaintInfo::lock_flags, MEM_dupallocN(), MEM_freeN(), multipaint_selection(), NULL, MDeformVert::totweight, TRUE, WeightPaintInfo::vgroup_validmap, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex().
static float calc_vp_alpha_dl | ( | VPaint * | vp, |
ViewContext * | vc, | ||
float | vpimat[][3], | ||
const float * | vert_nor, | ||
const float | mval[2], | ||
const float | brush_size_pressure, | ||
const float | brush_alpha_pressure | ||
) | [static] |
Definition at line 767 of file paint_vertex.c.
References calc_vp_strength_dl(), dot_v3v3(), VPaint::flag, len_v3(), and VP_NORMALS.
Referenced by vpaint_paint_face(), and wpaint_stroke_update_step().
static float calc_vp_strength_dl | ( | VPaint * | vp, |
ViewContext * | vc, | ||
const float * | vert_nor, | ||
const float | mval[2], | ||
const float | brush_size_pressure | ||
) | [static] |
Definition at line 748 of file paint_vertex.c.
References ViewContext::ar, brush_curve_strength_clamp(), dot_v2v2(), VPaint::paint, paint_brush(), project_float_noclip(), sqrtf, and sub_v2_v2v2().
Referenced by calc_vp_alpha_dl(), and wpaint_stroke_update_step().
static void clamp_weights | ( | MDeformVert * | dvert | ) | [static] |
Definition at line 1486 of file paint_vertex.c.
References CLAMP(), MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by apply_mp_locks_normalize().
static void copy_vpaint_prev | ( | VPaint * | vp, |
unsigned int * | mcol, | ||
int | tot | ||
) | [static] |
Definition at line 317 of file paint_vertex.c.
References MEM_freeN(), MEM_mallocN(), NULL, VPaint::tot, and VPaint::vpaint_prev.
Referenced by vpaint_stroke_done(), and vpaint_stroke_test_start().
static void copy_wpaint_prev | ( | VPaint * | wp, |
MDeformVert * | dverts, | ||
int | dcount | ||
) | [static] |
Definition at line 332 of file paint_vertex.c.
References copy_dverts(), free_dverts(), MEM_mallocN(), NULL, VPaint::tot, and VPaint::wpaint_prev.
Referenced by wpaint_fill(), wpaint_stroke_done(), and wpaint_stroke_test_start().
static void defvert_reset_to_prev | ( | MDeformVert * | dv_prev, |
MDeformVert * | dv | ||
) | [static] |
Definition at line 1474 of file paint_vertex.c.
References MDeformWeight::def_nr, defvert_find_index(), MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex().
static void do_shared_vertexcol | ( | Mesh * | me | ) | [static] |
Definition at line 191 of file paint_vertex.c.
References Mesh::editflag, Mesh::mcol, ME_EDIT_PAINT_MASK, MEM_callocN(), MEM_freeN(), Mesh::mface, MTFace::mode, Mesh::mtface, NULL, TF_SHAREDCOL, Mesh::totface, Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by vpaint_stroke_update_step().
static void do_weight_paint_normalize_all | ( | MDeformVert * | dvert, |
const int | defbase_tot, | ||
const char * | vgroup_validmap | ||
) | [static] |
Definition at line 1072 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, i, sum(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by apply_mp_locks_normalize().
static void do_weight_paint_normalize_all_active | ( | MDeformVert * | dvert, |
const int | defbase_tot, | ||
const char * | vgroup_validmap, | ||
const int | vgroup_active | ||
) | [static] |
Definition at line 1114 of file paint_vertex.c.
References CLAMP(), MDeformWeight::def_nr, MDeformVert::dw, i, sum(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex().
static void do_weight_paint_vertex | ( | VPaint * | wp, |
Object * | ob, | ||
const WeightPaintInfo * | wpi, | ||
const unsigned int | index, | ||
float | alpha, | ||
float | paintweight | ||
) | [static] |
Definition at line 1607 of file paint_vertex.c.
References apply_mp_locks_normalize(), WeightPaintInfo::brush_alpha_value, Object::data, MDeformWeight::def_nr, WeightPaintInfo::defbase_sel, WeightPaintInfo::defbase_tot, WeightPaintInfo::defbase_tot_sel, defvert_find_index(), defvert_reset_to_prev(), defvert_verify_index(), WeightPaintInfo::do_auto_normalize, WeightPaintInfo::do_flip, WeightPaintInfo::do_multipaint, do_weight_paint_normalize_all_active(), Mesh::dvert, MDeformVert::dw, Mesh::editflag, FALSE, MDeformVert::flag, VPaint::flag, get_first_selected_nonzero_weight(), get_mp_change(), has_locked_group(), i, if(), WeightPaintInfo::lock_flags, ME_EDIT_MIRROR_X, MEM_dupallocN(), MEM_freeN(), mesh_get_x_mirror_vert(), NULL, MDeformVert::totweight, WeightPaintInfo::vgroup_active, WeightPaintInfo::vgroup_mirror, WeightPaintInfo::vgroup_validmap, VP_ONLYVGROUP, MDeformWeight::weight, wpaint_blend(), and VPaint::wpaint_prev.
Referenced by wpaint_stroke_update_step().
static void enforce_locks | ( | MDeformVert * | odv, |
MDeformVert * | ndv, | ||
const int | defbase_tot, | ||
const char * | defbase_sel, | ||
const char * | lock_flags, | ||
const char * | vgroup_validmap, | ||
char | do_auto_normalize, | ||
char | do_multipaint | ||
) | [static] |
Definition at line 1340 of file paint_vertex.c.
References defvert_find_index(), defvert_verify_index(), MDeformVert::dw, fabsf, get_mp_change(), has_locked_group(), i, MEM_callocN(), MEM_freeN(), multipaint_selection(), redistribute_change(), MDeformVert::totweight, and MDeformWeight::weight.
Referenced by apply_mp_locks_normalize().
static char* gen_lock_flags | ( | Object * | ob, |
int | defbase_tot | ||
) | [static] |
Definition at line 1193 of file paint_vertex.c.
References Object::defbase, DG_LOCK_WEIGHT, FALSE, ListBase::first, bDeformGroup::flag, i, MEM_freeN(), MEM_mallocN(), next, and NULL.
Referenced by wpaint_stroke_test_start().
static int get_first_selected_nonzero_weight | ( | MDeformVert * | dvert, |
const int | defbase_tot, | ||
const char * | defbase_sel | ||
) | [static] |
Definition at line 1589 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex().
static int* get_indexarray | ( | Mesh * | me | ) | [static] |
Definition at line 151 of file paint_vertex.c.
References MEM_mallocN(), and Mesh::totface.
Referenced by vpaint_stroke_test_start(), and wpaint_stroke_test_start().
static float get_mp_change | ( | MDeformVert * | odv, |
const int | defbase_tot, | ||
const char * | defbase_sel, | ||
float | brush_change | ||
) | [static] |
Definition at line 1453 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, i, MDeformVert::totweight, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex(), and enforce_locks().
static char has_locked_group | ( | MDeformVert * | dvert, |
const int | defbase_tot, | ||
const char * | bone_groups, | ||
const char * | lock_flags | ||
) | [static] |
Definition at line 1174 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, FALSE, i, MDeformVert::totweight, TRUE, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex(), and enforce_locks().
static int has_locked_group_selected | ( | int | defbase_tot, |
const char * | defbase_sel, | ||
const char * | lock_flags | ||
) | [static] |
Definition at line 1213 of file paint_vertex.c.
References FALSE, i, and TRUE.
Referenced by apply_mp_locks_normalize().
static void make_vertexcol | ( | Object * | ob | ) | [static] |
Definition at line 257 of file paint_vertex.c.
References CD_CALLOC, CD_MCOL, CustomData_add_layer(), DAG_id_tag_update(), Mesh::edit_mesh, Mesh::fdata, get_mesh(), Mesh::id, Object::id, ID::lib, Mesh::mcol, mesh_update_customdata_pointers(), NULL, and Mesh::totface.
Referenced by set_vpaint(), vpaint_fill(), and vpaint_stroke_test_start().
static unsigned int mcol_add | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 523 of file paint_vertex.c.
Referenced by vpaint_blend_tool().
static unsigned int mcol_blend | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 500 of file paint_vertex.c.
Referenced by vpaint_blend_tool(), and vpaint_paint_face().
static unsigned int mcol_darken | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 621 of file paint_vertex.c.
Referenced by vpaint_blend_tool().
static unsigned int mcol_lighten | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 593 of file paint_vertex.c.
Referenced by vpaint_blend_tool().
static unsigned int mcol_mul | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 569 of file paint_vertex.c.
Referenced by vpaint_blend_tool().
static unsigned int mcol_sub | ( | unsigned int | col1, |
unsigned int | col2, | ||
int | fac | ||
) | [static] |
Definition at line 546 of file paint_vertex.c.
Referenced by vpaint_blend_tool().
static void multipaint_selection | ( | MDeformVert * | dvert, |
const int | defbase_tot, | ||
float | change, | ||
const char * | defbase_sel | ||
) | [static] |
Definition at line 1242 of file paint_vertex.c.
References defvert_find_index(), i, simple_enum_gen::val, and MDeformWeight::weight.
Referenced by apply_mp_locks_normalize(), and enforce_locks().
static VPaint* new_vpaint | ( | int | wpaint | ) | [static] |
Definition at line 139 of file paint_vertex.c.
References VPaint::flag, MEM_callocN(), VP_AREA, and VP_SPRAY.
Referenced by set_vpaint(), and set_wpaint().
void PAINT_OT_vertex_paint | ( | wmOperatorType * | ot | ) |
Definition at line 2678 of file paint_vertex.c.
References wmOperatorType::cancel, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, paint_stroke_modal(), wmOperatorType::poll, RNA_def_collection_runtime(), RNA_OperatorStrokeElement, wmOperatorType::srna, vertex_paint_poll(), vpaint_cancel(), and vpaint_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_vertex_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 2455 of file paint_vertex.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, paint_poll_test(), wmOperatorType::poll, and set_vpaint().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_from_bones | ( | wmOperatorType * | ot | ) |
Definition at line 2722 of file paint_vertex.c.
References ARM_GROUPS_AUTO, ARM_GROUPS_ENVELOPE, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), wmOperatorType::srna, weight_from_bones_exec(), weight_from_bones_poll(), and WM_menu_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_paint | ( | wmOperatorType * | ot | ) |
Definition at line 2364 of file paint_vertex.c.
References wmOperatorType::cancel, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, OPTYPE_REGISTER, OPTYPE_UNDO, paint_stroke_modal(), wmOperatorType::poll, RNA_def_collection_runtime(), RNA_OperatorStrokeElement, wmOperatorType::srna, weight_paint_poll(), wpaint_cancel(), and wpaint_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_paint_toggle | ( | wmOperatorType * | ot | ) |
Definition at line 1912 of file paint_vertex.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, paint_poll_test(), wmOperatorType::poll, and set_wpaint().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_sample | ( | wmOperatorType * | ot | ) |
Definition at line 951 of file paint_vertex.c.
References wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_UNDO, wmOperatorType::poll, weight_paint_mode_poll(), and weight_sample_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_sample_group | ( | wmOperatorType * | ot | ) |
Definition at line 1050 of file paint_vertex.c.
References DummyRNA_DEFAULT_items, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NULL, OPTYPE_UNDO, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), RNA_def_enum_funcs(), wmOperatorType::srna, weight_paint_mode_poll(), weight_paint_sample_enum_itemf(), weight_sample_group_exec(), and WM_menu_invoke().
Referenced by ED_operatortypes_paint().
void PAINT_OT_weight_set | ( | wmOperatorType * | ot | ) |
Definition at line 2394 of file paint_vertex.c.
References wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, mask_paint_poll(), wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and weight_paint_set_exec().
Referenced by ED_operatortypes_paint().
static int paint_poll_test | ( | bContext * | C | ) | [static] |
Definition at line 1900 of file paint_vertex.c.
References CTX_data_active_object(), CTX_data_edit_object(), Object::data, and NULL.
Referenced by PAINT_OT_vertex_paint_toggle(), and PAINT_OT_weight_paint_toggle().
static float redistribute_change | ( | MDeformVert * | ndv, |
const int | defbase_tot, | ||
char * | change_status, | ||
const char | change_me, | ||
int | changeto, | ||
float | totchange, | ||
float | total_valid, | ||
char | do_auto_normalize | ||
) | [static] |
Definition at line 1281 of file paint_vertex.c.
References MDeformWeight::def_nr, MDeformVert::dw, FALSE, i, MDeformVert::totweight, TRUE, and MDeformWeight::weight.
Referenced by enforce_locks().
static unsigned int rgba_to_mcol | ( | float | r, |
float | g, | ||
float | b, | ||
float | a | ||
) | [static] |
Definition at line 160 of file paint_vertex.c.
Referenced by vpaint_get_current_col().
static int sample_backbuf_area | ( | ViewContext * | vc, |
int * | indexar, | ||
int | totface, | ||
int | x, | ||
int | y, | ||
float | size | ||
) | [static] |
Definition at line 710 of file paint_vertex.c.
References IMB_freeImBuf(), ImBuf::index, ImBuf::rect, view3d_read_backbuf(), WM_framebuffer_to_index(), ImBuf::x, and ImBuf::y.
Referenced by vpaint_stroke_update_step(), and wpaint_stroke_update_step().
static int set_vpaint | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 2411 of file paint_vertex.c.
References CTX_data_active_object(), CTX_data_scene(), DAG_id_tag_update(), get_mesh(), Mesh::id, make_vertexcol(), Mesh::mcol, Object::mode, NC_SCENE, ND_MODE, new_vpaint(), NULL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, object_data_is_libdata(), OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, VPaint::paint, paint_cursor_start(), PAINT_CURSOR_VERTEX_PAINT, paint_init(), set_wpaint(), Scene::toolsettings, vertex_paint_poll(), ToolSettings::vpaint, and WM_event_add_notifier().
Referenced by PAINT_OT_vertex_paint_toggle().
static int set_wpaint | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 1848 of file paint_vertex.c.
References bArmature::act_bone, CTX_data_active_object(), CTX_data_scene(), DAG_id_tag_update(), Object::data, ED_vgroup_select_by_name(), get_mesh(), Mesh::id, Object::id, ID::lib, mesh_mirrtopo_table(), mesh_octree_table(), Object::mode, modifiers_isDeformedByArmature(), Bone::name, NC_SCENE, ND_MODE, new_vpaint(), NULL, OB_MODE_POSE, OB_MODE_WEIGHT_PAINT, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, VPaint::paint, paint_cursor_start(), PAINT_CURSOR_WEIGHT_PAINT, paint_init(), Scene::toolsettings, weight_paint_poll(), WM_event_add_notifier(), and ToolSettings::wpaint.
Referenced by PAINT_OT_weight_paint_toggle(), and set_vpaint().
int vertex_paint_mode_poll | ( | bContext * | C | ) |
Definition at line 92 of file paint_vertex.c.
References CTX_data_active_object(), Object::data, Object::mode, and OB_MODE_VERTEX_PAINT.
Referenced by ED_keymap_paint(), PAINT_OT_vertex_color_set(), and vertex_paint_poll().
int vertex_paint_poll | ( | bContext * | C | ) |
Definition at line 99 of file paint_vertex.c.
References CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), paint_brush(), ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_VIEW3D, ScrArea::spacetype, and vertex_paint_mode_poll().
Referenced by PAINT_OT_vertex_paint(), and set_vpaint().
static unsigned int vpaint_blend | ( | VPaint * | vp, |
unsigned int | col, | ||
unsigned int | colorig, | ||
const unsigned int | paintcol, | ||
const int | alpha_i, | ||
const int | brush_alpha_value_i | ||
) | [static] |
Definition at line 673 of file paint_vertex.c.
References co, VPaint::flag, VPaint::paint, paint_brush(), Brush::vertexpaint_tool, VP_SPRAY, and vpaint_blend_tool().
Referenced by vpaint_paint_face().
static unsigned int vpaint_blend_tool | ( | const int | tool, |
const unsigned int | col, | ||
const unsigned int | paintcol, | ||
const int | alpha_i | ||
) | [static] |
Definition at line 649 of file paint_vertex.c.
References BLI_assert, mcol_add(), mcol_blend(), mcol_darken(), mcol_lighten(), mcol_mul(), mcol_sub(), PAINT_BLEND_ADD, PAINT_BLEND_BLUR, PAINT_BLEND_DARKEN, PAINT_BLEND_LIGHTEN, PAINT_BLEND_MIX, PAINT_BLEND_MUL, and PAINT_BLEND_SUB.
Referenced by vpaint_blend().
static int vpaint_cancel | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 2671 of file paint_vertex.c.
References OPERATOR_CANCELLED, and paint_stroke_cancel().
Referenced by PAINT_OT_vertex_paint().
void vpaint_fill | ( | Object * | ob, |
unsigned int | paintcol | ||
) |
Definition at line 348 of file paint_vertex.c.
References DAG_id_tag_update(), Mesh::editflag, get_mesh(), i, Mesh::id, make_vertexcol(), Mesh::mcol, ME_EDIT_PAINT_MASK, ME_FACE_SEL, Mesh::mface, NULL, and Mesh::totface.
Referenced by vertex_color_set_exec().
unsigned int vpaint_get_current_col | ( | VPaint * | vp | ) |
Definition at line 185 of file paint_vertex.c.
References VPaint::paint, paint_brush(), Brush::rgb, and rgba_to_mcol().
Referenced by vertex_color_set_exec(), and vpaint_stroke_test_start().
static int vpaint_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 2656 of file paint_vertex.c.
References wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_RUNNING_MODAL, paint_stroke_new(), wmEvent::type, wmOperator::type, vpaint_stroke_done(), vpaint_stroke_test_start(), vpaint_stroke_update_step(), and WM_event_add_modal_handler().
Referenced by PAINT_OT_vertex_paint().
static void vpaint_paint_face | ( | VPaint * | vp, |
VPaintData * | vpd, | ||
Object * | ob, | ||
const unsigned int | index, | ||
const float | mval[2], | ||
const float | brush_size_pressure, | ||
const float | brush_alpha_pressure, | ||
int | UNUSEDflip | ||
) | [static] |
Definition at line 2538 of file paint_vertex.c.
References Object::actcol, calc_vp_alpha_dl(), Mesh::editflag, MFace::flag, VPaint::flag, get_mesh(), i, MFace::mat_nr, Mesh::mcol, mcol_blend(), ME_EDIT_PAINT_MASK, ME_FACE_SEL, Mesh::mface, VPaint::paint, PAINT_BLEND_BLUR, paint_brush(), VPaintData::paintcol, MFace::v1, MFace::v4, VPaintData::vc, VPaintData::vertexcosnos, Brush::vertexpaint_tool, VP_COLINDEX, vpaint_blend(), VPaint::vpaint_prev, and VPaintData::vpimat.
Referenced by vpaint_stroke_update_step().
static void vpaint_stroke_done | ( | bContext * | C, |
struct PaintStroke * | stroke | ||
) | [static] |
Definition at line 2641 of file paint_vertex.c.
References copy_vpaint_prev(), CTX_data_tool_settings(), VPaintData::indexar, MEM_freeN(), NULL, paint_stroke_mode_data(), VPaintData::vertexcosnos, and ToolSettings::vpaint.
Referenced by vpaint_invoke().
static int vpaint_stroke_test_start | ( | bContext * | C, |
struct wmOperator * | op, | ||
wmEvent * | UNUSEDevent | ||
) | [static] |
Definition at line 2501 of file paint_vertex.c.
References copy_m3_m4(), copy_vpaint_prev(), CTX_data_active_object(), CTX_data_tool_settings(), wmOperator::customdata, get_indexarray(), get_mesh(), VPaintData::indexar, invert_m4_m4(), make_vertexcol(), Mesh::mcol, MEM_callocN(), mesh_get_mapped_verts_nors(), mult_m4_m4m4(), NULL, Object::obmat, OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, paint_stroke_set_mode_data(), VPaintData::paintcol, ViewContext::rv3d, ViewContext::scene, Mesh::totface, VPaintData::vc, VPaintData::vertexcosnos, view3d_set_viewcontext(), RegionView3D::viewmat, ToolSettings::vpaint, vpaint_get_current_col(), and VPaintData::vpimat.
Referenced by vpaint_invoke().
static void vpaint_stroke_update_step | ( | bContext * | C, |
struct PaintStroke * | stroke, | ||
PointerRNA * | itemptr | ||
) | [static] |
Definition at line 2581 of file paint_vertex.c.
References ViewContext::ar, brush_alpha(), brush_size(), brush_use_alpha_pressure(), brush_use_size_pressure(), CTX_data_scene(), CTX_data_tool_settings(), DAG_id_tag_update(), Object::data, do_shared_vertexcol(), ED_region_tag_redraw(), VPaint::flag, VPaintData::indexar, mult_m4_m4m4(), ViewContext::obact, Object::obmat, VPaint::paint, PAINT_BLEND_BLUR, paint_brush(), paint_stroke_mode_data(), RegionView3D::persmat, RNA_boolean_get(), RNA_float_get(), RNA_float_get_array(), ViewContext::rv3d, sample_backbuf_area(), swap_m4m4(), Mesh::totface, totindex, VPaintData::vc, Brush::vertexpaint_tool, view3d_operator_needs_opengl(), view3d_sample_backbuf(), VP_AREA, ToolSettings::vpaint, vpaint_paint_face(), ARegion::winrct, rcti::xmin, and rcti::ymin.
Referenced by vpaint_invoke().
static int weight_from_bones_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 2706 of file paint_vertex.c.
References create_vgroups_from_armature(), CTX_data_active_object(), CTX_data_scene(), DAG_id_tag_update(), Object::data, Mesh::editflag, Mesh::id, ME_EDIT_MIRROR_X, modifiers_isDeformedByArmature(), NC_GEOM, ND_DATA, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), and WM_event_add_notifier().
Referenced by PAINT_OT_weight_from_bones().
static int weight_from_bones_poll | ( | bContext * | C | ) | [static] |
Definition at line 2699 of file paint_vertex.c.
References CTX_data_active_object(), Object::mode, modifiers_isDeformedByArmature(), and OB_MODE_WEIGHT_PAINT.
Referenced by PAINT_OT_weight_from_bones().
int weight_paint_mode_poll | ( | bContext * | C | ) |
Definition at line 113 of file paint_vertex.c.
References CTX_data_active_object(), Object::data, Object::mode, and OB_MODE_WEIGHT_PAINT.
Referenced by ED_keymap_paint(), PAINT_OT_weight_sample(), and PAINT_OT_weight_sample_group().
int weight_paint_poll | ( | bContext * | C | ) |
Definition at line 120 of file paint_vertex.c.
References CTX_data_active_object(), CTX_data_tool_settings(), CTX_wm_area(), CTX_wm_region(), Object::mode, NULL, OB_MODE_WEIGHT_PAINT, paint_brush(), ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_VIEW3D, and ScrArea::spacetype.
Referenced by PAINT_OT_weight_paint(), and set_wpaint().
static EnumPropertyItem* weight_paint_sample_enum_itemf | ( | bContext * | C, |
PointerRNA * | UNUSEDptr, | ||
PropertyRNA * | UNUSEDprop, | ||
int * | free | ||
) | [static] |
Definition at line 966 of file paint_vertex.c.
References ViewContext::ar, BLI_countlist(), CTX_wm_window(), MDeformWeight::def_nr, Object::defbase, DummyRNA_NULL_items, Mesh::dvert, MDeformVert::dw, wmWindow::eventstate, FALSE, ListBase::first, get_mesh(), i, ImBuf::index, MEM_callocN(), MEM_freeN(), Mesh::mface, bDeformGroup::name, next, NULL, ViewContext::obact, RNA_enum_item_add(), RNA_enum_item_end(), ViewContext::rv3d, MDeformVert::totweight, TRUE, MFace::v1, ViewContext::v3d, MFace::v4, view3d_operator_needs_opengl(), view3d_sample_backbuf(), view3d_set_viewcontext(), ARegion::winrct, wmEvent::x, rcti::xmin, wmEvent::y, and rcti::ymin.
Referenced by PAINT_OT_weight_sample_group().
static int weight_paint_set_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 2384 of file paint_vertex.c.
References CTX_data_active_object(), CTX_data_scene(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, Scene::toolsettings, ToolSettings::vgroup_weight, ToolSettings::wpaint, and wpaint_fill().
Referenced by PAINT_OT_weight_set().
static int weight_sample_group_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 1035 of file paint_vertex.c.
References Object::actdef, BLI_assert, DAG_id_tag_update(), Object::id, NC_OBJECT, ND_DRAW, OB_RECALC_DATA, ViewContext::obact, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), view3d_set_viewcontext(), and WM_event_add_notifier().
Referenced by PAINT_OT_weight_sample_group().
static int weight_sample_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 884 of file paint_vertex.c.
References Object::actdef, ViewContext::ar, BKE_report(), CD_MASK_BAREMESH, co, defvert_find_weight(), Mesh::dvert, FALSE, FLT_MAX, get_mesh(), DerivedMesh::getVertCo, ImBuf::index, len(), len_squared_v2v2(), mesh_get_derived_final(), Mesh::mface, wmEvent::mval, NA_EDITED, NC_BRUSH, NULL, ViewContext::obact, OPERATOR_CANCELLED, OPERATOR_FINISHED, project_float_noclip(), DerivedMesh::release, wmOperator::reports, RPT_WARNING, ViewContext::rv3d, ViewContext::scene, Scene::toolsettings, TRUE, MFace::v1, ViewContext::v3d, MFace::v4, ToolSettings::vgroup_weight, view3d_operator_needs_opengl(), view3d_sample_backbuf(), view3d_set_viewcontext(), and WM_main_add_notifier().
Referenced by PAINT_OT_weight_sample().
static float wpaint_blend | ( | VPaint * | wp, |
float | weight, | ||
float | weight_prev, | ||
const float | alpha, | ||
float | paintval, | ||
const float | brush_alpha_value, | ||
const short | do_flip, | ||
const short | do_multipaint_totsel | ||
) | [static] |
Definition at line 829 of file paint_vertex.c.
References CLAMP(), FALSE, VPaint::flag, VPaint::paint, PAINT_BLEND_ADD, PAINT_BLEND_DARKEN, PAINT_BLEND_LIGHTEN, PAINT_BLEND_MIX, PAINT_BLEND_SUB, paint_brush(), Brush::vertexpaint_tool, VP_SPRAY, and wpaint_blend_tool().
Referenced by do_weight_paint_vertex().
static float wpaint_blend_tool | ( | const int | tool, |
const float | weight, | ||
const float | paintval, | ||
const float | alpha | ||
) | [static] |
Definition at line 802 of file paint_vertex.c.
References BLI_assert, PAINT_BLEND_ADD, PAINT_BLEND_BLUR, PAINT_BLEND_DARKEN, PAINT_BLEND_LIGHTEN, PAINT_BLEND_MIX, PAINT_BLEND_MUL, and PAINT_BLEND_SUB.
Referenced by wpaint_blend().
static int wpaint_cancel | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 2357 of file paint_vertex.c.
References OPERATOR_CANCELLED, and paint_stroke_cancel().
Referenced by PAINT_OT_weight_paint().
Definition at line 380 of file paint_vertex.c.
References Object::actdef, copy_wpaint_prev(), DAG_id_tag_update(), Object::data, defvert_verify_index(), Mesh::dvert, Mesh::editflag, MVert::flag, MDeformVert::flag, MFace::flag, Mesh::id, ME_EDIT_MIRROR_X, ME_EDIT_PAINT_SEL_MODE, ME_FACE_SEL, mesh_get_x_mirror_vert(), Mesh::mface, Mesh::mvert, NULL, SCE_SELECT_FACE, SCE_SELECT_VERTEX, SELECT, Mesh::totface, Mesh::totvert, MFace::v1, MFace::v4, MDeformWeight::weight, wpaint_mirror_vgroup_ensure(), and VPaint::wpaint_prev.
Referenced by weight_paint_set_exec().
static int wpaint_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 2342 of file paint_vertex.c.
References wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_RUNNING_MODAL, paint_stroke_new(), wmEvent::type, wmOperator::type, WM_event_add_modal_handler(), wpaint_stroke_done(), wpaint_stroke_test_start(), and wpaint_stroke_update_step().
Referenced by PAINT_OT_weight_paint().
static char * wpaint_make_validmap | ( | Object * | ob | ) | [static] |
Definition at line 1944 of file paint_vertex.c.
References BLI_assert, BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghash_remove(), BLI_ghash_size(), BLI_ghashutil_strcmp(), BLI_ghashutil_strhash(), bPoseChannel::bone, BONE_NO_DEFORM, bPose::chanbase, Object::defbase, eModifierMode_Realtime, eModifierMode_Virtual, eModifierType_Armature, ListBase::first, Bone::flag, i, MEM_mallocN(), ModifierData::mode, Object::modifiers, modifiers_getVirtualModifierList(), bPoseChannel::name, bDeformGroup::name, bPoseChannel::next, ModifierData::next, bDeformGroup::next, NULL, ArmatureModifierData::object, Object::pose, SET_INT_IN_POINTER, and ModifierData::type.
Referenced by wpaint_stroke_test_start().
static int wpaint_mirror_vgroup_ensure | ( | Object * | ob, |
const int | vgroup_active | ||
) | [static] |
Definition at line 282 of file paint_vertex.c.
References Object::actdef, BLI_findlink(), Object::defbase, ED_vgroup_add_name(), FALSE, ListBase::first, flip_side_name(), MAXBONENAME, bDeformGroup::name, bDeformGroup::next, and NULL.
Referenced by wpaint_fill(), and wpaint_stroke_test_start().
static void wpaint_stroke_done | ( | bContext * | C, |
struct PaintStroke * | stroke | ||
) | [static] |
Definition at line 2301 of file paint_vertex.c.
References Object::actdef, copy_wpaint_prev(), CTX_data_active_object(), CTX_data_tool_settings(), DAG_id_tag_update(), Object::data, ListBase::first, i, WPaintData::indexar, WPaintData::lock_flags, MEM_freeN(), ParticleSystem::next, NULL, paint_stroke_mode_data(), Object::particlesystem, PSYS_RECALC_RESET, PSYS_TOT_VG, ParticleSystem::recalc, WPaintData::vertexcosnos, ParticleSystem::vgroup, WPaintData::vgroup_validmap, and ToolSettings::wpaint.
Referenced by wpaint_invoke().
static int wpaint_stroke_test_start | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | UNUSEDevent | ||
) | [static] |
Definition at line 2002 of file paint_vertex.c.
References Object::actdef, ToolSettings::auto_normalize, BKE_report(), BLI_assert, BLI_countlist(), BLI_findindex(), BLI_findlink(), copy_m3_m4(), copy_wpaint_prev(), CTX_data_active_object(), CTX_data_scene(), wmOperator::customdata, Object::data, Object::defbase, WPaintData::defbase_tot, defgroup_find_name(), DG_LOCK_WEIGHT, Mesh::dvert, ED_vgroup_add(), ED_vgroup_add_name(), ED_vgroup_data_create(), Mesh::editflag, FALSE, ListBase::first, bDeformGroup::flag, gen_lock_flags(), get_indexarray(), get_mesh(), get_pose_channel(), Mesh::id, WPaintData::indexar, invert_m4_m4(), WPaintData::lock_flags, ME_EDIT_MIRROR_X, MEM_callocN(), mesh_get_mapped_verts_nors(), modifiers_isDeformedByArmature(), mult_m4_m4m4(), ToolSettings::multipaint, bPoseChannel::name, Bone::name, NC_GEOM, ND_DATA, NULL, Scene::obedit, Object::obmat, OPERATOR_PASS_THROUGH, paint_stroke_set_mode_data(), Object::pose, wmOperator::reports, RPT_WARNING, ViewContext::rv3d, Scene::toolsettings, Mesh::totface, Mesh::totvert, TRUE, WPaintData::vc, WPaintData::vertexcosnos, WPaintData::vgroup_active, WPaintData::vgroup_mirror, WPaintData::vgroup_validmap, view3d_set_viewcontext(), RegionView3D::viewmat, WM_event_add_notifier(), ToolSettings::wpaint, wpaint_make_validmap(), wpaint_mirror_vgroup_ensure(), and WPaintData::wpimat.
Referenced by wpaint_invoke().
static void wpaint_stroke_update_step | ( | bContext * | C, |
struct PaintStroke * | stroke, | ||
PointerRNA * | itemptr | ||
) | [static] |
Definition at line 2103 of file paint_vertex.c.
References Object::actcol, Object::actdef, ViewContext::ar, ToolSettings::auto_normalize, brush_alpha(), brush_size(), brush_use_alpha_pressure(), brush_use_size_pressure(), calc_vp_alpha_dl(), calc_vp_strength_dl(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region(), DAG_id_tag_update(), Object::data, WPaintData::defbase_tot, defvert_find_index(), defvert_verify_index(), do_weight_paint_vertex(), Mesh::dvert, ED_region_tag_redraw(), Mesh::editflag, MVert::flag, MDeformVert::flag, MFace::flag, VPaint::flag, get_selected_defgroups(), WPaintData::indexar, WPaintData::lock_flags, MFace::mat_nr, ME_EDIT_PAINT_MASK, ME_EDIT_VERT_SEL, ME_FACE_SEL, MEM_freeN(), MEM_mallocN(), Mesh::mface, mult_m4_m4m4(), ToolSettings::multipaint, Mesh::mvert, NULL, ViewContext::obact, Object::obmat, VPaint::paint, PAINT_BLEND_BLUR, paint_brush(), paint_stroke_mode_data(), RegionView3D::persmat, RNA_boolean_get(), RNA_float_get(), RNA_float_get_array(), ViewContext::rv3d, sample_backbuf_area(), SELECT, swap_m4m4(), Mesh::totface, totindex, MFace::v1, MFace::v2, MFace::v3, MFace::v4, WPaintData::vc, WPaintData::vertexcosnos, Brush::vertexpaint_tool, WPaintData::vgroup_active, WPaintData::vgroup_mirror, WPaintData::vgroup_validmap, ToolSettings::vgroup_weight, view3d_operator_needs_opengl(), view3d_sample_backbuf(), VP_AREA, VP_COLINDEX, VP_ONLYVGROUP, MDeformWeight::weight, ARegion::winrct, ToolSettings::wpaint, WPaintData::wpimat, rcti::xmin, and rcti::ymin.
Referenced by wpaint_invoke().