Blender V5.3
draw_cache_impl_grease_pencil.cc File Reference

Grease Pencil API for render engines. More...

Go to the source code of this file.

Classes

struct  blender::draw::GreasePencilBatchCache
struct  blender::draw::GreasePencilStrokeVert
struct  blender::draw::GreasePencilColorVert

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::draw

Macros

#define EDIT_CURVES_NURBS_CONTROL_POINT   (1u)
#define EDIT_CURVES_BEZIER_HANDLE   (1u << 1)
#define EDIT_CURVES_ACTIVE_HANDLE   (1u << 2)
#define EDIT_CURVES_BEZIER_KNOT   (1u << 3)
#define EDIT_CURVES_HANDLE_TYPES_SHIFT   (4u)

Functions

gpu::Batch * blender::draw::DRW_cache_grease_pencil_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_edit_points_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_edit_lines_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_edit_handles_get (const Scene *scene, Object *ob)
gpu::VertBuf * blender::draw::DRW_cache_grease_pencil_position_buffer_get (const Scene *scene, Object *ob)
gpu::VertBuf * blender::draw::DRW_cache_grease_pencil_color_buffer_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_weight_points_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_weight_lines_get (const Scene *scene, Object *ob)
gpu::Batch * blender::draw::DRW_cache_grease_pencil_face_wireframe_get (const Scene *scene, Object *ob)
Vertex Formats

Used for data transfer from OpenSubdiv, and for data processing on our side.

static const GPUVertFormat * blender::draw::grease_pencil_stroke_format ()
static const GPUVertFormat * blender::draw::grease_pencil_color_format ()
Internal Utilities
static bool blender::draw::grease_pencil_batch_cache_valid (const GreasePencil &grease_pencil)
static GreasePencilBatchCache * blender::draw::grease_pencil_batch_cache_init (GreasePencil &grease_pencil)
static void blender::draw::grease_pencil_batch_cache_clear (GreasePencil &grease_pencil)
static GreasePencilBatchCache * blender::draw::grease_pencil_batch_cache_get (GreasePencil &grease_pencil)
Expose via BKE callbacks
void blender::draw::DRW_grease_pencil_batch_cache_dirty_tag (GreasePencil *grease_pencil, int mode)
void blender::draw::DRW_grease_pencil_batch_cache_validate (GreasePencil *grease_pencil)
void blender::draw::DRW_grease_pencil_batch_cache_free (GreasePencil *grease_pencil)

Vertex Buffers

#define GREASE_PENCIL_EDIT_POINT_SELECTED   (1 << 0)
#define GREASE_PENCIL_EDIT_STROKE_SELECTED   (1 << 1)
#define GREASE_PENCIL_EDIT_MULTIFRAME   (1 << 2)
#define GREASE_PENCIL_EDIT_STROKE_START   (1 << 3)
#define GREASE_PENCIL_EDIT_STROKE_END   (1 << 4)
#define GREASE_PENCIL_EDIT_POINT_DIMMED   (1 << 5)
BLI_INLINE int32_t blender::draw::pack_rotation_aspect_hardness_miter (const float rot, const float asp, const float softness, const float miter_angle)
static bool blender::draw::grease_pencil_batch_cache_is_edit_discarded (GreasePencilBatchCache *cache)
static IndexMask blender::draw::grease_pencil_get_editable_non_nurbs_curves (Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory)
static IndexMask blender::draw::grease_pencil_get_visible_non_nurbs_curves (Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
static void blender::draw::index_buf_add_line_points (const bke::greasepencil::Drawing &drawing, const IndexMask &curves_mask, MutableSpan< uint > lines_data, int *r_drawing_line_index, int *r_drawing_line_start_offset)
static void blender::draw::index_buf_add_points (const bke::greasepencil::Drawing &drawing, const IndexMask &curves_mask, MutableSpan< uint > points_data, int *r_drawing_point_index, int *r_drawing_start_offset)
static IndexMask blender::draw::grease_pencil_get_editable_selected_nurbs_curves (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static IndexMask blender::draw::grease_pencil_get_visible_nurbs_curves (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static void blender::draw::grease_pencil_cache_add_nurbs (const bke::greasepencil::Drawing &drawing, const IndexMask &nurbs_curves, const VArray< float > &selected_point, const float4x4 &layer_space_to_object_space, MutableSpan< float3 > edit_line_points, MutableSpan< float > edit_line_selection, int *r_drawing_line_start_offset, int *r_total_line_ids_num)
static void blender::draw::index_buf_add_nurbs_lines (const bke::greasepencil::Drawing &drawing, const IndexMask &nurbs_curves, MutableSpan< uint > lines_data, int *r_drawing_line_index, int *r_drawing_line_start_offset)
static void blender::draw::grease_pencil_weight_batch_ensure (Object &object, const GreasePencil &grease_pencil, const Scene &scene)
static void blender::draw::index_buf_add_bezier_handle_lines (const IndexMask bezier_points, const int all_points, MutableSpan< uint2 > handle_lines, int *r_drawing_line_index, const int *r_drawing_line_start_offset)
static uint32_t blender::draw::bezier_data_value (int8_t handle_type, bool is_active)
static void blender::draw::index_buf_add_bezier_line_points (const IndexMask bezier_points, MutableSpan< uint > points_data, int *r_drawing_point_index, int *r_drawing_start_offset)
static void blender::draw::grease_pencil_edit_batch_ensure (Object &object, const GreasePencil &grease_pencil, const Scene &scene)
template<typename T>
static VArray< T > blender::draw::attribute_interpolate (const VArray< T > &input, const bke::CurvesGeometry &curves)
static VArray< float > blender::draw::interpolate_corners (const bke::CurvesGeometry &curves)
static float blender::draw::segment_radius_length (const float l, const float r1, const float r2)
static Array< float > blender::draw::get_radii_lengths (const Span< float > lengths, const VArray< float > &radii, const IndexRange &points)
static void blender::draw::grease_pencil_geom_batch_ensure (Object &object, const GreasePencil &grease_pencil, const Scene &scene)
static void blender::draw::grease_pencil_wire_batch_ensure (Object &object, const GreasePencil &grease_pencil, const Scene &scene)

Detailed Description

Grease Pencil API for render engines.

Definition in file draw_cache_impl_grease_pencil.cc.

Macro Definition Documentation

◆ EDIT_CURVES_ACTIVE_HANDLE

#define EDIT_CURVES_ACTIVE_HANDLE   (1u << 2)

Definition at line 46 of file draw_cache_impl_grease_pencil.cc.

◆ EDIT_CURVES_BEZIER_HANDLE

#define EDIT_CURVES_BEZIER_HANDLE   (1u << 1)

Definition at line 45 of file draw_cache_impl_grease_pencil.cc.

◆ EDIT_CURVES_BEZIER_KNOT

#define EDIT_CURVES_BEZIER_KNOT   (1u << 3)

Definition at line 49 of file draw_cache_impl_grease_pencil.cc.

◆ EDIT_CURVES_HANDLE_TYPES_SHIFT

#define EDIT_CURVES_HANDLE_TYPES_SHIFT   (4u)

Definition at line 50 of file draw_cache_impl_grease_pencil.cc.

◆ EDIT_CURVES_NURBS_CONTROL_POINT

#define EDIT_CURVES_NURBS_CONTROL_POINT   (1u)

Definition at line 44 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_MULTIFRAME

#define GREASE_PENCIL_EDIT_MULTIFRAME   (1 << 2)

Definition at line 783 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_POINT_DIMMED

#define GREASE_PENCIL_EDIT_POINT_DIMMED   (1 << 5)

Definition at line 786 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_POINT_SELECTED

#define GREASE_PENCIL_EDIT_POINT_SELECTED   (1 << 0)

Definition at line 781 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_STROKE_END

#define GREASE_PENCIL_EDIT_STROKE_END   (1 << 4)

◆ GREASE_PENCIL_EDIT_STROKE_SELECTED

#define GREASE_PENCIL_EDIT_STROKE_SELECTED   (1 << 1)

Definition at line 782 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_STROKE_START

#define GREASE_PENCIL_EDIT_STROKE_START   (1 << 3)