32 bool enabled_ =
false;
39 if (
state.is_space_v3d()) {
40 enabled_ = is_cursor_visible_3d(
state);
43 enabled_ = is_cursor_visible_2d(
state);
56 if (
state.is_space_v3d()) {
72 &
state.region->v2d, sima->
cursor[0], sima->
cursor[1], &pixel_coord[0], &pixel_coord[1]);
76 cursor_mat.
location()[0] = pixel_coord[0] + 0.5f;
77 cursor_mat.
location()[1] = pixel_coord[1] + 0.5f;
80 const float ofs = -0.01f;
82 ofs,
state.region->winx + ofs, ofs,
state.region->winy + ofs, -100.0f, 100.0f);
84 float4x4 mvp = proj_mat * cursor_mat;
100 int3 vert_stride_count_line = {2, 9999 , 0};
101 int3 vert_stride_count_circle = {1, 9999 , 0};
103 if (
state.is_space_v3d()) {
114 pass.
push_constant(
"gpu_vert_stride_count_offset", vert_stride_count_circle);
117 pass.
push_constant(
"gpu_vert_stride_count_offset", vert_stride_count_line);
122 pass.
push_constant(
"gpu_vert_stride_count_offset", vert_stride_count_circle);
124 pass.
push_constant(
"gpu_vert_stride_count_offset", vert_stride_count_line);
184 static bool is_cursor_visible_2d(
const State &
state)
187 if (space_data ==
nullptr) {
194 switch (sima->
mode) {
Object * BKE_object_pose_armature_get(Object *ob)
Paint * BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
const Brush * BKE_paint_brush_for_read(const Paint *paint)
@ IMAGE_PAINT_BRUSH_TYPE_CLONE
struct ViewLayer ViewLayer
#define OB_MODE_ALL_PAINT
@ OB_MODE_WEIGHT_GREASE_PENCIL
@ IMAGEPAINT_PROJECT_LAYER_CLONE
@ SI_OVERLAY_SHOW_OVERLAYS
struct SpaceInfo SpaceInfo
struct SpaceImage SpaceImage
@ V3D_OVERLAY_HIDE_CURSOR
@ V3D_PROJ_TEST_CLIP_NEAR
float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[3])
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
blender::gpu::Shader * GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
void UI_view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void shader_set(gpu::Shader *shader)
void draw_expand(gpu::Batch *batch, GPUPrimType primitive_type, uint primitive_len, uint instance_len, uint vertex_len, uint vertex_first, ResourceIndexRange res_index={}, uint custom_id=0)
void state_set(DRWState state, int clip_plane_count=0)
void push_constant(const char *name, const float &data)
void begin_sync(Resources &res, const State &state) final
void draw_output(Framebuffer &framebuffer, Manager &manager, View &) final
detail::Pass< command::DrawCommandBuf > PassSimple
MatBase< T, 4, 4 > orthographic(T left, T right, T bottom, T top, T near_clip, T far_clip)
Create an orthographic projection matrix using OpenGL coordinate convention: Maps each axis range to ...
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
MatT from_scale(const VecBase< typename MatT::base_type, ScaleDim > &scale)
MatT from_rotation(const RotationT &rotation)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
MatBase< float, 4, 4 > float4x4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
VecBase< int32_t, 3 > int3
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
SpaceImageOverlay overlay
const MatView< T, ViewNumCol, ViewNumRow, NumCol, NumRow, SrcStartCol, SrcStartRow, Alignment > view() const
static MatBase identity()