Blender V4.5
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
namespace  blender::draw

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::VertBufblender::draw::DRW_cache_grease_pencil_position_buffer_get (const Scene *scene, Object *ob)
gpu::VertBufblender::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 GPUVertFormatblender::draw::grease_pencil_stroke_format ()
static const GPUVertFormatblender::draw::grease_pencil_color_format ()
Internal Utilities
static bool blender::draw::grease_pencil_batch_cache_valid (const GreasePencil &grease_pencil)
static GreasePencilBatchCacheblender::draw::grease_pencil_batch_cache_init (GreasePencil &grease_pencil)
static void blender::draw::grease_pencil_batch_cache_clear (GreasePencil &grease_pencil)
static GreasePencilBatchCacheblender::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 (float rot, float asp, float softness)
static void blender::draw::copy_transformed_positions (const Span< float3 > src_positions, const IndexRange range, const float4x4 &transform, MutableSpan< float3 > dst_positions)
static bool blender::draw::grease_pencil_batch_cache_is_edit_discarded (GreasePencilBatchCache *cache)
static void blender::draw::grease_pencil_weight_batch_ensure (Object &object, const GreasePencil &grease_pencil, const Scene &scene)
static IndexMask blender::draw::grease_pencil_get_visible_nurbs_points (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 IndexMask blender::draw::grease_pencil_get_visible_non_nurbs_curves (Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory)
static void blender::draw::grease_pencil_cache_add_nurbs (Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory, 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_line_points (Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory, MutableSpan< uint > lines_data, int *r_drawing_line_index, int *r_drawing_line_start_offset)
static void blender::draw::index_buf_add_nurbs_lines (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory, MutableSpan< uint > lines_data, int *r_drawing_line_index, int *r_drawing_line_start_offset)
static void blender::draw::index_buf_add_bezier_lines (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory, MutableSpan< uint > lines_data, int *r_drawing_line_index, int *r_drawing_line_start_offset)
static void blender::draw::index_buf_add_points (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory, MutableSpan< uint > points_data, int *r_drawing_point_index, int *r_drawing_start_offset)
static void blender::draw::index_buf_add_bezier_line_points (Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory, 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< Tblender::draw::attribute_interpolate (const VArray< T > &input, const bke::CurvesGeometry &curves)
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

◆ GREASE_PENCIL_EDIT_MULTIFRAME

#define GREASE_PENCIL_EDIT_MULTIFRAME   (1 << 2)

Definition at line 690 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_POINT_DIMMED

#define GREASE_PENCIL_EDIT_POINT_DIMMED   (1 << 5)

Definition at line 693 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_POINT_SELECTED

#define GREASE_PENCIL_EDIT_POINT_SELECTED   (1 << 0)

Definition at line 688 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 689 of file draw_cache_impl_grease_pencil.cc.

◆ GREASE_PENCIL_EDIT_STROKE_START

#define GREASE_PENCIL_EDIT_STROKE_START   (1 << 3)