39#define EDIT_CURVES_NURBS_CONTROL_POINT (1u)
40#define EDIT_CURVES_BEZIER_HANDLE (1u << 1)
41#define EDIT_CURVES_ACTIVE_HANDLE (1u << 2)
44#define EDIT_CURVES_BEZIER_KNOT (1u << 3)
45#define EDIT_CURVES_HANDLE_TYPES_SHIFT (4u)
150 grease_pencil.
runtime->batch_cache);
151 return (cache && cache->
is_dirty ==
false &&
159 grease_pencil.
runtime->batch_cache);
160 if (cache ==
nullptr) {
161 cache = MEM_new<GreasePencilBatchCache>(__func__);
162 grease_pencil.
runtime->batch_cache = cache;
178 grease_pencil.
runtime->batch_cache);
179 if (cache ==
nullptr) {
211 grease_pencil.
runtime->batch_cache);
228 const float softness,
229 const float miter_angle)
233 float asp_normalized = (asp > 1.0f) ? (1.0f / asp) : asp;
235 if (asp_normalized <= 0.0f) {
236 asp_normalized = 1.0f;
262 const float miter_norm = (miter_angle /
M_PI);
285 constexpr float no_active_weight = 666.0f;
289 grease_pencil.
runtime->batch_cache);
301 const char *active_defgroup_name = (active_defgroup ==
nullptr) ?
"" : active_defgroup->
name;
310 "pos", gpu::VertAttrType::SFLOAT_32_32_32);
313 "selection", gpu::VertAttrType::SFLOAT_32);
319 int visible_points_num = 0;
320 int total_line_ids_num = 0;
321 int total_points_num = 0;
324 total_points_num +=
curves.points_num();
327 if (total_points_num == 0) {
337 int drawing_start_offset = 0;
339 const Layer &layer = *layers[info.layer_index];
346 object, info.drawing, memory);
350 curves.positions(), layer_space_to_object_space, points_pos.
slice(points));
358 drawing_start_offset +=
curves.points_num();
364 total_line_ids_num += visible_strokes.
size();
366 total_line_ids_num += drawing_visible_points_num;
371 if (layer.is_locked()) {
375 visible_points_num += drawing_visible_points_num;
381 int lines_ibo_index = 0;
386 int points_ibo_index = 0;
389 drawing_start_offset = 0;
391 const Layer *layer = layers[info.layer_index];
397 object, info.drawing, memory);
401 const IndexRange points = points_by_curve[curve_i];
404 for (
const int point : points) {
405 lines_data[lines_ibo_index++] = point + drawing_start_offset;
409 lines_data[lines_ibo_index++] = points.
first() + drawing_start_offset;
416 if (!layer->is_locked()) {
418 const IndexRange points = points_by_curve[curve_i];
419 for (
const int point : points) {
420 points_data[points_ibo_index++] = point + drawing_start_offset;
425 drawing_start_offset +=
curves.points_num();
461 const IndexMask editable_and_selected_curves =
463 object, drawing, layer_index, memory);
467 const int curve_i = point_to_curve_map[point_i];
468 const bool is_selected = editable_and_selected_curves.
contains(curve_i);
470 return is_selected && is_nurbs;
487 const IndexMask selected_editable_strokes =
489 object, drawing, layer_index, memory);
493 selected_editable_strokes,
GrainSize(4096), memory, [&](
const int64_t curve_i) {
501 const int layer_index,
506 object, drawing, layer_index, memory);
508 return visible_strokes;
520 const int layer_index,
523 const float4x4 &layer_space_to_object_space,
526 int *r_drawing_line_start_offset,
527 int *r_total_line_ids_num)
530 object, drawing, layer_index, memory);
539 object, drawing, layer_index, memory);
552 *r_drawing_line_start_offset += nurbs_points.
size();
553 *r_total_line_ids_num += nurbs_points.
size();
556 *r_total_line_ids_num += nurbs_curves.
size();
561 const int layer_index,
564 int *r_drawing_line_index,
565 int *r_drawing_line_start_offset)
572 object, drawing, layer_index, memory);
574 const int offset = *r_drawing_line_start_offset;
575 int line_index = *r_drawing_line_index;
578 visible_strokes_for_lines.
foreach_index([&](
const int curve_i) {
579 const IndexRange points = points_by_curve_eval[curve_i];
582 for (
const int point : points) {
583 lines_data[line_index++] = point + offset;
587 lines_data[line_index++] = points.
first() + offset;
593 *r_drawing_line_index = line_index;
594 *r_drawing_line_start_offset +=
curves.evaluated_points_num();
602 int *r_drawing_line_index,
603 int *r_drawing_line_start_offset)
608 object, drawing, layer_index, memory);
613 int line_index = *r_drawing_line_index;
617 const IndexRange points = points_by_curve[curve_i];
620 lines_data[line_index++] = point + *r_drawing_line_start_offset;
625 *r_drawing_line_start_offset += points.
size();
628 *r_drawing_line_index = line_index;
632 const int all_points,
634 int *r_drawing_line_index,
635 int *r_drawing_line_start_offset)
641 const int offset = *r_drawing_line_start_offset;
642 int line_index = *r_drawing_line_index;
646 handle_lines[line_index++] =
uint2(offset + all_points +
pos + bezier_points.
size() * 0,
648 handle_lines[line_index++] =
uint2(offset + all_points +
pos + bezier_points.
size() * 1,
652 *r_drawing_line_index = line_index;
660 int *r_drawing_point_index,
661 int *r_drawing_start_offset)
667 const IndexMask selected_editable_strokes =
669 object, drawing, layer_index, memory);
671 const int offset = *r_drawing_start_offset;
672 int ibo_index = *r_drawing_point_index;
674 selected_editable_strokes.
foreach_index([&](
const int curve_i) {
675 const IndexRange points = points_by_curve[curve_i];
676 for (
const int point : points) {
677 points_data[ibo_index++] = point + offset;
681 *r_drawing_point_index = ibo_index;
682 *r_drawing_start_offset +=
curves.points_num();
693 int *r_drawing_point_index,
694 int *r_drawing_start_offset)
700 const int offset = *r_drawing_start_offset;
701 int ibo_index = *r_drawing_point_index;
705 points_data[ibo_index++] = point + offset;
708 *r_drawing_point_index = ibo_index;
709 *r_drawing_start_offset += bezier_points.
size() * 2;
713#define GREASE_PENCIL_EDIT_POINT_SELECTED (1 << 0)
714#define GREASE_PENCIL_EDIT_STROKE_SELECTED (1 << 1)
715#define GREASE_PENCIL_EDIT_MULTIFRAME (1 << 2)
716#define GREASE_PENCIL_EDIT_STROKE_START (1 << 3)
717#define GREASE_PENCIL_EDIT_STROKE_END (1 << 4)
718#define GREASE_PENCIL_EDIT_POINT_DIMMED (1 << 5)
727 grease_pencil.
runtime->batch_cache);
743 "pos", gpu::VertAttrType::SFLOAT_32_32_32);
746 "pos", gpu::VertAttrType::SFLOAT_32_32_32);
749 "selection", gpu::VertAttrType::SFLOAT_32);
752 "vflag", gpu::VertAttrType::UINT_32);
755 "selection", gpu::VertAttrType::SFLOAT_32);
758 "data", gpu::VertAttrType::UINT_32);
770 int total_points_num = 0;
772 const Layer &layer = *layers[info.layer_index];
774 if (layer.is_locked()) {
779 total_points_num +=
curves.points_num();
782 int total_line_points_num = 0;
785 total_line_points_num +=
curves.evaluated_points_num();
788 int total_bezier_point_num = 0;
794 total_bezier_point_num += bezier_points.
size();
800 object, info.drawing, info.layer_index, memory);
803 total_line_points_num += nurbs_points.
size();
807 total_points_num += total_bezier_point_num * 2;
809 if (total_points_num == 0) {
826 edit_points_selection.fill(0.0f);
827 edit_points_vflag.fill(0);
828 edit_points_info.fill(0);
829 edit_line_selection.fill(0.0f);
831 int visible_points_num = 0;
832 int total_line_ids_num = 0;
833 int total_bezier_num = 0;
834 int drawing_start_offset = 0;
835 int drawing_line_start_offset = 0;
837 const Layer &layer = *layers[info.layer_index];
845 object, info.drawing, info.layer_index, memory);
848 const IndexRange points_eval(drawing_line_start_offset,
curves.evaluated_points_num());
850 if (!layer.is_locked()) {
852 curves.positions(), layer_space_to_object_space, edit_points.
slice(points));
856 layer_space_to_object_space,
857 edit_line_points.slice(points_eval));
860 if (!layer.is_locked()) {
863 for (
const int curve_i :
curves.curves_range()) {
864 const IndexRange sub_points = points_by_curve[curve_i].shift(drawing_start_offset);
869 const IndexMask selected_editable_points =
871 object, info.drawing, info.layer_index, memory);
883 curves.ensure_can_interpolate_to_evaluated();
884 curves.interpolate_to_evaluated(selection_slice.
as_span(), line_selection_slice);
888 drawing_line_start_offset +=
curves.evaluated_points_num();
891 total_line_ids_num += visible_strokes_for_lines.
size();
894 visible_strokes_for_lines);
899 if (layer.is_locked()) {
903 drawing_start_offset +=
curves.points_num();
904 const IndexMask selected_editable_strokes =
906 object, info.drawing, info.layer_index, memory);
910 selected_editable_strokes);
920 layer_space_to_object_space,
923 &drawing_line_start_offset,
924 &total_line_ids_num);
934 bezier_points.
size());
962 const bool selected = selected_point[point_i] || selected_left[point_i] ||
963 selected_right[point_i];
971 visible_points_num += bezier_points.
size() * 2;
972 drawing_start_offset += bezier_points.
size() * 2;
974 total_bezier_num += bezier_points.
size();
981 int lines_ibo_index = 0;
986 int points_ibo_index = 0;
992 int handle_lines_id = 0;
994 drawing_start_offset = 0;
995 drawing_line_start_offset = 0;
997 const Layer *layer = layers[info.layer_index];
1006 &drawing_line_start_offset);
1008 if (!layer->is_locked()) {
1018 &drawing_line_start_offset);
1020 info.drawing.strokes().points_num(),
1023 &drawing_start_offset);
1030 &drawing_start_offset);
1032 bezier_points, points_data, &points_ibo_index, &drawing_start_offset);
1085 return miter_angles;
1103 for (const int curve_i : range) {
1104 const IndexRange eval_points = evaluated_points_by_curve[curve_i];
1105 const IndexRange points = points_by_curve[curve_i];
1106 MutableSpan<float> eval_corners_range = eval_corners.as_mutable_span().slice(eval_points);
1108 switch (types[curve_i]) {
1109 case CURVE_TYPE_POLY:
1110 for (const int i : points.index_range()) {
1111 eval_corners_range[i] = miter_angles[points[i]];
1114 case CURVE_TYPE_BEZIER: {
1115 const Span<int> offsets = curves.bezier_evaluated_offsets_for_curve(curve_i);
1116 for (const int i : points.index_range()) {
1117 eval_corners_range[offsets[i]] = miter_angles[points[i]];
1121 case CURVE_TYPE_NURBS:
1122 case CURVE_TYPE_CATMULL_ROM: {
1139 grease_pencil.
runtime->batch_cache);
1141 if (cache->
vbo !=
nullptr) {
1155 int total_verts_num = 0;
1156 int total_triangles_num = 0;
1166 object, info.drawing, memory);
1168 const int num_curves = visible_strokes.
size();
1169 const int verts_start_offsets_size = num_curves;
1170 const int tris_start_offsets_size = num_curves;
1171 Array<int> verts_start_offsets(verts_start_offsets_size);
1172 Array<int> tris_start_offsets(tris_start_offsets_size);
1177 for (
const int curve_i :
curves.curves_range()) {
1178 IndexRange points = points_by_curve[curve_i];
1179 if (visible_strokes.
contains(curve_i)) {
1180 tris_start_offsets[
pos] = t_offset;
1183 if (points.
size() >= 3) {
1184 t_offset += points.
size() - 2;
1192 IndexRange points = points_by_curve[curve_i];
1193 const bool is_cyclic = cyclic[curve_i] && (points.
size() > 2);
1199 verts_start_offsets[
pos] = v_offset;
1201 num_points += points.
size();
1205 total_verts_num += num_points + num_cyclic + num_curves * 2;
1206 total_triangles_num += (num_points + num_cyclic) * 2;
1207 total_triangles_num += info.drawing.triangles().size();
1209 verts_start_offsets_per_visible_drawing.
append(std::move(verts_start_offsets));
1210 tris_start_offsets_per_visible_drawing.
append(std::move(tris_start_offsets));
1229 int triangle_ibo_index = 0;
1232 for (
const int drawing_i : drawings.
index_range()) {
1238 if (
curves.evaluated_points_num() == 0) {
1247 curves.ensure_can_interpolate_to_evaluated();
1282 const Span<int> verts_start_offsets = verts_start_offsets_per_visible_drawing[drawing_i];
1283 const Span<int> tris_start_offsets = tris_start_offsets_per_visible_drawing[drawing_i];
1286 object, info.
drawing, memory);
1288 curves.ensure_evaluated_lengths();
1290 auto populate_point = [&](
IndexRange verts_range,
1305 s_vert.radius =
math::max(radii[point_i], 0.0f) *
1307 s_vert.opacity = opacities[point_i] *
1311 s_vert.point_id = cyclic ? -verts_range[idx] : verts_range[idx];
1312 s_vert.stroke_id = verts_range.
first();
1320 stroke_point_aspect_ratios[curve_i],
1321 stroke_softness[curve_i],
1322 miter_angles[point_i]);
1323 s_vert.u_stroke = u_stroke;
1326 copy_v4_v4(c_vert.vcol, vertex_colors[point_i]);
1327 copy_v4_v4(c_vert.fcol, stroke_fill_colors[curve_i]);
1328 c_vert.fcol[3] = (int(c_vert.fcol[3] * 10000.0f) * 10.0f) + fill_opacities[curve_i];
1331 triangle_ibo_data[triangle_ibo_index] =
uint3(v_mat + 0, v_mat + 1, v_mat + 2);
1332 triangle_ibo_index++;
1333 triangle_ibo_data[triangle_ibo_index] =
uint3(v_mat + 2, v_mat + 1, v_mat + 3);
1334 triangle_ibo_index++;
1338 const IndexRange points = points_by_curve[curve_i];
1339 const bool is_cyclic = cyclic[curve_i] && (points.
size() > 2);
1340 const int verts_start_offset = verts_start_offsets[
pos];
1341 const int tris_start_offset = tris_start_offsets[
pos];
1342 const int num_verts = 1 + points.
size() + (
is_cyclic ? 1 : 0) + 1;
1346 const float4x2 texture_matrix = texture_matrices[curve_i] * object_space_to_layer_space;
1348 const Span<float> lengths =
curves.evaluated_lengths_for_curve(curve_i, cyclic[curve_i]);
1351 verts_slice.
first().mat = -1;
1353 verts_slice.
first().stroke_id = verts_range.
last();
1356 if (points.
size() >= 3) {
1358 for (
const int3 tri : tris_slice) {
1359 triangle_ibo_data[triangle_ibo_index] =
uint3(
1363 triangle_ibo_index++;
1368 const float u_scale = u_scales[curve_i];
1369 const float u_translation = u_translations[curve_i];
1371 const int idx =
i + 1;
1372 const float u_stroke = u_scale * (
i > 0 ? lengths[
i - 1] : 0.0f) + u_translation;
1373 populate_point(verts_range,
1375 start_caps[curve_i],
1387 const int idx = points.
size() + 1;
1388 const float u = points.
size() > 1 ? lengths[points.
size() - 1] : 0.0f;
1389 const float u_stroke = u_scale * u + u_translation;
1390 populate_point(verts_range,
1392 start_caps[curve_i],
1404 verts_slice.
last().mat = -1;
1409 verts[total_verts_num + 0].mat = -1;
1410 verts[total_verts_num + 1].mat = -1;
1433 grease_pencil.
runtime->batch_cache);
1457 object, info.drawing, memory);
1460 const IndexRange points = points_by_curve[curve_i];
1461 const int point_len = points.
size();
1462 const int point_start = index_len;
1463 const bool is_cyclic = cyclic[curve_i] && (point_len > 2);
1465 index_len += point_len + (
is_cyclic ? 1 : 0) + 1;
1467 index_start_per_curve.
append(point_start);
1469 is_onion_per_curve.
append(info.onion_id != 0);
1472 index_start_per_curve.
append(index_len);
1481 for (const int curve : range) {
1483 const IndexRange offset_range = range_per_curve[curve].drop_back(1);
1486 const IndexRange index_range = offset_range.shift(curve + 1);
1487 if (is_onion_per_curve[curve]) {
1488 for (const int i : offset_range.index_range()) {
1489 indices[offset_range[i]] = gpu::RESTART_INDEX;
1491 if (cyclic_per_curve[curve]) {
1492 indices[offset_range.last()] = gpu::RESTART_INDEX;
1496 for (const int i : offset_range.index_range()) {
1497 indices[offset_range[i]] = index_range[i];
1499 if (cyclic_per_curve[curve]) {
1500 indices[offset_range.last()] = index_range.first();
1503 indices[offset_range.one_after_last()] = gpu::RESTART_INDEX;
1512 cache->is_dirty =
false;
1521 grease_pencil->
runtime->batch_cache);
1522 if (cache ==
nullptr) {
1547 grease_pencil->
runtime->batch_cache =
nullptr;
Low-level operations for curves.
Low-level operations for grease pencil that cannot be defined in the C++ header yet.
@ BKE_GREASEPENCIL_BATCH_DIRTY_ALL
Low-level operations for grease pencil.
#define BLI_assert_unreachable()
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int clamp_i(int value, int min, int max)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
@ GP_STROKE_CAP_TYPE_ROUND
#define GP_STROKE_MITER_ANGLE_BEVEL
#define GP_STROKE_MITER_ANGLE_ROUND
T & DRW_object_get_data_for_drawing(const Object &object)
#define GPU_batch_create(primitive_type, vertex_buf, index_buf)
int GPU_batch_vertbuf_add(blender::gpu::Batch *batch, blender::gpu::VertBuf *vertex_buf, bool own_vbo)
#define GPU_BATCH_DISCARD_SAFE(batch)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, GPUBatchFlag owns_flag)
blender::MutableSpan< uint32_t > GPU_indexbuf_get_data(GPUIndexBufBuilder *)
#define GPU_INDEXBUF_DISCARD_SAFE(elem)
void GPU_indexbuf_init(GPUIndexBufBuilder *, GPUPrimType, uint prim_len, uint vertex_len)
blender::gpu::IndexBuf * GPU_indexbuf_build_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices)
void GPU_indexbuf_init_ex(GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len)
void GPU_vertbuf_use(blender::gpu::VertBuf *)
blender::gpu::VertBuf * GPU_vertbuf_create_with_format_ex(const GPUVertFormat &format, GPUUsageType usage)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
uint GPU_vertbuf_get_vertex_len(const blender::gpu::VertBuf *verts)
@ GPU_USAGE_FLAG_BUFFER_TEXTURE_ONLY
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
constexpr int64_t first() const
constexpr int64_t last(const int64_t n=0) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr MutableSpan< NewT > cast() const
constexpr Span< T > as_span() const
constexpr T & first() const
constexpr T & last(const int64_t n=0) const
constexpr Span slice(int64_t start, int64_t size) const
void materialize(MutableSpan< T > r_span) const
T get_internal_single() const
static VArray from_single(T value, const int64_t size)
static VArray from_container(ContainerT container)
void append(const T &value)
IndexRange index_range() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
Span< float4x2 > texture_matrices() const
const bke::CurvesGeometry & strokes() const
VArray< float > radii() const
Span< int3 > triangles() const
VArray< ColorGeometry4f > fill_colors() const
VArray< float > opacities() const
float4x4 to_object_space(const Object &object) const
bool contains(int64_t query_index) const
void foreach_index(Fn &&fn) const
#define EDIT_CURVES_ACTIVE_HANDLE
#define EDIT_CURVES_HANDLE_TYPES_SHIFT
#define EDIT_CURVES_BEZIER_KNOT
#define EDIT_CURVES_BEZIER_HANDLE
#define GREASE_PENCIL_EDIT_STROKE_START
#define GREASE_PENCIL_EDIT_STROKE_END
static bool is_cyclic(const Nurb *nu)
#define GPENCIL_MATERIAL_BUFFER_LEN
#define GP_IS_STROKE_VERTEX_BIT
#define GP_CORNER_TYPE_BEVEL_BITS
#define GP_CORNER_TYPE_ROUND_BITS
#define GP_VERTEX_ID_SHIFT
#define GP_CORNER_TYPE_MITER_NUMBER
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
void copy(const GVArray &src, GMutableSpan dst, int64_t grain_size=4096)
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, int64_t grain_size=4096)
int64_t count_booleans(const VArray< bool > &varray)
static bool grease_pencil_batch_cache_valid(const GreasePencil &grease_pencil)
static void 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 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)
gpu::Batch * DRW_cache_grease_pencil_get(const Scene *scene, Object *ob)
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grease_pencil)
static const GPUVertFormat * grease_pencil_stroke_format()
static void grease_pencil_batch_cache_clear(GreasePencil &grease_pencil)
static void 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 IndexMask grease_pencil_get_visible_nurbs_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static VArray< float > interpolate_corners(const bke::CurvesGeometry &curves)
static IndexMask grease_pencil_get_visible_non_nurbs_curves(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, IndexMaskMemory &memory)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grease_pencil)
gpu::Batch * DRW_cache_grease_pencil_face_wireframe_get(const Scene *scene, Object *ob)
static void index_buf_add_bezier_line_points(const IndexMask bezier_points, MutableSpan< uint > points_data, int *r_drawing_point_index, int *r_drawing_start_offset)
gpu::Batch * DRW_cache_grease_pencil_edit_handles_get(const Scene *scene, Object *ob)
static GreasePencilBatchCache * grease_pencil_batch_cache_init(GreasePencil &grease_pencil)
static void grease_pencil_edit_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grease_pencil, int mode)
static void grease_pencil_weight_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
static VArray< T > attribute_interpolate(const VArray< T > &input, const bke::CurvesGeometry &curves)
static GreasePencilBatchCache * grease_pencil_batch_cache_get(GreasePencil &grease_pencil)
static void index_buf_add_bezier_handle_lines(const IndexMask bezier_points, const int all_points, MutableSpan< uint2 > handle_lines, int *r_drawing_line_index, int *r_drawing_line_start_offset)
gpu::VertBuf * DRW_cache_grease_pencil_position_buffer_get(const Scene *scene, Object *ob)
gpu::Batch * DRW_cache_grease_pencil_edit_lines_get(const Scene *scene, Object *ob)
static IndexMask grease_pencil_get_visible_nurbs_curves(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static const GPUVertFormat * grease_pencil_color_format()
gpu::Batch * DRW_cache_grease_pencil_weight_lines_get(const Scene *scene, Object *ob)
static bool grease_pencil_batch_cache_is_edit_discarded(GreasePencilBatchCache *cache)
gpu::Batch * DRW_cache_grease_pencil_edit_points_get(const Scene *scene, Object *ob)
static uint32_t bezier_data_value(int8_t handle_type, bool is_active)
BLI_INLINE int32_t pack_rotation_aspect_hardness_miter(const float rot, const float asp, const float softness, const float miter_angle)
gpu::Batch * DRW_cache_grease_pencil_weight_points_get(const Scene *scene, Object *ob)
static void grease_pencil_wire_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
static void 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 grease_pencil_geom_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
gpu::VertBuf * DRW_cache_grease_pencil_color_buffer_get(const Scene *scene, Object *ob)
IndexMask retrieve_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const int layer_index, const int handle_display, IndexMaskMemory &memory)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
Vector< DrawingInfo > retrieve_visible_drawings(const Scene &scene, const GreasePencil &grease_pencil, const bool do_onion_skinning)
IndexMask retrieve_editable_and_selected_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
IndexMask retrieve_visible_strokes(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
IndexMask retrieve_editable_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
constexpr uint32_t RESTART_INDEX
void masked_fill(MutableSpan< T > data, const T &value, const IndexMask &mask)
CartesianBasis invert(const CartesianBasis &basis)
T max(const T &a, const T &b)
void transform_points(const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
int sum_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
VecBase< uint32_t, 2 > uint2
VecBase< uint32_t, 3 > uint3
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
VecBase< int32_t, 3 > int3
MatBase< float, 4, 2 > float4x2
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
VecBase< float, 3 > float3
int vertex_group_active_index
ListBase vertex_group_names
GreasePencilRuntimeHandle * runtime
gpu::IndexBuf * edit_handles_ibo
gpu::IndexBuf * edit_line_indices
gpu::Batch * edit_handles
gpu::VertBuf * edit_points_info
gpu::VertBuf * edit_points_vflag
gpu::VertBuf * edit_line_pos
gpu::IndexBuf * edit_points_indices
gpu::VertBuf * edit_line_selection
gpu::VertBuf * edit_points_selection
gpu::VertBuf * edit_points_pos
int32_t packed_asp_hard_rot
const bke::greasepencil::Drawing & drawing