39 r_show_lines = flag_show_lines;
63 r_show_lines = flag_show_lines;
97 bool show_points =
false;
98 bool show_lines =
false;
104 *draw_ctx->
scene, grease_pencil,
false);
116 ".selection", domain,
true);
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();
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;
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)
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_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
float4x4 to_world_space(const Object &object) 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
blender::gpu::Batch * DRW_cache_grease_pencil_edit_lines_get(const Scene *scene, Object *ob)
blender::gpu::Batch * DRW_cache_grease_pencil_weight_lines_get(const Scene *scene, Object *ob)
blender::gpu::Batch * DRW_cache_grease_pencil_edit_points_get(const Scene *scene, Object *ob)
blender::gpu::Batch * DRW_cache_grease_pencil_weight_points_get(const Scene *scene, Object *ob)
Vector< DrawingInfo > retrieve_visible_drawings(const Scene &scene, const GreasePencil &grease_pencil, const bool do_onion_skinning)
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)
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< float, 3 > float3
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()
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
MatBase< float, 3, 3 > float3x3