49 PassSimple edit_mesh_normals_ps_ = {
"Normals"};
57 PassSimple edit_mesh_analysis_ps_ = {
"Mesh Analysis"};
58 PassSimple edit_mesh_weight_ps_ = {
"Edit Weight"};
64 PassSimple edit_mesh_facedots_ps_ = {
"FaceDots"};
65 PassSimple edit_mesh_skin_roots_ps_ = {
"SkinRoots"};
68 PassSimple edit_mesh_prepass_ps_ = {
"Prepass"};
70 bool xray_enabled_ =
false;
71 bool xray_flag_enabled_ =
false;
73 bool show_retopology_ =
false;
74 bool show_mesh_analysis_ =
false;
75 bool show_face_overlay_ =
false;
76 bool show_weight_ =
false;
78 bool select_vert_ =
false;
79 bool select_edge_ =
false;
80 bool select_face_ =
false;
81 bool select_face_dots_ =
false;
87 static constexpr float cage_ndc_offset_ = 0.5f;
88 static constexpr float edge_ndc_offset_ = 1.0f;
89 static constexpr float vert_ndc_offset_ = 1.5f;
93 View view_edit_cage_ = {
"view_edit_cage"};
105 offset_data_ =
state.offset_data_get();
106 xray_enabled_ =
state.xray_enabled;
107 xray_flag_enabled_ =
state.xray_flag_enabled;
109 const int edit_flag =
state.v3d->overlay.edit_flag;
128 const bool is_wire_shading_mode = (
state.v3d->shading.type ==
OB_WIRE);
130 uint4 data_mask = data_mask_get(edit_flag);
132 float backwire_opacity = (
state.xray_flag_enabled) ? 0.5f : 1.0f;
133 float face_alpha = (show_face_overlay_) ? 1.0f : 0.0f;
139 gpu::Texture **depth_tex = (
state.xray_flag_enabled) ? &res.depth_tx : &res.dummy_depth_tx;
142 auto &pass = edit_mesh_prepass_ps_;
145 state.clipping_plane_count);
146 pass.shader_set(res.shaders->mesh_edit_depth.get());
147 pass.push_constant(
"retopology_offset", retopology_offset);
159 if (
state.xray_flag_enabled) {
163 auto &pass = edit_mesh_normals_ps_;
167 pass.state_set(pass_state,
state.clipping_plane_count);
170 auto &sub = pass.sub(name);
172 sub.bind_texture(
"depth_tx", depth_tex);
173 sub.push_constant(
"alpha", backwire_opacity);
174 sub.push_constant(
"is_constant_screen_size_normals", use_screen_size);
175 sub.push_constant(
"normal_size",
state.overlay.normals_length);
176 sub.push_constant(
"normal_screen_size",
state.overlay.normals_constant_screen_size);
177 sub.push_constant(
"retopology_offset", retopology_offset);
178 sub.push_constant(
"hq_normals", use_hq_normals);
182 face_normals_ = loop_normals_ = vert_normals_ =
nullptr;
185 face_normals_subdiv_ = shader_pass(res.shaders->mesh_face_normal_subdiv.get(),
"SubdFNor");
186 face_normals_ = shader_pass(res.shaders->mesh_face_normal.get(),
"FaceNor");
189 loop_normals_subdiv_ = shader_pass(res.shaders->mesh_loop_normal_subdiv.get(),
"SubdLNor");
190 loop_normals_ = shader_pass(res.shaders->mesh_loop_normal.get(),
"LoopNor");
193 vert_normals_subdiv_ = shader_pass(res.shaders->mesh_vert_normal_subdiv.get(),
"SubdVNor");
194 vert_normals_ = shader_pass(res.shaders->mesh_vert_normal.get(),
"VertexNor");
202 auto &pass = edit_mesh_weight_ps_;
205 state.clipping_plane_count);
206 pass.shader_set(shadeless ? res.shaders->paint_weight.get() :
207 res.shaders->paint_weight_fake_shading.get());
210 pass.bind_texture(
"colorramp", &res.weight_ramp_tx);
211 pass.push_constant(
"draw_contours",
false);
212 pass.push_constant(
"opacity",
state.overlay.weight_paint_mode_opacity);
219 auto &pass = edit_mesh_analysis_ps_;
222 state.clipping_plane_count);
223 pass.shader_set(res.shaders->mesh_analysis.get());
226 pass.bind_texture(
"weight_tx", res.weight_ramp_tx);
229 auto mesh_edit_common_resource_bind = [&](
PassSimple &pass,
float alpha,
float ndc_offset) {
245 auto &pass = edit_mesh_edges_ps_;
250 state.clipping_plane_count);
251 pass.
shader_set(res.shaders->mesh_edit_edge.get());
254 mesh_edit_common_resource_bind(pass, backwire_opacity, edge_ndc_offset_);
257 auto &pass = edit_mesh_faces_ps_;
261 state.clipping_plane_count);
262 pass.
shader_set(res.shaders->mesh_edit_face.get());
263 mesh_edit_common_resource_bind(pass, face_alpha, 0.0f);
266 auto &pass = edit_mesh_cages_ps_;
269 state.clipping_plane_count);
270 pass.
shader_set(res.shaders->mesh_edit_face.get());
271 mesh_edit_common_resource_bind(pass, face_alpha, cage_ndc_offset_);
274 auto &pass = edit_mesh_verts_ps_;
278 state.clipping_plane_count);
279 pass.
shader_set(res.shaders->mesh_edit_vert.get());
280 mesh_edit_common_resource_bind(pass, backwire_opacity, vert_ndc_offset_);
283 auto &pass = edit_mesh_facedots_ps_;
287 state.clipping_plane_count);
288 pass.
shader_set(res.shaders->mesh_edit_facedot.get());
289 mesh_edit_common_resource_bind(pass, backwire_opacity, vert_ndc_offset_);
292 auto &pass = edit_mesh_skin_roots_ps_;
296 state.clipping_plane_count);
297 pass.
shader_set(res.shaders->mesh_edit_skin_root.get());
315 Object *ob = ob_ref.object;
320 const bool draw_as_solid = (ob->
dt >
OB_WIRE) && !
state.xray_enabled;
323 if (show_retopology_) {
325 edit_mesh_prepass_ps_.draw(geom, res_handle);
327 if (draw_as_solid && !
state.is_render_depth_available) {
329 edit_mesh_prepass_ps_.draw(geom, res_handle);
332 if (show_mesh_analysis_) {
334 edit_mesh_analysis_ps_.draw(geom, res_handle);
339 edit_mesh_weight_ps_.draw(geom, res_handle);
344 (use_gpu_subdiv && !has_edit_cage ? face_normals_subdiv_ : face_normals_)
349 (use_gpu_subdiv && !has_edit_cage ? loop_normals_subdiv_ : loop_normals_)
354 ((use_gpu_subdiv && !has_edit_cage) ? vert_normals_subdiv_ : vert_normals_)
360 edit_mesh_edges_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
364 (has_edit_cage ? &edit_mesh_cages_ps_ : &edit_mesh_faces_ps_)->
draw(geom, res_handle);
368 edit_mesh_verts_ps_.draw(geom, res_handle);
370 if (select_face_dots_) {
372 edit_mesh_facedots_ps_.draw(geom, res_handle);
375 if (mesh_has_skin_roots(ob)) {
377 edit_mesh_skin_roots_ps_.draw_expand(geom,
GPU_PRIM_LINES, 15, 1, res_handle);
393 manager.submit(edit_mesh_prepass_ps_, view);
394 manager.submit(edit_mesh_analysis_ps_, view);
395 manager.submit(edit_mesh_weight_ps_, view);
397 if (!xray_enabled_) {
400 manager.submit(edit_mesh_faces_ps_, view);
401 manager.submit(edit_mesh_cages_ps_, view);
404 if (xray_flag_enabled_) {
409 manager.submit(edit_mesh_normals_ps_, view);
410 manager.submit(edit_mesh_edges_ps_, view);
411 manager.submit(edit_mesh_verts_ps_, view);
412 manager.submit(edit_mesh_skin_roots_ps_, view);
413 manager.submit(edit_mesh_facedots_ps_, view);
428 manager.submit(edit_mesh_faces_ps_, view);
429 manager.submit(edit_mesh_cages_ps_, view);
432 if (!xray_flag_enabled_) {
439 manager.submit(edit_mesh_normals_ps_, view);
440 manager.submit(edit_mesh_edges_ps_, view);
441 manager.submit(edit_mesh_verts_ps_, view);
442 manager.submit(edit_mesh_skin_roots_ps_, view);
443 manager.submit(edit_mesh_facedots_ps_, view);
452 if (
mesh.runtime->edit_mesh !=
nullptr) {
456 return (editmesh_eval_cage !=
nullptr) && (editmesh_eval_cage != editmesh_eval_final);
462 uint4 data_mask_get(
const int flag)
475 static bool mesh_has_skin_roots(
const Object *ob)
507 PassSimple image_border_ps_ = {
"ImageBorder"};
510 PassSimple brush_stencil_ps_ = {
"BrushStencil"};
515 bool select_vert_ =
false;
516 bool select_edge_ =
false;
517 bool select_face_ =
false;
518 bool select_face_dots_ =
false;
520 bool show_face_overlay_ =
false;
522 bool show_uv_edit_ =
false;
527 bool show_wireframe_ =
false;
531 bool show_stencil_ =
false;
535 bool show_mask_ =
false;
537 Mask *mask_id_ =
nullptr;
538 Texture mask_texture_ = {
"mask_texture_"};
541 bool show_mesh_analysis_ =
false;
550 float total_area_ratio_;
553 bool show_tiled_image_active_ =
false;
554 bool show_tiled_image_border_ =
false;
555 bool show_tiled_image_label_ =
false;
581 show_mask_ = space_mode_is_mask && space_image->
mask_info.
mask &&
594 enabled_ = !is_viewer || show_mask_;
602 show_uv_edit_ = space_mode_is_uv && object_mode_is_edit;
605 if (!show_uv_edit_) {
606 select_vert_ =
false;
607 select_edge_ =
false;
608 select_face_ =
false;
609 select_face_dots_ =
false;
611 show_face_overlay_ =
false;
615 select_face_ = !show_mesh_analysis_ && !hide_faces;
620 const char sel_mode_3d = tool_setting->
selectmode;
637 select_face_dots_ = (sel_mode_2d &
UV_SELECT_FACE) && !hide_faces;
641 if (show_mesh_analysis_) {
649 (space_mode_is_paint || space_mode_is_uv);
651 if (space_mode_is_uv && object_mode_is_edit) {
652 show_wireframe_ = show_wireframe_uv_edit;
656 show_wireframe_ = show_wireframe_uv_guide;
658 show_face_overlay_ = show_wireframe_;
666 show_stencil_ = space_mode_is_paint &&
brush &&
668 image_paint_settings.
clone;
673 show_tiled_image_border_ = is_tiled_image;
674 show_tiled_image_active_ = is_tiled_image;
675 show_tiled_image_label_ = is_tiled_image;
681 if (show_wireframe_) {
682 auto &pass = wireframe_ps_;
686 pass.shader_set(res.shaders->uv_wireframe.get());
690 pass.push_constant(
"do_smooth_wire", do_smooth_wire);
694 auto &pass = edges_ps_;
700 pass.specialize_constant(sh,
"use_edge_select", select_edge_);
704 pass.push_constant(
"line_style",
int(edit_uv_line_style_from_space_image(space_image)));
712 const float alpha = (select_vert_ || select_face_dots_) ? space_image->
uv_opacity : 1.0f;
713 pass.push_constant(
"alpha", alpha);
714 pass.push_constant(
"dash_length", dash_length);
715 pass.push_constant(
"do_smooth_wire", do_smooth_wire);
724 auto &pass = verts_ps_;
728 pass.shader_set(res.shaders->uv_edit_vert.get());
731 pass.push_constant(
"dot_size", (dot_size + 1.5f) *
float(
M_SQRT2));
732 pass.push_constant(
"outline_width", 0.75f);
733 pass.push_constant(
"color", theme_color);
736 if (select_face_dots_) {
739 auto &pass = facedots_ps_;
743 pass.shader_set(res.shaders->uv_edit_facedot.get());
746 pass.push_constant(
"dot_size", dot_size);
749 if (show_face_overlay_ || select_face_) {
750 const float opacity = (object_mode_is_edit && space_mode_is_uv) ?
754 auto &pass = faces_ps_;
757 pass.shader_set(res.shaders->uv_edit_face.get());
760 pass.push_constant(
"uv_opacity", opacity);
763 if (show_mesh_analysis_) {
764 auto &pass = analysis_ps_;
768 res.shaders->uv_analysis_stretch_angle.get() :
769 res.shaders->uv_analysis_stretch_area.get());
772 pass.push_constant(
"aspect",
state.image_uv_aspect);
774 pass.push_constant(
"total_area_ratio", &total_area_ratio_);
777 per_mesh_area_3d_.clear();
778 per_mesh_area_2d_.clear();
787 !((ob_ref.object->base_flag &
BASE_SELECTED) || (ob_ref.object ==
state.object_active)))
792 Object *ob = ob_ref.object;
796 const StringRef active_uv_map =
mesh.active_or_default_uv_map_name();
798 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
804 if (show_wireframe_ && has_active_object_uvmap) {
806 wireframe_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
808 if (show_face_overlay_ && has_active_object_uvmap && space_image->
uv_face_opacity > 0.0f) {
810 faces_ps_.draw(geom, res_handle);
823 Object &ob = *ob_ref.object;
832 const bool is_uv_editable = is_edit_object && space_image->
mode ==
SI_MODE_UV;
834 const bool is_paint_mode =
ELEM(
837 const bool is_face_selectable = (is_edit_object || (is_paint_mode && use_face_selection));
838 const StringRef active_uv_map =
mesh.active_or_default_uv_map_name();
840 const std::optional<bke::AttributeMetaData> meta_data = attributes.
lookup_meta_data(
851 if (has_active_edit_uvmap && is_uv_editable) {
854 edges_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
858 verts_ps_.draw(geom, res_handle);
860 if (select_face_dots_) {
862 facedots_ps_.draw(geom, res_handle);
864 if (show_face_overlay_ || select_face_) {
866 faces_ps_.draw(geom, res_handle);
868 if (show_wireframe_) {
870 wireframe_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
873 if (show_mesh_analysis_) {
874 int index_3d, index_2d;
876 index_3d = per_mesh_area_3d_.append_and_get_index(
nullptr);
877 index_2d = per_mesh_area_2d_.append_and_get_index(
nullptr);
884 ob,
mesh, &per_mesh_area_3d_[index_3d], &per_mesh_area_2d_[index_2d]);
886 analysis_ps_.draw(geom, res_handle);
892 if ((has_active_object_uvmap || has_active_edit_uvmap) && is_face_selectable) {
893 if (show_wireframe_) {
895 wireframe_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
897 if ((show_face_overlay_ && space_image->
uv_face_opacity > 0.0f) || select_face_) {
899 faces_ps_.draw(geom, res_handle);
905 if ((has_active_object_uvmap || has_active_edit_uvmap) && !is_uv_editable &&
908 if (show_wireframe_) {
910 wireframe_ps_.draw_expand(geom,
GPU_PRIM_TRIS, 2, 1, res_handle);
914 faces_ps_.draw(geom, res_handle);
926 float total_3d = 0.0f;
927 float total_2d = 0.0f;
928 for (
const float *mesh_area_2d : per_mesh_area_2d_) {
929 total_2d += *mesh_area_2d;
931 for (
const float *mesh_area_3d : per_mesh_area_3d_) {
932 total_3d += *mesh_area_3d;
941 if (show_tiled_image_border_) {
953 auto &pass = image_border_ps_;
956 pass.shader_set(res.shaders->uv_image_borders.get());
958 auto draw_tile = [&](
const ImageTile *
tile,
const bool is_active) {
959 const int tile_x = ((
tile->tile_number - 1001) % 10);
960 const int tile_y = ((
tile->tile_number - 1001) / 10);
961 const float3 tile_location(tile_x, tile_y, 0.0f);
962 pass.push_constant(
"tile_pos", tile_location);
963 pass.push_constant(
"ucolor", is_active ? selected_color : theme_color);
964 pass.draw(res.shapes.quad_wire.get());
967 if (show_tiled_image_label_ && !is_active) {
968 std::string text = std::to_string(
tile->tile_number);
986 draw_tile(
tile,
false);
993 if (show_tiled_image_active_ && active_tile !=
nullptr) {
994 draw_tile(active_tile,
true);
999 auto &pass = brush_stencil_ps_;
1009 stencil_texture.
wrap(stencil_gpu_texture);
1015 pass.shader_set(res.shaders->uv_brush_stencil.get());
1016 pass.bind_texture(
"img_tx", stencil_texture);
1017 pass.push_constant(
"img_premultiplied",
true);
1018 pass.push_constant(
"img_alpha_blend",
true);
1019 pass.push_constant(
"ucolor",
float4(1.0f, 1.0f, 1.0f, image_paint_settings.
clone_alpha));
1021 pass.push_constant(
"brush_scale",
float2(stencil_texture.
size().xy()) / size_image);
1022 pass.draw(res.shapes.quad_solid.get());
1027 paint_mask_texture_ensure(mask_id_,
state.image_size,
state.image_aspect);
1032 auto &pass = paint_mask_ps_;
1036 pass.shader_set(res.shaders->uv_paint_mask.get());
1037 pass.bind_texture(
"img_tx", mask_texture_);
1038 pass.push_constant(
"color",
float4(1.0f, 1.0f, 1.0f, 1.0f));
1039 pass.push_constant(
"opacity", opacity);
1040 pass.push_constant(
"brush_offset",
float2(0.0f));
1041 pass.push_constant(
"brush_scale",
float2(1.0f));
1042 pass.draw(res.shapes.quad_solid.get());
1056 manager.submit(paint_mask_ps_, view);
1058 if (show_tiled_image_border_) {
1059 manager.submit(image_border_ps_, view);
1061 if (show_wireframe_) {
1062 manager.submit(wireframe_ps_, view);
1064 if (show_mesh_analysis_) {
1065 manager.submit(analysis_ps_, view);
1067 if (show_face_overlay_ || select_face_) {
1068 manager.submit(faces_ps_, view);
1070 if (show_uv_edit_) {
1071 manager.submit(edges_ps_, view);
1073 if (select_face_dots_) {
1074 manager.submit(facedots_ps_, view);
1077 manager.submit(verts_ps_, view);
1079 if (show_stencil_) {
1080 manager.submit(brush_stencil_ps_, view);
1097 manager.submit(paint_mask_ps_, view);
1106 switch (sima->
dt_uv) {
1125 void paint_mask_texture_ensure(Mask *mask,
const int2 &resolution,
const float2 &aspect)
1127 const int width = resolution.
x;
1128 const int height =
floor(
float(resolution.
y) * (aspect.
y / aspect.
x));
1136 mask_texture_.free();
1137 mask_texture_.ensure_2d(
CustomData interface, see also DNA_customdata_types.h.
#define RETOPOLOGY_OFFSET(v3d)
#define SET_FLAG_FROM_TEST(value, test, flag)
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
void hold_texture(gpu::Texture *texture)
void wrap(gpu::Texture *tex)
int3 size(int miplvl=0) const
void shader_set(gpu::Shader *shader)
void bind_texture(const char *name, gpu::Texture *texture, GPUSamplerState state=sampler_auto)
void state_set(DRWState state, int clip_plane_count=0)
void bind_ubo(const char *name, gpu::UniformBuf *buffer)
void push_constant(const char *name, const float &data)
detail::PassBase< command::DrawCommandBuf > Sub
void end_sync(Resources &res, const State &state) final
void object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
void draw_on_render(gpu::FrameBuffer *framebuffer, Manager &manager, View &view) final
void draw(Framebuffer &framebuffer, Manager &manager, View &view) final
void edit_object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
void begin_sync(Resources &res, const State &state) final
void draw_line(Framebuffer &framebuffer, Manager &manager, View &view) final
void draw_line_only(Framebuffer &framebuffer, Manager &manager, View &view) final
void edit_object_sync(Manager &manager, const ObjectRef &ob_ref, Resources &, const State &state) final
static bool mesh_has_edit_cage(const Object *ob)
void begin_sync(Resources &res, const State &state) final
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
const ccl_global KernelWorkTile * tile
bool is_uv_map(const AttributeMetaData &meta_data)
constexpr int overlay_edit_text
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_angle(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_edges(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_edges(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_facedots(Object &object, Mesh &mesh)
detail::Pass< command::DrawCommandBuf > PassSimple
gpu::Batch * DRW_mesh_batch_cache_get_edituv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_facedots(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_verts(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_loop_normals(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_triangles(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_vertices(Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_all_uv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_vert_normals(Mesh &mesh)
gpu::Batch * DRW_cache_mesh_surface_weights_get(Object *ob)
gpu::Batch * DRW_mesh_batch_cache_get_uv_faces(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edituv_faces_stretch_area(Object &object, Mesh &mesh, float **tot_area, float **tot_uv_area)
gpu::Batch * DRW_cache_mesh_surface_get(Object *ob)
gpu::Batch * DRW_mesh_batch_cache_get_uv_wireframe(Object &object, Mesh &mesh)
gpu::Batch * DRW_mesh_batch_cache_get_edit_skin_roots(Mesh &mesh)
gpu::Batch * DRW_cache_mesh_surface_mesh_analysis_get(Object *ob)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
void get_color_4fv(int colorid, float col[4])
float get_value_f(int colorid)
void get_color_shade_4fv(int colorid, int offset, float col[4])
void get_color_shade_4ubv(int colorid, int offset, unsigned char col[4])
void GPU_framebuffer_bind(gpu::FrameBuffer *fb)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< uint8_t, 4 > uchar4
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
@ MASK_OVERLAY_ALPHACHANNEL
MaskRasterHandle * BKE_maskrasterize_handle_new()
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
bool BKE_subsurf_modifier_has_gpu_subdiv(const Mesh *mesh)
VecBase< uint32_t, 4 > uint4
const Mesh * BKE_object_get_editmesh_eval_final(const Object *object)
@ DRW_TEXT_CACHE_GLOBALSPACE
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
bool GPU_use_hq_normals_workaround()
@ GPU_TEXTURE_USAGE_SHADER_READ
T & DRW_object_get_data_for_drawing(const Object &object)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
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)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
int CustomData_get_offset_named(const CustomData *data, eCustomDataType type, StringRef name)
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, Mask *mask, int width, int height, bool do_aspect_correct, bool do_mask_aa, bool do_feather)
@ USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE
@ USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
@ DRW_STATE_FIRST_VERTEX_CONVENTION
@ DRW_STATE_BLEND_ALPHA_PREMUL
@ DRW_STATE_DEPTH_LESS_EQUAL
void GPU_debug_group_end()
void DRW_text_edit_mesh_measure_stats(const ARegion *region, const View3D *v3d, const Object *ob, const UnitSettings &unit, DRWTextStore *dt)
const Brush * BKE_paint_brush_for_read(const Paint *paint)
T * DEG_get_original(T *id)
draw::Manager * DRW_manager_get()
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
@ V3D_OVERLAY_EDIT_LOOP_NORMALS
@ V3D_OVERLAY_EDIT_WEIGHT
@ V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS
@ V3D_OVERLAY_EDIT_BWEIGHTS
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_STATVIS
@ V3D_OVERLAY_EDIT_CREASES
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_EDGE_LEN
@ V3D_OVERLAY_EDIT_VERT_NORMALS
@ V3D_OVERLAY_EDIT_FACE_NORMALS
@ V3D_OVERLAY_EDIT_FREESTYLE_EDGE
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_RETOPOLOGY
@ V3D_OVERLAY_EDIT_FREESTYLE_FACE
@ V3D_OVERLAY_EDIT_FACE_DOT
@ V3D_OVERLAY_EDIT_INDICES
gpu::Texture * BKE_image_acquire_gpu_texture(Image *image, ImageUser *iuser)
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle, unsigned int width, unsigned int height, float *buffer)
Rasterize a buffer from a single mask (threaded execution).
void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float r_size[2])
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, StringRef name)
bool DRW_object_is_in_edit_mode(const Object *ob)
void GPU_debug_group_begin(const char *name)
@ 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
MaskOverlayMode overlay_mode
eSpaceImage_UVDT_Stretch dt_uvstretch