55 switch (sima->
dt_uv) {
75 Mask *
mask,
const int width,
const int height_,
const float aspx,
const float aspy)
77 const int height =
float(height_) * (aspy / aspx);
79 float *buffer =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) * height * width, __func__));
112 const bool is_image_type = (
image ==
nullptr) ||
ELEM(
image->type,
117 const bool has_edit_object = (draw_ctx->
object_edit) !=
nullptr;
122 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 &&
142 pd->
edit_uv.
do_faces = show_overlays && do_faces && !do_uvstretching_overlay;
146 ((is_paint_mode && do_tex_paint_shadows &&
149 (is_uv_editor && do_tex_paint_shadows &&
151 (is_view_mode && do_tex_paint_shadows &&
153 (do_uv_overlay && (show_modified_uvs)));
254 float theme_color[4];
312 float theme_color[4], selected_color[4];
320 const float3 offset = {0.0f, 0.0f, 0.0f};
324 const int tile_x = ((
tile->tile_number - 1001) % 10);
325 const int tile_y = ((
tile->tile_number - 1001) / 10);
326 obmat[3][1] =
float(tile_y);
327 obmat[3][0] =
float(tile_x);
353 float tile_location[3] = {
354 float((
tile->tile_number - 1001) % 10),
float((
tile->tile_number - 1001) / 10), 0.0f};
365 if (stencil_texture !=
nullptr) {
387 obmat[0][0] = size_stencil_image[0] / size_image[0];
388 obmat[1][1] = size_stencil_image[1] / size_image[1];
424 for (
Object *
object : objects) {
441 blender::gpu::Batch *geom;
449 &mesh.
runtime->edit_mesh->bm->ldata,
454 if (has_active_edit_uvmap) {
497 if (draw_shadows && (has_active_object_uvmap || has_active_edit_uvmap)) {
513 float total_area = 0.0f;
514 float total_area_uv = 0.0f;
517 total_area += *totals->total_area;
518 total_area_uv += *totals->total_area_uv;
521 if (total_area > FLT_EPSILON && total_area_uv > FLT_EPSILON) {
559 GPUFrameBuffer *previous_framebuffer =
nullptr;
560 if (is_combined_overlay) {
566 if (previous_framebuffer) {
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_active_layer(const CustomData *data, eCustomDataType type)
void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float r_size[2])
GPUTexture * BKE_image_get_gpu_texture(Image *image, ImageUser *iuser)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d, eObjectMode mode)
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
MaskRasterHandle * BKE_maskrasterize_handle_new(void)
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)
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.
Brush * BKE_paint_brush(Paint *paint)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) 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 dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
ID * DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
#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_size(SpaceImage *sima, int *r_width, int *r_height)
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
void ED_space_image_get_aspect(SpaceImage *sima, float *r_aspx, float *r_aspy)
GPUFrameBuffer * GPU_framebuffer_active_get()
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
int GPU_texture_original_height(const GPUTexture *texture)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
int GPU_texture_original_width(const GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
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 Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves 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 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)
struct GPUShader GPUShader
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
local_group_size(16, 16) .push_constant(Type texture
blender::gpu::Batch * DRW_cache_quad_get()
blender::gpu::Batch * DRW_cache_quad_wires_get()
DefaultFramebufferList * DRW_viewport_framebuffer_list_get()
bool DRW_object_is_in_edit_mode(const Object *ob)
DRWTextStore * DRW_text_cache_ensure()
int DRW_object_visibility_in_active_context(const Object *ob)
const DRWContextState * DRW_context_state_get()
DRWShadingGroup * DRW_shgroup_create(GPUShader *shader, DRWPass *pass)
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)
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], const bool shadow, const bool align_center)
@ DRW_TEXT_CACHE_GLOBALSPACE
@ DRW_STATE_DEPTH_LESS_EQUAL
@ DRW_STATE_BLEND_ALPHA_PREMUL
draw_view in_light_buf[] float
ccl_global const KernelWorkTile * tile
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float4 mask(const int4 mask, const float4 a)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_uv_edges(Object &object, Mesh &mesh)
void DRW_mesh_batch_cache_validate(Object &object, Mesh &mesh)
blender::gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Object &object, Mesh &mesh, float **tot_area, float **tot_uv_area)
VecBase< float, 4 > float4
static GPUTexture * edit_uv_mask_texture(Mask *mask, const int width, const int height_, const float aspx, const float aspy)
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 void edit_uv_stretching_update_ratios(OVERLAY_Data *vedata)
static void overlay_edit_uv_cache_populate(OVERLAY_Data *vedata, Object &ob)
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)
GPUShader * OVERLAY_shader_edit_uv_edges_for_edge_select_get()
GPUShader * OVERLAY_shader_edit_uv_face_dots_get()
GPUShader * OVERLAY_shader_edit_uv_stencil_image()
GPUShader * OVERLAY_shader_edit_uv_mask_image()
GPUShader * OVERLAY_shader_edit_uv_verts_get()
GPUShader * OVERLAY_shader_edit_uv_tiled_image_borders_get()
GPUShader * OVERLAY_shader_edit_uv_stretching_angle_get()
@ 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_edges_get()
GPUShader * OVERLAY_shader_edit_uv_face_get()
GPUShader * OVERLAY_shader_edit_uv_stretching_area_get()
GPUFrameBuffer * default_fb
MeshRuntimeHandle * runtime
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
struct OVERLAY_PrivateData::@175340032015206350127150312336076341200255315207 edit_uv
bool do_tiled_image_overlay
DRWShadingGroup * edit_uv_verts_grp
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 ToolSettings * toolsettings