|
Blender
V2.93
|
#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_brush_types.h"#include "DNA_gpencil_types.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_modifier_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_space_types.h"#include "DNA_view3d_types.h"#include "DNA_workspace_types.h"#include "BLI_bitmap.h"#include "BLI_hash.h"#include "BLI_listbase.h"#include "BLI_math_vector.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_brush.h"#include "BKE_ccg.h"#include "BKE_colortools.h"#include "BKE_context.h"#include "BKE_crazyspace.h"#include "BKE_deform.h"#include "BKE_gpencil.h"#include "BKE_idtype.h"#include "BKE_image.h"#include "BKE_key.h"#include "BKE_lib_id.h"#include "BKE_main.h"#include "BKE_mesh.h"#include "BKE_mesh_mapping.h"#include "BKE_mesh_runtime.h"#include "BKE_modifier.h"#include "BKE_multires.h"#include "BKE_object.h"#include "BKE_paint.h"#include "BKE_pbvh.h"#include "BKE_subdiv_ccg.h"#include "BKE_subsurf.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_query.h"#include "RNA_enum_types.h"#include "BLO_read_write.h"#include "bmesh.h"Go to the source code of this file.
Macros | |
| #define | RAKE_THRESHHOLD 20 |
| #define | GOLDEN_RATIO_CONJUGATE 0.618033988749895f |
Variables | |
| IDTypeInfo | IDType_ID_PAL |
| IDTypeInfo | IDType_ID_PC |
| const char | PAINT_CURSOR_SCULPT [3] = {255, 100, 100} |
| const char | PAINT_CURSOR_VERTEX_PAINT [3] = {255, 255, 255} |
| const char | PAINT_CURSOR_WEIGHT_PAINT [3] = {200, 200, 255} |
| const char | PAINT_CURSOR_TEXTURE_PAINT [3] = {255, 255, 255} |
| static ePaintOverlayControlFlags | overlay_flags = 0 |
| void BKE_paint_blend_read_data | ( | BlendDataReader * | reader, |
| const Scene * | scene, | ||
| Paint * | p | ||
| ) |
Definition at line 1193 of file paint.c.
References BKE_curvemapping_blend_read(), BKE_paint_cavity_curve_preset(), BKE_paint_runtime_init(), BLO_read_data_address, Paint::cavity_curve, CURVE_PRESET_LINE, if(), MEM_allocN_len, MEM_callocN, MEM_freeN, Paint::num_input_samples, scene, Paint::tool_slots, Paint::tool_slots_len, and Scene::toolsettings.
| void BKE_paint_blend_read_lib | ( | BlendLibReader * | reader, |
| Scene * | sce, | ||
| Paint * | p | ||
| ) |
Definition at line 1219 of file paint.c.
References BKE_paint_runtime_init(), BLO_read_id_address, PaintToolSlot::brush, Paint::brush, Scene::id, ID::lib, NULL, Paint::paint_cursor, Paint::palette, Paint::tool_slots, Paint::tool_slots_len, and Scene::toolsettings.
Referenced by scene_blend_read_lib().
| void BKE_paint_blend_write | ( | BlendWriter * | writer, |
| Paint * | p | ||
| ) |
Definition at line 1185 of file paint.c.
References BKE_curvemapping_blend_write(), BLO_write_struct_array, Paint::cavity_curve, Paint::tool_slots, and Paint::tool_slots_len.
Referenced by scene_blend_write().
Definition at line 604 of file paint.c.
References Paint::brush, and NULL.
Referenced by BKE_paint_init(), bmesh_topology_rake(), brush_add_exec(), brush_add_gpencil_exec(), brush_colors_flip_exec(), brush_curve_preset_exec(), brush_curve_preset_poll(), brush_generic_tool_set(), brush_reset_exec(), brush_scale_size_exec(), brush_strength(), buttons_context_path_brush(), buttons_texture_users_from_context(), calc_area_center(), calc_area_normal_and_center(), calc_sculpt_normal(), calc_sculpt_plane(), cloth_brush_apply_brush_foces(), do_clay_brush(), do_clay_strips_brush(), do_clay_thumb_brush(), do_crease_brush(), do_displacement_eraser_brush(), do_displacement_smear_brush(), do_draw_brush(), do_draw_sharp_brush(), do_elastic_deform_brush(), do_fill_brush(), do_flatten_brush(), do_grab_brush(), do_gravity(), do_inflate_brush(), do_layer_brush(), do_mask_brush(), do_mask_brush_draw(), do_nudge_brush(), do_pinch_brush(), do_rotate_brush(), do_scrape_brush(), do_slide_relax_brush(), do_snake_hook_brush(), do_symmetrical_brush_actions(), do_thumb_brush(), dyntopo_detail_size_edit_invoke(), ED_paint_proj_mesh_data_check(), gpencil_draw_init(), gpencil_fill_invoke(), gpencil_session_init_fill(), gpencil_stroke_from_buffer(), gpencil_stroke_paintmode_poll_with_tool(), gpencil_stroke_sculptmode_poll_with_tool(), gpencil_stroke_vertexmode_poll_with_tool(), gpencil_stroke_weightmode_poll_with_tool(), HC_relaxation_iteration_uv(), image_paint_brush(), laplacian_relaxation_iteration_uv(), OVERLAY_edit_uv_cache_init(), OVERLAY_edit_uv_init(), paint_2d_new_stroke(), paint_brush_stroke_add_step(), paint_cursor_context_init(), paint_cursor_update_pixel_radius(), paint_draw_smooth_cursor(), paint_line_strokes_spacing(), paint_mesh_restore_co(), paint_poll(), paint_proj_new_stroke(), paint_sample_color(), paint_space_stroke(), paint_space_stroke_spacing(), paint_stroke_done(), paint_stroke_modal(), paint_stroke_new(), paint_stroke_update_step(), paint_weight_gradient_exec(), project_state_init(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), sample_detail_dyntopo(), sculpt_brush_exit_tex(), sculpt_brush_init_tex(), SCULPT_brush_plane_offset_get(), sculpt_brush_stroke_cancel(), sculpt_brush_stroke_init(), SCULPT_calc_area_normal(), SCULPT_calc_brush_plane(), SCULPT_cloth_brush_do_simulation_step(), SCULPT_cloth_brush_ensure_nodes_constraints(), sculpt_cloth_ensure_constraints_in_simulation_area(), sculpt_combine_proxies(), SCULPT_cursor_geometry_info_update(), SCULPT_do_boundary_brush(), SCULPT_do_cloth_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_paint_brush(), SCULPT_do_pose_brush(), SCULPT_do_smear_brush(), SCULPT_do_surface_smooth_brush(), SCULPT_enhance_details_brush(), sculpt_expand_cache_initial_config_set(), sculpt_face_sets_automasking_init(), sculpt_fix_noise_tear(), SCULPT_flush_stroke_deform(), sculpt_restore_mesh(), sculpt_sample_color_invoke(), SCULPT_smooth(), sculpt_stroke_done(), SCULPT_stroke_get_location(), sculpt_stroke_update_step(), sculpt_tool_name(), SCULPT_topology_automasking_init(), sculpt_update_cache_invariants(), sculpt_update_cache_variants(), sculpt_update_tex(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), tex_color_alpha(), texture_get_from_context(), texture_paint_init(), ui_do_but_COLOR(), update_brush_local_mat(), update_sculpt_normal(), uv_sculpt_stroke_apply(), uv_sculpt_stroke_init(), uv_sculpt_stroke_poll(), vertex_paint_poll_ex(), vpaint_do_symmetrical_brush_actions(), vpaint_get_current_col(), vpaint_stroke_test_start(), vwpaint_update_cache_variants(), weight_paint_poll_ex(), weight_paint_set_exec(), weight_sample_invoke(), wpaint_do_symmetrical_brush_actions(), and wpaint_stroke_update_step().
Definition at line 609 of file paint.c.
References BKE_paint_toolslots_brush_update(), Paint::brush, id_us_min(), and id_us_plus().
Referenced by BKE_brush_add_gpencil(), BKE_brush_gpencil_paint_presets(), BKE_brush_gpencil_sculpt_presets(), BKE_brush_gpencil_vertex_presets(), BKE_brush_gpencil_weight_presets(), BKE_paint_init(), brush_add_exec(), brush_add_gpencil_exec(), brush_generic_tool_set(), do_versions_after_linking_280(), gpencil_brush_reset_all_exec(), gpencil_get_default_eraser(), gpencil_primitive_init(), sculpt_stroke_done(), sculpt_update_cache_invariants(), and toolsystem_ref_link().
| void BKE_paint_cavity_curve_preset | ( | Paint * | p, |
| int | preset | ||
| ) |
Definition at line 992 of file paint.c.
References BKE_curvemap_reset(), BKE_curvemapping_add(), BKE_curvemapping_changed(), Paint::cavity_curve, CurveMapping::clipr, CurveMapping::cm, CUMA_EXTEND_EXTRAPOLATE, CURVEMAP_SLOPE_POSITIVE, CurveMapping::flag, NULL, and CurveMapping::preset.
Referenced by BKE_paint_blend_read_data(), and BKE_paint_init().
Definition at line 1156 of file paint.c.
References BKE_curvemapping_copy(), PaintToolSlot::brush, Paint::brush, Paint::cavity_curve, id_us_plus(), LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_dupallocN, NULL, Paint::palette, Paint::tool_slots, and Paint::tool_slots_len.
Referenced by BKE_toolsettings_copy().
| PaintCurve* BKE_paint_curve_add | ( | Main * | bmain, |
| const char * | name | ||
| ) |
Definition at line 691 of file paint.c.
References BKE_id_new(), and ID_PC.
Referenced by paintcurve_new_exec(), and paintcurve_point_add().
| void BKE_paint_curve_clamp_endpoint_add_index | ( | PaintCurve * | pc, |
| const int | add_index | ||
| ) |
Definition at line 723 of file paint.c.
References PaintCurve::add_index, and PaintCurve::tot_points.
Referenced by paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), and paintcurve_slide_invoke().
| void BKE_paint_curve_set | ( | Brush * | br, |
| PaintCurve * | pc | ||
| ) |
Definition at line 714 of file paint.c.
References id_us_min(), id_us_plus(), and Brush::paint_curve.
| bool BKE_paint_ensure | ( | ToolSettings * | ts, |
| struct Paint ** | r_paint | ||
| ) |
Call when entering each respective paint mode.
Definition at line 1032 of file paint.c.
References BKE_paint_runtime_init(), BLI_assert, data, ELEM, Paint::flags, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, MEM_callocN, NULL, Paint_Runtime::ob_mode, ImagePaintSettings::paint, PAINT_SHOW_BRUSH, PAINT_SYMM_X, Paint::runtime, ToolSettings::sculpt, SCULPT_DYNTOPO_COLLAPSE, SCULPT_DYNTOPO_SUBDIVIDE, SWAP, Paint::symmetry_flags, Paint_Runtime::tool_offset, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_ensure_from_paintmode(), BKE_sculpt_toolsettings_data_ensure(), ED_gpencil_add_defaults(), ed_vwpaintmode_enter_generic(), gpencil_paintmode_toggle_exec(), gpencil_sculptmode_toggle_exec(), gpencil_vertexmode_toggle_exec(), and gpencil_weightmode_toggle_exec().
| bool BKE_paint_ensure_from_paintmode | ( | Scene * | sce, |
| ePaintMode | mode | ||
| ) |
Definition at line 306 of file paint.c.
References BKE_paint_ensure(), ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, NULL, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, PAINT_MODE_WEIGHT_GPENCIL, ToolSettings::sculpt, Scene::toolsettings, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_init(), BLO_update_defaults_startup_blend(), do_versions_after_linking_280(), and toolsystem_ref_link().
| void BKE_paint_face_set_overlay_color_get | ( | const int | face_set, |
| const int | seed, | ||
| uchar | r_color[4] | ||
| ) |
Definition at line 2249 of file paint.c.
References abs(), BLI_hash_int_01(), floorf, GOLDEN_RATIO_CONJUGATE, hsv_to_rgb(), rgba_float_to_uchar(), and seed.
Referenced by extract_sculpt_data_init(), GPU_pbvh_grid_buffers_update(), and GPU_pbvh_mesh_buffers_update().
| void BKE_paint_free | ( | Paint * | paint | ) |
Definition at line 1146 of file paint.c.
References BKE_curvemapping_free(), Paint::cavity_curve, MEM_SAFE_FREE, and Paint::tool_slots.
Referenced by BKE_toolsettings_free().
Definition at line 447 of file paint.c.
References ViewLayer::basact, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, Object::mode, NULL, OB_MODE_EDIT, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT, OB_MODE_SCULPT_GPENCIL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_GPENCIL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_GPENCIL, OB_MODE_WEIGHT_PAINT, Base::object, ImagePaintSettings::paint, Sculpt::paint, UvSculpt::paint, GpPaint::paint, GpVertexPaint::paint, GpSculptPaint::paint, GpWeightPaint::paint, VPaint::paint, ToolSettings::sculpt, Scene::toolsettings, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_get_active_from_context(), BKE_paint_invalidate_cursor_overlay(), BKE_paint_invalidate_overlay_tex(), buttons_context_path_brush(), calculateCenterActive(), and is_cursor_visible().
Definition at line 484 of file paint.c.
References ViewLayer::basact, BKE_paint_get_active(), C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), ToolSettings::imapaint, Object::mode, SpaceImage::mode, NULL, OB_MODE_EDIT, Base::object, ImagePaintSettings::paint, UvSculpt::paint, SI_MODE_PAINT, SI_MODE_UV, Scene::toolsettings, and ToolSettings::uvsculpt.
| Paint* BKE_paint_get_active_from_paintmode | ( | Scene * | sce, |
| ePaintMode | mode | ||
| ) |
Definition at line 354 of file paint.c.
References ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, NULL, ImagePaintSettings::paint, Sculpt::paint, UvSculpt::paint, GpPaint::paint, GpVertexPaint::paint, GpSculptPaint::paint, GpWeightPaint::paint, VPaint::paint, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, PAINT_MODE_WEIGHT_GPENCIL, ToolSettings::sculpt, Scene::toolsettings, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_init(), brush_select_exec(), ED_object_sculptmode_enter_ex(), ed_vwpaintmode_enter_generic(), toolsystem_ref_link(), and WM_toolsystem_ref_sync_from_context().
| uint BKE_paint_get_brush_tool_offset_from_paintmode | ( | const ePaintMode | mode | ) |
Definition at line 663 of file paint.c.
References PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, and PAINT_MODE_WEIGHT_GPENCIL.
Referenced by ui_id_brush_get_icon().
| ePaintOverlayControlFlags BKE_paint_get_overlay_flags | ( | void | ) |
Definition at line 278 of file paint.c.
References overlay_flags.
Referenced by load_tex(), load_tex_cursor(), and paint_draw_alpha_overlay().
| const EnumPropertyItem* BKE_paint_get_tool_enum_from_paintmode | ( | ePaintMode | mode | ) |
Definition at line 389 of file paint.c.
References NULL, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, PAINT_MODE_WEIGHT_GPENCIL, rna_enum_brush_gpencil_sculpt_types_items, rna_enum_brush_gpencil_types_items, rna_enum_brush_gpencil_vertex_types_items, rna_enum_brush_gpencil_weight_types_items, rna_enum_brush_image_tool_items, rna_enum_brush_sculpt_tool_items, rna_enum_brush_uv_sculpt_tool_items, rna_enum_brush_vertex_tool_items, and rna_enum_brush_weight_tool_items.
Referenced by brush_generic_tool_set(), brush_select_exec(), PAINT_OT_brush_select(), toolsystem_ref_link(), ui_id_brush_get_icon(), ui_tooltip_data_from_tool(), and WM_toolsystem_ref_sync_from_context().
| const char* BKE_paint_get_tool_prop_id_from_paintmode | ( | ePaintMode | mode | ) |
Definition at line 417 of file paint.c.
References NULL, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, and PAINT_MODE_WEIGHT_GPENCIL.
Referenced by brush_select_exec(), PAINT_OT_brush_select(), and ui_tooltip_data_from_tool().
| void BKE_paint_init | ( | Main * | bmain, |
| Scene * | sce, | ||
| ePaintMode | mode, | ||
| const char | col[3] | ||
| ) |
Definition at line 1115 of file paint.c.
References UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, BKE_brush_add(), BKE_brush_first_search(), BKE_paint_brush(), BKE_paint_brush_set(), BKE_paint_cavity_curve_preset(), BKE_paint_ensure_from_paintmode(), BKE_paint_get_active_from_paintmode(), BKE_paint_object_mode_from_paintmode(), Paint::brush, Paint::cavity_curve, col, CURVE_PRESET_LINE, Brush::id, id_us_min(), UnifiedPaintSettings::last_stroke_valid, NULL, Paint::paint_cursor_col, PAINT_MODE_HAS_BRUSH, Scene::toolsettings, ToolSettings::unified_paint_settings, and zero_v3().
Referenced by ED_object_sculptmode_enter_ex(), ED_object_texture_paint_mode_enter_ex(), ED_space_image_paint_update(), and ed_vwpaintmode_enter_generic().
| void BKE_paint_invalidate_cursor_overlay | ( | Scene * | scene, |
| ViewLayer * | view_layer, | ||
| CurveMapping * | curve | ||
| ) |
Definition at line 259 of file paint.c.
References BKE_paint_get_active(), Paint::brush, curve, Brush::curve, NULL, overlay_flags, PAINT_OVERLAY_INVALID_CURVE, and scene.
Referenced by brush_curve_preset_exec().
| void BKE_paint_invalidate_overlay_all | ( | void | ) |
Definition at line 272 of file paint.c.
References overlay_flags, PAINT_OVERLAY_INVALID_CURVE, PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY, and PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY.
Referenced by brush_generic_tool_set(), paint_cursor_delete_textures(), and paint_cursor_start().
Definition at line 239 of file paint.c.
References BKE_paint_get_active(), Paint::brush, Brush::mask_mtex, Brush::mtex, overlay_flags, PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY, PAINT_OVERLAY_INVALID_TEXTURE_SECONDARY, scene, tex, and MTex::tex.
| eObjectMode BKE_paint_object_mode_from_paintmode | ( | ePaintMode | mode | ) |
Definition at line 1009 of file paint.c.
References OB_MODE_EDIT, OB_MODE_SCULPT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, and PAINT_MODE_WEIGHT.
Referenced by BKE_paint_init(), and brush_add_exec().
Definition at line 700 of file paint.c.
References NULL, and Paint::palette.
Referenced by paint_sample_color().
Definition at line 705 of file paint.c.
References id_us_min(), id_us_plus(), and Paint::palette.
Referenced by BKE_gpencil_palette_ensure(), eyedropper_add_palette_color(), paint_sample_color(), and palette_new_exec().
| void BKE_paint_reset_overlay_invalid | ( | ePaintOverlayControlFlags | flag | ) |
Definition at line 301 of file paint.c.
References overlay_flags.
Referenced by load_tex(), and load_tex_cursor().
| void BKE_paint_runtime_init | ( | const ToolSettings * | ts, |
| Paint * | paint | ||
| ) |
Definition at line 620 of file paint.c.
References BLI_assert_unreachable, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, Paint_Runtime::ob_mode, OB_MODE_EDIT, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT, OB_MODE_SCULPT_GPENCIL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_GPENCIL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_GPENCIL, OB_MODE_WEIGHT_PAINT, ImagePaintSettings::paint, Sculpt::paint, UvSculpt::paint, GpPaint::paint, GpVertexPaint::paint, GpSculptPaint::paint, GpWeightPaint::paint, VPaint::paint, Paint::runtime, ToolSettings::sculpt, Paint_Runtime::tool_offset, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by BKE_paint_blend_read_data(), BKE_paint_blend_read_lib(), and BKE_paint_ensure().
| bool BKE_paint_select_elem_test | ( | Object * | ob | ) |
used to check if selection is possible (when we don't care if its face or vert)
Definition at line 987 of file paint.c.
References BKE_paint_select_face_test(), and BKE_paint_select_vert_test().
Referenced by mask_paint_poll(), view3d_circle_select_exec(), view3d_select_exec(), and view3d_selectable_data().
| bool BKE_paint_select_face_test | ( | Object * | ob | ) |
Definition at line 968 of file paint.c.
References Object::data, ME_EDIT_PAINT_FACE_SEL, Object::mode, NULL, OB_MESH, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by BKE_paint_select_elem_test(), BKE_sculpt_object_pbvh_ensure(), facemask_paint_poll(), object_get_datamask(), validate_object_select_id(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), view3d_select_exec(), and viewselected_exec().
| bool BKE_paint_select_vert_test | ( | Object * | ob | ) |
Definition at line 976 of file paint.c.
References Object::data, ME_EDIT_PAINT_VERT_SEL, Object::mode, NULL, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by BKE_paint_select_elem_test(), BKE_sculpt_object_pbvh_ensure(), vert_paint_poll(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), and view3d_select_exec().
| void BKE_paint_set_overlay_override | ( | eOverlayFlags | flags | ) |
Definition at line 283 of file paint.c.
References BRUSH_OVERLAY_CURSOR_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_OVERRIDE_MASK, BRUSH_OVERLAY_PRIMARY_OVERRIDE_ON_STROKE, BRUSH_OVERLAY_SECONDARY_OVERRIDE_ON_STROKE, overlay_flags, PAINT_OVERLAY_OVERRIDE_CURSOR, PAINT_OVERLAY_OVERRIDE_PRIMARY, PAINT_OVERLAY_OVERRIDE_SECONDARY, and PAINT_OVERRIDE_MASK.
Referenced by paint_stroke_free(), and paint_stroke_new().
Definition at line 1173 of file paint.c.
References UnifiedPaintSettings::average_stroke_accum, UnifiedPaintSettings::average_stroke_counter, copy_v3_v3(), UnifiedPaintSettings::last_stroke_valid, mul_v3_v3fl(), Object::obmat, scene, Scene::toolsettings, and ToolSettings::unified_paint_settings.
Referenced by view3d_orbit_calc_center(), and viewselected_exec().
| ePaintMode BKE_paintmode_get_active_from_context | ( | const bContext * | C | ) |
Definition at line 519 of file paint.c.
References ViewLayer::basact, C, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), Object::mode, SpaceImage::mode, NULL, OB_MODE_EDIT, OB_MODE_SCULPT, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, Base::object, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_WEIGHT, SI_MODE_PAINT, and SI_MODE_UV.
| ePaintMode BKE_paintmode_get_from_tool | ( | const struct bToolRef * | tref | ) |
Definition at line 570 of file paint.c.
References CTX_MODE_PAINT_GPENCIL, CTX_MODE_PAINT_TEXTURE, CTX_MODE_PAINT_VERTEX, CTX_MODE_PAINT_WEIGHT, CTX_MODE_SCULPT, CTX_MODE_SCULPT_GPENCIL, CTX_MODE_VERTEX_GPENCIL, CTX_MODE_WEIGHT_GPENCIL, bToolRef::mode, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_GPENCIL, PAINT_MODE_SCULPT_UV, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_VERTEX_GPENCIL, PAINT_MODE_WEIGHT, PAINT_MODE_WEIGHT_GPENCIL, SI_MODE_PAINT, SI_MODE_UV, SPACE_IMAGE, bToolRef::space_type, and SPACE_VIEW3D.
Referenced by toolsystem_ref_link(), and WM_toolsystem_ref_sync_from_context().
Definition at line 751 of file paint.c.
References BKE_id_new(), and ID_PAL.
Referenced by BKE_gpencil_palette_ensure(), BKE_palette_from_hash(), eyedropper_add_palette_color(), paint_sample_color(), and palette_new_exec().
| void BKE_palette_clear | ( | Palette * | palette | ) |
Definition at line 745 of file paint.c.
References Palette::active_color, BLI_freelistN(), and Palette::colors.
| PaletteColor* BKE_palette_color_add | ( | Palette * | palette | ) |
Definition at line 757 of file paint.c.
References BLI_addtail(), Palette::colors, and MEM_callocN.
Referenced by BKE_gpencil_palette_ensure(), BKE_palette_from_hash(), eyedropper_add_palette_color(), paint_sample_color(), palette_color_add_exec(), palette_join_exec(), and palette_sort_exec().
| void BKE_palette_color_remove | ( | Palette * | palette, |
| PaletteColor * | color | ||
| ) |
Remove color from palette. Must be certain color is inside the palette!
Definition at line 729 of file paint.c.
References Palette::active_color, BLI_listbase_count_at_most(), BLI_listbase_is_empty(), BLI_remlink(), Palette::colors, and MEM_freeN.
Referenced by palette_color_delete_exec(), palette_join_exec(), palette_sort_exec(), and ui_do_but_COLOR().
| bool BKE_palette_from_hash | ( | Main * | bmain, |
| GHash * | color_table, | ||
| const char * | name, | ||
| const bool | linear | ||
| ) |
Definition at line 905 of file paint.c.
References BKE_palette_add(), BKE_palette_color_add(), BKE_palette_sort_hsv(), BLI_ghash_len(), BLI_ghashIterator_getValue(), col, copy_v3_v3(), cpack_to_rgb(), GHASH_ITER, tPaletteColorHSV::h, linearrgb_to_srgb_v3_v3(), MEM_calloc_arrayN, MEM_SAFE_FREE, NULL, POINTER_AS_INT, r, tPaletteColorHSV::rgb, PaletteColor::rgb, rgb_to_hsv(), tPaletteColorHSV::s, t, v, and tPaletteColorHSV::v.
Referenced by gpencil_extract_palette_from_vertex(), and palette_extract_img_exec().
| bool BKE_palette_is_empty | ( | const struct Palette * | palette | ) |
Definition at line 764 of file paint.c.
References BLI_listbase_is_empty(), and Palette::colors.
| void BKE_palette_sort_hsv | ( | tPaletteColorHSV * | color_array, |
| const int | totcol | ||
| ) |
Definition at line 881 of file paint.c.
References palettecolor_compare_hsv().
Referenced by BKE_palette_from_hash(), and palette_sort_exec().
| void BKE_palette_sort_luminance | ( | tPaletteColorHSV * | color_array, |
| const int | totcol | ||
| ) |
Definition at line 899 of file paint.c.
References palettecolor_compare_luminance().
Referenced by palette_sort_exec().
| void BKE_palette_sort_svh | ( | tPaletteColorHSV * | color_array, |
| const int | totcol | ||
| ) |
Definition at line 887 of file paint.c.
References palettecolor_compare_svh().
Referenced by palette_sort_exec().
| void BKE_palette_sort_vhs | ( | tPaletteColorHSV * | color_array, |
| const int | totcol | ||
| ) |
Definition at line 893 of file paint.c.
References palettecolor_compare_vhs().
Referenced by palette_sort_exec().
Definition at line 2219 of file paint.c.
References BKE_pbvh_grids_update(), SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_hidden, and SubdivCCG::grids.
Referenced by BKE_sculpt_object_pbvh_ensure().
| void BKE_sculpt_color_layer_create_if_needed | ( | struct Object * | object | ) |
Definition at line 1800 of file paint.c.
References BKE_mesh_update_customdata_pointers(), BKE_object_get_original_mesh(), CD_DEFAULT, CD_PROP_COLOR, CustomData_add_layer(), CustomData_has_layer(), DEG_id_tag_update(), Mesh::id, ID_RECALC_GEOMETRY, NULL, and Mesh::totvert.
Referenced by sculpt_brush_stroke_init(), sculpt_color_filter_invoke(), and sculpt_expand_invoke().
Ensures we do have expected mesh data in original mesh for the sculpt mode.
Definition at line 2057 of file paint.c.
References BKE_mesh_from_object(), BKE_mesh_tessface_clear(), BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_mask_layers_ensure(), BKE_sculpt_multires_active(), BLI_assert, CD_SCULPT_FACE_SETS, CustomData_get_layer(), DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, mesh, Object::mode, NULL, OB_MODE_SCULPT, scene, and Object::sculpt.
Referenced by quadriflow_start_job(), sculpt_init_session(), and voxel_remesh_exec().
| void BKE_sculpt_face_sets_ensure_from_base_mesh_visibility | ( | Mesh * | mesh | ) |
Ensures that a Face Set data-layers exists. If it does not, it creates one respecting the visibility stored in the vertices of the mesh. If it does, it copies the visibility from the mesh to the Face Sets.
Definition at line 1950 of file paint.c.
References abs(), CD_CALLOC, CD_SCULPT_FACE_SETS, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), Mesh::face_sets_color_default, MPoly::flag, ME_HIDE, mesh, Mesh::mpoly, NULL, and Mesh::totpoly.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), and BKE_sculpt_sync_face_set_visibility().
| int BKE_sculpt_mask_layers_ensure | ( | Object * | ob, |
| MultiresModifierData * | mmd | ||
| ) |
Definition at line 1829 of file paint.c.
References BKE_ccg_gridsize(), CD_CALLOC, CD_GRID_PAINT_MASK, CD_PAINT_MASK, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), GridPaintMask::data, Object::data, float(), l, Mesh::ldata, GridPaintMask::level, MPoly::loopstart, max_ii(), ME_POLY_LOOP_NEXT, ME_POLY_LOOP_PREV, MEM_callocN, Mesh::mloop, Mesh::mpoly, next, NULL, ret, SCULPT_MASK_LAYER_CALC_LOOP, SCULPT_MASK_LAYER_CALC_VERT, MultiresModifierData::sculptlvl, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Mesh::totvert, BMLoop::v, and MLoop::v.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), ED_object_modifier_add(), geometry_extract_apply(), multires_subdivide_exec(), and paint_mask_slice_exec().
| MultiresModifierData* BKE_sculpt_multires_active | ( | Scene * | scene, |
| Object * | ob | ||
| ) |
Definition at line 1527 of file paint.c.
References BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), SculptSession::bm, CD_MDISPS, CustomData_get_layer(), Object::data, eModifierMode_Realtime, eModifierType_Multires, eMultiresModifierFlag_UseSculptBaseMesh, MultiresModifierData::flags, if(), Mesh::ldata, Object::mode, ModifierData::next, NULL, OB_MODE_SCULPT, scene, Object::sculpt, and MultiresModifierData::sculptlvl.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), ED_object_sculptmode_enter_ex(), ED_object_sculptmode_exit_ex(), mesh_calc_modifiers(), sculpt_modifiers_active(), sculpt_undo_restore_list(), and sculpt_update_object().
Definition at line 2171 of file paint.c.
References BKE_paint_select_face_test(), BKE_paint_select_vert_test(), BKE_pbvh_type(), BKE_sculpt_bvh_update_from_ccg(), SculptSession::bm, build_pbvh_for_dynamic_topology(), build_pbvh_from_ccg(), build_pbvh_from_regular_mesh(), Object::data, DEG_get_evaluated_object(), depsgraph, Object_Runtime::mesh_deform_eval, Object::mode, NULL, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, SculptSession::pbvh, PBVH_GRIDS, Mesh::runtime, Object::runtime, Object::sculpt, Mesh_Runtime::subdiv_ccg, and Object::type.
Referenced by hide_show_exec(), and sculpt_update_object().
Definition at line 2044 of file paint.c.
References BKE_sculpt_face_sets_ensure_from_base_mesh_visibility(), BKE_sculpt_sync_face_sets_visibility_to_base_mesh(), BKE_sculpt_sync_face_sets_visibility_to_grids(), and mesh.
Referenced by build_pbvh_from_ccg(), and build_pbvh_from_regular_mesh().
| void BKE_sculpt_sync_face_sets_visibility_to_base_mesh | ( | Mesh * | mesh | ) |
Definition at line 1998 of file paint.c.
References BKE_mesh_flush_hidden_from_polys(), CD_SCULPT_FACE_SETS, CustomData_get_layer(), MPoly::flag, ME_HIDE, mesh, Mesh::mpoly, SET_FLAG_FROM_TEST, and Mesh::totpoly.
Referenced by BKE_sculpt_sync_face_set_visibility(), and SCULPT_visibility_sync_all_face_sets_to_vertices().
Definition at line 2013 of file paint.c.
References BKE_subdiv_ccg_grid_hidden_ensure(), BKE_subdiv_ccg_grid_to_face_index(), BKE_subdiv_ccg_key_top_level(), BLI_bitmap_set_all(), CD_SCULPT_FACE_SETS, CustomData_get_layer(), CCGKey::grid_area, SubdivCCG::grid_hidden, mesh, and Mesh::totloop.
Referenced by BKE_sculpt_sync_face_set_visibility(), and SCULPT_visibility_sync_all_face_sets_to_vertices().
| void BKE_sculpt_toolsettings_data_ensure | ( | struct Scene * | scene | ) |
Definition at line 1895 of file paint.c.
References BKE_paint_ensure(), Sculpt::constant_detail, Sculpt::detail_percent, Sculpt::detail_size, Sculpt::paint, scene, ToolSettings::sculpt, Paint::tile_offset, and Scene::toolsettings.
Referenced by sculpt_init_session(), and vertex_paint_init_session().
Definition at line 1789 of file paint.c.
References BKE_object_get_evaluated_mesh(), BLI_assert, DEG_get_original_object(), depsgraph, NULL, and sculpt_update_object().
Referenced by mesh_build_data().
| void BKE_sculpt_update_object_before_eval | ( | Object * | ob | ) |
Definition at line 1757 of file paint.c.
References BKE_pbvh_node_mark_update(), BKE_pbvh_search_gather(), BKE_sculptsession_free_deformMats(), BKE_sculptsession_free_vwpaint_data(), SculptSession::building_vp_handle, SculptSession::cache, SculptSession::expand_cache, SculptSession::filter_cache, MEM_freeN, NULL, SculptSession::pbvh, Object::sculpt, and sculptsession_free_pbvh().
Referenced by editbmesh_build_data(), and mesh_build_data().
| void BKE_sculpt_update_object_for_edit | ( | Depsgraph * | depsgraph, |
| Object * | ob_orig, | ||
| bool | need_pmap, | ||
| bool | need_mask, | ||
| bool | need_colors | ||
| ) |
Definition at line 1817 of file paint.c.
References BKE_object_get_evaluated_mesh(), BLI_assert, DEG_get_evaluated_object(), DEG_get_original_object(), depsgraph, NULL, and sculpt_update_object().
Referenced by ED_sculpt_init_transform(), ED_sculpt_update_modal_transform(), mask_flood_fill_exec(), paint_cursor_draw_3d_view_brush_cursor_inactive(), paint_cursor_preview_boundary_data_update(), sample_detail_voxel(), sculpt_brush_stroke_init(), sculpt_cloth_filter_invoke(), sculpt_cloth_filter_modal(), sculpt_color_filter_invoke(), sculpt_dirty_mask_exec(), sculpt_expand_invoke(), sculpt_expand_modal(), sculpt_face_set_create_exec(), sculpt_face_set_edit_invoke(), sculpt_face_set_init_exec(), sculpt_face_sets_change_visibility_exec(), SCULPT_geometry_preview_lines_update(), sculpt_gesture_face_set_begin(), sculpt_gesture_mask_begin(), sculpt_gesture_project_begin(), sculpt_gesture_trim_begin(), sculpt_init_session(), sculpt_mask_by_color_invoke(), sculpt_mask_expand_invoke(), sculpt_mask_expand_modal(), sculpt_mask_filter_exec(), sculpt_mask_init_exec(), sculpt_mesh_filter_invoke(), sculpt_mesh_filter_modal(), sculpt_set_persistent_base_exec(), sculpt_set_pivot_position_exec(), SCULPT_stroke_modifiers_check(), sculpt_undo_restore_coords(), sculpt_undo_restore_list(), vertex_paint_init_session(), and vertex_paint_init_stroke().
| void BKE_sculptsession_bm_to_me | ( | Object * | ob, |
| bool | reorder | ||
| ) |
Definition at line 1398 of file paint.c.
References DEG_id_tag_update(), Object::id, ID_RECALC_GEOMETRY, Object::sculpt, and sculptsession_bm_to_me_update_data_only().
Referenced by BKE_sculptsession_free(), ED_editors_flush_edits_for_object_ex(), and SCULPT_dynamic_topology_disable_ex().
| void BKE_sculptsession_bm_to_me_for_render | ( | Object * | object | ) |
Definition at line 1444 of file paint.c.
References BKE_object_free_derived_caches(), SculptSession::bm, Object::sculpt, and sculptsession_bm_to_me_update_data_only().
Referenced by ED_editors_flush_edits_for_object_ex().
| void BKE_sculptsession_free | ( | Object * | ob | ) |
Definition at line 1466 of file paint.c.
References BKE_image_pool_free(), BKE_sculptsession_bm_to_me(), BKE_sculptsession_free_vwpaint_data(), SculptSession::bm, SculptSession::bm_log, BM_log_free(), BM_mesh_free(), SculptSession::boundary_preview, SculptSession::deform_cos, SculptSession::deform_imats, SculptBoundary::distance, SculptBoundary::edges, SculptBoundary::edit_info, SculptSession::epmap, SculptSession::epmap_mem, MEM_freeN, MEM_SAFE_FREE, NULL, SculptSession::orig_cos, SculptSession::pmap, SculptSession::pmap_mem, SculptSession::pose_ik_chain_preview, Object::sculpt, sculptsession_free_pbvh(), SculptPoseIKChain::segments, SculptSession::tex_pool, SculptSession::texcache, SculptPoseIKChain::tot_segments, SculptSession::vemap, SculptSession::vemap_mem, SculptBoundary::vertices, and SculptPoseIKChainSegment::weights.
Referenced by ED_object_sculptmode_exit_ex(), ed_vwpaintmode_enter_generic(), ed_vwpaintmode_exit_generic(), object_free_data(), and sculpt_init_session().
| void BKE_sculptsession_free_deformMats | ( | SculptSession * | ss | ) |
Definition at line 1337 of file paint.c.
References SculptSession::deform_cos, SculptSession::deform_imats, MEM_SAFE_FREE, and SculptSession::orig_cos.
Referenced by BKE_sculpt_update_object_before_eval(), sculpt_undo_restore_list(), and sculpt_update_object().
| void BKE_sculptsession_free_vwpaint_data | ( | struct SculptSession * | ss | ) |
Definition at line 1344 of file paint.c.
References BKE_defvert_array_free_elems(), MEM_freeN, MEM_SAFE_FREE, SculptSession::mode, SculptSession::mode_type, NULL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, SculptVertexPaintGeomMap::poly_map_mem, SculptSession::totvert, SculptVertexPaintGeomMap::vert_map_mem, SculptVertexPaintGeomMap::vert_to_loop, SculptVertexPaintGeomMap::vert_to_poly, SculptSession::vpaint, and SculptSession::wpaint.
Referenced by BKE_sculpt_update_object_before_eval(), and BKE_sculptsession_free().
Definition at line 2230 of file paint.c.
References BKE_pbvh_type(), SculptSession::deform_modifiers_active, SculptSession::mode_type, NULL, OB_MODE_SCULPT, OB_SOLID, SculptSession::pbvh, PBVH_FACES, Object::sculpt, View3D::shading, SculptSession::shapekey_active, and View3DShading::type.
Definition at line 2096 of file paint.c.
References BKE_pbvh_build_bmesh(), BKE_pbvh_new(), SculptSession::bm, SculptSession::bm_log, SculptSession::bm_smooth_shading, SculptSession::cd_face_node_offset, SculptSession::cd_vert_node_offset, pbvh_show_face_sets_set(), pbvh_show_mask_set(), Object::sculpt, and SculptSession::show_mask.
Referenced by BKE_sculpt_object_pbvh_ensure().
Definition at line 2149 of file paint.c.
References BKE_mesh_from_object(), BKE_pbvh_build_grids(), BKE_pbvh_new(), BKE_pbvh_respect_hide_set(), BKE_sculpt_sync_face_set_visibility(), BKE_subdiv_ccg_key_top_level(), SubdivCCG::grid_faces, SubdivCCG::grid_flag_mats, SubdivCCG::grid_hidden, SubdivCCG::grids, SubdivCCG::num_grids, pbvh_show_face_sets_set(), pbvh_show_mask_set(), Object::sculpt, SculptSession::show_face_sets, and SculptSession::show_mask.
Referenced by BKE_sculpt_object_pbvh_ensure().
|
static |
Definition at line 2110 of file paint.c.
References BKE_mesh_recalc_looptri(), BKE_mesh_vert_coords_alloc(), BKE_object_get_original_mesh(), BKE_pbvh_build_mesh(), BKE_pbvh_new(), BKE_pbvh_respect_hide_set(), BKE_pbvh_vert_coords_apply(), BKE_sculpt_sync_face_set_visibility(), check_sculpt_object_deformed(), float(), Mesh::ldata, MEM_freeN, MEM_malloc_arrayN, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, pbvh_show_face_sets_set(), pbvh_show_mask_set(), poly_to_tri_count(), Object::sculpt, SculptSession::show_face_sets, SculptSession::show_mask, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_sculpt_object_pbvh_ensure().
|
static |
Definition at line 1922 of file paint.c.
References NULL, and OB_SHAPE_LOCK.
Referenced by build_pbvh_from_regular_mesh().
| bool paint_calculate_rake_rotation | ( | UnifiedPaintSettings * | ups, |
| Brush * | brush, | ||
| const float | mouse_pos[2] | ||
| ) |
Definition at line 1300 of file paint.c.
References atan2f, Paint::brush, MTex::brush_angle_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, copy_v2_v2(), UnifiedPaintSettings::last_rake, UnifiedPaintSettings::last_rake_angle, len_squared_v2(), Brush::mask_mtex, Brush::mtex, MTEX_ANGLE_RAKE, paint_update_brush_rake_rotation(), r, RAKE_THRESHHOLD, and sub_v2_v2v2().
Referenced by paint_brush_update(), paint_cursor_update_rake_rotation(), and paint_stroke_modal().
|
static |
Definition at line 198 of file paint.c.
References BLO_read_data_address, and PaintCurve::points.
|
static |
Definition at line 187 of file paint.c.
References BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_struct_array, PaintCurve::id, PaintCurve::points, PaintCurve::tot_points, and ID::us.
|
static |
Definition at line 166 of file paint.c.
References MEM_dupallocN, PaintCurve::points, and PaintCurve::tot_points.
|
static |
Definition at line 179 of file paint.c.
References MEM_SAFE_FREE, PaintCurve::points, and PaintCurve::tot_points.
| float paint_grid_paint_mask | ( | const GridPaintMask * | gpm, |
| uint | level, | ||
| uint | x, | ||
| uint | y | ||
| ) |
Definition at line 1272 of file paint.c.
References BKE_ccg_factor(), BKE_ccg_gridsize(), GridPaintMask::data, GridPaintMask::level, x, and y.
| bool paint_is_bmesh_face_hidden | ( | BMFace * | f | ) |
Definition at line 1257 of file paint.c.
References BM_elem_flag_test, BM_ELEM_HIDDEN, BM_FACE_FIRST_LOOP, BMLoop::next, and BMLoop::v.
Referenced by partialvis_update_bmesh_faces().
Definition at line 1237 of file paint.c.
References MVert::flag, ME_HIDE, MLoopTri::tri, and MLoop::v.
| bool paint_is_grid_face_hidden | ( | const uint * | grid_hidden, |
| int | gridsize, | ||
| int | x, | ||
| int | y | ||
| ) |
Definition at line 1247 of file paint.c.
References BLI_BITMAP_TEST, x, and y.
Referenced by BKE_pbvh_count_grid_quads(), gpu_pbvh_grid_fill_index_buffers(), pbvh_grids_node_nearest_to_ray(), and pbvh_grids_node_raycast().
| void paint_update_brush_rake_rotation | ( | UnifiedPaintSettings * | ups, |
| Brush * | brush, | ||
| float | rotation | ||
| ) |
Definition at line 1283 of file paint.c.
References Paint::brush, MTex::brush_angle_mode, UnifiedPaintSettings::brush_rotation, UnifiedPaintSettings::brush_rotation_sec, Brush::mask_mtex, Brush::mtex, and MTEX_ANGLE_RAKE.
Referenced by paint_calculate_rake_rotation(), and paint_stroke_curve_end().
|
static |
Definition at line 122 of file paint.c.
References BLO_read_list(), and Palette::colors.
|
static |
Definition at line 108 of file paint.c.
References BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_struct, Palette::colors, ListBase::first, Palette::id, PaletteColor::next, and ID::us.
|
static |
Definition at line 90 of file paint.c.
References BLI_duplicatelist(), and Palette::colors.
|
static |
Definition at line 101 of file paint.c.
References BLI_freelistN(), and Palette::colors.
|
static |
Definition at line 80 of file paint.c.
References BLI_assert, Palette::id, id_fake_user_set(), and MEMCMP_STRUCT_AFTER_IS_ZERO.
|
static |
Definition at line 128 of file paint.c.
References BKE_lib_id_swap(), NULL, ID::properties, and SWAP.
|
static |
Definition at line 770 of file paint.c.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_hsv().
|
static |
Definition at line 864 of file paint.c.
References tPaletteColorHSV::rgb.
Referenced by BKE_palette_sort_luminance().
|
static |
Definition at line 802 of file paint.c.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_svh().
|
static |
Definition at line 833 of file paint.c.
References tPaletteColorHSV::h, tPaletteColorHSV::s, and tPaletteColorHSV::v.
Referenced by BKE_palette_sort_vhs().
Definition at line 1569 of file paint.c.
References BKE_modifier_get_info(), BKE_modifier_is_enabled(), BKE_modifiers_get_virtual_modifierlist(), BKE_sculpt_multires_active(), SculptSession::bm, Object::data, eModifierMode_Realtime, eModifierType_Multires, eModifierType_ShapeKey, eModifierTypeType_OnlyDeform, eMultiresModifierFlag_UseSculptBaseMesh, MultiresModifierData::flags, Sculpt::flags, if(), Mesh::key, Object::mode, ModifierData::next, OB_MODE_SCULPT, OB_SHAPE_LOCK, scene, Object::sculpt, SCULPT_ONLY_DEFORM, Object::shapeflag, Object::shapenr, ModifierTypeInfo::type, and ModifierData::type.
Referenced by sculpt_update_object().
|
static |
| need_mask | So that the evaluated mesh that is returned has mask data. |
Definition at line 1616 of file paint.c.
References Freestyle::a, SculptSession::active, BKE_crazyspace_build_sculpt(), BKE_keyblock_convert_to_vertcos(), BKE_keyblock_from_object(), BKE_mesh_vert_coords_alloc(), BKE_mesh_vert_poly_map_create(), BKE_object_get_original_mesh(), BKE_pbvh_face_sets_color_set(), BKE_pbvh_face_sets_set(), BKE_pbvh_is_deformed(), BKE_pbvh_subdiv_cgg_set(), BKE_pbvh_vert_coords_apply(), BKE_sculpt_multires_active(), BKE_sculpt_object_pbvh_ensure(), BKE_sculptsession_free_deformMats(), BLI_assert, SculptSession::building_vp_handle, CD_GRID_PAINT_MASK, CD_PAINT_MASK, CD_PROP_COLOR, CD_SCULPT_FACE_SETS, CustomData_get_layer(), CustomData_has_layer(), SculptSession::deform_cos, SculptSession::deform_imats, SculptSession::deform_modifiers_active, DEG_get_input_scene(), SculptSession::depsgraph, depsgraph, SculptSession::face_sets, Mesh::face_sets_color_default, Mesh::face_sets_color_seed, Sculpt::flags, float(), invert_m3(), Mesh::ldata, SculptSession::level, MEM_freeN, SculptSession::mloop, Mesh::mloop, Object::mode, SculptSession::modifier, SculptSession::mpoly, Mesh::mpoly, SculptSession::multires, SculptSession::mvert, Mesh::mvert, NULL, OB_MESH, OB_MODE_SCULPT, SculptSession::orig_cos, SculptSession::pbvh, pbvh_show_face_sets_set(), pbvh_show_mask_set(), SculptSession::pmap, SculptSession::pmap_mem, Mesh::runtime, SculptSession::scene, scene, Object::sculpt, ToolSettings::sculpt, SCULPT_HIDE_FACE_SETS, SCULPT_HIDE_MASK, sculpt_modifiers_active(), MultiresModifierData::sculptlvl, SculptSession::shapekey_active, SculptSession::show_face_sets, SculptSession::show_mask, SculptSession::subdiv_ccg, Mesh_Runtime::subdiv_ccg, Scene::toolsettings, SculptSession::totfaces, Mesh::totloop, SculptSession::totpoly, Mesh::totpoly, SculptSession::totvert, Mesh::totvert, Object::type, UNUSED_VARS_NDEBUG, SculptSession::vcol, and SculptSession::vmask.
Referenced by BKE_sculpt_update_object_after_eval(), and BKE_sculpt_update_object_for_edit().
|
static |
Write out the sculpt dynamic-topology BMesh to the Mesh.
Definition at line 1374 of file paint.c.
References SculptSession::bm, BM_elem_flag_set, BM_ELEM_SMOOTH, BM_FACES_OF_MESH, BM_ITER_MESH, SculptSession::bm_log, BM_log_mesh_elems_reorder(), BM_mesh_bm_to_me(), SculptSession::bm_smooth_shading, Object::data, NULL, and Object::sculpt.
Referenced by BKE_sculptsession_bm_to_me(), and BKE_sculptsession_bm_to_me_for_render().
|
static |
Definition at line 1409 of file paint.c.
References BKE_pbvh_free(), SculptVertexInfo::boundary, SculptVertexInfo::connected_component, SculptSession::epmap, SculptSession::epmap_mem, SculptFakeNeighbors::fake_neighbor_index, SculptSession::fake_neighbors, MEM_SAFE_FREE, NULL, SculptSession::pbvh, SculptSession::persistent_base, SculptSession::pmap, SculptSession::pmap_mem, SculptSession::preview_vert_index_count, SculptSession::preview_vert_index_list, SculptSession::vemap, SculptSession::vemap_mem, and SculptSession::vertex_info.
Referenced by BKE_sculpt_update_object_before_eval(), and BKE_sculptsession_free().
| IDTypeInfo IDType_ID_PAL |
| IDTypeInfo IDType_ID_PC |
|
static |
Definition at line 237 of file paint.c.
Referenced by BKE_paint_get_overlay_flags(), BKE_paint_invalidate_cursor_overlay(), BKE_paint_invalidate_overlay_all(), BKE_paint_invalidate_overlay_tex(), BKE_paint_reset_overlay_invalid(), BKE_paint_set_overlay_override(), brush_defaults(), load_tex(), and load_tex_cursor().
| const char PAINT_CURSOR_SCULPT[3] = {255, 100, 100} |
Definition at line 232 of file paint.c.
Referenced by ED_object_sculptmode_enter_ex().
| const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255} |
Definition at line 235 of file paint.c.
Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_space_image_paint_update().
| const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255} |
Definition at line 233 of file paint.c.
Referenced by ed_vwpaintmode_enter_generic().
| const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255} |
Definition at line 234 of file paint.c.
Referenced by ed_vwpaintmode_enter_generic().