Blender
V3.3
|
#include "DNA_view3d_enums.h"
Go to the source code of this file.
Macros | |
#define | ED_IMAGE_UNDO_TILE_BITS 6 |
#define | ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS) |
#define | ED_IMAGE_UNDO_TILE_NUMBER(size) (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS) |
Typedefs | |
typedef struct PaintTileMap | PaintTileMap |
#define ED_IMAGE_UNDO_TILE_BITS 6 |
Definition at line 104 of file ED_paint.h.
#define ED_IMAGE_UNDO_TILE_NUMBER | ( | size | ) | (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS) |
Definition at line 106 of file ED_paint.h.
#define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS) |
Definition at line 105 of file ED_paint.h.
typedef struct PaintTileMap PaintTileMap |
Definition at line 1 of file ED_paint.h.
void* ED_image_paint_tile_find | ( | PaintTileMap * | paint_tile_map, |
struct Image * | image, | ||
struct ImBuf * | ibuf, | ||
struct ImageUser * | iuser, | ||
int | x_tile, | ||
int | y_tile, | ||
unsigned short ** | r_mask, | ||
bool | validate | ||
) |
Definition at line 158 of file image_undo.cc.
References ED_IMAGE_UNDO_TILE_SIZE, PaintTileKey::ibuf, image(), PaintTileKey::image, PaintTileKey::iuser_tile, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_ptr(), PaintTileMap::map, PaintTile::mask, MEM_callocN, PaintTile::pt, PaintTile::rect, square_i(), ImageUser::tile, PaintTile::valid, PaintTileKey::x_tile, and PaintTileKey::y_tile.
Referenced by ED_image_paint_tile_push(), and paint_2d_do_making_brush().
Definition at line 69 of file image_undo.cc.
References BLI_spin_end(), and paint_tiles_lock.
Referenced by project_paint_end().
Definition at line 64 of file image_undo.cc.
References BLI_spin_init(), and paint_tiles_lock.
Referenced by proj_paint_state_thread_init().
struct PaintTileMap* ED_image_paint_tile_map_get | ( | void | ) |
Definition at line 1061 of file image_undo.cc.
References BKE_undosys_stack_init_or_active_with_type(), BKE_UNDOSYS_TYPE_IMAGE, BLI_assert, ED_undo_stack_get(), ImageUndoStep::paint_mode, PAINT_MODE_TEXTURE_2D, ImageUndoStep::paint_tile_map, and UndoStack::step_init.
Referenced by ED_imapaint_dirty_region(), paint_2d_do_making_brush(), project_paint_undo_subtiles(), and blender::ed::sculpt_paint::paint::image::push_undo().
void* ED_image_paint_tile_push | ( | PaintTileMap * | paint_tile_map, |
struct Image * | image, | ||
struct ImBuf * | ibuf, | ||
struct ImBuf ** | tmpibuf, | ||
struct ImageUser * | iuser, | ||
int | x_tile, | ||
int | y_tile, | ||
unsigned short ** | r_mask, | ||
bool ** | r_valid, | ||
bool | use_thread_lock, | ||
bool | find_prev | ||
) |
Definition at line 192 of file image_undo.cc.
References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add_or_modify(), BLI_spin_lock(), BLI_spin_unlock(), data, ED_image_paint_tile_find(), ED_IMAGE_UNDO_TILE_SIZE, PaintTile::fp, PaintTileKey::ibuf, PaintTile::ibuf, image(), PaintTileKey::image, PaintTile::image, IMB_rectcpy(), imbuf_alloc_temp_tile(), PaintTile::iuser, PaintTileKey::iuser_tile, PaintTileMap::map, PaintTile::mask, MEM_callocN, paint_tiles_lock, PaintTile::pt, ptile_free(), PaintTile::rect, ImBuf::rect_float, ImageUser::scene, square_i(), SWAP, ImageUser::tile, PaintTile::uint, PaintTile::use_float, PaintTile::valid, PaintTileKey::x_tile, PaintTile::x_tile, PaintTileKey::y_tile, and PaintTile::y_tile.
Referenced by ED_imapaint_dirty_region(), project_paint_undo_subtiles(), and blender::ed::sculpt_paint::paint::image::push_undo().
void ED_image_undo_push_begin | ( | const char * | name, |
int | paint_mode | ||
) |
The caller is responsible for running ED_image_undo_push_end, failure to do so causes an invalid state for the undo system.
Definition at line 1095 of file image_undo.cc.
References image_undo_push_begin().
Referenced by ED_imapaint_bucket_fill(), sculpt_stroke_test_start(), texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
void ED_image_undo_push_begin_with_image | ( | const char * | name, |
struct Image * | image, | ||
struct ImBuf * | ibuf, | ||
struct ImageUser * | iuser | ||
) |
Definition at line 1100 of file image_undo.cc.
References BKE_image_get_tile, BKE_UNDOSYS_TYPE_IMAGE, BLI_assert, ED_undo_stack_get(), ImageUndoStep::handles, image(), image_undo_push_begin(), PAINT_MODE_TEXTURE_2D, UndoImageBuf::post, UndoStep::prev, ImageUndoStep::step, UndoStack::step_active, ImageUser::tile, UndoImageBuf::tiles, UndoImageBuf::tiles_len, UndoStep::type, ubuf_from_image_all_tiles(), ubuf_lookup_from_reference(), uhandle_ensure(), uhandle_ensure_ubuf(), and UndoImageTile::users.
Referenced by image_flip_exec(), image_invert_exec(), and image_scale_exec().
Definition at line 1133 of file image_undo.cc.
References BKE_undosys_stack_limit_steps_and_memory_defaults, BKE_undosys_step_push(), ED_undo_stack_get(), and WM_file_tag_modified().
Referenced by ED_imapaint_bucket_fill(), image_flip_exec(), image_invert_exec(), image_scale_exec(), blender::ed::sculpt_paint::image::ops::paint::paint_stroke_done(), sculpt_stroke_done(), and texture_paint_camera_project_exec().
Restore painting image to previous state. Used for anchored and drag-dot style brushes.
Definition at line 1077 of file image_undo.cc.
References ptile_invalidate_map(), and ptile_restore_runtime_map().
Referenced by blender::ed::sculpt_paint::image::ops::paint::paint_stroke_update_step().
Export for ED_undo_sys.
Definition at line 1027 of file image_undo.cc.
References UndoType::flags, image_undosys_foreach_ID_ref(), image_undosys_poll(), image_undosys_step_decode(), image_undosys_step_encode(), image_undosys_step_encode_init(), image_undosys_step_free(), UndoType::name, UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_encode_init, UndoType::step_foreach_ID_ref, UndoType::step_free, UndoType::step_size, and UNDOTYPE_FLAG_DECODE_ACTIVE_STEP.
Referenced by ED_undosys_type_init().
void ED_imapaint_bucket_fill | ( | struct bContext * | C, |
float | color[3], | ||
struct wmOperator * | op, | ||
const int | mouse[2] | ||
) |
Definition at line 961 of file paint_image.cc.
References C, color, CTX_wm_space_image(), DEG_id_tag_update(), ED_image_undo_push_begin(), ED_image_undo_push_end(), Image::id, SpaceImage::image, wmOperatorType::name, paint_2d_bucket_fill(), PAINT_MODE_TEXTURE_2D, and wmOperator::type.
Referenced by drop_color_invoke().
Definition at line 91 of file paint_image.cc.
References BLI_rcti_init_minmax(), ImagePaintPartialRedraw::dirty_region, and imapaintpartial.
Referenced by image_flip_exec(), image_invert_exec(), image_scale_exec(), paint_2d_bucket_fill(), paint_2d_gradient_fill(), and paint_2d_redraw().
void ED_imapaint_dirty_region | ( | struct Image * | ima, |
struct ImBuf * | ibuf, | ||
struct ImageUser * | iuser, | ||
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
bool | find_old | ||
) |
Definition at line 109 of file paint_image.cc.
References BKE_image_mark_dirty(), BLI_rcti_do_minmax_rcti(), BLI_rcti_init(), ImagePaintPartialRedraw::dirty_region, ED_image_paint_tile_map_get(), ED_image_paint_tile_push(), imapaint_region_tiles(), imapaintpartial, IMB_freeImBuf(), IMB_rectclip(), w(), x, and y.
Referenced by paint_2d_bucket_fill(), paint_2d_gradient_fill(), and paint_2d_op().
void ED_keymap_paint | ( | struct wmKeyConfig * | keyconf | ) |
Definition at line 1491 of file paint_ops.c.
References CURVES_SCULPT_mode_poll(), facemask_paint_poll(), image_texture_paint_poll(), paint_curve_poll(), paint_stroke_modal_keymap(), wmKeyMap::poll, sculpt_expand_modal_keymap(), SCULPT_mode_poll(), vert_paint_poll(), vertex_paint_mode_poll(), weight_paint_mode_poll(), WM_keymap_ensure(), and WM_modalkeymap_assign().
Referenced by ED_spacetypes_keymap().
Definition at line 1383 of file paint_ops.c.
References wmOperatorType::description, OPTYPE_UNDO, ot, wmOperatorTypeMacro::ptr, RNA_boolean_set(), WM_operatortype_append_macro(), and WM_operatortype_macro_define().
Referenced by ED_spacemacros_init().
Definition at line 1399 of file paint_ops.c.
References BRUSH_OT_add(), BRUSH_OT_add_gpencil(), BRUSH_OT_curve_preset(), BRUSH_OT_reset(), BRUSH_OT_scale_size(), BRUSH_OT_stencil_control(), BRUSH_OT_stencil_fit_image_aspect(), BRUSH_OT_stencil_reset_transform(), PAINT_OT_add_simple_uvs(), PAINT_OT_add_texture_paint_slot(), PAINT_OT_brush_colors_flip(), PAINT_OT_brush_select(), PAINT_OT_face_select_all(), PAINT_OT_face_select_hide(), PAINT_OT_face_select_linked(), PAINT_OT_face_select_linked_pick(), PAINT_OT_face_vert_reveal(), PAINT_OT_grab_clone(), PAINT_OT_hide_show(), PAINT_OT_image_from_view(), PAINT_OT_image_paint(), PAINT_OT_mask_box_gesture(), PAINT_OT_mask_flood_fill(), PAINT_OT_mask_lasso_gesture(), PAINT_OT_mask_line_gesture(), PAINT_OT_project_image(), PAINT_OT_sample_color(), PAINT_OT_texture_paint_toggle(), PAINT_OT_vert_select_all(), PAINT_OT_vert_select_hide(), PAINT_OT_vert_select_ungrouped(), PAINT_OT_vertex_color_brightness_contrast(), PAINT_OT_vertex_color_from_weight(), PAINT_OT_vertex_color_hsv(), PAINT_OT_vertex_color_invert(), PAINT_OT_vertex_color_levels(), PAINT_OT_vertex_color_set(), PAINT_OT_vertex_color_smooth(), PAINT_OT_vertex_paint(), PAINT_OT_vertex_paint_toggle(), PAINT_OT_weight_from_bones(), PAINT_OT_weight_gradient(), PAINT_OT_weight_paint(), PAINT_OT_weight_paint_toggle(), PAINT_OT_weight_sample(), PAINT_OT_weight_sample_group(), PAINT_OT_weight_set(), PAINTCURVE_OT_add_point(), PAINTCURVE_OT_cursor(), PAINTCURVE_OT_delete_point(), PAINTCURVE_OT_draw(), PAINTCURVE_OT_new(), PAINTCURVE_OT_select(), PAINTCURVE_OT_slide(), PALETTE_OT_color_add(), PALETTE_OT_color_delete(), PALETTE_OT_color_move(), PALETTE_OT_extract_from_image(), PALETTE_OT_join(), PALETTE_OT_new(), PALETTE_OT_sort(), SCULPT_OT_uv_sculpt_stroke(), and WM_operatortype_append().
Referenced by ED_spacetypes_init().
void ED_paint_data_warning | ( | struct ReportList * | reports, |
bool | uvs, | ||
bool | mat, | ||
bool | tex, | ||
bool | stencil | ||
) |
Definition at line 6309 of file paint_image_proj.c.
References BKE_reportf(), RPT_WARNING, and tex.
Referenced by texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
bool ED_paint_proj_mesh_data_check | ( | struct Scene * | scene, |
struct Object * | ob, | ||
bool * | uvs, | ||
bool * | mat, | ||
bool * | tex, | ||
bool * | stencil | ||
) |
Make sure that active object has a material, and assign UVs and image layers if they do not exist.
Definition at line 6320 of file paint_image_proj.c.
References BKE_mesh_from_object(), BKE_object_material_get(), BKE_paint_brush(), BKE_texpaint_slot_refresh_cache(), BLI_assert, ImagePaintSettings::canvas, CD_MLOOPUV, CustomData_number_of_layers(), ImagePaintSettings::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, TexPaintSlot::ima, IMAGEPAINT_MISSING_MATERIAL, IMAGEPAINT_MISSING_STENCIL, IMAGEPAINT_MISSING_TEX, IMAGEPAINT_MISSING_UVS, IMAGEPAINT_MODE_IMAGE, IMAGEPAINT_MODE_MATERIAL, IMAGEPAINT_PROJECT_LAYER_STENCIL, Brush::imagepaint_tool, ToolSettings::imapaint, Mesh::ldata, ImagePaintSettings::missing_data, ImagePaintSettings::mode, NULL, OB_MESH, ImagePaintSettings::paint, Material::paint_active_slot, PAINT_TOOL_MASK, scene, ImagePaintSettings::stencil, tex, Material::texpaintslot, Scene::toolsettings, Object::totcol, and Object::type.
Referenced by add_simple_uvs_exec(), ED_editors_init_for_undo(), ED_object_texture_paint_mode_enter_ex(), material_slot_add_exec(), material_slot_remove_exec(), material_slot_remove_unused_exec(), mesh_uv_texture_add_exec(), mesh_uv_texture_remove_exec(), proj_paint_add_slot(), scene_changed(), texture_paint_camera_project_exec(), and blender::ed::sculpt_paint::image::ops::paint::texture_paint_init().
eV3DShadingColorType ED_paint_shading_color_override | ( | struct bContext * | C, |
const struct PaintModeSettings * | settings, | ||
struct Object * | ob, | ||
eV3DShadingColorType | orig_color_type | ||
) |
Color type of an object can be overridden in sculpt/paint mode.
Referenced by workbench_color_type_get().
Definition at line 51 of file editors/sculpt_paint/paint_canvas.cc.
References C, bToolRef::idname, paint_tool_shading_color_follows_last_used(), paint_tool_uses_canvas(), Object::sculpt, SculptSession::sticky_shading_color, and WM_toolsystem_ref_from_context().
Referenced by sculpt_brush_stroke_init(), and sculpt_color_filter_invoke().
Does the given tool use a paint canvas.
When #tref isn't given the active tool from the context is used.
Definition at line 83 of file editors/sculpt_paint/paint_canvas.cc.
References C, bToolRef::idname, paint_tool_uses_canvas(), and WM_toolsystem_ref_from_context().
Referenced by ED_paint_shading_color_override().
void ED_paintcurve_undo_push_begin | ( | const char * | name | ) |
Definition at line 158 of file paint_curve_undo.c.
References BKE_undosys_step_push_init_with_type(), BKE_UNDOSYS_TYPE_PAINTCURVE, C, ED_undo_stack_get(), and NULL.
Referenced by paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), and paintcurve_slide_modal().
Definition at line 165 of file paint_curve_undo.c.
References BKE_undosys_stack_limit_steps_and_memory_defaults, BKE_undosys_step_push(), C, ED_undo_stack_get(), NULL, and WM_file_tag_modified().
Referenced by paintcurve_delete_point_exec(), paintcurve_point_add(), paintcurve_point_select(), and paintcurve_slide_modal().
Export for ED_undo_sys.
Definition at line 136 of file paint_curve_undo.c.
References UndoType::flags, UndoType::name, paintcurve_undosys_foreach_ID_ref(), paintcurve_undosys_poll(), paintcurve_undosys_step_decode(), paintcurve_undosys_step_encode(), paintcurve_undosys_step_encode_init(), paintcurve_undosys_step_free(), UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_encode_init, UndoType::step_foreach_ID_ref, UndoType::step_free, and UndoType::step_size.
Referenced by ED_undosys_type_init().