|
Blender
V2.93
|
#include <math.h>#include <stdlib.h>#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_object_types.h"#include "DNA_brush_types.h"#include "DNA_scene_types.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_math_color.h"#include "BLI_rect.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_brush.h"#include "BKE_context.h"#include "BKE_customdata.h"#include "BKE_image.h"#include "BKE_material.h"#include "BKE_mesh_runtime.h"#include "BKE_paint.h"#include "BKE_report.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_query.h"#include "RNA_access.h"#include "RNA_define.h"#include "GPU_framebuffer.h"#include "GPU_matrix.h"#include "GPU_state.h"#include "GPU_texture.h"#include "IMB_colormanagement.h"#include "IMB_imbuf.h"#include "IMB_imbuf_types.h"#include "RE_texture.h"#include "ED_image.h"#include "ED_screen.h"#include "ED_view3d.h"#include "BLI_sys_types.h"#include "ED_mesh.h"#include "DRW_select_buffer.h"#include "WM_api.h"#include "WM_types.h"#include "paint_intern.h"Go to the source code of this file.
|
static |
Definition at line 615 of file paint_utils.c.
References BKE_brush_curve_preset(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paint_invalidate_cursor_overlay(), C, CTX_data_scene(), CTX_data_view_layer(), Brush::curve, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), and scene.
Referenced by BRUSH_OT_curve_preset().
|
static |
Definition at line 629 of file paint_utils.c.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), C, and Brush::curve.
Referenced by BRUSH_OT_curve_preset().
| void BRUSH_OT_curve_preset | ( | wmOperatorType * | ot | ) |
Definition at line 636 of file paint_utils.c.
References BLT_I18NCONTEXT_ID_CURVE, brush_curve_preset_exec(), brush_curve_preset_poll(), CURVE_PRESET_LINE, CURVE_PRESET_MAX, CURVE_PRESET_ROOT, CURVE_PRESET_ROUND, CURVE_PRESET_SHARP, CURVE_PRESET_SMOOTH, wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, NULL, ot, wmOperatorType::poll, RNA_def_enum(), RNA_def_property_translation_context(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 703 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_CANCELLED, OPERATOR_FINISHED, paintface_deselect_all_visible(), wmOperator::ptr, and RNA_enum_get().
Referenced by PAINT_OT_face_select_all().
|
static |
Definition at line 783 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintface_hide(), wmOperator::ptr, and RNA_boolean_get().
Referenced by PAINT_OT_face_select_hide().
|
static |
Definition at line 807 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintface_reveal(), wmOperator::ptr, RNA_boolean_get(), and select().
Referenced by PAINT_OT_face_select_reveal().
| void flip_qt_qt | ( | float | out[4], |
| const float | in[4], | ||
| const ePaintSymmetryFlags | symm | ||
| ) |
Definition at line 429 of file paint_utils.c.
References angle(), axis_angle_normalized_to_quat(), normalize_v3(), PAINT_SYMM_X, PAINT_SYMM_Y, PAINT_SYMM_Z, and quat_to_axis_angle().
| void flip_v3_v3 | ( | float | out[3], |
| const float | in[3], | ||
| const ePaintSymmetryFlags | symm | ||
| ) |
Definition at line 407 of file paint_utils.c.
References PAINT_SYMM_X, PAINT_SYMM_Y, and PAINT_SYMM_Z.
Referenced by calc_overlap(), cursor_draw_point_with_symmetry(), flip_v3(), SCULPT_brush_strength_factor(), sculpt_brush_test_clipping(), SCULPT_cache_calc_brushdata_symm(), SCULPT_do_boundary_brush(), sculpt_expand_get_vertex_index_for_symmetry_pass(), SCULPT_floodfill_add_active(), SCULPT_floodfill_add_initial_with_symmetry(), SCULPT_geodesic_from_vertex_and_symm(), sculpt_gesture_flip_for_symmetry_pass(), sculpt_gesture_is_effected_lasso(), sculpt_gesture_trim_apply_for_symmetry_pass(), SCULPT_is_vertex_inside_brush_radius_symm(), and sculpt_pose_brush_is_vertex_inside_brush_radius().
Definition at line 396 of file paint_utils.c.
References BKE_object_material_get(), TexPaintSlot::ima, MPoly::mat_nr, Mesh::mpoly, NULL, Material::paint_active_slot, and Material::texpaintslot.
Referenced by paint_sample_color().
|
static |
Definition at line 377 of file paint_utils.c.
References ViewContext::depsgraph, DRW_select_buffer_sample_point(), ED_view3d_select_id_validate(), ViewContext::region, and ViewContext::v3d.
Referenced by paint_sample_color().
|
static |
Definition at line 299 of file paint_utils.c.
References BKE_mesh_runtime_looptri_ensure(), BKE_object_material_get(), CD_MLOOPUV, CD_ORIGINDEX, MVert::co, copy_v3_v3(), CustomData_get_layer(), CustomData_get_layer_named(), fabsf, GPU_matrix_model_view_get, GPU_matrix_projection_get, GPU_viewport_size_get_i(), IMAGEPAINT_MODE_MATERIAL, ToolSettings::imapaint, imapaint_tri_weights(), Mesh::ldata, MLoopTri_Store::len, Mesh_Runtime::looptris, MPoly::mat_nr, Mesh::mloop, ImagePaintSettings::mode, Mesh::mpoly, mul_m4_m4m4(), Mesh::mvert, Object::obmat, Material::paint_active_slot, MLoopTri::poly, Mesh::runtime, scene, Material::texpaintslot, Scene::toolsettings, MLoopTri::tri, UNPACK3, MLoopUV::uv, TexPaintSlot::uvname, MLoop::v, view, and w().
Referenced by paint_sample_color().
Definition at line 242 of file paint_utils.c.
References copy_v3_v3(), and mul_m4_v4().
Referenced by imapaint_tri_weights().
|
static |
Definition at line 250 of file paint_utils.c.
References copy_v3_v3(), imapaint_project(), invert_m3_m3(), mul_m3_v3(), mul_v3_fl(), v1, v2, view, and w().
Referenced by imapaint_pick_uv().
| float paint_calc_object_space_radius | ( | ViewContext * | vc, |
| const float | center[3], | ||
| float | pixel_radius | ||
| ) |
Definition at line 151 of file paint_utils.c.
References center, ED_view3d_calc_zfac(), ED_view3d_win_to_delta(), fabsf, len_v3(), mat4_to_scale(), mul_v3_m4v3(), NULL, ViewContext::obact, Object::obmat, ViewContext::region, and ViewContext::rv3d.
Referenced by paint_cursor_update_object_space_radius(), paint_cursor_update_unprojected_radius(), paint_space_stroke_spacing(), SCULPT_cursor_geometry_info_update(), sculpt_update_cache_variants(), and vwpaint_update_cache_variants().
| void paint_calc_redraw_planes | ( | float | planes[4][4], |
| const ARegion * | region, | ||
| Object * | ob, | ||
| const rcti * | screen_rect | ||
| ) |
Definition at line 133 of file paint_utils.c.
References ED_view3d_clipping_calc(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
| bool paint_convert_bb_to_rect | ( | rcti * | rect, |
| const float | bb_min[3], | ||
| const float | bb_max[3], | ||
| const ARegion * | region, | ||
| RegionView3D * | rv3d, | ||
| Object * | ob | ||
| ) |
Definition at line 86 of file paint_utils.c.
References BLI_rcti_do_minmax_v(), BLI_rcti_init_minmax(), ED_view3d_ob_project_mat_get(), ED_view3d_project_float_v2_m4(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
| float paint_get_tex_pixel | ( | const MTex * | mtex, |
| float | u, | ||
| float | v, | ||
| struct ImagePool * | pool, | ||
| int | thread | ||
| ) |
Definition at line 169 of file paint_utils.c.
References blender::compositor::pool, RE_texture_evaluate(), and v.
| void paint_get_tex_pixel_col | ( | const MTex * | mtex, |
| float | u, | ||
| float | v, | ||
| float | rgba[4], | ||
| struct ImagePool * | pool, | ||
| int | thread, | ||
| bool | convert_to_linear, | ||
| struct ColorSpace * | colorspace | ||
| ) |
Definition at line 180 of file paint_utils.c.
References clamp_v4(), IMB_colormanagement_colorspace_to_scene_linear_v3(), linearrgb_to_srgb_v3_v3(), blender::compositor::pool, RE_texture_evaluate(), and v.
| void PAINT_OT_face_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 713 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_all_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and WM_operator_properties_select_all().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_face_select_hide | ( | wmOperatorType * | ot | ) |
Definition at line 792 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_hide_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_face_select_linked | ( | wmOperatorType * | ot | ) |
Definition at line 668 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_select_linked_exec(), and wmOperatorType::poll.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_face_select_linked_pick | ( | wmOperatorType * | ot | ) |
Definition at line 689 of file paint_utils.c.
References wmOperatorType::description, facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, paint_select_linked_pick_invoke(), wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_face_select_reveal | ( | wmOperatorType * | ot | ) |
Definition at line 816 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, face_select_reveal_exec(), facemask_paint_poll(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_paint().
| void PAINT_OT_vert_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 736 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, vert_paint_poll(), vert_select_all_exec(), and WM_operator_properties_select_all().
Referenced by ED_operatortypes_paint().
| void PAINT_OT_vert_select_ungrouped | ( | wmOperatorType * | ot | ) |
Definition at line 766 of file paint_utils.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, vert_paint_poll(), and vert_select_ungrouped_exec().
Referenced by ED_operatortypes_paint().
| void paint_sample_color | ( | bContext * | C, |
| ARegion * | region, | ||
| int | x, | ||
| int | y, | ||
| bool | texpaint_proj, | ||
| bool | use_palette | ||
| ) |
Definition at line 453 of file paint_utils.c.
References Palette::active_color, bilinear_interpolation_color_wrap(), BKE_brush_color_set(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), BKE_imageuser_default(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paint_palette(), BKE_paint_palette_set(), BKE_palette_add(), BKE_palette_color_add(), BLI_listbase_count(), C, ImagePaintSettings::canvas, CD_MASK_BAREMESH, CD_MASK_ORIGINDEX, CD_MLOOPUV, CLAMP, Palette::colors, copy_v3_v3(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), CTX_wm_view3d(), CustomData_has_layer(), Object::data, DEG_get_evaluated_object(), depsgraph, ED_space_image_color_sample(), ED_view3d_viewcontext_init(), fmodf, ImageUser::framenr, GPU_DATA_FLOAT, GPU_frontbuffer_read_pixels(), IMA_SRC_TILED, IMAGEPAINT_MODE_MATERIAL, ToolSettings::imapaint, imapaint_face_image(), imapaint_pick_face(), imapaint_pick_uv(), Image::lastframe, linearrgb_to_srgb_v3_v3(), mesh_get_eval_final(), ImagePaintSettings::mode, NULL, OBACT, CustomData_MeshMasks::pmask, ImBuf::rect, ImBuf::rect_float, PaletteColor::rgb, rgb_uchar_to_float(), scene, Image::source, straight_to_premul_v4(), ImageUser::tile, Scene::toolsettings, Mesh::totpoly, v, view3d_operator_needs_opengl(), ARegion::winrct, ARegion::winx, ARegion::winy, x, ImBuf::x, rcti::xmin, y, ImBuf::y, and rcti::ymin.
Referenced by sample_color_exec(), sample_color_invoke(), and sample_color_modal().
|
static |
Definition at line 661 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), NULL, OPERATOR_FINISHED, and paintface_select_linked().
Referenced by PAINT_OT_face_select_linked().
|
static |
Definition at line 680 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), wmEvent::mval, OPERATOR_FINISHED, paintface_select_linked(), wmOperator::ptr, RNA_boolean_get(), select(), and view3d_operator_needs_opengl().
Referenced by PAINT_OT_face_select_linked_pick().
| void paint_stroke_operator_properties | ( | wmOperatorType * | ot | ) |
Definition at line 210 of file paint_utils.c.
References BRUSH_STROKE_INVERT, BRUSH_STROKE_NORMAL, BRUSH_STROKE_SMOOTH, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_collection_runtime(), RNA_def_enum(), RNA_def_property_flag(), RNA_OperatorStrokeElement, and wmOperatorType::srna.
Referenced by PAINT_OT_image_paint(), PAINT_OT_vertex_paint(), PAINT_OT_weight_paint(), and SCULPT_OT_brush_stroke().
|
static |
Definition at line 727 of file paint_utils.c.
References C, CTX_data_active_object(), CTX_wm_region(), ED_region_tag_redraw(), OPERATOR_FINISHED, paintvert_deselect_all_visible(), paintvert_tag_select_update(), wmOperator::ptr, and RNA_enum_get().
Referenced by PAINT_OT_vert_select_all().
|
static |
Definition at line 750 of file paint_utils.c.
References BKE_report(), BLI_listbase_is_empty(), C, CTX_data_active_object(), CTX_wm_region(), Object::data, Object::defbase, Mesh::dvert, ED_region_tag_redraw(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, paintvert_select_ungrouped(), paintvert_tag_select_update(), wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), and RPT_ERROR.
Referenced by PAINT_OT_vert_select_ungrouped().