49 switch (sima->
dt_uv) {
69 Mask *
mask,
const int width,
const int height_,
const float aspx,
const float aspy)
105 const bool is_image_type =
113 const bool do_uv_overlay = is_image_type && is_uv_editor && has_edit_object;
125 const bool do_uvstretching_overlay = is_image_type && is_uv_editor && is_edit_mode &&
128 const bool do_stencil_overlay = is_paint_mode && is_image_type && brush &&
133 pd->
edit_uv.
do_faces = show_overlays && do_faces && !do_uvstretching_overlay;
137 ((is_paint_mode && do_tex_paint_shadows &&
140 (is_uv_editor && do_tex_paint_shadows &&
142 (is_view_mode && do_tex_paint_shadows &&
144 (do_uv_overlay && (show_modified_uvs)));
242 float theme_color[4];
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};
347 if (stencil_ibuf ==
NULL) {
365 grp,
"color", (
float[4]){1.0f, 1.0f, 1.0f, brush->
clone.
alpha});
369 float size_stencil_image[2] = {stencil_ibuf->
x, stencil_ibuf->
y};
375 obmat[0][0] = size_stencil_image[0] / size_image[0];
376 obmat[1][1] = size_stencil_image[1] / size_image[1];
411 uint objects_len = 0;
414 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
437 const bool has_active_edit_uvmap = is_edit_object &&
443 if (has_active_edit_uvmap) {
486 if (draw_shadows && (has_active_object_uvmap || has_active_edit_uvmap)) {
502 float total_area = 0.0f;
503 float total_area_uv = 0.0f;
506 total_area += *totals->total_area;
507 total_area_uv += *totals->total_area_uv;
510 if (total_area > FLT_EPSILON && total_area_uv > FLT_EPSILON) {
556 if (is_combined_overlay) {
562 if (previous_framebuffer) {
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
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, int width, int height, bool do_aspect_correct, bool do_mask_aa, bool do_feather)
MaskRasterHandle * BKE_maskrasterize_handle_new(void)
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, unsigned int width, unsigned int height, float *buffer)
Rasterize a buffer from a single mask (threaded execution).
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_uniform_block(shgroup, name, ubo)
#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 height
_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
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.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
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)
void DRW_mesh_batch_cache_validate(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_facedots(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_verts(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(struct Object *object, struct Mesh *me, float **tot_area, float **tot_uv_area)
struct GPUBatch * DRW_mesh_batch_cache_get_edituv_edges(struct Object *object, struct Mesh *me)
struct GPUBatch * DRW_mesh_batch_cache_get_uv_edges(struct Object *object, struct Mesh *me)
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_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
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
ccl_global float * buffer
ccl_global const KernelWorkTile * tile
ccl_gpu_kernel_postfix ccl_global float int int int int sh
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
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)
GPUShader * OVERLAY_shader_edit_uv_edges_for_edge_select_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
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
struct OVERLAY_PrivateData::@255 edit_uv
DRWShadingGroup * edit_uv_edges_grp
DRWShadingGroup * edit_uv_shadow_edges_grp
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