88 if (
format.attr_len == 0) {
105 if (
format.attr_len == 0) {
122 grease_pencil.
runtime->batch_cache);
123 return (cache && cache->
is_dirty ==
false &&
131 grease_pencil.
runtime->batch_cache);
132 if (cache ==
nullptr) {
133 cache = MEM_new<GreasePencilBatchCache>(__func__);
134 grease_pencil.
runtime->batch_cache = cache;
150 grease_pencil.
runtime->batch_cache);
151 if (cache ==
nullptr) {
180 grease_pencil.
runtime->batch_cache);
199 float asp_normalized = (asp > 1.0f) ? (1.0f / asp) : asp;
223 for (
const int point_i : range) {
242 constexpr float no_active_weight = 666.0f;
246 grease_pencil.
runtime->batch_cache);
258 const char *active_defgroup_name = (active_defgroup ==
nullptr) ?
"" : active_defgroup->
name;
267 if (format_points_pos.
attr_len == 0) {
272 if (format_points_weight.
attr_len == 0) {
280 int visible_points_num = 0;
281 int total_line_ids_num = 0;
282 int total_points_num = 0;
285 total_points_num +=
curves.points_num();
288 if (total_points_num == 0) {
298 int drawing_start_offset = 0;
300 const Layer &layer = *layers[info.layer_index];
307 object, info.drawing, memory);
313 copy_transformed_positions(positions, range, layer_space_to_object_space, positions_slice);
322 drawing_start_offset +=
curves.points_num();
325 total_line_ids_num += visible_strokes.
size();
329 total_line_ids_num += std::accumulate(
330 size_per_editable_stroke.
begin(), size_per_editable_stroke.
end(), 0);
335 if (layer.is_locked()) {
340 const IndexRange points = points_by_curve[curve_i];
341 visible_points_num += points.
size();
358 drawing_start_offset = 0;
360 const Layer *layer = layers[info.layer_index];
366 object, info.drawing, memory);
370 const IndexRange points = points_by_curve[curve_i];
373 for (
const int point_i : points) {
385 if (!layer->is_locked()) {
387 const IndexRange points = points_by_curve[curve_i];
388 for (
const int point : points) {
394 drawing_start_offset +=
curves.points_num();
430 const IndexMask editable_and_selected_curves =
432 object, drawing, layer_index, memory);
436 const int curve_i = point_to_curve_map[point_i];
437 const bool is_selected = editable_and_selected_curves.
contains(curve_i);
439 return is_selected && is_nurbs;
458 const IndexMask selected_editable_strokes =
460 object, drawing, layer_index, memory);
475 object, drawing, memory);
488 const int layer_index,
491 const float4x4 &layer_space_to_object_space,
494 int *r_drawing_line_start_offset,
495 int *r_total_line_ids_num)
498 object, drawing, layer_index, memory);
507 object, drawing, layer_index, memory);
517 copy_transformed_positions(
518 positions_eval_slice, range, layer_space_to_object_space, positions_eval_slice);
526 *r_drawing_line_start_offset += nurbs_points.
size();
527 *r_total_line_ids_num += nurbs_points.
size();
530 *r_total_line_ids_num += nurbs_curves.
size();
538 int *r_drawing_line_start_offset)
545 object, drawing, memory);
548 visible_strokes_for_lines.
foreach_index([&](
const int curve_i) {
549 const IndexRange points = points_by_curve_eval[curve_i];
552 for (
const int point_i : points) {
563 *r_drawing_line_start_offset +=
curves.evaluated_points_num();
571 int *r_drawing_line_start_offset)
576 object, drawing, layer_index, memory);
583 const IndexRange points = points_by_curve[curve_i];
591 *r_drawing_line_start_offset += points.
size();
600 int *r_drawing_line_start_offset)
603 object, drawing, layer_index, memory);
611 elb,
point + bezier_points.
size() * 0 + (*r_drawing_line_start_offset));
613 elb,
point + bezier_points.
size() * 1 + (*r_drawing_line_start_offset));
615 elb,
point + bezier_points.
size() * 2 + (*r_drawing_line_start_offset));
620 *r_drawing_line_start_offset += bezier_points.
size() * 3;
628 int *r_drawing_start_offset)
634 const IndexMask selected_editable_strokes =
636 object, drawing, layer_index, memory);
638 selected_editable_strokes.
foreach_index([&](
const int curve_i) {
639 const IndexRange points = points_by_curve[curve_i];
640 for (
const int point : points) {
645 *r_drawing_start_offset +=
curves.points_num();
653 int *r_drawing_start_offset)
656 object, drawing, layer_index, memory);
667 *r_drawing_start_offset += bezier_points.
size() * 2;
671#define GREASE_PENCIL_EDIT_POINT_SELECTED (1 << 0)
672#define GREASE_PENCIL_EDIT_STROKE_SELECTED (1 << 1)
673#define GREASE_PENCIL_EDIT_MULTIFRAME (1 << 2)
674#define GREASE_PENCIL_EDIT_STROKE_START (1 << 3)
675#define GREASE_PENCIL_EDIT_STROKE_END (1 << 4)
676#define GREASE_PENCIL_EDIT_POINT_DIMMED (1 << 5)
685 grease_pencil.
runtime->batch_cache);
701 if (format_edit_points_pos.
attr_len == 0) {
706 if (format_edit_line_pos.
attr_len == 0) {
711 if (format_edit_points_selection.
attr_len == 0) {
717 if (format_edit_points_vflag.
attr_len == 0) {
722 if (format_edit_line_selection.
attr_len == 0) {
736 int total_points_num = 0;
738 const Layer &layer = *layers[info.layer_index];
740 if (layer.is_locked()) {
745 total_points_num +=
curves.points_num();
748 int total_line_points_num = 0;
751 total_line_points_num +=
curves.evaluated_points_num();
754 int total_bezier_point_num = 0;
758 object, info.drawing, info.layer_index, memory);
760 total_bezier_point_num += bezier_points.
size();
766 object, info.drawing, info.layer_index, memory);
769 total_line_points_num += nurbs_points.
size();
773 total_points_num += total_bezier_point_num * 2;
775 total_line_points_num += total_bezier_point_num * 3;
777 if (total_points_num == 0) {
792 edit_points_selection.fill(0.0f);
793 edit_points_vflag.fill(0);
794 edit_line_selection.fill(0.0f);
796 int visible_points_num = 0;
797 int total_line_ids_num = 0;
798 int drawing_start_offset = 0;
799 int drawing_line_start_offset = 0;
801 const Layer &layer = *layers[info.layer_index];
809 object, info.drawing, memory);
812 const IndexRange points_eval(drawing_line_start_offset,
curves.evaluated_points_num());
815 if (!layer.is_locked()) {
818 copy_transformed_positions(positions, range, layer_space_to_object_space, positions_slice);
827 copy_transformed_positions(
828 positions_eval, range, layer_space_to_object_space, positions_eval_slice);
832 if (!layer.is_locked()) {
835 for (
const int curve_i :
curves.curves_range()) {
836 const IndexRange points = points_by_curve[curve_i].shift(drawing_start_offset);
841 const IndexMask selected_editable_points =
843 object, info.drawing, info.layer_index, memory);
855 curves.ensure_can_interpolate_to_evaluated();
856 curves.interpolate_to_evaluated(selection_slice.
as_span(), line_selection_slice);
860 drawing_line_start_offset +=
curves.evaluated_points_num();
863 total_line_ids_num += visible_strokes_for_lines.
size();
864 Array<int> size_per_editable_stroke(visible_strokes_for_lines.
size());
866 points_by_curve_eval, visible_strokes_for_lines, size_per_editable_stroke);
868 total_line_ids_num += std::accumulate(
869 size_per_editable_stroke.
begin(), size_per_editable_stroke.
end(), 0);
874 if (layer.is_locked()) {
878 drawing_start_offset +=
curves.points_num();
879 const IndexMask selected_editable_strokes =
881 object, info.drawing, info.layer_index, memory);
883 Array<int> size_per_selected_editable_stroke(selected_editable_strokes.
size());
885 points_by_curve, selected_editable_strokes, size_per_selected_editable_stroke);
888 visible_points_num += std::accumulate(
889 size_per_selected_editable_stroke.
begin(), size_per_selected_editable_stroke.
end(), 0);
899 layer_space_to_object_space,
902 &drawing_line_start_offset,
903 &total_line_ids_num);
906 object, info.drawing, info.layer_index, memory);
913 bezier_points.
size());
927 copy_transformed_positions(
928 positions_slice_left, range, layer_space_to_object_space, positions_slice_left);
929 copy_transformed_positions(
930 positions_slice_right, range, layer_space_to_object_space, positions_slice_right);
945 drawing_line_start_offset + bezier_points.
size(), bezier_points.
size());
947 drawing_line_start_offset + bezier_points.
size() * 2, bezier_points.
size());
961 copy_transformed_positions(positions_eval_center_slice,
963 layer_space_to_object_space,
964 positions_eval_center_slice);
976 visible_points_num += bezier_points.
size() * 2;
977 drawing_start_offset += bezier_points.
size() * 2;
980 drawing_line_start_offset += bezier_points.
size() * 3;
981 total_line_ids_num += bezier_points.
size() * 3;
984 total_line_ids_num += bezier_points.
size();
1000 drawing_start_offset = 0;
1001 drawing_line_start_offset = 0;
1003 const Layer *layer = layers[info.layer_index];
1007 object, info.drawing, info.layer_index, &elb, memory, &drawing_line_start_offset);
1009 if (!layer->is_locked()) {
1011 object, info.drawing, info.layer_index, &elb, memory, &drawing_line_start_offset);
1013 object, info.drawing, info.layer_index, &elb, memory, &drawing_line_start_offset);
1015 object, info.drawing, info.layer_index, &epb, memory, &drawing_start_offset);
1017 object, info.drawing, info.layer_index, &epb, memory, &drawing_start_offset);
1063 grease_pencil.
runtime->batch_cache);
1065 if (cache->
vbo !=
nullptr) {
1079 int total_verts_num = 0;
1080 int total_triangles_num = 0;
1090 object, info.drawing, memory);
1092 const int num_curves = visible_strokes.
size();
1093 const int verts_start_offsets_size = num_curves;
1094 const int tris_start_offsets_size = num_curves;
1095 Array<int> verts_start_offsets(verts_start_offsets_size);
1096 Array<int> tris_start_offsets(tris_start_offsets_size);
1101 for (
const int curve_i :
curves.curves_range()) {
1102 IndexRange points = points_by_curve[curve_i];
1103 if (visible_strokes.
contains(curve_i)) {
1104 tris_start_offsets[
pos] = t_offset;
1107 if (points.
size() >= 3) {
1108 t_offset += points.
size() - 2;
1116 IndexRange points = points_by_curve[curve_i];
1117 const bool is_cyclic = cyclic[curve_i] && (points.
size() > 2);
1123 verts_start_offsets[
pos] = v_offset;
1125 num_points += points.
size();
1129 total_verts_num += num_points + num_cyclic + num_curves * 2;
1130 total_triangles_num += (num_points + num_cyclic) * 2;
1131 total_triangles_num += info.drawing.triangles().size();
1133 verts_start_offsets_per_visible_drawing.
append(std::move(verts_start_offsets));
1134 tris_start_offsets_per_visible_drawing.
append(std::move(tris_start_offsets));
1154 for (
const int drawing_i : drawings.
index_range()) {
1160 if (
curves.evaluated_points_num() == 0) {
1169 curves.ensure_can_interpolate_to_evaluated();
1203 const Span<int> verts_start_offsets = verts_start_offsets_per_visible_drawing[drawing_i];
1204 const Span<int> tris_start_offsets = tris_start_offsets_per_visible_drawing[drawing_i];
1207 object, info.
drawing, memory);
1209 curves.ensure_evaluated_lengths();
1211 auto populate_point = [&](
IndexRange verts_range,
1225 s_vert.radius =
math::max(radii[point_i], 0.0f) *
1230 s_vert.opacity = opacities[point_i] *
1232 s_vert.point_id = verts_range[idx];
1233 s_vert.stroke_id = verts_range.
first();
1237 rotations[point_i], stroke_point_aspect_ratios[curve_i], stroke_softness[curve_i]);
1238 s_vert.u_stroke = u_stroke;
1241 copy_v4_v4(c_vert.vcol, vertex_colors[point_i]);
1242 copy_v4_v4(c_vert.fcol, stroke_fill_colors[curve_i]);
1243 c_vert.fcol[3] = (
int(c_vert.fcol[3] * 10000.0f) * 10.0f) + fill_opacities[curve_i];
1251 const IndexRange points = points_by_curve[curve_i];
1252 const bool is_cyclic = cyclic[curve_i] && (points.
size() > 2);
1253 const int verts_start_offset = verts_start_offsets[
pos];
1254 const int tris_start_offset = tris_start_offsets[
pos];
1255 const int num_verts = 1 + points.
size() + (
is_cyclic ? 1 : 0) + 1;
1259 const float4x2 texture_matrix = texture_matrices[curve_i] * object_space_to_layer_space;
1261 const Span<float> lengths =
curves.evaluated_lengths_for_curve(curve_i, cyclic[curve_i]);
1264 verts_slice.
first().mat = -1;
1267 if (points.
size() >= 3) {
1269 for (
const uint3 tri : tris_slice) {
1278 const float u_scale = u_scales[curve_i];
1279 const float u_translation = u_translations[curve_i];
1281 const int idx = i + 1;
1282 const float u_stroke = u_scale * (i > 0 ? lengths[i - 1] : 0.0f) + u_translation;
1283 populate_point(verts_range,
1285 start_caps[curve_i],
1296 const int idx = points.
size() + 1;
1297 const float u = points.
size() > 1 ? lengths[points.
size() - 1] : 0.0f;
1298 const float u_stroke = u_scale * u + u_translation;
1299 populate_point(verts_range,
1301 start_caps[curve_i],
1312 verts_slice.
last().mat = -1;
1317 verts[total_verts_num + 0].mat = -1;
1318 verts[total_verts_num + 1].mat = -1;
1341 grease_pencil.
runtime->batch_cache);
1365 object, info.drawing, memory);
1368 const IndexRange points = points_by_curve[curve_i];
1369 const int point_len = points.
size();
1370 const int point_start = index_len;
1371 const bool is_cyclic = cyclic[curve_i] && (point_len > 2);
1373 index_len += point_len + (
is_cyclic ? 1 : 0) + 1;
1375 index_start_per_curve.
append(point_start);
1377 is_onion_per_curve.
append(info.onion_id != 0);
1380 index_start_per_curve.
append(index_len);
1389 for (const int curve : range) {
1391 const IndexRange offset_range = range_per_curve[curve].drop_back(1);
1394 const IndexRange index_range = offset_range.shift(curve + 1);
1395 if (is_onion_per_curve[curve]) {
1396 for (const int i : offset_range.index_range()) {
1397 indices[offset_range[i]] = gpu::RESTART_INDEX;
1399 if (cyclic_per_curve[curve]) {
1400 indices[offset_range.last()] = gpu::RESTART_INDEX;
1404 for (const int i : offset_range.index_range()) {
1405 indices[offset_range[i]] = index_range[i];
1407 if (cyclic_per_curve[curve]) {
1408 indices[offset_range.last()] = index_range.first();
1411 indices[offset_range.one_after_last()] = gpu::RESTART_INDEX;
1421 cache->is_dirty =
false;
1430 grease_pencil->
runtime->batch_cache);
1431 if (cache ==
nullptr) {
1456 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 struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
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
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
#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)
void GPU_indexbuf_build_in_place_ex(GPUIndexBufBuilder *builder, uint index_min, uint index_max, bool uses_restart_indices, blender::gpu::IndexBuf *elem)
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)
void GPU_indexbuf_add_primitive_restart(GPUIndexBufBuilder *)
blender::gpu::IndexBuf * GPU_indexbuf_calloc()
blender::gpu::IndexBuf * GPU_indexbuf_build(GPUIndexBufBuilder *)
void GPU_indexbuf_add_generic_vert(GPUIndexBufBuilder *, uint v)
void GPU_indexbuf_init_ex(GPUIndexBufBuilder *, GPUPrimType, uint index_len, uint vertex_len)
void GPU_indexbuf_add_tri_verts(GPUIndexBufBuilder *, uint v1, uint v2, uint v3)
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
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
MutableSpan< T > as_mutable_span()
static IndexMask from_predicate(const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate)
static IndexMask from_intersection(const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory)
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 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
static VArray ForContainer(ContainerT container)
void append(const T &value)
IndexRange index_range() const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) const
Span< float4x2 > texture_matrices() const
const bke::CurvesGeometry & strokes() const
VArray< float > radii() const
Span< uint3 > triangles() const
VArray< ColorGeometry4f > fill_colors() const
VArray< float > opacities() const
float4x4 to_object_space(const Object &object) const
IndexRange index_range() const
bool contains(int64_t query_index) const
void foreach_index(Fn &&fn) const
#define GREASE_PENCIL_EDIT_STROKE_START
#define GREASE_PENCIL_EDIT_STROKE_END
static bool is_cyclic(const Nurb *nu)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
#define GPENCIL_MATERIAL_BUFFER_LEN
#define GP_IS_STROKE_VERTEX_BIT
#define GP_VERTEX_ID_SHIFT
#define unit_float_to_uchar_clamp(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)
constexpr float LEGACY_RADIUS_CONVERSION_FACTOR
static bool grease_pencil_batch_cache_valid(const GreasePencil &grease_pencil)
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)
static void index_buf_add_nurbs_lines(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, GPUIndexBufBuilder *elb, IndexMaskMemory &memory, int *r_drawing_line_start_offset)
blender::gpu::Batch * DRW_cache_grease_pencil_get(const Scene *scene, Object *ob)
void DRW_grease_pencil_batch_cache_validate(GreasePencil *grase_pencil)
static void grease_pencil_batch_cache_clear(GreasePencil &grease_pencil)
static IndexMask grease_pencil_get_visible_nurbs_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
static void index_buf_add_bezier_line_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, GPUIndexBufBuilder *epb, IndexMaskMemory &memory, int *r_drawing_start_offset)
blender::gpu::Batch * DRW_cache_grease_pencil_face_wireframe_get(const Scene *scene, Object *ob)
static void index_buf_add_points(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, GPUIndexBufBuilder *epb, IndexMaskMemory &memory, int *r_drawing_start_offset)
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)
static void grease_pencil_weight_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
void DRW_grease_pencil_batch_cache_free(GreasePencil *grase_pencil)
static VArray< T > attribute_interpolate(const VArray< T > &input, const bke::CurvesGeometry &curves)
static GreasePencilBatchCache * grease_pencil_batch_cache_get(GreasePencil &grease_pencil)
gpu::VertBuf * DRW_cache_grease_pencil_position_buffer_get(const Scene *scene, Object *ob)
blender::gpu::Batch * DRW_cache_grease_pencil_edit_lines_get(const Scene *scene, Object *ob)
static IndexMask grease_pencil_get_visible_non_nurbs_curves(Object &object, const bke::greasepencil::Drawing &drawing, IndexMaskMemory &memory)
static IndexMask grease_pencil_get_visible_nurbs_curves(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
blender::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)
blender::gpu::Batch * DRW_cache_grease_pencil_edit_points_get(const Scene *scene, Object *ob)
static void index_buf_add_line_points(Object &object, const bke::greasepencil::Drawing &drawing, int, GPUIndexBufBuilder *elb, IndexMaskMemory &memory, int *r_drawing_line_start_offset)
static GPUVertFormat * grease_pencil_stroke_format()
static GPUVertFormat * grease_pencil_color_format()
void DRW_grease_pencil_batch_cache_dirty_tag(GreasePencil *grase_pencil, int mode)
blender::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 copy_transformed_positions(const Span< float3 > src_positions, const IndexRange range, const float4x4 &transform, MutableSpan< float3 > dst_positions)
static void grease_pencil_geom_batch_ensure(Object &object, const GreasePencil &grease_pencil, const Scene &scene)
BLI_INLINE int32_t pack_rotation_aspect_hardness(float rot, float asp, float softness)
gpu::VertBuf * DRW_cache_grease_pencil_color_buffer_get(const Scene *scene, Object *ob)
static void index_buf_add_bezier_lines(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, GPUIndexBufBuilder *elb, IndexMaskMemory &memory, int *r_drawing_line_start_offset)
IndexMask retrieve_editable_and_selected_strokes(Object &object, const bke::greasepencil::Drawing &drawing, int layer_index, IndexMaskMemory &memory)
IndexMask retrieve_visible_bezier_handle_points(Object &object, const bke::greasepencil::Drawing &drawing, const 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)
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)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
void gather_group_sizes(OffsetIndices< int > offsets, const IndexMask &mask, MutableSpan< int > sizes)
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, 3 > uint3
MatBase< float, 4, 4 > float4x4
VecBase< float, 4 > float4
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_line_indices
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