Blender  V2.93
Classes | Typedefs | Functions
overlay_edit_uv.c File Reference
#include "DRW_render.h"
#include "draw_cache_impl.h"
#include "draw_manager_text.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 GPUTextureedit_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 Documentation

◆ OVERLAY_StretchingAreaTotals

Function Documentation

◆ edit_uv_line_style_from_space_image()

static OVERLAY_UVLineStyle edit_uv_line_style_from_space_image ( const SpaceImage sima)
static

◆ edit_uv_mask_texture()

static GPUTexture* edit_uv_mask_texture ( Mask mask,
const int  width,
const int  height_,
const float  aspx,
const float  aspy 
)
static

◆ edit_uv_stretching_update_ratios()

static void edit_uv_stretching_update_ratios ( OVERLAY_Data vedata)
static

◆ OVERLAY_edit_uv_cache_finish()

void OVERLAY_edit_uv_cache_finish ( OVERLAY_Data vedata)

◆ OVERLAY_edit_uv_cache_init()

void OVERLAY_edit_uv_cache_init ( OVERLAY_Data vedata)

Definition at line 184 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, 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::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_ASCII, 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(), 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_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, 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_SIZE, ImageTile::tile_number, Scene::toolsettings, OVERLAY_PrivateData::total_area_ratio, OVERLAY_PrivateData::total_area_ratio_inv, Object::type, UI_GetThemeColor4fv(), UI_GetThemeColorShade4fv(), UI_GetThemeColorShade4ubv(), UI_GetThemeValuef(), unit_m4(), OVERLAY_PrivateData::uv_aspect, OVERLAY_PrivateData::uv_opacity, DRWContextState::view_layer, ImBuf::x, and ImBuf::y.

Referenced by OVERLAY_cache_init().

◆ overlay_edit_uv_cache_populate()

static void overlay_edit_uv_cache_populate ( OVERLAY_Data vedata,
Object ob 
)
static

◆ OVERLAY_edit_uv_draw()

void OVERLAY_edit_uv_draw ( OVERLAY_Data vedata)

◆ OVERLAY_edit_uv_draw_finish()

static void OVERLAY_edit_uv_draw_finish ( OVERLAY_Data vedata)
static

◆ OVERLAY_edit_uv_init()

void OVERLAY_edit_uv_init ( OVERLAY_Data vedata)

Definition at line 106 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, 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, 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, Image::source, DRWContextState::space_data, OVERLAY_Data::stl, Scene::toolsettings, OVERLAY_PrivateData::total_area_ratio, OVERLAY_PrivateData::total_area_ratio_inv, OVERLAY_PrivateData::totals, Image::type, UI_DPI_FAC, USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE, OVERLAY_PrivateData::uv_aspect, OVERLAY_PrivateData::uv_opacity, SpaceImage::uv_opacity, UV_SELECT_FACE, and UV_SYNC_SELECTION.

Referenced by OVERLAY_engine_init().