|
Blender
V2.59
|
#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_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 | WPaintData |
| struct | VPaintData |
Defines | |
| #define | VP_MIX 0 |
| #define | VP_ADD 1 |
| #define | VP_SUB 2 |
| #define | VP_MUL 3 |
| #define | VP_BLUR 4 |
| #define | VP_LIGHTEN 5 |
| #define | VP_DARKEN 6 |
Typedefs | |
| 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 void | wpaint_mirror_vgroup_ensure (Object *ob, int *vgroup_mirror) |
| 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 void | vpaint_blend (VPaint *vp, unsigned int *col, unsigned int *colorig, unsigned int paintcol, int alpha) |
| static int | sample_backbuf_area (ViewContext *vc, int *indexar, int totface, int x, int y, float size) |
| static float | calc_vp_alpha_dl (VPaint *vp, ViewContext *vc, float vpimat[][3], float *vert_nor, const float mval[2], float pressure) |
| static void | wpaint_blend (VPaint *wp, MDeformWeight *dw, MDeformWeight *uw, float alpha, float paintval, int flip) |
| 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_auto_normalize (MDeformVert *dvert, int paint_nr, char *map) |
| static void | do_weight_paint_vertex (VPaint *wp, Object *ob, int index, float alpha, float paintweight, int flip, int vgroup_mirror, char *validmap) |
| 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 char * | wpaint_make_validmap (Object *ob) |
| 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, int index, const float mval[2], float 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.
| #define VP_ADD 1 |
Definition at line 91 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| #define VP_BLUR 4 |
Definition at line 94 of file paint_vertex.c.
Referenced by vpaint_blend(), vpaint_paint_face(), vpaint_stroke_update_step(), wpaint_blend(), and wpaint_stroke_update_step().
| #define VP_DARKEN 6 |
Definition at line 96 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| #define VP_LIGHTEN 5 |
Definition at line 95 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| #define VP_MIX 0 |
Definition at line 90 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| #define VP_MUL 3 |
Definition at line 93 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| #define VP_SUB 2 |
Definition at line 92 of file paint_vertex.c.
Referenced by vpaint_blend(), and wpaint_blend().
| typedef struct VPaintData VPaintData |
| static float calc_vp_alpha_dl | ( | VPaint * | vp, |
| ViewContext * | vc, | ||
| float | vpimat[][3], | ||
| float * | vert_nor, | ||
| const float | mval[2], | ||
| float | pressure | ||
| ) | [static] |
Definition at line 752 of file paint_vertex.c.
References ViewContext::ar, brush_alpha(), brush_curve_strength_clamp(), brush_size(), brush_use_alpha_pressure(), brush_use_size_pressure(), VPaint::flag, VPaint::paint, paint_brush(), project_int_noclip(), size(), sqrtf, and VP_NORMALS.
Referenced by vpaint_paint_face(), and wpaint_stroke_update_step().
| static void copy_vpaint_prev | ( | VPaint * | vp, |
| unsigned int * | mcol, | ||
| int | tot | ||
| ) | [static] |
Definition at line 328 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 343 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 do_shared_vertexcol | ( | Mesh * | me | ) | [static] |
Definition at line 201 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_auto_normalize | ( | MDeformVert * | dvert, |
| int | paint_nr, | ||
| char * | map | ||
| ) | [static] |
Definition at line 1065 of file paint_vertex.c.
References 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, | ||
| int | index, | ||
| float | alpha, | ||
| float | paintweight, | ||
| int | flip, | ||
| int | vgroup_mirror, | ||
| char * | validmap | ||
| ) | [static] |
Definition at line 1100 of file paint_vertex.c.
References Object::actdef, Object::data, defvert_find_index(), defvert_verify_index(), do_weight_paint_auto_normalize(), Mesh::dvert, Mesh::editflag, VPaint::flag, ME_EDIT_MIRROR_X, mesh_get_x_mirror_vert(), NULL, VP_ONLYVGROUP, MDeformWeight::weight, wpaint_blend(), and VPaint::wpaint_prev.
Referenced by wpaint_stroke_update_step().
| static int* get_indexarray | ( | Mesh * | me | ) | [static] |
Definition at line 161 of file paint_vertex.c.
References MEM_mallocN(), and Mesh::totface.
Referenced by vpaint_stroke_test_start(), wpaint_fill(), and wpaint_stroke_test_start().
| static void make_vertexcol | ( | Object * | ob | ) | [static] |
Definition at line 267 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 547 of file paint_vertex.c.
Referenced by vpaint_blend().
| static unsigned int mcol_blend | ( | unsigned int | col1, |
| unsigned int | col2, | ||
| int | fac | ||
| ) | [static] |
Definition at line 524 of file paint_vertex.c.
Referenced by vpaint_blend(), and vpaint_paint_face().
| static unsigned int mcol_darken | ( | unsigned int | col1, |
| unsigned int | col2, | ||
| int | fac | ||
| ) | [static] |
Definition at line 645 of file paint_vertex.c.
Referenced by vpaint_blend().
| static unsigned int mcol_lighten | ( | unsigned int | col1, |
| unsigned int | col2, | ||
| int | fac | ||
| ) | [static] |
Definition at line 617 of file paint_vertex.c.
Referenced by vpaint_blend().
| static unsigned int mcol_mul | ( | unsigned int | col1, |
| unsigned int | col2, | ||
| int | fac | ||
| ) | [static] |
Definition at line 593 of file paint_vertex.c.
Referenced by vpaint_blend().
| static unsigned int mcol_sub | ( | unsigned int | col1, |
| unsigned int | col2, | ||
| int | fac | ||
| ) | [static] |
Definition at line 570 of file paint_vertex.c.
Referenced by vpaint_blend().
| static VPaint* new_vpaint | ( | int | wpaint | ) | [static] |
Definition at line 149 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 1910 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 1701 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 1954 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 1610 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 1202 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 946 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 1042 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 1640 of file paint_vertex.c.
References wmOperatorType::exec, facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, 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 1193 of file paint_vertex.c.
References CTX_data_active_object(), CTX_data_edit_object(), and NULL.
Referenced by PAINT_OT_vertex_paint_toggle(), and PAINT_OT_weight_paint_toggle().
| static unsigned int rgba_to_mcol | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) | [static] |
Definition at line 170 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 715 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 1657 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 1141 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 102 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 109 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 void vpaint_blend | ( | VPaint * | vp, |
| unsigned int * | col, | ||
| unsigned int * | colorig, | ||
| unsigned int | paintcol, | ||
| int | alpha | ||
| ) | [static] |
Definition at line 672 of file paint_vertex.c.
References brush_alpha(), co, VPaint::flag, mcol_add(), mcol_blend(), mcol_darken(), mcol_lighten(), mcol_mul(), mcol_sub(), VPaint::paint, paint_brush(), Brush::vertexpaint_tool, VP_ADD, VP_BLUR, VP_DARKEN, VP_LIGHTEN, VP_MIX, VP_MUL, VP_SPRAY, and VP_SUB.
Referenced by vpaint_paint_face().
| static int vpaint_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 1903 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 359 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 195 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 1888 of file paint_vertex.c.
References wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_RUNNING_MODAL, paint_stroke_new(), wmOperator::type, wmEvent::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, | ||
| int | index, | ||
| const float | mval[2], | ||
| float | pressure, | ||
| int | UNUSEDflip | ||
| ) | [static] |
Definition at line 1784 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_brush(), VPaintData::paintcol, MFace::v1, MFace::v4, VPaintData::vc, VPaintData::vertexcosnos, Brush::vertexpaint_tool, VP_BLUR, 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 1873 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 1747 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(), mul_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 1818 of file paint_vertex.c.
References ViewContext::ar, brush_size(), CTX_data_tool_settings(), DAG_id_tag_update(), Object::data, do_shared_vertexcol(), ED_region_tag_redraw(), VPaint::flag, VPaintData::indexar, mul_m4_m4m4(), ViewContext::obact, Object::obmat, VPaint::paint, 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, VP_BLUR, 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 1938 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 1931 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 123 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 130 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 961 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 1630 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 1028 of file paint_vertex.c.
References Object::actdef, 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 879 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_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 void wpaint_blend | ( | VPaint * | wp, |
| MDeformWeight * | dw, | ||
| MDeformWeight * | uw, | ||
| float | alpha, | ||
| float | paintval, | ||
| int | flip | ||
| ) | [static] |
Definition at line 795 of file paint_vertex.c.
References brush_alpha(), CLAMP(), VPaint::flag, NULL, VPaint::paint, paint_brush(), Brush::vertexpaint_tool, VP_ADD, VP_BLUR, VP_DARKEN, VP_LIGHTEN, VP_MIX, VP_MUL, VP_SPRAY, VP_SUB, and MDeformWeight::weight.
Referenced by do_weight_paint_vertex().
| static int wpaint_cancel | ( | bContext * | C, |
| wmOperator * | op | ||
| ) | [static] |
Definition at line 1603 of file paint_vertex.c.
References OPERATOR_CANCELLED, and paint_stroke_cancel().
Referenced by PAINT_OT_weight_paint().
Definition at line 390 of file paint_vertex.c.
References Object::actdef, copy_wpaint_prev(), DAG_id_tag_update(), Object::data, defvert_verify_index(), Mesh::dvert, Mesh::editflag, MFace::flag, get_indexarray(), i, Mesh::id, ME_EDIT_MIRROR_X, ME_EDIT_PAINT_MASK, ME_FACE_SEL, MEM_freeN(), mesh_get_x_mirror_vert(), Mesh::mface, NULL, Mesh::totface, Mesh::totvert, MFace::v1, MFace::v2, MFace::v3, 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 1588 of file paint_vertex.c.
References wmOperator::customdata, wmOperatorType::modal, NULL, OPERATOR_RUNNING_MODAL, paint_stroke_new(), wmOperator::type, wmEvent::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 1232 of file paint_vertex.c.
References BLI_ghash_free(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_new(), BLI_ghash_remove(), 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_callocN(), ModifierData::mode, Object::modifiers, modifiers_getVirtualModifierList(), bDeformGroup::name, bPoseChannel::name, bDeformGroup::next, ModifierData::next, bPoseChannel::next, NULL, ArmatureModifierData::object, Object::pose, SET_INT_IN_POINTER, and ModifierData::type.
Referenced by wpaint_stroke_test_start().
| static void wpaint_mirror_vgroup_ensure | ( | Object * | ob, |
| int * | vgroup_mirror | ||
| ) | [static] |
Definition at line 292 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 1549 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, 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 1290 of file paint_vertex.c.
References Object::actdef, ToolSettings::auto_normalize, WPaintData::auto_normalize, copy_m3_m4(), copy_wpaint_prev(), CTX_data_active_object(), CTX_data_scene(), CTX_data_tool_settings(), wmOperator::customdata, Object::data, Object::defbase, defgroup_find_index(), defgroup_find_name(), Mesh::dvert, ED_vgroup_add(), ED_vgroup_add_name(), ED_vgroup_data_create(), Mesh::editflag, ListBase::first, get_indexarray(), get_mesh(), get_pose_channel(), Mesh::id, WPaintData::indexar, invert_m4_m4(), ME_EDIT_MIRROR_X, MEM_callocN(), mesh_get_mapped_verts_nors(), modifiers_isDeformedByArmature(), mul_m4_m4m4(), Bone::name, bPoseChannel::name, NC_GEOM, ND_DATA, NULL, Scene::obedit, Object::obmat, OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, paint_stroke_set_mode_data(), Object::pose, ViewContext::rv3d, Mesh::totface, Mesh::totvert, WPaintData::vc, WPaintData::vertexcosnos, 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 1376 of file paint_vertex.c.
References Object::actcol, Object::actdef, ViewContext::ar, brush_size(), calc_vp_alpha_dl(), CTX_data_tool_settings(), CTX_wm_region(), DAG_id_tag_update(), Object::data, defvert_find_index(), defvert_verify_index(), do_weight_paint_vertex(), Mesh::dvert, ED_region_tag_redraw(), Mesh::editflag, MFace::flag, VPaint::flag, WPaintData::indexar, MFace::mat_nr, ME_EDIT_PAINT_MASK, ME_FACE_SEL, Mesh::mface, mul_m4_m4m4(), NULL, ViewContext::obact, Object::obmat, VPaint::paint, 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, MFace::v1, MFace::v2, MFace::v3, MFace::v4, WPaintData::vc, WPaintData::vertexcosnos, Brush::vertexpaint_tool, WPaintData::vgroup_mirror, WPaintData::vgroup_validmap, ToolSettings::vgroup_weight, view3d_operator_needs_opengl(), view3d_sample_backbuf(), VP_AREA, VP_BLUR, VP_COLINDEX, VP_ONLYVGROUP, MDeformWeight::weight, ARegion::winrct, ToolSettings::wpaint, WPaintData::wpimat, rcti::xmin, and rcti::ymin.
Referenced by wpaint_invoke().