Blender
V3.3
|
#include "BLI_bitmap.h"
#include "BLI_utildefines.h"
#include "DNA_brush_enums.h"
#include "DNA_object_enums.h"
#include "BKE_attribute.h"
Go to the source code of this file.
Classes | |
struct | SculptVertexPaintGeomMap |
struct | SculptPoseIKChainSegment |
struct | SculptPoseIKChain |
struct | SculptClothLengthConstraint |
struct | SculptClothSimulation |
struct | SculptPersistentBase |
struct | SculptVertexInfo |
struct | SculptBoundaryEditInfo |
struct | SculptBoundaryPreviewEdge |
struct | SculptBoundary |
struct | SculptFakeNeighbors |
struct | SculptSession |
Macros | |
#define | PAINT_MODE_HAS_BRUSH(mode) !ELEM(mode, PAINT_MODE_SCULPT_UV) |
#define | PAINT_OVERRIDE_MASK |
#define | PAINT_SYMM_AREA_DEFAULT 0 |
#define | PAINT_SYMM_AREAS 8 |
#define | SCULPT_FACE_SET_NONE 0 |
Typedefs | |
typedef enum ePaintMode | ePaintMode |
typedef enum ePaintOverlayControlFlags | ePaintOverlayControlFlags |
typedef enum ePaintSymmetryAreas | ePaintSymmetryAreas |
typedef struct SculptPoseIKChainSegment | SculptPoseIKChainSegment |
typedef struct SculptPoseIKChain | SculptPoseIKChain |
typedef enum eSculptClothNodeSimState | eSculptClothNodeSimState |
typedef enum eSculptClothConstraintType | eSculptClothConstraintType |
typedef struct SculptClothLengthConstraint | SculptClothLengthConstraint |
typedef struct SculptClothSimulation | SculptClothSimulation |
typedef struct SculptPersistentBase | SculptPersistentBase |
typedef struct SculptVertexInfo | SculptVertexInfo |
typedef struct SculptBoundaryEditInfo | SculptBoundaryEditInfo |
typedef struct SculptBoundaryPreviewEdge | SculptBoundaryPreviewEdge |
typedef struct SculptBoundary | SculptBoundary |
typedef struct SculptFakeNeighbors | SculptFakeNeighbors |
typedef struct SculptSession | SculptSession |
Variables | |
const char | PAINT_CURSOR_SCULPT [3] |
const char | PAINT_CURSOR_VERTEX_PAINT [3] |
const char | PAINT_CURSOR_WEIGHT_PAINT [3] |
const char | PAINT_CURSOR_TEXTURE_PAINT [3] |
#define PAINT_MODE_HAS_BRUSH | ( | mode | ) | !ELEM(mode, PAINT_MODE_SCULPT_UV) |
Definition at line 89 of file BKE_paint.h.
#define PAINT_OVERRIDE_MASK |
Definition at line 101 of file BKE_paint.h.
#define PAINT_SYMM_AREA_DEFAULT 0 |
Defines 8 areas resulting of splitting the object space by the XYZ axis planes. This is used to flip or mirror transform values depending on where the vertex is and where the transform operation started to support XYZ symmetry on those operations in a predictable way.
Definition at line 110 of file BKE_paint.h.
#define PAINT_SYMM_AREAS 8 |
Definition at line 118 of file BKE_paint.h.
#define SCULPT_FACE_SET_NONE 0 |
Definition at line 267 of file BKE_paint.h.
typedef enum ePaintMode ePaintMode |
typedef enum ePaintOverlayControlFlags ePaintOverlayControlFlags |
typedef enum ePaintSymmetryAreas ePaintSymmetryAreas |
typedef enum eSculptClothConstraintType eSculptClothConstraintType |
typedef enum eSculptClothNodeSimState eSculptClothNodeSimState |
typedef struct SculptBoundary SculptBoundary |
typedef struct SculptBoundaryEditInfo SculptBoundaryEditInfo |
typedef struct SculptBoundaryPreviewEdge SculptBoundaryPreviewEdge |
typedef struct SculptClothLengthConstraint SculptClothLengthConstraint |
typedef struct SculptClothSimulation SculptClothSimulation |
typedef struct SculptFakeNeighbors SculptFakeNeighbors |
typedef struct SculptPersistentBase SculptPersistentBase |
typedef struct SculptPoseIKChain SculptPoseIKChain |
typedef struct SculptPoseIKChainSegment SculptPoseIKChainSegment |
Pose Brush IK Chain.
typedef struct SculptSession SculptSession |
typedef struct SculptVertexInfo SculptVertexInfo |
anonymous enum |
Enumerator | |
---|---|
SCULPT_MASK_LAYER_CALC_VERT | |
SCULPT_MASK_LAYER_CALC_LOOP |
Definition at line 737 of file BKE_paint.h.
enum ePaintMode |
Enumerator | |
---|---|
PAINT_MODE_SCULPT | |
PAINT_MODE_VERTEX | Vertex color. |
PAINT_MODE_WEIGHT | |
PAINT_MODE_TEXTURE_3D | 3D view (projection painting). |
PAINT_MODE_TEXTURE_2D | Image space (2D painting). |
PAINT_MODE_SCULPT_UV | |
PAINT_MODE_GPENCIL | |
PAINT_MODE_VERTEX_GPENCIL | |
PAINT_MODE_SCULPT_GPENCIL | |
PAINT_MODE_WEIGHT_GPENCIL | |
PAINT_MODE_SCULPT_CURVES | |
PAINT_MODE_INVALID | Keep last. |
Definition at line 67 of file BKE_paint.h.
Definition at line 92 of file BKE_paint.h.
enum ePaintSymmetryAreas |
Enumerator | |
---|---|
PAINT_SYMM_AREA_X | |
PAINT_SYMM_AREA_Y | |
PAINT_SYMM_AREA_Z |
Definition at line 112 of file BKE_paint.h.
Enumerator | |
---|---|
SCULPT_CLOTH_CONSTRAINT_STRUCTURAL | |
SCULPT_CLOTH_CONSTRAINT_DEFORMATION | |
SCULPT_CLOTH_CONSTRAINT_SOFTBODY | |
SCULPT_CLOTH_CONSTRAINT_PIN |
Definition at line 316 of file BKE_paint.h.
Enumerator | |
---|---|
SCULPT_CLOTH_NODE_UNINITIALIZED | |
SCULPT_CLOTH_NODE_INACTIVE | |
SCULPT_CLOTH_NODE_ACTIVE |
Definition at line 305 of file BKE_paint.h.
bool BKE_object_attributes_active_color_fill | ( | struct Object * | ob, |
const float | fill_color[4], | ||
bool | only_selected | ||
) |
Fills the object's active color attribute layer with the fill color.
[in] | ob | The object. |
[in] | fill_color | The fill color. |
[in] | only_selected | Limit the fill to selected faces or vertices. |
Definition at line 4167 of file paint_vertex.cc.
References paint_object_attributes_active_color_fill_ex().
Referenced by blender::ed::geometry::geometry_color_attribute_add_exec(), and proj_paint_color_attribute_create().
Checks if face/vertex hiding is always applied in the current mode. Returns true in vertex/weight paint.
Definition at line 999 of file paint.c.
References Object::data, Object::mode, NULL, OB_MESH, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT, and Object::type.
Referenced by face_vert_reveal_poll().
void BKE_paint_blend_read_data | ( | struct BlendDataReader * | reader, |
const struct Scene * | scene, | ||
struct Paint * | paint | ||
) |
Referenced by direct_link_paint_helper(), and scene_blend_read_data().
void BKE_paint_blend_read_lib | ( | struct BlendLibReader * | reader, |
struct Scene * | scene, | ||
struct Paint * | paint | ||
) |
Definition at line 1230 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 | ( | struct BlendWriter * | writer, |
struct Paint * | paint | ||
) |
Definition at line 1196 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 607 of file paint.c.
References BKE_paint_brush_for_read().
Referenced by BKE_paint_init(), 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_sculpt_normal(), calc_sculpt_plane(), cloth_brush_apply_brush_foces(), do_gravity(), do_symmetrical_brush_actions(), dyntopo_detail_size_edit_invoke(), ED_paint_proj_mesh_data_check(), ED_sculpt_update_modal_transform(), 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(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::ed::sculpt_paint::new_selection_paint_operation(), OVERLAY_edit_uv_cache_init(), OVERLAY_edit_uv_init(), paint_2d_new_stroke(), paint_and_tex_color_alpha_intern(), paint_brush_stroke_add_step(), PAINT_brush_tool_poll(), paint_cursor_context_init(), paint_cursor_update_pixel_radius(), paint_draw_smooth_cursor(), paint_line_strokes_spacing(), paint_mesh_restore_co(), paint_proj_new_stroke(), paint_sample_color(), paint_space_stroke(), paint_space_stroke_spacing(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), paint_stroke_modal(), paint_stroke_new(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step(), paint_weight_gradient_exec(), project_state_init(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), sample_detail_dyntopo(), SCULPT_bmesh_topology_rake(), sculpt_brush_exit_tex(), sculpt_brush_init_tex(), SCULPT_brush_plane_offset_get(), sculpt_brush_stroke_cancel(), sculpt_brush_stroke_init(), sculpt_brush_stroke_invoke(), SCULPT_calc_area_center(), SCULPT_calc_area_normal(), SCULPT_calc_area_normal_and_center(), 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_clay_brush(), SCULPT_do_clay_strips_brush(), SCULPT_do_clay_thumb_brush(), SCULPT_do_cloth_brush(), SCULPT_do_crease_brush(), SCULPT_do_displacement_eraser_brush(), SCULPT_do_displacement_smear_brush(), SCULPT_do_draw_brush(), SCULPT_do_draw_face_sets_brush(), SCULPT_do_draw_sharp_brush(), SCULPT_do_elastic_deform_brush(), SCULPT_do_fill_brush(), SCULPT_do_flatten_brush(), SCULPT_do_grab_brush(), SCULPT_do_inflate_brush(), SCULPT_do_layer_brush(), SCULPT_do_mask_brush(), SCULPT_do_mask_brush_draw(), SCULPT_do_multiplane_scrape_brush(), SCULPT_do_nudge_brush(), SCULPT_do_paint_brush(), SCULPT_do_paint_brush_image(), SCULPT_do_pinch_brush(), SCULPT_do_pose_brush(), SCULPT_do_rotate_brush(), SCULPT_do_scrape_brush(), SCULPT_do_slide_relax_brush(), SCULPT_do_smear_brush(), SCULPT_do_snake_hook_brush(), SCULPT_do_surface_smooth_brush(), SCULPT_do_thumb_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_gesture_trim_calculate_depth(), sculpt_restore_mesh(), sculpt_sample_color_invoke(), SCULPT_smooth(), sculpt_stroke_done(), SCULPT_stroke_get_location(), sculpt_stroke_test_start(), sculpt_stroke_update_step(), sculpt_tool_name(), SCULPT_topology_automasking_init(), sculpt_update_cache_invariants(), sculpt_update_cache_variants(), smooth_brush_toggle_off(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), texture_get_from_context(), blender::ed::sculpt_paint::image::ops::paint::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_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().
Referenced by blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensityAddOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::ed::sculpt_paint::SmoothOperationExecutor::execute(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::execute(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_poll(), blender::ed::sculpt_paint::new_grow_shrink_operation(), blender::ed::sculpt_paint::new_pinch_operation(), blender::ed::sculpt_paint::sculpt_curves_stroke_invoke(), blender::ed::sculpt_paint::start_brush_operation(), blender::ed::sculpt_paint::use_add_density_mode(), and vpaint_get_current_col().
Definition at line 617 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(), smooth_brush_toggle_off(), smooth_brush_toggle_on(), and toolsystem_ref_link().
bool BKE_paint_canvas_image_get | ( | struct PaintModeSettings * | settings, |
struct Object * | ob, | ||
struct Image ** | r_image, | ||
struct ImageUser ** | r_image_user | ||
) |
Definition at line 39 of file blenkernel/intern/paint_canvas.cc.
References PaintModeSettings::canvas_image, PaintModeSettings::canvas_source, blender::bke::paint::canvas::get_active_slot(), TexPaintSlot::ima, TexPaintSlot::image_user, PaintModeSettings::image_user, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, and PAINT_CANVAS_SOURCE_MATERIAL.
Referenced by BKE_paint_canvas_key_get(), blender::ed::sculpt_paint::paint::image::ImageData::init_active_image(), and SCULPT_use_image_paint_brush().
char* BKE_paint_canvas_key_get | ( | struct PaintModeSettings * | settings, |
struct Object * | ob | ||
) |
Create a key that can be used to compare with previous ones to identify changes. The resulting 'string' is owned by the caller.
Definition at line 107 of file blenkernel/intern/paint_canvas.cc.
References BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BKE_paint_canvas_image_get(), BKE_paint_canvas_uvmap_layer_index_get(), BLI_strdup(), image(), LISTBASE_FOREACH, ImageUser::tile, ImBuf::x, and ImBuf::y.
Referenced by sculpt_update_object().
int BKE_paint_canvas_uvmap_layer_index_get | ( | const struct PaintModeSettings * | settings, |
struct Object * | ob | ||
) |
Definition at line 70 of file blenkernel/intern/paint_canvas.cc.
References PaintModeSettings::canvas_source, CD_MLOOPUV, CustomData_get_active_layer_index(), CustomData_get_named_layer_index(), Object::data, blender::bke::paint::canvas::get_active_slot(), Mesh::ldata, mesh, OB_MESH, PAINT_CANVAS_SOURCE_COLOR_ATTRIBUTE, PAINT_CANVAS_SOURCE_IMAGE, PAINT_CANVAS_SOURCE_MATERIAL, Object::type, and TexPaintSlot::uvname.
Referenced by BKE_paint_canvas_key_get().
Definition at line 1005 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().
Called when copying scene settings, so even if 'src' and 'tar' are the same still do a id_us_plus(), rather than if we were copying between 2 existing scenes where a matching value should decrease the existing user count as with #paint_brush_set()
Definition at line 1167 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, src, Paint::tool_slots, and Paint::tool_slots_len.
Referenced by BKE_toolsettings_copy().
struct PaintCurve* BKE_paint_curve_add | ( | struct Main * | bmain, |
const char * | name | ||
) |
Definition at line 705 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 | ( | struct PaintCurve * | pc, |
int | add_index | ||
) |
Definition at line 737 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 | ( | struct Brush * | br, |
struct PaintCurve * | pc | ||
) |
Definition at line 728 of file paint.c.
References id_us_min(), id_us_plus(), and Brush::paint_curve.
bool BKE_paint_ensure | ( | struct ToolSettings * | ts, |
struct Paint ** | r_paint | ||
) |
Call when entering each respective paint mode.
Definition at line 1042 of file paint.c.
References BKE_paint_runtime_init(), BLI_assert, ToolSettings::curves_sculpt, 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(), blender::ed::sculpt_paint::curves_sculptmode_enter(), 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 | ( | struct Scene * | sce, |
ePaintMode | mode | ||
) |
Definition at line 294 of file paint.c.
References BKE_paint_ensure(), ToolSettings::curves_sculpt, 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_CURVES, 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().
Definition at line 2336 of file paint.c.
References blender::math::abs(), BLI_hash_int_01(), floorf, GOLDEN_RATIO_CONJUGATE, hsv_to_rgb(), usdtokens::rgba(), rgba_float_to_uchar(), and seed.
Referenced by blender::draw::extract_sculpt_data_init(), blender::draw::extract_sculpt_data_init_subdiv(), GPU_pbvh_grid_buffers_update(), and GPU_pbvh_mesh_buffers_update().
Definition at line 1161 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 444 of file paint.c.
References ViewLayer::basact, ToolSettings::curves_sculpt, 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_CURVES, 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, CurvesSculpt::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().
Referenced by brush_add_exec(), brush_add_gpencil_exec(), brush_colors_flip_exec(), brush_curve_preset_exec(), brush_curve_preset_poll(), brush_reset_exec(), brush_scale_size_exec(), buttons_texture_users_from_context(), createTransPaintCurveVerts(), drw_sculpt_generate_calls(), gpencil_brush_cursor_draw(), initTransInfo(), paint_brush_stroke_add_step(), PAINT_brush_tool_poll(), paint_cursor_context_init(), paint_curve_poll(), paint_draw_line_cursor(), paint_draw_smooth_cursor(), paint_line_strokes_spacing(), paint_sample_color(), paint_space_stroke(), paint_space_stroke_spacing(), paint_stroke_modal(), paint_stroke_new(), paintcurve_delete_point_exec(), paintcurve_new_exec(), paintcurve_point_add(), paintcurve_point_select(), paintcurve_slide_invoke(), paintcurve_undosys_poll(), paintcurve_undosys_step_encode(), palette_color_add_exec(), palette_color_delete_exec(), palette_color_move_exec(), palette_join_exec(), palette_new_exec(), palette_poll(), palette_sort_exec(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), SCULPT_cursor_geometry_info_update(), blender::ed::sculpt_paint::sculpt_curves_stroke_invoke(), SCULPT_stroke_get_location(), stencil_control_invoke(), stencil_control_poll(), stencil_fit_image_aspect_exec(), stencil_reset_transform_exec(), and ui_do_but_COLOR().
struct Paint* BKE_paint_get_active_from_paintmode | ( | struct Scene * | sce, |
ePaintMode | mode | ||
) |
Definition at line 345 of file paint.c.
References ToolSettings::curves_sculpt, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, ToolSettings::imapaint, NULL, ImagePaintSettings::paint, Sculpt::paint, CurvesSculpt::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_CURVES, 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 | ( | ePaintMode | mode | ) |
Definition at line 675 of file paint.c.
References PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_CURVES, 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 266 of file paint.c.
References overlay_flags.
Referenced by load_tex(), load_tex_cursor(), and paint_draw_alpha_overlay().
const struct EnumPropertyItem* BKE_paint_get_tool_enum_from_paintmode | ( | ePaintMode | mode | ) |
Definition at line 382 of file paint.c.
References NULL, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_CURVES, 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_curves_sculpt_tool_items, 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 412 of file paint.c.
References NULL, PAINT_MODE_GPENCIL, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_SCULPT_CURVES, 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 | ( | struct Main * | bmain, |
struct Scene * | sce, | ||
ePaintMode | mode, | ||
const char | col[3] | ||
) |
Definition at line 1130 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 | ( | struct Scene * | scene, |
struct ViewLayer * | view_layer, | ||
struct CurveMapping * | curve | ||
) |
Definition at line 247 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().
Definition at line 260 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(), ED_paint_cursor_start(), and paint_cursor_delete_textures().
void BKE_paint_invalidate_overlay_tex | ( | struct Scene * | scene, |
struct ViewLayer * | view_layer, | ||
const struct Tex * | tex | ||
) |
Referenced by texture_changed().
eObjectMode BKE_paint_object_mode_from_paintmode | ( | ePaintMode | mode | ) |
Definition at line 1022 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 714 of file paint.c.
References NULL, and Paint::palette.
Referenced by paint_sample_color().
Definition at line 719 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 289 of file paint.c.
References overlay_flags.
Referenced by load_tex(), and load_tex_cursor().
void BKE_paint_runtime_init | ( | const struct ToolSettings * | ts, |
struct Paint * | paint | ||
) |
Referenced by paint_toolslots_init_with_runtime().
used to check if selection is possible (when we don't care if its face or vert)
Definition at line 994 of file paint.c.
References BKE_paint_select_face_test(), and BKE_paint_select_vert_test().
Referenced by face_vert_reveal_poll(), mask_paint_poll(), view3d_circle_select_exec(), view3d_select_exec(), and view3d_selectable_data().
Return true when in vertex/weight/texture paint + face-select mode?
Definition at line 980 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(), 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().
Return true when in vertex/weight paint + vertex-select mode?
Definition at line 987 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(), face_vert_reveal_exec(), vert_paint_poll(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select(), and view3d_select_exec().
void BKE_paint_set_overlay_override | ( | enum eOverlayFlags | flag | ) |
Definition at line 271 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 1184 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().
Definition at line 157 of file paint_toolslots.c.
References PaintToolSlot::brush, NULL, and Paint::tool_slots.
Referenced by brush_tool_cycle(), gpencil_primitive_init(), smooth_brush_toggle_on(), and toolsystem_ref_link().
Definition at line 124 of file paint_toolslots.c.
References BKE_paint_toolslots_brush_update_ex(), Paint::brush, and NULL.
Referenced by BKE_paint_brush_set(), and BKE_paint_toolslots_brush_validate().
Definition at line 109 of file paint_toolslots.c.
References BKE_brush_tool_get, BKE_paint_toolslots_len_ensure(), BLI_assert, PaintToolSlot::brush, Brush::id, id_us_min(), id_us_plus(), Paint::runtime, Paint_Runtime::tool_offset, Paint::tool_slots, and UNUSED_VARS_NDEBUG.
Referenced by BKE_paint_toolslots_brush_update().
Run this to ensure brush types are set for each slot on entering modes (for new scenes for example).
Definition at line 132 of file paint_toolslots.c.
References BKE_brush_tool_get, BKE_paint_toolslots_brush_update(), BLI_assert, PaintToolSlot::brush, Brush::id, id_us_min(), NULL, Brush::ob_mode, Paint_Runtime::ob_mode, paint_toolslots_init(), Paint::runtime, Paint_Runtime::tool_offset, Paint::tool_slots, Paint::tool_slots_len, and UNUSED_VARS_NDEBUG.
Referenced by ED_object_texture_paint_mode_enter_ex(), gpencil_brush_reset_all_exec(), gpencil_paintmode_toggle_exec(), gpencil_sculptmode_toggle_exec(), gpencil_vertexmode_toggle_exec(), gpencil_weightmode_toggle_exec(), sculpt_mode_toggle_exec(), vpaint_mode_toggle_exec(), and wpaint_mode_toggle_exec().
Definition at line 72 of file paint_toolslots.c.
References ToolSettings::curves_sculpt, ListBase::first, ToolSettings::gp_paint, ToolSettings::gp_sculptpaint, ToolSettings::gp_vertexpaint, ToolSettings::gp_weightpaint, Scene::id, ToolSettings::imapaint, ID::next, ImagePaintSettings::paint, Sculpt::paint, CurvesSculpt::paint, UvSculpt::paint, GpPaint::paint, GpVertexPaint::paint, GpSculptPaint::paint, GpWeightPaint::paint, VPaint::paint, paint_toolslots_init_with_runtime(), scene, Main::scenes, ToolSettings::sculpt, Scene::toolsettings, ToolSettings::uvsculpt, ToolSettings::vpaint, and ToolSettings::wpaint.
Referenced by do_versions_after_linking_280().
Definition at line 29 of file paint_toolslots.c.
References BLI_assert, len, MEM_recallocN, Paint::tool_slots, and Paint::tool_slots_len.
Referenced by BKE_paint_toolslots_brush_update_ex(), and paint_toolslots_init().
ePaintMode BKE_paintmode_get_active_from_context | ( | const struct bContext * | C | ) |
Referenced by brush_add_exec(), brush_generic_tool_set(), image_undosys_step_encode(), paint_brush_stroke_add_step(), paint_cursor_context_init(), paint_line_strokes_spacing(), paint_space_stroke(), paint_space_stroke_spacing(), paint_stroke_curve_end(), paint_stroke_modal(), paint_stroke_new(), paintcurve_cursor_invoke(), paintcurve_draw_exec(), palette_color_add_exec(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), sculpt_undo_use_multires_mesh(), stencil_control_poll(), ui_apply_but_undo(), and ui_tooltip_data_from_tool().
ePaintMode BKE_paintmode_get_from_tool | ( | const struct bToolRef * | tref | ) |
Definition at line 571 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_CURVES, 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_CURVES, 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 764 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().
Definition at line 758 of file paint.c.
References Palette::active_color, BLI_freelistN(), and Palette::colors.
struct PaletteColor* BKE_palette_color_add | ( | struct Palette * | palette | ) |
Definition at line 770 of file paint.c.
References BLI_addtail(), color, 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 | ( | struct Palette * | palette, |
struct PaletteColor * | color | ||
) |
Remove color from palette. Must be certain color is inside the palette!
Definition at line 742 of file paint.c.
References Palette::active_color, BLI_listbase_count_at_most(), BLI_listbase_is_empty(), BLI_remlink(), color, 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 | ( | struct Main * | bmain, |
struct GHash * | color_table, | ||
const char * | name, | ||
bool | linear | ||
) |
Definition at line 918 of file paint.c.
References usdtokens::b(), BKE_palette_add(), BKE_palette_color_add(), BKE_palette_sort_hsv(), BLI_ghash_len(), BLI_ghashIterator_getValue(), col, copy_v3_v3(), cpack_to_rgb(), usdtokens::g(), 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().
Definition at line 777 of file paint.c.
References BLI_listbase_is_empty(), and Palette::colors.
void BKE_palette_sort_hsv | ( | struct tPaletteColorHSV * | color_array, |
int | totcol | ||
) |
Definition at line 894 of file paint.c.
References palettecolor_compare_hsv().
Referenced by BKE_palette_from_hash(), and palette_sort_exec().
void BKE_palette_sort_luminance | ( | struct tPaletteColorHSV * | color_array, |
int | totcol | ||
) |
Definition at line 912 of file paint.c.
References palettecolor_compare_luminance().
Referenced by palette_sort_exec().
void BKE_palette_sort_svh | ( | struct tPaletteColorHSV * | color_array, |
int | totcol | ||
) |
Definition at line 900 of file paint.c.
References palettecolor_compare_svh().
Referenced by palette_sort_exec().
void BKE_palette_sort_vhs | ( | struct tPaletteColorHSV * | color_array, |
int | totcol | ||
) |
Definition at line 906 of file paint.c.
References palettecolor_compare_vhs().
Referenced by palette_sort_exec().
Definition at line 2307 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().
Create new color layer on object if it doesn't have one and if experimental feature set has sculpt vertex color enabled. Returns truth if new layer has been added, false otherwise.
Definition at line 1880 of file paint.c.
References ARRAY_SIZE, BKE_id_attributes_active_color_set(), BKE_mesh_update_customdata_pointers(), BKE_object_get_original_mesh(), BKE_pbvh_update_active_vcol(), CD_DEFAULT, CD_PROP_BYTE_COLOR, CD_PROP_COLOR, CustomData_add_layer(), CustomData_get_layer_index(), CustomData_has_layer(), DEG_id_tag_update(), Mesh::id, ID_RECALC_GEOMETRY_ALL_MODES, CustomData::layers, Mesh::ldata, NULL, SculptSession::pbvh, Object::sculpt, Mesh::totvert, types, and Mesh::vdata.
Referenced by sculpt_brush_stroke_init(), sculpt_color_filter_invoke(), sculpt_expand_invoke(), and sculpt_mask_by_color_invoke().
Ensures we do have expected mesh data in original mesh for the sculpt mode.
Definition at line 2144 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, Mesh::pdata, scene, and Object::sculpt.
Referenced by quadriflow_start_job(), sculpt_init_session(), and voxel_remesh_exec().
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 2043 of file paint.c.
References blender::math::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, Mesh::pdata, and Mesh::totpoly.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), and BKE_sculpt_sync_face_set_visibility().
int BKE_sculpt_mask_layers_ensure | ( | struct Object * | ob, |
struct MultiresModifierData * | mmd | ||
) |
Definition at line 1926 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, blender::meshintersect::prev(), ret, SCULPT_MASK_LAYER_CALC_LOOP, SCULPT_MASK_LAYER_CALC_VERT, MultiresModifierData::sculptlvl, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Mesh::totvert, BMLoop::v, and Mesh::vdata.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), BKE_sculpt_update_object_before_eval(), ED_object_modifier_add(), geometry_extract_apply(), multires_subdivide_exec(), and paint_mask_slice_exec().
struct MultiresModifierData* BKE_sculpt_multires_active | ( | const struct Scene * | scene, |
struct Object * | ob | ||
) |
Sculpt mode handles multi-res differently from regular meshes, but only if it's the last modifier on the stack and it is not on the first level.
Referenced by ED_object_sculptmode_enter_ex(), ED_object_sculptmode_exit_ex(), mesh_calc_modifiers(), and sculpt_undo_restore_list().
Definition at line 2258 of file paint.c.
References BKE_object_get_original_mesh(), BKE_pbvh_pmap_set(), BKE_pbvh_type(), BKE_pbvh_update_active_vcol(), 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, NULL, OB_MESH, SculptSession::pbvh, PBVH_GRIDS, SculptSession::pmap, Mesh::runtime, Object::runtime, Object::sculpt, Mesh_Runtime::subdiv_ccg, and Object::type.
Referenced by hide_show_exec(), and sculpt_update_object().
This ensure that all elements in the mesh (both vertices and grids) have their visibility updated according to the face sets.
Definition at line 2137 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().
Individual function to sync the Face Set visibility to mesh and grids.
Definition at line 2091 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, Mesh::pdata, SET_FLAG_FROM_TEST, and Mesh::totpoly.
Referenced by BKE_sculpt_sync_face_set_visibility(), and SCULPT_visibility_sync_all_face_sets_to_vertices().
void BKE_sculpt_sync_face_sets_visibility_to_grids | ( | struct Mesh * | mesh, |
struct SubdivCCG * | subdiv_ccg | ||
) |
Definition at line 2106 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, Mesh::pdata, and Mesh::totloop.
Referenced by BKE_sculpt_sync_face_set_visibility(), and SCULPT_visibility_sync_all_face_sets_to_vertices().
Definition at line 1992 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 1869 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().
Referenced by makeDerivedMesh().
void BKE_sculpt_update_object_for_edit | ( | struct Depsgraph * | depsgraph, |
struct Object * | ob_orig, | ||
bool | need_pmap, | ||
bool | need_mask, | ||
bool | is_paint_tool | ||
) |
Definition at line 1914 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_sample_color_invoke(), 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 vwpaint_init_stroke().
Definition at line 1401 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().
Definition at line 1447 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().
Definition at line 1469 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, SculptSession::last_paint_canvas_key, 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, 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 | ( | struct SculptSession * | ss | ) |
Definition at line 1342 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 1349 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().
bool BKE_sculptsession_use_pbvh_draw | ( | const struct Object * | ob, |
const struct RegionView3D * | rv3d | ||
) |
Test if PBVH can be used directly for drawing, which is faster than drawing the mesh and all updates that come with it.
Referenced by basic_cache_populate(), EEVEE_materials_cache_populate(), OVERLAY_facing_cache_populate(), OVERLAY_fade_cache_populate(), OVERLAY_mode_transfer_cache_populate(), OVERLAY_sculpt_cache_populate(), OVERLAY_wireframe_cache_populate(), SCULPT_flush_update_done(), SCULPT_flush_update_step(), SCULPT_stroke_modifiers_check(), SCULPT_tag_update_overlays(), sculpt_undo_restore_list(), and workbench_color_type_get().
bool paint_calculate_rake_rotation | ( | struct UnifiedPaintSettings * | ups, |
struct Brush * | brush, | ||
const float | mouse_pos[2] | ||
) |
Definition at line 1305 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().
float paint_grid_paint_mask | ( | const struct GridPaintMask * | gpm, |
uint | level, | ||
uint | x, | ||
uint | y | ||
) |
Referenced by multires_disp_run_cb(), and multires_grid_paint_mask_downsample().
Return true if all vertices in the face are visible, false otherwise.
Definition at line 1262 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().
bool paint_is_face_hidden | ( | const struct MLoopTri * | lt, |
const struct MVert * | mvert, | ||
const struct MLoop * | mloop | ||
) |
Returns non-zero if any of the face's vertices are hidden, zero otherwise.
Referenced by build_mesh_leaf_node(), gpu_pbvh_is_looptri_visible(), pbvh_faces_node_nearest_to_ray(), and pbvh_faces_node_raycast().
bool paint_is_grid_face_hidden | ( | const unsigned int * | grid_hidden, |
int | gridsize, | ||
int | x, | ||
int | y | ||
) |
Returns non-zero if any of the corners of the grid face whose inner corner is at (x, y) are hidden, zero otherwise.
Definition at line 1253 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 | ( | struct UnifiedPaintSettings * | ups, |
struct Brush * | brush, | ||
float | rotation | ||
) |
Definition at line 1288 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().
|
extern |
Definition at line 220 of file paint.c.
Referenced by ED_object_sculptmode_enter_ex().
|
extern |
Definition at line 223 of file paint.c.
Referenced by ED_object_texture_paint_mode_enter_ex(), and ED_space_image_paint_update().
|
extern |
Definition at line 221 of file paint.c.
Referenced by ed_vwpaintmode_enter_generic().
|
extern |
Definition at line 222 of file paint.c.
Referenced by ed_vwpaintmode_enter_generic().