Blender
V3.3
|
#include "DRW_render.h"
#include "draw_cache_impl.h"
#include "draw_manager_text.h"
#include "BKE_customdata.h"
#include "BKE_editmesh.h"
#include "BKE_image.h"
#include "BKE_layer.h"
#include "BKE_mask.h"
#include "BKE_object.h"
#include "BKE_paint.h"
#include "DNA_brush_types.h"
#include "DNA_mesh_types.h"
#include "DEG_depsgraph_query.h"
#include "ED_image.h"
#include "IMB_imbuf_types.h"
#include "GPU_batch.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "overlay_private.h"
Go to the source code of this file.
Classes | |
struct | OVERLAY_StretchingAreaTotals |
Typedefs | |
typedef struct OVERLAY_StretchingAreaTotals | OVERLAY_StretchingAreaTotals |
Functions | |
static OVERLAY_UVLineStyle | edit_uv_line_style_from_space_image (const SpaceImage *sima) |
static GPUTexture * | edit_uv_mask_texture (Mask *mask, const int width, const int height_, const float aspx, const float aspy) |
Internal API | |
static void | overlay_edit_uv_cache_populate (OVERLAY_Data *vedata, Object *ob) |
void | OVERLAY_edit_uv_init (OVERLAY_Data *vedata) |
void | OVERLAY_edit_uv_cache_init (OVERLAY_Data *vedata) |
static void | edit_uv_stretching_update_ratios (OVERLAY_Data *vedata) |
void | OVERLAY_edit_uv_cache_finish (OVERLAY_Data *vedata) |
static void | OVERLAY_edit_uv_draw_finish (OVERLAY_Data *vedata) |
void | OVERLAY_edit_uv_draw (OVERLAY_Data *vedata) |
typedef struct OVERLAY_StretchingAreaTotals OVERLAY_StretchingAreaTotals |
|
static |
Definition at line 45 of file overlay_edit_uv.c.
References SpaceImage::dt_uv, SpaceImage::mode, OVERLAY_UV_LINE_STYLE_BLACK, OVERLAY_UV_LINE_STYLE_DASH, OVERLAY_UV_LINE_STYLE_OUTLINE, OVERLAY_UV_LINE_STYLE_SHADOW, OVERLAY_UV_LINE_STYLE_WHITE, SI_MODE_UV, SI_UVDT_BLACK, SI_UVDT_DASH, SI_UVDT_OUTLINE, and SI_UVDT_WHITE.
Referenced by OVERLAY_edit_uv_init().
|
static |
Definition at line 68 of file overlay_edit_uv.c.
References BKE_maskrasterize_buffer(), BKE_maskrasterize_handle_free(), BKE_maskrasterize_handle_init(), BKE_maskrasterize_handle_new(), buffer, float(), GPU_R16F, GPU_texture_create_2d(), height, mask(), MEM_freeN, MEM_mallocN, and width.
Referenced by OVERLAY_edit_uv_cache_init().
|
static |
Definition at line 496 of file overlay_edit_uv.c.
References BLI_freelistN(), OVERLAY_PrivateData::draw_type, OVERLAY_PrivateData::edit_uv, LISTBASE_FOREACH, OVERLAY_StorageList::pd, SI_UVDT_STRETCH_AREA, OVERLAY_Data::stl, OVERLAY_PrivateData::total_area_ratio, and OVERLAY_PrivateData::totals.
Referenced by OVERLAY_edit_uv_cache_finish().
void OVERLAY_edit_uv_cache_finish | ( | OVERLAY_Data * | vedata | ) |
Definition at line 517 of file overlay_edit_uv.c.
References OVERLAY_PrivateData::do_uv_stretching_overlay, OVERLAY_PrivateData::edit_uv, edit_uv_stretching_update_ratios(), OVERLAY_StorageList::pd, and OVERLAY_Data::stl.
Referenced by OVERLAY_cache_finish().
void OVERLAY_edit_uv_cache_init | ( | OVERLAY_Data * | vedata | ) |
Definition at line 175 of file overlay_edit_uv.c.
References BrushClone::alpha, BKE_image_acquire_ibuf(), BKE_image_get_gpu_texture(), BKE_image_get_size_fl(), BKE_paint_brush(), BKE_view_layer_array_from_objects_in_mode_unique_data, BLI_findlink(), BLI_snprintf(), DRW_Global::block_ubo, Brush::clone, color, OVERLAY_PrivateData::dash_length, Object::data, DEG_get_evaluated_object(), DRWContextState::depsgraph, OVERLAY_PrivateData::do_face_dots, OVERLAY_PrivateData::do_faces, OVERLAY_PrivateData::do_mask_overlay, OVERLAY_PrivateData::do_smooth_wire, OVERLAY_PrivateData::do_stencil_overlay, OVERLAY_PrivateData::do_tiled_image_border_overlay, OVERLAY_PrivateData::do_tiled_image_overlay, OVERLAY_PrivateData::do_uv_overlay, OVERLAY_PrivateData::do_uv_shadow_overlay, OVERLAY_PrivateData::do_uv_stretching_overlay, OVERLAY_PrivateData::do_verts, OVERLAY_PrivateData::draw_type, DRW_cache_quad_get(), DRW_cache_quad_wires_get(), DRW_context_state_get(), DRW_mesh_batch_cache_validate(), DRW_PASS_CREATE, DRW_shgroup_call_obmat, DRW_shgroup_create(), DRW_shgroup_uniform_block, DRW_shgroup_uniform_bool(), DRW_shgroup_uniform_bool_copy(), DRW_shgroup_uniform_float(), DRW_shgroup_uniform_float_copy(), DRW_shgroup_uniform_int_copy(), DRW_shgroup_uniform_texture(), DRW_shgroup_uniform_vec2_copy(), DRW_shgroup_uniform_vec3_copy(), DRW_shgroup_uniform_vec4_copy(), DRW_STATE_BLEND_ALPHA, DRW_STATE_BLEND_ALPHA_PREMUL, DRW_STATE_BLEND_MUL, DRW_STATE_DEPTH_ALWAYS, DRW_STATE_DEPTH_LESS_EQUAL, DRW_STATE_WRITE_COLOR, DRW_STATE_WRITE_DEPTH, DRW_text_cache_add(), DRW_text_cache_ensure(), DRW_TEXT_CACHE_GLOBALSPACE, OVERLAY_PrivateData::edit_uv, OVERLAY_PrivateData::edit_uv_edges_grp, OVERLAY_PassList::edit_uv_edges_ps, OVERLAY_PrivateData::edit_uv_face_dots_grp, OVERLAY_PrivateData::edit_uv_faces_grp, OVERLAY_PassList::edit_uv_faces_ps, OVERLAY_PassList::edit_uv_mask_ps, edit_uv_mask_texture(), OVERLAY_PrivateData::edit_uv_shadow_edges_grp, OVERLAY_PassList::edit_uv_stencil_ps, OVERLAY_PrivateData::edit_uv_stretching_grp, OVERLAY_PassList::edit_uv_stretching_ps, OVERLAY_PassList::edit_uv_tiled_image_borders_ps, OVERLAY_PrivateData::edit_uv_verts_grp, OVERLAY_PassList::edit_uv_verts_ps, float(), G_draw, GPUBatch, if(), image(), BrushClone::image, SpaceImage::image, OVERLAY_PrivateData::image_aspect, OVERLAY_PrivateData::image_size, OVERLAY_PrivateData::line_style, LISTBASE_FOREACH, M_SQRT2, OVERLAY_PrivateData::mask, MASK_OVERLAY_COMBINED, OVERLAY_PrivateData::mask_overlay_mode, OVERLAY_PrivateData::mask_texture, MEM_freeN, NULL, OB_MESH, DRWContextState::obact, DRWContextState::object_mode, BrushClone::offset, overlay_edit_uv_cache_populate(), OVERLAY_shader_edit_uv_edges_for_edge_select_get(), OVERLAY_shader_edit_uv_edges_get(), OVERLAY_shader_edit_uv_face_dots_get(), OVERLAY_shader_edit_uv_face_get(), OVERLAY_shader_edit_uv_mask_image(), OVERLAY_shader_edit_uv_stencil_image(), OVERLAY_shader_edit_uv_stretching_angle_get(), OVERLAY_shader_edit_uv_stretching_area_get(), OVERLAY_shader_edit_uv_tiled_image_borders_get(), OVERLAY_shader_edit_uv_verts_get(), OVERLAY_UV_LINE_STYLE_SHADOW, OVERLAY_StorageList::pd, OVERLAY_Data::psl, scene, DRWContextState::scene, sh, SI_UVDT_STRETCH_ANGLE, DRWContextState::space_data, srgb_to_linearrgb_v4(), state, OVERLAY_PrivateData::stencil_ibuf, OVERLAY_PrivateData::stencil_image, OVERLAY_PrivateData::stencil_lock, OVERLAY_Data::stl, TH_BACK, TH_FACE_SELECT, TH_FACEDOT_SIZE, TH_VERTEX, TH_VERTEX_SIZE, tile, ImageTile::tile_number, Scene::toolsettings, OVERLAY_PrivateData::total_area_ratio, Object::type, UI_GetThemeColor4fv(), UI_GetThemeColorShade4fv(), UI_GetThemeColorShade4ubv(), UI_GetThemeValuef(), unit_m4(), OVERLAY_PrivateData::uv_aspect, OVERLAY_PrivateData::uv_opacity, UV_SELECT_EDGE, UV_SYNC_SELECTION, DRWContextState::view_layer, ImBuf::x, and ImBuf::y.
Referenced by OVERLAY_cache_init().
|
static |
Definition at line 423 of file overlay_edit_uv.c.
References BLI_addtail(), BMEditMesh::bm, CD_MLOOPUV, CustomData_get_active_layer(), Object::data, OVERLAY_PrivateData::do_face_dots, OVERLAY_PrivateData::do_faces, OVERLAY_PrivateData::do_uv_overlay, OVERLAY_PrivateData::do_uv_shadow_overlay, OVERLAY_PrivateData::do_uv_stretching_overlay, OVERLAY_PrivateData::do_verts, OVERLAY_PrivateData::draw_type, DRW_context_state_get(), DRW_mesh_batch_cache_get_edituv_edges(), DRW_mesh_batch_cache_get_edituv_facedots(), DRW_mesh_batch_cache_get_edituv_faces(), DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(), DRW_mesh_batch_cache_get_edituv_faces_stretch_area(), DRW_mesh_batch_cache_get_edituv_verts(), DRW_mesh_batch_cache_get_uv_edges(), DRW_object_is_in_edit_mode(), DRW_object_visibility_in_active_context(), DRW_shgroup_call_obmat, Mesh::edit_mesh, OVERLAY_PrivateData::edit_uv, OVERLAY_PrivateData::edit_uv_edges_grp, OVERLAY_PrivateData::edit_uv_face_dots_grp, OVERLAY_PrivateData::edit_uv_faces_grp, OVERLAY_PrivateData::edit_uv_shadow_edges_grp, OVERLAY_PrivateData::edit_uv_stretching_grp, OVERLAY_PrivateData::edit_uv_verts_grp, GPUBatch, BMesh::ldata, Mesh::ldata, MEM_mallocN, Object::mode, NULL, OB_MODE_OBJECT, OB_VISIBLE_SELF, DRWContextState::object_mode, OVERLAY_StorageList::pd, SI_UVDT_STRETCH_ANGLE, OVERLAY_Data::stl, OVERLAY_StretchingAreaTotals::total_area, OVERLAY_StretchingAreaTotals::total_area_uv, and OVERLAY_PrivateData::totals.
Referenced by OVERLAY_edit_uv_cache_init().
void OVERLAY_edit_uv_draw | ( | OVERLAY_Data * | vedata | ) |
Definition at line 542 of file overlay_edit_uv.c.
References DefaultFramebufferList::default_fb, OVERLAY_PrivateData::do_faces, OVERLAY_PrivateData::do_mask_overlay, OVERLAY_PrivateData::do_stencil_overlay, OVERLAY_PrivateData::do_tiled_image_border_overlay, OVERLAY_PrivateData::do_uv_overlay, OVERLAY_PrivateData::do_uv_shadow_overlay, OVERLAY_PrivateData::do_uv_stretching_overlay, DRW_draw_pass(), DRW_viewport_framebuffer_list_get(), OVERLAY_PrivateData::edit_uv, OVERLAY_PassList::edit_uv_edges_ps, OVERLAY_PassList::edit_uv_faces_ps, OVERLAY_PassList::edit_uv_mask_ps, OVERLAY_PassList::edit_uv_stencil_ps, OVERLAY_PassList::edit_uv_stretching_ps, OVERLAY_PassList::edit_uv_tiled_image_borders_ps, OVERLAY_PassList::edit_uv_verts_ps, GPU_framebuffer_active_get(), GPU_framebuffer_bind(), MASK_OVERLAY_COMBINED, OVERLAY_PrivateData::mask_overlay_mode, NULL, OVERLAY_edit_uv_draw_finish(), OVERLAY_StorageList::pd, OVERLAY_Data::psl, and OVERLAY_Data::stl.
Referenced by OVERLAY_draw_scene().
|
static |
Definition at line 527 of file overlay_edit_uv.c.
References BKE_image_release_ibuf(), DRW_TEXTURE_FREE_SAFE, OVERLAY_PrivateData::edit_uv, OVERLAY_PrivateData::mask_texture, NULL, OVERLAY_StorageList::pd, OVERLAY_PrivateData::stencil_ibuf, OVERLAY_PrivateData::stencil_image, OVERLAY_PrivateData::stencil_lock, and OVERLAY_Data::stl.
Referenced by OVERLAY_edit_uv_draw().
void OVERLAY_edit_uv_init | ( | OVERLAY_Data * | vedata | ) |
Definition at line 92 of file overlay_edit_uv.c.
References BKE_paint_brush(), BLI_listbase_clear(), OVERLAY_PrivateData::dash_length, DEG_get_evaluated_id(), DRWContextState::depsgraph, OVERLAY_PrivateData::do_face_dots, OVERLAY_PrivateData::do_faces, OVERLAY_PrivateData::do_mask_overlay, OVERLAY_PrivateData::do_smooth_wire, OVERLAY_PrivateData::do_stencil_overlay, OVERLAY_PrivateData::do_tiled_image_border_overlay, OVERLAY_PrivateData::do_tiled_image_overlay, OVERLAY_PrivateData::do_uv_overlay, OVERLAY_PrivateData::do_uv_shadow_overlay, OVERLAY_PrivateData::do_uv_stretching_overlay, OVERLAY_PrivateData::do_verts, MaskSpaceInfo::draw_flag, OVERLAY_PrivateData::draw_type, DRW_context_state_get(), SpaceImage::dt_uvstretch, ED_space_image_get_aspect(), ED_space_image_get_size(), ED_space_image_get_uv_aspect(), OVERLAY_PrivateData::edit_uv, edit_uv_line_style_from_space_image(), ELEM, SpaceImage::flag, OVERLAY_PrivateData::hide_overlays, Mask::id, IMA_SRC_TILED, IMA_TYPE_IMAGE, IMA_TYPE_MULTILAYER, IMA_TYPE_UV_TEST, image(), SpaceImage::image, OVERLAY_PrivateData::image_aspect, OVERLAY_PrivateData::image_size, OVERLAY_PrivateData::line_style, OVERLAY_PrivateData::mask, MaskSpaceInfo::mask, MASK_DRAWFLAG_OVERLAY, SpaceImage::mask_info, OVERLAY_PrivateData::mask_overlay_mode, SpaceImage::mode, NULL, OB_MODE_EDIT, OB_MODE_TEXTURE_PAINT, DRWContextState::object_edit, DRWContextState::object_mode, MaskSpaceInfo::overlay_mode, PAINT_TOOL_CLONE, OVERLAY_StorageList::pd, SCE_SELECT_FACE, scene, DRWContextState::scene, SI_DRAW_STRETCH, SI_DRAWSHADOW, SI_MODE_MASK, SI_MODE_PAINT, SI_MODE_UV, SI_MODE_VIEW, SI_NO_DRAW_TEXPAINT, SI_NO_DRAWFACES, DRWContextState::space_data, OVERLAY_Data::stl, Scene::toolsettings, OVERLAY_PrivateData::total_area_ratio, OVERLAY_PrivateData::totals, UI_DPI_FAC, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, OVERLAY_PrivateData::uv_aspect, OVERLAY_PrivateData::uv_opacity, SpaceImage::uv_opacity, UV_SELECT_EDGE, UV_SELECT_FACE, and UV_SYNC_SELECTION.
Referenced by OVERLAY_engine_init().