63 switch (sima->
dt_uv) {
83 Mask *
mask,
const int width,
const int height_,
const float aspx,
const float aspy)
119 const bool is_image_type =
127 const bool do_uv_overlay = is_image_type && is_uv_editor && has_edit_object;
134 const bool do_uvstretching_overlay = is_image_type && is_uv_editor && is_edit_mode &&
137 const bool do_stencil_overlay = is_paint_mode && is_image_type && brush &&
141 pd->
edit_uv.
do_faces = show_overlays && do_faces && !do_uvstretching_overlay;
145 ((is_paint_mode && do_tex_paint_shadows &&
148 (is_uv_editor && do_tex_paint_shadows &&
150 (is_view_mode && do_tex_paint_shadows &&
152 (do_uv_overlay && (show_modified_uvs)));
296 float theme_color[4], selected_color[4];
307 const int tile_x = ((tile->tile_number - 1001) % 10);
308 const int tile_y = ((tile->tile_number - 1001) / 10);
309 obmat[3][1] = (
float)tile_y;
310 obmat[3][0] = (
float)tile_x;
335 float tile_location[3] = {
336 ((tile->tile_number - 1001) % 10), ((tile->tile_number - 1001) / 10), 0.0f};
368 float size_stencil_image[2] = {stencil_ibuf->
x, stencil_ibuf->
y};
374 obmat[0][0] = size_stencil_image[0] / size_image[0];
375 obmat[1][1] = size_stencil_image[1] / size_image[1];
409 uint objects_len = 0;
412 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
435 const bool has_active_edit_uvmap = is_edit_object &&
441 if (has_active_edit_uvmap) {
482 if (draw_shadows && (has_active_object_uvmap || has_active_edit_uvmap)) {
498 float total_area = 0.0f;
499 float total_area_uv = 0.0f;
502 total_area += *totals->total_area;
503 total_area_uv += *totals->total_area_uv;
506 if (total_area > FLT_EPSILON && total_area_uv > FLT_EPSILON) {
553 if (is_combined_overlay) {
559 if (previous_framebuffer) {
typedef float(TangentPoint)[2]
int CustomData_get_active_layer(const struct CustomData *data, int type)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float r_size[2])
struct GPUTexture * BKE_image_get_gpu_texture(struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
#define BKE_view_layer_array_from_objects_in_mode_unique_data(view_layer, v3d, r_len, mode)
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask, const int width, const int height, const bool do_aspect_correct, const bool do_mask_aa, const bool do_feather)
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, const unsigned int width, const unsigned int height, float *buffer)
Rasterize a buffer from a single mask (threaded execution).
MaskRasterHandle * BKE_maskrasterize_handle_new(void)
General operations, lookup, etc. for blender objects.
struct Brush * BKE_paint_brush(struct Paint *paint)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void unit_m4(float m[4][4])
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
#define MASK_DRAWFLAG_OVERLAY
#define UV_SYNC_SELECTION
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
@ DRW_STATE_DEPTH_LESS_EQUAL
@ DRW_STATE_BLEND_ALPHA_PREMUL
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_call_obmat(shgroup, geom, obmat)
#define DRW_TEXTURE_FREE_SAFE(tex)
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_space_image_get_size(struct SpaceImage *sima, int *r_width, int *r_height)
void ED_space_image_get_aspect(struct SpaceImage *sima, float *r_aspx, float *r_aspy)
struct GPUFrameBuffer GPUFrameBuffer
GPUFrameBuffer * GPU_framebuffer_active_get(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
struct GPUShader GPUShader
struct GPUTexture GPUTexture
GPUTexture * GPU_texture_create_2d(const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
Contains defines and structs used throughout the imbuf module.
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
void UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4])
float UI_GetThemeValuef(int colorid)
GPUBatch * DRW_cache_quad_get(void)
GPUBatch * DRW_cache_quad_wires_get(void)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_facedots(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_verts(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_edges(struct Mesh *me)
void DRW_mesh_batch_cache_validate(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_uv_edges(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(struct Mesh *me, float **tot_area, float **tot_uv_area)
bool DRW_object_is_in_edit_mode(const Object *ob)
DefaultFramebufferList * DRW_viewport_framebuffer_list_get(void)
int DRW_object_visibility_in_active_context(const Object *ob)
const DRWContextState * DRW_context_state_get(void)
struct DRWTextStore * DRW_text_cache_ensure(void)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_shgroup_uniform_block(DRWShadingGroup *shgroup, const char *name, const GPUUniformBuf *ubo)
void DRW_shgroup_uniform_texture(DRWShadingGroup *shgroup, const char *name, const GPUTexture *tex)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
void DRW_shgroup_uniform_bool(DRWShadingGroup *shgroup, const char *name, const int *value, int arraysize)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_shgroup_uniform_float(DRWShadingGroup *shgroup, const char *name, const float *value, int arraysize)
void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_draw_pass(DRWPass *pass)
void DRW_text_cache_add(DRWTextStore *dt, const float co[3], const char *str, const int str_len, short xoffs, short yoffs, short flag, const uchar col[4])
@ DRW_TEXT_CACHE_GLOBALSPACE
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
static void OVERLAY_edit_uv_draw_finish(OVERLAY_Data *vedata)
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)
static void edit_uv_stretching_update_ratios(OVERLAY_Data *vedata)
struct OVERLAY_StretchingAreaTotals OVERLAY_StretchingAreaTotals
void OVERLAY_edit_uv_draw(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_cache_finish(OVERLAY_Data *vedata)
void OVERLAY_edit_uv_init(OVERLAY_Data *vedata)
static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object *ob)
GPUShader * OVERLAY_shader_edit_uv_stretching_angle_get(void)
GPUShader * OVERLAY_shader_edit_uv_face_get(void)
GPUShader * OVERLAY_shader_edit_uv_stencil_image(void)
GPUShader * OVERLAY_shader_edit_uv_face_dots_get(void)
@ OVERLAY_UV_LINE_STYLE_DASH
@ OVERLAY_UV_LINE_STYLE_SHADOW
@ OVERLAY_UV_LINE_STYLE_WHITE
@ OVERLAY_UV_LINE_STYLE_OUTLINE
@ OVERLAY_UV_LINE_STYLE_BLACK
GPUShader * OVERLAY_shader_edit_uv_stretching_area_get(void)
GPUShader * OVERLAY_shader_edit_uv_verts_get(void)
GPUShader * OVERLAY_shader_edit_uv_mask_image(void)
GPUShader * OVERLAY_shader_edit_uv_edges_get(void)
GPUShader * OVERLAY_shader_edit_uv_tiled_image_borders_get(void)
struct SpaceLink * space_data
struct Depsgraph * depsgraph
struct ViewLayer * view_layer
struct Object * object_edit
struct GPUUniformBuf * block_ubo
struct GPUFrameBuffer * default_fb
struct BMEditMesh * edit_mesh
struct CustomData pdata ldata
OVERLAY_StorageList * stl
DRWPass * edit_uv_edges_ps
DRWPass * edit_uv_stencil_ps
DRWPass * edit_uv_mask_ps
DRWPass * edit_uv_tiled_image_borders_ps
DRWPass * edit_uv_faces_ps
DRWPass * edit_uv_verts_ps
DRWPass * edit_uv_stretching_ps
OVERLAY_UVLineStyle line_style
bool do_tiled_image_overlay
struct ImBuf * stencil_ibuf
DRWShadingGroup * edit_uv_verts_grp
struct Image * stencil_image
DRWShadingGroup * edit_uv_edges_grp
struct OVERLAY_PrivateData::@244 edit_uv
DRWShadingGroup * edit_uv_shadow_edges_grp
float total_area_ratio_inv
eMaskOverlayMode mask_overlay_mode
DRWShadingGroup * edit_uv_faces_grp
bool do_uv_stretching_overlay
DRWShadingGroup * edit_uv_stretching_grp
eSpaceImage_UVDT_Stretch draw_type
DRWShadingGroup * edit_uv_face_dots_grp
bool do_tiled_image_border_overlay
GPUTexture * mask_texture
bool do_uv_shadow_overlay
struct OVERLAY_PrivateData * pd
struct ToolSettings * toolsettings
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)