39 r_show_lines = flag_show_lines;
63 r_show_lines = flag_show_lines;
97 bool show_points =
false;
98 bool show_lines =
false;
103 Vector<ed::greasepencil::DrawingInfo> drawings = ed::greasepencil::retrieve_visible_drawings(
104 *draw_ctx->
scene, grease_pencil,
false);
105 if (drawings.is_empty()) {
114 const bke::AttrDomain domain = show_points ? bke::AttrDomain::Point : bke::AttrDomain::Curve;
116 ".selection", domain,
true);
118 "material_index", bke::AttrDomain::Curve, 0);
121 auto show_stroke_name = [&](
const int stroke_i) {
123 for (
const int point_i : points_by_curve[stroke_i]) {
124 if (selections[point_i]) {
130 return selections[stroke_i];
134 const int point_i = points_by_curve[stroke_i].first();
135 if (show_stroke_name(stroke_i)) {
158 bool show_points =
false;
159 bool show_lines =
false;
217 float4x4 mat = ob->object_to_world();
222 mat = layer.to_world_space(*ob);
229 std::swap(mat[0], mat[2]);
232 std::swap(mat[1], mat[2]);
252 mat.
view<3, 3>() *= 2.0f;
260 mat = mat * local_transform;
263 const int line_count = gridlines * 4 + 2;
289 blender::gpu::Batch *geom_lines = DRW_cache_grease_pencil_edit_lines_get(draw_ctx->
scene, ob);
297 blender::gpu::Batch *geom_points = DRW_cache_grease_pencil_edit_points_get(draw_ctx->
scene,
321 blender::gpu::Batch *geom_lines = DRW_cache_grease_pencil_edit_lines_get(draw_ctx->
scene, ob);
329 blender::gpu::Batch *geom_points = DRW_cache_grease_pencil_edit_points_get(draw_ctx->
scene,
345 blender::gpu::Batch *geom_lines = DRW_cache_grease_pencil_weight_lines_get(draw_ctx->
scene,
354 blender::gpu::Batch *geom_points = DRW_cache_grease_pencil_weight_points_get(draw_ctx->
scene,
370 blender::gpu::Batch *geom_lines = DRW_cache_grease_pencil_edit_lines_get(draw_ctx->
scene, ob);
378 blender::gpu::Batch *geom_points = DRW_cache_grease_pencil_edit_points_get(draw_ctx->
scene,
Low-level operations for curves.
Low-level operations for grease pencil.
struct Material * BKE_object_material_get_eval(struct Object *ob, short act)
@ OB_MODE_VERTEX_GREASE_PENCIL
@ OB_MODE_SCULPT_GREASE_PENCIL
@ OB_MODE_WEIGHT_GREASE_PENCIL
@ GP_SCULPT_MASK_SELECTMODE_POINT
@ GP_SCULPT_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_SEGMENT
@ GP_VERTEX_MASK_SELECTMODE_POINT
@ GP_PROJECT_DEPTH_STROKE
@ V3D_GP_SHOW_MATERIAL_NAME
@ V3D_GP_SHOW_STROKE_DIRECTION
#define DRW_shgroup_call_no_cull(shgroup, geom, ob)
#define DRW_PASS_CREATE(pass, state)
#define DRW_shgroup_uniform_block(shgroup, name, ubo)
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
struct GPUShader GPUShader
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
OffsetIndices< int > points_by_curve() const
IndexRange curves_range() const
Span< float3 > positions() const
AttributeAccessor attributes() const
const bke::CurvesGeometry & strokes() const
int DRW_object_wire_theme_get(Object *ob, ViewLayer *view_layer, float **r_color)
bool DRW_state_show_text()
DRWTextStore * DRW_text_cache_ensure()
const DRWContextState * DRW_context_state_get()
DRWShadingGroup * DRW_shgroup_create(GPUShader *shader, DRWPass *pass)
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_call_procedural_lines(DRWShadingGroup *shgroup, const Object *ob, uint line_count)
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_view_viewmat_get(const DRWView *view, float mat[4][4], bool inverse)
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_TEXT_CACHE_STRING_PTR
@ DRW_STATE_DEPTH_LESS_EQUAL
MatT from_loc_scale(const typename MatT::loc_type &location, const VecBase< typename MatT::base_type, ScaleDim > &scale)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void OVERLAY_edit_grease_pencil_draw(OVERLAY_Data *vedata)
void OVERLAY_weight_grease_pencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_vertex_grease_pencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_edit_grease_pencil_cache_init(OVERLAY_Data *vedata)
static void overlay_grease_pencil_draw_stroke_color_name(Object &object, const int mat_nr, const blender::float3 position)
static void is_selection_visible(bool &r_show_points, bool &r_show_lines)
void OVERLAY_grease_pencil_cache_init(OVERLAY_Data *vedata)
void OVERLAY_edit_grease_pencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
void OVERLAY_grease_pencil_draw(OVERLAY_Data *vedata)
void OVERLAY_sculpt_grease_pencil_cache_populate(OVERLAY_Data *vedata, Object *ob)
static void OVERLAY_grease_pencil_material_names(Object *ob)
GPUShader * OVERLAY_shader_edit_particle_point()
GPUShader * OVERLAY_shader_edit_particle_strand()
GPUShader * OVERLAY_shader_gpencil_canvas()
GPUUniformBuf * block_ubo
OVERLAY_StorageList * stl
DRWPass * grease_pencil_canvas_ps
DRWPass * edit_grease_pencil_ps
DRWShadingGroup * edit_grease_pencil_wires_grp
DRWShadingGroup * edit_grease_pencil_points_grp
struct ToolSettings * toolsettings
float gpencil_grid_color[3]
float gpencil_grid_opacity
float gpencil_grid_scale[2]
float gpencil_grid_offset[2]
int gpencil_grid_subdivisions
const c_style_mat & ptr() const
const MatView< T, ViewNumCol, ViewNumRow, NumCol, NumRow, SrcStartCol, SrcStartRow, Alignment > view() const