|
Blender V5.0
|
#include "MEM_guardedalloc.h"#include "BLI_bitmap.h"#include "BLI_listbase.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_interface_layout.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 |
| ENUM_OPERATORS | ( | WPGradient_vertStore::Flag | , |
| WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED | ) |
References WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED.
|
static |
Definition at line 577 of file paint_vertex_weight_ops.cc.
References Brush::alpha, BKE_brush_curve_strength_clamped(), BKE_defvert_ensure_index(), BKE_defvert_find_index(), BKE_defvert_remove_group(), Brush::blend, BLI_assert, WPGradient_userData::brush, CLAMP, WPGradient_userData::def_nr, WPGradient_userData::dvert, ED_wpaint_blend_tool(), WPGradient_vertStoreBase::elem, WPGradient_vertStore::flag, len_v2v2(), line_point_factor_v2(), WPGradient_vertStore::sco, WPGradient_userData::sco_end, WPGradient_userData::sco_line_div, WPGradient_userData::sco_start, WPGradient_userData::type, WPGradient_userData::use_vgroup_restrict, WPGradient_userData::vert_cache, WPGradient_vertStore::VGRAD_STORE_DW_EXIST, WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED, MDeformWeight::weight, WPGradient_vertStore::weight_orig, WPGradient_userData::weightpaint, WPAINT_GRADIENT_TYPE_LINEAR, and WPAINT_GRADIENT_TYPE_RADIAL.
Referenced by gradientVertInit__mapFunc(), and gradientVertUpdate__mapFunc().
|
static |
Definition at line 649 of file paint_vertex_weight_ops.cc.
References BKE_defvert_find_index(), BLI_BITMAP_ENABLE, BLI_BITMAP_TEST, copy_v2_fl(), WPGradient_userData::def_nr, WPGradient_userData::dvert, ED_view3d_project_float_object(), WPGradient_vertStoreBase::elem, WPGradient_vertStore::flag, FLT_MAX, gradientVert_update(), WPGradient_userData::hide_vert, Span< T >::is_empty(), WPGradient_userData::region, WPGradient_vertStore::sco, WPGradient_userData::select_vert, WPGradient_userData::use_select, V3D_PROJ_RET_OK, V3D_PROJ_TEST_CLIP_BB, V3D_PROJ_TEST_CLIP_NEAR, WPGradient_userData::vert_cache, WPGradient_userData::vert_visit, WPGradient_vertStore::VGRAD_STORE_DW_EXIST, WPGradient_vertStore::VGRAD_STORE_NOP, MDeformWeight::weight, and WPGradient_vertStore::weight_orig.
Referenced by paint_weight_gradient_exec().
|
static |
Definition at line 634 of file paint_vertex_weight_ops.cc.
References WPGradient_vertStoreBase::elem, FLT_MAX, gradientVert_update(), WPGradient_vertStore::sco, and WPGradient_userData::vert_cache.
Referenced by paint_weight_gradient_exec().
| void PAINT_OT_weight_from_bones | ( | wmOperatorType * | ot | ) |
Definition at line 126 of file paint_vertex_weight_ops.cc.
References ARM_GROUPS_AUTO, ARM_GROUPS_ENVELOPE, OPTYPE_REGISTER, OPTYPE_UNDO, ot, RNA_def_enum(), weight_from_bones_exec(), weight_from_bones_poll(), and WM_menu_invoke().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_gradient | ( | wmOperatorType * | ot | ) |
Definition at line 902 of file paint_vertex_weight_ops.cc.
References OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_weight_gradient_exec(), paint_weight_gradient_invoke(), paint_weight_gradient_modal(), PROP_SKIP_SAVE, RNA_def_enum(), RNA_def_property_flag(), weight_paint_poll_ignore_tool(), WM_CURSOR_EDIT, WM_gesture_straightline_cancel(), WM_operator_properties_gesture_straightline(), WPAINT_GRADIENT_TYPE_LINEAR, and WPAINT_GRADIENT_TYPE_RADIAL.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_sample | ( | wmOperatorType * | ot | ) |
Definition at line 275 of file paint_vertex_weight_ops.cc.
References OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_UNDO, ot, weight_paint_mode_poll(), and weight_sample_invoke().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_sample_group | ( | wmOperatorType * | ot | ) |
Definition at line 385 of file paint_vertex_weight_ops.cc.
References OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_UNDO, ot, weight_paint_mode_region_view3d_poll(), and weight_sample_group_invoke().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_weight_set | ( | wmOperatorType * | ot | ) |
Definition at line 514 of file paint_vertex_weight_ops.cc.
References OPTYPE_REGISTER, OPTYPE_UNDO, ot, weight_paint_mode_poll(), and weight_paint_set_exec().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 746 of file paint_vertex_weight_ops.cc.
References Geometry::attributes, ToolSettings::auto_normalize, BKE_brush_weight_get(), BKE_curvemapping_init(), BKE_defvert_normalize_lock_map(), BKE_mesh_foreach_mapped_vert(), BKE_object_defgroup_active_index_get(), BKE_object_defgroup_lock_flags_get(), BKE_object_defgroup_validmap_get(), BKE_object_get_evaluated_mesh(), BKE_paint_brush(), BLI_BITMAP_NEW, BLI_listbase_count(), C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_tool_settings(), CTX_wm_region(), Brush::curve_distance_falloff, wmOperator::customdata, data, Object::data, wmGenericUserData::data, DEG_get_evaluated(), DEG_id_tag_update(), depsgraph, ED_view3d_init_mats_rv3d(), ED_wpaint_ensure_data(), Mesh::editflag, VPaint::flag, float, gradientVertInit__mapFunc(), gradientVertUpdate__mapFunc(), i, Object::id, ID_RECALC_GEOMETRY, len_v2v2(), blender::bke::AttributeAccessor::lookup(), blender::bke::AttributeAccessor::lookup_or_default(), ME_EDIT_PAINT_FACE_SEL, ME_EDIT_PAINT_VERT_SEL, MEM_freeN(), MEM_malloc_arrayN(), MEM_mallocN(), MEM_SAFE_FREE, MESH_FOREACH_NOP, blender::bke::mesh_select_face_flush(), NC_OBJECT, ND_DRAW, OPERATOR_CANCELLED, OPERATOR_FINISHED, VPaint::paint, blender::bke::Point, wmOperator::ptr, ARegion::regiondata, wmOperator::reports, RNA_enum_get(), RNA_int_get(), Scene::toolsettings, wmGenericUserData::use_free, wmGesture::user_data, Mesh::vertex_group_names, Mesh::verts_num, WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED, VP_FLAG_VGROUP_RESTRICT, WM_event_add_notifier(), ToolSettings::wpaint, and wpaint_prev_create().
Referenced by PAINT_OT_weight_gradient().
|
static |
Definition at line 878 of file paint_vertex_weight_ops.cc.
References C, CTX_wm_region(), wmOperator::customdata, ED_wpaint_ensure_data(), wmGesture::is_active, KM_PRESS, LEFTMOUSE, OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, ARegion::regiontype, wmOperator::reports, ret, RGN_TYPE_WINDOW, wmEvent::type, wmEvent::val, and WM_gesture_straightline_invoke().
Referenced by PAINT_OT_weight_gradient().
|
static |
Definition at line 696 of file paint_vertex_weight_ops.cc.
References BKE_defvert_array_copy(), BKE_defvert_array_free_elems(), BKE_object_defgroup_active_is_locked(), BKE_report(), C, CTX_data_active_object(), wmOperator::customdata, Object::data, wmGenericUserData::data, DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, KM_RELEASE, LEFTMOUSE, MEM_freeN(), NC_OBJECT, ND_DRAW, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, wmOperator::reports, ret, RPT_WARNING, wmEvent::type, wmGesture::user_data, wmEvent::val, Mesh::verts_num, WM_event_add_notifier(), WM_gesture_straightline_cancel(), WM_gesture_straightline_modal(), WPaintPrev::wpaint_prev, wpaint_prev_destroy(), and WPGradient_vertStoreBase::wpp.
Referenced by PAINT_OT_weight_gradient().
|
static |
Definition at line 107 of file paint_vertex_weight_ops.cc.
References BKE_modifiers_is_deformed_by_armature(), C, CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), Object::data, DEG_id_tag_update(), DEG_relations_tag_update(), depsgraph, ED_object_vgroup_calc_from_armature(), Mesh::id, ME_SYMMETRY_X, NC_GEOM, ND_DATA, OPERATOR_FINISHED, wmOperator::ptr, wmOperator::reports, RNA_enum_get(), Mesh::symmetry, and WM_event_add_notifier().
Referenced by PAINT_OT_weight_from_bones().
|
static |
Definition at line 100 of file paint_vertex_weight_ops.cc.
References BKE_modifiers_is_deformed_by_armature(), C, CTX_data_active_object(), Object::mode, and OB_MODE_WEIGHT_PAINT.
Referenced by PAINT_OT_weight_from_bones().
|
static |
Samples cursor location, and gives menu with vertex groups to activate. This function fills in used vertex-groups.
Definition at line 300 of file paint_vertex_weight_ops.cc.
References MDeformWeight::def_nr, MDeformVert::dw, i, blender::MutableSpan< T >::size(), MDeformVert::totweight, and UNLIKELY.
Referenced by weight_sample_group_invoke().
Definition at line 407 of file paint_vertex_weight_ops.cc.
References Geometry::attributes, BKE_defvert_ensure_index(), BKE_object_defgroup_active_index_get(), Object::data, DEG_id_tag_update(), ED_wpaint_mirror_vgroup_ensure(), Mesh::editflag, blender::bke::Face, faces, Mesh::faces_num, flag, MDeformVert::flag, i, Mesh::id, blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), ME_EDIT_MIRROR_TOPO, ME_EDIT_PAINT_SEL_MODE, ME_SYMMETRY_X, ME_USING_MIRROR_X_VERTEX_GROUPS, mesh_get_x_mirror_vert(), blender::bke::Point, SCE_SELECT_FACE, SCE_SELECT_VERTEX, blender::Span< T >::slice(), Mesh::symmetry, Mesh::verts_num, MDeformWeight::weight, WPaintPrev::wpaint_prev, wpaint_prev_create(), and wpaint_prev_destroy().
Referenced by weight_paint_set_exec().
|
static |
Definition at line 496 of file paint_vertex_weight_ops.cc.
References BKE_brush_weight_get(), BKE_paint_brush(), C, CTX_data_active_object(), CTX_data_tool_settings(), CTX_wm_region(), ED_region_tag_redraw(), ED_wpaint_ensure_data(), OPERATOR_CANCELLED, OPERATOR_FINISHED, VPaint::paint, wmOperator::reports, weight_paint_set(), ToolSettings::wpaint, and WPAINT_ENSURE_MIRROR.
Referenced by PAINT_OT_weight_set().
|
static |
Definition at line 316 of file paint_vertex_weight_ops.cc.
References BKE_mesh_from_object(), BKE_report(), BLI_assert, BLI_listbase_count(), BLI_listbase_is_empty(), C, CTX_data_depsgraph_pointer(), depsgraph, ED_MESH_PICK_DEFAULT_FACE_DIST, ED_MESH_PICK_DEFAULT_VERT_DIST, ED_mesh_pick_face(), ED_mesh_pick_vert(), ED_view3d_init_mats_rv3d(), ED_view3d_viewcontext_init(), Mesh::editflag, blender::wm::ExecDefault, faces, i, LISTBASE_FOREACH_INDEX, ME_EDIT_PAINT_VERT_SEL, wmEvent::mval, ViewContext::obact, uiLayout::op(), OPERATOR_CANCELLED, uiLayout::operator_context_set(), OPERATOR_INTERFACE, ot, wmOperator::ptr, wmOperator::reports, RNA_property_enum_set(), RPT_WARNING, ViewContext::rv3d, blender::Span< T >::slice(), wmOperator::type, UI_ITEM_NONE, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), ViewContext::v3d, Mesh::vertex_group_names, view3d_operator_needs_gpu(), weight_paint_sample_mark_groups(), WM_operatortype_find(), and WM_operatortype_name().
Referenced by PAINT_OT_weight_sample_group().
|
static |
Sets wp->weight to the closest weight value to vertex.
Definition at line 169 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(), C, 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(), Mesh::editflag, ME_EDIT_PAINT_VERT_SEL, ME_USING_MIRROR_X_VERTEX_GROUPS, MEM_freeN(), MEM_SAFE_FREE, 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, Mesh::vertex_group_active_index, Mesh::vertex_group_names, view3d_operator_needs_gpu(), WM_main_add_notifier(), ToolSettings::wpaint, and ToolSettings::wpaint_lock_relative.
Referenced by PAINT_OT_weight_sample().
|
static |
Definition at line 74 of file paint_vertex_weight_ops.cc.
References BKE_defvert_array_copy(), MEM_malloc_arrayN(), WPaintPrev::tot, WPaintPrev::wpaint_prev, and wpaint_prev_init().
Referenced by paint_weight_gradient_exec(), and weight_paint_set().
|
static |
Definition at line 85 of file paint_vertex_weight_ops.cc.
References BKE_defvert_array_free(), WPaintPrev::tot, and WPaintPrev::wpaint_prev.
Referenced by paint_weight_gradient_modal(), and weight_paint_set().
|
static |
Definition at line 68 of file paint_vertex_weight_ops.cc.
References WPaintPrev::tot, and WPaintPrev::wpaint_prev.
Referenced by wpaint_prev_create().