|
Blender V5.0
|
#include <cmath>#include <cstdlib>#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_object_types.h"#include "DNA_brush_types.h"#include "DNA_scene_types.h"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_matrix.hh"#include "BLI_math_vector.hh"#include "BLI_rect.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_brush.hh"#include "BKE_bvhutils.hh"#include "BKE_context.hh"#include "BKE_customdata.hh"#include "BKE_image.hh"#include "BKE_layer.hh"#include "BKE_material.hh"#include "BKE_mesh.hh"#include "BKE_mesh_sample.hh"#include "BKE_object.hh"#include "BKE_paint.hh"#include "BKE_paint_types.hh"#include "BKE_report.hh"#include "DEG_depsgraph_query.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "IMB_imbuf_types.hh"#include "IMB_interp.hh"#include "ED_grease_pencil.hh"#include "ED_image.hh"#include "ED_screen.hh"#include "ED_view3d.hh"#include "ED_mesh.hh"#include "UI_interface_types.hh"#include "WM_api.hh"#include "WM_types.hh"#include "IMB_colormanagement.hh"#include "paint_intern.hh"Go to the source code of this file.
Classes | |
| struct | SampleColorData |
Functions | |
Sample Color Operator | |
| static blender::float2 | imapaint_pick_uv (const Mesh *mesh_eval, Scene *scene, Object *ob_eval, const int tri_index, const blender::float3 &bary_coord) |
| static int | imapaint_pick_face (ViewContext *vc, const int mval[2], int *r_tri_index, int *r_face_index, blender::float3 *r_bary_coord, const Mesh &mesh) |
| static void | paint_sample_color (bContext *C, ARegion *region, int x, int y, bool texpaint_proj, bool use_palette) |
| static void | sample_color_update_header (SampleColorData *data, bContext *C) |
| static wmOperatorStatus | sample_color_exec (bContext *C, wmOperator *op) |
| static wmOperatorStatus | sample_color_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static wmOperatorStatus | sample_color_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| static bool | sample_color_poll (bContext *C) |
| void | PAINT_OT_sample_color (wmOperatorType *ot) |
|
static |
Definition at line 115 of file paint_sample_color.cc.
References BLI_bvhtree_ray_cast(), BVHTreeRayHit::co, blender::bke::mesh_surface_sample::compute_bary_coord_in_triangle(), ViewContext::depsgraph, BVHTreeRayHit::dist, ED_view3d_win_to_segment_clipped(), Mesh::faces_num, FLT_MAX, BVHTreeRayHit::index, blender::math::normalize(), ViewContext::obact, blender::bke::BVHTreeFromMesh::raycast_callback, ViewContext::region, blender::math::transform_point(), blender::bke::BVHTreeFromMesh::tree, and ViewContext::v3d.
Referenced by paint_sample_color().
|
static |
Definition at line 72 of file paint_sample_color.cc.
References Geometry::attributes, BKE_object_material_get(), CD_PROP_FLOAT2, blender::bke::Corner, Mesh::corner_data, CustomData_get_active_layer_name(), blender::bke::Face, ToolSettings::imapaint, blender::Span< T >::is_empty(), blender::bke::AttributeAccessor::lookup(), blender::bke::AttributeAccessor::lookup_or_default(), ImagePaintSettings::mode, Material::paint_active_slot, PAINT_CANVAS_SOURCE_MATERIAL, blender::bke::mesh_surface_sample::sample_corner_attribute_with_bary_coords(), Material::texpaintslot, Scene::toolsettings, and TexPaintSlot::uvname.
Referenced by paint_sample_color().
| void PAINT_OT_sample_color | ( | wmOperatorType * | ot | ) |
Definition at line 489 of file paint_sample_color.cc.
References OPTYPE_DEPENDS_ON_CURSOR, OPTYPE_REGISTER, ot, PROP_HIDDEN, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_int_vector(), RNA_def_property_flag(), sample_color_exec(), sample_color_invoke(), sample_color_modal(), and sample_color_poll().
Referenced by ED_operatortypes_paint().
|
static |
Definition at line 159 of file paint_sample_color.cc.
References Palette::active_color, Geometry::attributes, BKE_brush_color_set(), BKE_image_acquire_ibuf(), BKE_image_get_tile_from_pos(), BKE_image_release_ibuf(), BKE_imageuser_default(), BKE_object_get_evaluated_mesh(), BKE_object_material_get(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paint_palette(), BKE_paint_palette_set(), BKE_palette_add(), BKE_palette_color_add(), BKE_palette_color_set(), BKE_texpaint_slot_refresh_cache(), BKE_view_layer_active_object_get(), BKE_view_layer_synced_ensure(), BLI_listbase_count(), ImBuf::byte_buffer, C, ImagePaintSettings::canvas, CD_PROP_FLOAT2, CLAMP, blender::math::clamp(), ImBuf::colormanage_flag, Palette::colors, ImBufByteBuffer::colorspace, Mesh::corner_data, CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_space_image(), CTX_wm_view3d(), CTX_wm_window(), CustomData_has_layer(), ImBufByteBuffer::data, ImBufFloatBuffer::data, DEG_get_evaluated(), depsgraph, ColorManagedDisplaySettings::display_device, Scene::display_settings, ED_space_image_color_sample(), ED_view3d_viewcontext_init(), blender::bke::Face, ImBuf::float_buffer, ImageUser::framenr, TexPaintSlot::ima, IMA_SRC_TILED, IMAGEPAINT_MODE_MATERIAL, ToolSettings::imapaint, imapaint_pick_face(), imapaint_pick_uv(), IMB_COLORMANAGE_IS_DATA, IMB_colormanagement_colorspace_to_scene_linear_v3(), IMB_colormanagement_display_get_named(), IMB_colormanagement_display_to_scene_linear_v3(), ImagePaintSettings::interp, interp(), TexPaintSlot::interp, blender::imbuf::interpolate_bilinear_wrap_byte(), blender::imbuf::interpolate_bilinear_wrap_fl(), blender::imbuf::interpolate_nearest_wrap_byte(), blender::imbuf::interpolate_nearest_wrap_fl(), Image::lastframe, blender::bke::AttributeAccessor::lookup_or_default(), ImagePaintSettings::mode, Material::paint_active_slot, rgba_uchar_to_float(), SHD_INTERP_CLOSEST, SHD_INTERP_LINEAR, Image::source, straight_to_premul_v4(), Material::texpaintslot, ImageUser::tile, Scene::toolsettings, v, ARegion::winrct, ARegion::winx, ARegion::winy, WM_window_pixels_read_sample(), ImBuf::x, x, rcti::xmin, ImBuf::y, y, and rcti::ymin.
Referenced by sample_color_exec(), sample_color_invoke(), and sample_color_modal().
|
static |
Definition at line 358 of file paint_sample_color.cc.
References BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), C, CTX_wm_region(), CTX_wm_window(), Paint::flags, NA_EDITED, NC_BRUSH, OPERATOR_FINISHED, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, RNA_boolean_get(), RNA_int_get_array(), Texture3D, WM_event_add_notifier(), WM_paint_cursor_tag_redraw(), and WM_redraw_windows().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 389 of file paint_sample_color.cc.
References BKE_brush_color_get(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), C, copy_v3_v3(), CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, data, Paint::flags, wmEvent::mval, NA_EDITED, NC_BRUSH, OPERATOR_RUNNING_MODAL, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, RNA_boolean_get(), RNA_int_set_array(), sample_color_update_header(), Texture3D, wmEvent::type, WM_CURSOR_EYEDROPPER, WM_cursor_modal_set(), WM_event_add_modal_handler(), WM_event_add_notifier(), WM_paint_cursor_tag_redraw(), WM_redraw_windows(), and WM_userdef_event_type_from_keymap_type().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 426 of file paint_sample_color.cc.
References BKE_brush_color_set(), BKE_paint_brush(), BKE_paint_get_active_from_context(), BKE_paintmode_get_active_from_context(), BKE_report(), C, CTX_wm_region(), CTX_wm_window(), wmOperator::customdata, data, ED_workspace_status_text(), Paint::flags, KM_PRESS, KM_RELEASE, LEFTMOUSE, MOUSEMOVE, wmEvent::mval, NA_EDITED, NC_BRUSH, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, paint_sample_color(), PAINT_SHOW_BRUSH, wmOperator::ptr, wmOperator::reports, RNA_boolean_get(), RNA_boolean_set(), RNA_int_set_array(), RPT_INFO, sample_color_update_header(), Texture3D, wmEvent::type, wmEvent::val, WM_cursor_modal_restore(), and WM_event_add_notifier().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 483 of file paint_sample_color.cc.
References C, blender::ed::greasepencil::grease_pencil_painting_poll(), image_paint_poll_ignore_tool(), and vertex_paint_poll_ignore_tool().
Referenced by PAINT_OT_sample_color().
|
static |
Definition at line 343 of file paint_sample_color.cc.
References C, CTX_wm_area(), data, ED_workspace_status_text(), IFACE_, SNPRINTF_UTF8, and UI_MAX_DRAW_STR.
Referenced by sample_color_invoke(), and sample_color_modal().