Blender V4.3
BKE_grease_pencil.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include <atomic>
13
14#include "BLI_array_utils.hh"
15#include "BLI_color.hh"
16#include "BLI_function_ref.hh"
18#include "BLI_map.hh"
21#include "BLI_shared_cache.hh"
22#include "BLI_utility_mixins.hh"
23#include "BLI_virtual_array.hh"
24
27
28struct Main;
29struct Depsgraph;
30struct Scene;
31struct Object;
32struct Material;
33
34namespace blender::bke::bake {
35struct BakeMaterialsList;
36}
37
38namespace blender::bke {
39
40namespace greasepencil {
41
42/* Previously, Grease Pencil used a radius convention where 1 `px` = 0.001 units. This `px`
43 * was the brush size which would be stored in the stroke thickness and then scaled by the
44 * point pressure factor. Finally, the render engine would divide this thickness value by
45 * 2000 (we're going from a thickness to a radius, hence the factor of two) to convert back
46 * into blender units. With Grease Pencil 3, the radius is no longer stored in `px` space,
47 * but in blender units (world space) directly. Also note that there is no longer a stroke
48 * "thickness" attribute, the radii are directly stored on the points.
49 * For compatibility, legacy thickness values have to be multiplied by this factor. */
50constexpr float LEGACY_RADIUS_CONVERSION_FACTOR = 1.0f / 2000.0f;
51
53 public:
62
67
68 /*
69 * Matrices that transform from a 3D point in layer-space to a 2D point in texture-space. This is
70 * stored per curve.
71 */
73
79 mutable std::atomic<int> user_count = 1;
80};
81
83 public:
84 Drawing();
85 Drawing(const Drawing &other);
86 Drawing(Drawing &&other);
87 Drawing &operator=(const Drawing &other);
88 Drawing &operator=(Drawing &&other);
89 ~Drawing();
90
91 const bke::CurvesGeometry &strokes() const;
96 Span<uint3> triangles() const;
101
103
108 void tag_positions_changed(const IndexMask &changed_curves);
109
115 void tag_topology_changed(const IndexMask &changed_curves);
116
126 void set_texture_matrices(Span<float4x2> matrices, const IndexMask &selection);
127
131 VArray<float> radii() const;
133
139 VArray<float> opacities() const;
141
148
155
160 void add_user() const;
165 void remove_user() const;
169 bool is_instanced() const;
173 bool has_users() const;
177 int user_count() const;
178
179 private:
183 OffsetIndices<int> triangle_offsets() const;
184};
185static_assert(sizeof(Drawing) == sizeof(::GreasePencilDrawing));
186
193static_assert(sizeof(DrawingReference) == sizeof(::GreasePencilDrawingReference));
194
201
202class LayerGroup;
203class Layer;
204
205/* Defines the common functions used by #TreeNode, #Layer, and #LayerGroup.
206 * NOTE: Because we cannot mix C-style and C++ inheritance (all of these three classes wrap a
207 * C-struct that already uses "inheritance"), we define and implement these methods on all these
208 * classes individually. This just means that we can call `layer->name()` directly instead of
209 * having to write `layer->as_node().name()`. For #Layer and #LayerGroup the calls are just
210 * forwarded to #TreeNode. */
211#define TREENODE_COMMON_METHODS \
212 StringRefNull name() const; \
213 void set_name(StringRefNull new_name); \
214 bool is_visible() const; \
215 void set_visible(bool visible); \
216 bool is_locked() const; \
217 void set_locked(bool locked); \
218 bool is_editable() const; \
219 bool is_selected() const; \
220 void set_selected(bool selected); \
221 bool use_onion_skinning() const; \
222 bool use_masks() const; \
223 bool ignore_locked_materials() const; \
224 bool is_child_of(const LayerGroup &group) const;
225
226/* Implements the forwarding of the methods defined by #TREENODE_COMMON_METHODS. */
227#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name) \
228 inline StringRefNull class_name::name() const \
229 { \
230 return this->as_node().name(); \
231 } \
232 inline void class_name::set_name(StringRefNull new_name) \
233 { \
234 return this->as_node().set_name(new_name); \
235 } \
236 inline bool class_name::is_visible() const \
237 { \
238 return this->as_node().is_visible(); \
239 } \
240 inline void class_name::set_visible(const bool visible) \
241 { \
242 this->as_node().set_visible(visible); \
243 } \
244 inline bool class_name::is_locked() const \
245 { \
246 return this->as_node().is_locked(); \
247 } \
248 inline void class_name::set_locked(const bool locked) \
249 { \
250 this->as_node().set_locked(locked); \
251 } \
252 inline bool class_name::is_editable() const \
253 { \
254 return this->as_node().is_editable(); \
255 } \
256 inline bool class_name::is_selected() const \
257 { \
258 return this->as_node().is_selected(); \
259 } \
260 inline void class_name::set_selected(const bool selected) \
261 { \
262 this->as_node().set_selected(selected); \
263 } \
264 inline bool class_name::use_onion_skinning() const \
265 { \
266 return this->as_node().use_onion_skinning(); \
267 } \
268 inline bool class_name::use_masks() const \
269 { \
270 return this->as_node().use_masks(); \
271 } \
272 inline bool class_name::ignore_locked_materials() const \
273 { \
274 return this->as_node().ignore_locked_materials(); \
275 } \
276 inline bool class_name::is_child_of(const LayerGroup &group) const \
277 { \
278 return this->as_node().is_child_of(group); \
279 }
280
287 public:
288 TreeNode();
291 TreeNode(const TreeNode &other);
292 ~TreeNode();
293
294 public:
295 /* Define the common functions for #TreeNode. */
300 bool is_group() const;
304 bool is_layer() const;
305
309 const Layer &as_layer() const;
310 Layer &as_layer();
311
315 const LayerGroup &as_group() const;
317
321 const LayerGroup *parent_group() const;
323
324 const TreeNode *parent_node() const;
326
330 int64_t depth() const;
331};
332static_assert(sizeof(TreeNode) == sizeof(::GreasePencilLayerTreeNode));
333
338 public:
339 LayerMask();
340 explicit LayerMask(StringRefNull name);
341 LayerMask(const LayerMask &other);
342 ~LayerMask();
343};
344static_assert(sizeof(LayerMask) == sizeof(::GreasePencilLayerMask));
345
351
352 /* Map of frame keys describing the transformation of the frames. Keys of the map are the source
353 * frame indices, and the values of the map are the destination frame indices. */
355
356 /* Copy of the layer frames, stored in two separate maps :
357 * - frames_static contains the frames not affected by the transformation,
358 * - frames_transformed contains the frames affected by the transformation.
359 * This allows to display the transformation while running, without removing any drawing.
360 */
363
364 /* Map containing the duration (in frames) for each frame in the layer that has a fixed duration,
365 * i.e. each frame that is not an implicit hold. */
367
368 /* Temporary copy of duplicated frames before we decide on a place to insert them.
369 * Used in the move+duplicate operator. */
371
373};
374
375/*
376 * The key type for a `GreasePencilFrame` in the frames map.
377 *
378 * This is either the start or end frame (scene time) of a `GreasePencilFrame`.
379 *
380 * If the key refers to a end frame, the value in the map for this key is
381 * `GreasePencilFrame::end()`.
382 * Note that end frame is exclusive with regards to the frame duration. E.g. if a frame starts at
383 * 10 and the end frame is at 15, then the duration is 4.
384 */
386
388 public:
424
425 /* Runtime data used for frame transformations. */
427
428 public:
429 /* Reset all runtime data. */
430 void clear();
431};
432
438 public:
439 using SortedKeysIterator = const int *;
440
441 Layer();
442 explicit Layer(StringRefNull name);
443 Layer(const Layer &other);
444 ~Layer();
445
446 /* Define the common functions for #TreeNode. */
451 const TreeNode &as_node() const;
452 TreeNode &as_node();
453
457 const LayerGroup &parent_group() const;
459
465
469 bool is_empty() const;
470
482 GreasePencilFrame *add_frame(FramesMapKeyT key, int duration = 0);
493 bool remove_frame(FramesMapKeyT key);
494
500
505 int drawing_index_at(const int frame_number) const;
506
510 bool has_drawing_at(const int frame_number) const;
511
516 std::optional<int> start_frame_at(int frame_number) const;
517
522 int sorted_keys_index_at(int frame_number) const;
527 SortedKeysIterator sorted_keys_iterator_at(int frame_number) const;
528
532 const GreasePencilFrame *frame_at(const int frame_number) const;
533 GreasePencilFrame *frame_at(const int frame_number);
534
540 int get_frame_duration_at(const int frame_number) const;
541
543
549
554
559
560 float4x4 parent_inverse() const;
561
566
572 void set_local_transform(const float4x4 &transform);
573
577 float4x4 to_object_space(const Object &object) const;
578
582 float4x4 to_world_space(const Object &object) const;
583
589 void set_parent_bone_name(const char *new_name);
590
596 void set_view_layer_name(const char *new_name);
597
598 private:
603 std::optional<FramesMapKeyT> frame_key_at(int frame_number) const;
604
605 GreasePencilFrame *add_frame_internal(int frame_number);
606
613 SortedKeysIterator remove_leading_end_frames_in_range(SortedKeysIterator begin,
615
619 float4x4 parent_to_world(const Object &parent) const;
620};
621static_assert(sizeof(Layer) == sizeof(::GreasePencilLayer));
622
642
647 friend struct ::GreasePencil;
648
649 public:
650 LayerGroup();
651 explicit LayerGroup(StringRefNull name);
652 LayerGroup(const LayerGroup &other);
653 ~LayerGroup();
654
655 LayerGroup &operator=(const LayerGroup &other);
656
657 public:
658 /* Define the common functions for #TreeNode. */
663 const TreeNode &as_node() const;
664 TreeNode &as_node();
665
669 bool is_empty() const;
670
675
679 int64_t num_nodes_total() const;
680
686
692
698
702 const TreeNode *find_node_by_name(StringRefNull name) const;
704
708 void print_nodes(StringRefNull header) const;
709
714
719
720 protected:
724 TreeNode &add_node(TreeNode &node);
725
729 void add_node_before(TreeNode &node, TreeNode &link);
733 void add_node_after(TreeNode &node, TreeNode &link);
734
738 void move_node_up(TreeNode &node, int step = 1);
739 void move_node_down(TreeNode &node, int step = 1);
743 void move_node_top(TreeNode &node);
744 void move_node_bottom(TreeNode &node);
745
750 bool unlink_node(TreeNode &link, bool keep_children = false);
751
752 private:
753 void ensure_nodes_cache() const;
754 void tag_nodes_cache_dirty() const;
755};
756static_assert(sizeof(LayerGroup) == sizeof(::GreasePencilLayerTreeGroup));
757
758inline void Drawing::add_user() const
759{
760 this->runtime->user_count.fetch_add(1, std::memory_order_relaxed);
761}
762inline void Drawing::remove_user() const
763{
764 this->runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
765}
766inline bool Drawing::is_instanced() const
767{
768 return this->runtime->user_count.load(std::memory_order_relaxed) > 1;
769}
770inline bool Drawing::has_users() const
771{
772 return this->runtime->user_count.load(std::memory_order_relaxed) > 0;
773}
774inline int Drawing::user_count() const
775{
776 return this->runtime->user_count.load(std::memory_order_relaxed);
777}
778
779inline bool TreeNode::is_group() const
780{
781 return this->type == GP_LAYER_TREE_GROUP;
782}
783inline bool TreeNode::is_layer() const
784{
785 return this->type == GP_LAYER_TREE_LEAF;
786}
787inline bool TreeNode::is_visible() const
788{
789 return ((this->flag & GP_LAYER_TREE_NODE_HIDE) == 0) &&
790 (!this->parent_group() || this->parent_group()->as_node().is_visible());
791}
792inline void TreeNode::set_visible(const bool visible)
793{
795}
796inline bool TreeNode::is_locked() const
797{
798 return ((this->flag & GP_LAYER_TREE_NODE_LOCKED) != 0) ||
799 (this->parent_group() && this->parent_group()->as_node().is_locked());
800}
801inline void TreeNode::set_locked(const bool locked)
802{
804}
805inline bool TreeNode::is_editable() const
806{
807 return this->is_visible() && !this->is_locked();
808}
809inline bool TreeNode::is_selected() const
810{
811 return (this->flag & GP_LAYER_TREE_NODE_SELECT) != 0;
812}
813inline void TreeNode::set_selected(const bool selected)
814{
816}
817inline bool TreeNode::use_onion_skinning() const
818{
819 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING) == 0) &&
820 (!this->parent_group() || this->parent_group()->as_node().use_onion_skinning());
821}
822inline bool TreeNode::use_masks() const
823{
824 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0) &&
825 (!this->parent_group() || this->parent_group()->as_node().use_masks());
826}
827inline bool TreeNode::ignore_locked_materials() const
828{
830}
831inline bool TreeNode::is_child_of(const LayerGroup &group) const
832{
833 if (const LayerGroup *parent = this->parent_group()) {
834 if (parent == &group) {
835 return true;
836 }
837 return parent->is_child_of(group);
838 }
839 return false;
840}
841inline StringRefNull TreeNode::name() const
842{
843 return (this->GreasePencilLayerTreeNode::name != nullptr) ?
845 StringRefNull();
846}
847inline const TreeNode &LayerGroup::as_node() const
848{
849 return *reinterpret_cast<const TreeNode *>(this);
850}
852{
853 return *reinterpret_cast<TreeNode *>(this);
854}
855inline bool LayerGroup::is_empty() const
856{
857 return BLI_listbase_is_empty(&this->children);
858}
859
860inline const TreeNode &Layer::as_node() const
861{
862 return *reinterpret_cast<const TreeNode *>(this);
863}
865{
866 return *reinterpret_cast<TreeNode *>(this);
867}
868
870inline bool Layer::is_empty() const
871{
872 return (this->frames().is_empty());
873}
874inline const LayerGroup &Layer::parent_group() const
875{
876 return *this->as_node().parent_group();
877}
879{
880 return *this->as_node().parent_group();
881}
882
884
885} // namespace greasepencil
886
888 public:
892 void *batch_cache = nullptr;
896 int eval_frame = 0;
901 bool is_drawing_stroke = false;
905 bool temp_use_eraser = false;
906 float temp_eraser_size = 0.0f;
907
908 std::unique_ptr<bake::BakeMaterialsList> bake_materials;
909
910 public:
913};
914
916 public:
919
920 std::optional<Span<float3>> positions() const;
921 std::optional<MutableSpan<float3>> positions_for_write();
922};
923
928 public:
933
938
943 std::optional<Array<GreasePencilDrawingEditHints>> drawing_hints;
944};
945
946} // namespace blender::bke
947
948inline blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap()
949{
950 return *reinterpret_cast<blender::bke::greasepencil::Drawing *>(this);
951}
952inline const blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap() const
953{
954 return *reinterpret_cast<const blender::bke::greasepencil::Drawing *>(this);
955}
956
957inline blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
958{
959 return *reinterpret_cast<blender::bke::greasepencil::DrawingReference *>(this);
960}
961inline const blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
962 const
963{
964 return *reinterpret_cast<const blender::bke::greasepencil::DrawingReference *>(this);
965}
966
967inline GreasePencilFrame GreasePencilFrame::end()
968{
969 return GreasePencilFrame{-1, 0, 0};
970}
971
972inline bool GreasePencilFrame::is_end() const
973{
974 return this->drawing_index == -1;
975}
976
977inline bool GreasePencilFrame::is_implicit_hold() const
978{
979 return (this->flag & GP_FRAME_IMPLICIT_HOLD) != 0;
980}
981
982inline bool GreasePencilFrame::is_selected() const
983{
984 return (this->flag & GP_FRAME_SELECTED) != 0;
985}
986
987inline blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap()
988{
989 return *reinterpret_cast<blender::bke::greasepencil::TreeNode *>(this);
990}
991inline const blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap() const
992{
993 return *reinterpret_cast<const blender::bke::greasepencil::TreeNode *>(this);
994}
995
996inline blender::bke::greasepencil::Layer &GreasePencilLayer::wrap()
997{
998 return *reinterpret_cast<blender::bke::greasepencil::Layer *>(this);
999}
1000inline const blender::bke::greasepencil::Layer &GreasePencilLayer::wrap() const
1001{
1002 return *reinterpret_cast<const blender::bke::greasepencil::Layer *>(this);
1003}
1004
1005inline blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap()
1006{
1007 return *reinterpret_cast<blender::bke::greasepencil::LayerGroup *>(this);
1008}
1009inline const blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap() const
1010{
1011 return *reinterpret_cast<const blender::bke::greasepencil::LayerGroup *>(this);
1012}
1013
1014inline const GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index) const
1015{
1016 BLI_assert(index >= 0 && index < this->drawings().size());
1017 return this->drawings()[index];
1018}
1019inline GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index)
1020{
1021 BLI_assert(index >= 0 && index < this->drawings().size());
1022 return this->drawings()[index];
1023}
1024
1025inline const blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index) const
1026{
1027 return *this->layers()[index];
1028}
1029inline blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index)
1030{
1031 return *this->layers_for_write()[index];
1032}
1033
1034inline const blender::bke::greasepencil::LayerGroup &GreasePencil::root_group() const
1035{
1036 return this->root_group_ptr->wrap();
1037}
1038inline blender::bke::greasepencil::LayerGroup &GreasePencil::root_group()
1039{
1040 return this->root_group_ptr->wrap();
1041}
1042
1043inline bool GreasePencil::has_active_layer() const
1044{
1045 return (this->active_node != nullptr) && (this->active_node->wrap().is_layer());
1046}
1047
1048inline bool GreasePencil::has_active_group() const
1049{
1050 return (this->active_node != nullptr) && (this->active_node->wrap().is_group());
1051}
1052
1054
1055void *BKE_grease_pencil_add(Main *bmain, const char *name);
1065
1070 GreasePencil *grease_pencil_dst);
1071
1072void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name);
1073
1074void BKE_grease_pencil_data_update(Depsgraph *depsgraph, Scene *scene, Object *object);
1075void BKE_grease_pencil_duplicate_drawing_array(const GreasePencil *grease_pencil_src,
1076 GreasePencil *grease_pencil_dst);
1077
1079 /* This is used when doing "move only origin" in object_data_transform.cc.
1080 * radius is needs to be stored here as it is tied to object scale. */
1081 float co[3];
1082 float radius;
1083};
1084
1088int BKE_grease_pencil_stroke_point_count(const GreasePencil &grease_pencil);
1092void BKE_grease_pencil_point_coords_get(const GreasePencil &grease_pencil,
1093 GreasePencilPointCoordinates *elem_data);
1098 GreasePencilPointCoordinates *elem_data);
1104 const blender::float4x4 &mat);
1105
1108 Object *ob,
1109 const char *name,
1110 int *r_index);
1113 Object *ob,
1114 const char *name,
1115 int *r_index);
1118 Object *ob,
1119 Brush *brush);
1121 Object *ob,
1122 Brush *brush);
1125void BKE_grease_pencil_material_remap(GreasePencil *grease_pencil, const uint *remap, int totcol);
1126void BKE_grease_pencil_material_index_remove(GreasePencil *grease_pencil, int index);
1127
1129 const GreasePencil *grease_pencil);
1130bool BKE_grease_pencil_material_index_used(GreasePencil *grease_pencil, int index);
void BKE_grease_pencil_point_coords_get(const GreasePencil &grease_pencil, GreasePencilPointCoordinates *elem_data)
void * BKE_grease_pencil_add(Main *bmain, const char *name)
#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name)
Material * BKE_grease_pencil_object_material_ensure_from_active_input_brush(Main *bmain, Object *ob, Brush *brush)
void BKE_grease_pencil_copy_parameters(const GreasePencil &src, GreasePencil &dst)
void BKE_grease_pencil_material_remap(GreasePencil *grease_pencil, const uint *remap, int totcol)
void BKE_grease_pencil_material_index_remove(GreasePencil *grease_pencil, int index)
Material * BKE_grease_pencil_object_material_ensure_active(Object *ob)
void BKE_grease_pencil_point_coords_apply_with_mat4(GreasePencil &grease_pencil, GreasePencilPointCoordinates *elem_data, const blender::float4x4 &mat)
void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name)
void BKE_grease_pencil_point_coords_apply(GreasePencil &grease_pencil, GreasePencilPointCoordinates *elem_data)
bool BKE_grease_pencil_references_cyclic_check(const GreasePencil *id_reference, const GreasePencil *grease_pencil)
Material * BKE_grease_pencil_object_material_new(Main *bmain, Object *ob, const char *name, int *r_index)
Material * BKE_grease_pencil_object_material_ensure_from_brush(Main *bmain, Object *ob, Brush *brush)
void BKE_grease_pencil_data_update(Depsgraph *depsgraph, Scene *scene, Object *object)
void BKE_grease_pencil_nomain_to_grease_pencil(GreasePencil *grease_pencil_src, GreasePencil *grease_pencil_dst)
bool BKE_grease_pencil_drawing_attribute_required(const GreasePencilDrawing *, const char *name)
Material * BKE_grease_pencil_object_material_ensure_from_active_input_material(Object *ob)
void BKE_grease_pencil_duplicate_drawing_array(const GreasePencil *grease_pencil_src, GreasePencil *grease_pencil_dst)
Material * BKE_grease_pencil_object_material_from_brush_get(Object *ob, Brush *brush)
Material * BKE_grease_pencil_brush_material_get(Brush *brush)
int BKE_grease_pencil_stroke_point_count(const GreasePencil &grease_pencil)
GreasePencil * BKE_grease_pencil_new_nomain()
void BKE_grease_pencil_copy_layer_parameters(const blender::bke::greasepencil::Layer &src, blender::bke::greasepencil::Layer &dst)
void BKE_grease_pencil_copy_layer_group_parameters(const blender::bke::greasepencil::LayerGroup &src, blender::bke::greasepencil::LayerGroup &dst)
GreasePencil * BKE_grease_pencil_copy_for_eval(const GreasePencil *grease_pencil_src)
bool BKE_grease_pencil_material_index_used(GreasePencil *grease_pencil, int index)
int BKE_grease_pencil_object_material_index_get_by_name(Object *ob, const char *name)
Material * BKE_grease_pencil_object_material_ensure_by_name(Main *bmain, Object *ob, const char *name, int *r_index)
#define BLI_assert(a)
Definition BLI_assert.h:50
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
unsigned int uint
#define SET_FLAG_FROM_TEST(value, test, flag)
GreasePencilLayerTreeNodeType
@ GP_LAYER_TREE_GROUP
@ GP_FRAME_IMPLICIT_HOLD
@ GP_LAYER_TREE_NODE_IGNORE_LOCKED_MATERIALS
@ GP_LAYER_TREE_NODE_LOCKED
@ GP_LAYER_TREE_NODE_HIDE
@ GP_LAYER_TREE_NODE_SELECT
@ GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING
@ GP_LAYER_TREE_NODE_HIDE_MASKS
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
std::optional< MutableSpan< float3 > > positions_for_write()
std::optional< Span< float3 > > positions() const
GreasePencilEditHints(const GreasePencil &grease_pencil_id_orig)
std::optional< Array< GreasePencilDrawingEditHints > > drawing_hints
std::unique_ptr< bake::BakeMaterialsList > bake_materials
SharedCache< Vector< float3 > > curve_plane_normals_cache
SharedCache< Vector< int > > triangle_offsets_cache
SharedCache< Vector< float4x2 > > curve_texture_matrices
SharedCache< Vector< uint3 > > triangles_cache
VArray< ColorGeometry4f > vertex_colors() const
Drawing & operator=(const Drawing &other)
Span< float3 > curve_plane_normals() const
MutableSpan< float > opacities_for_write()
Span< float4x2 > texture_matrices() const
MutableSpan< float > radii_for_write()
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
VArray< ColorGeometry4f > fill_colors() const
VArray< float > opacities() const
MutableSpan< ColorGeometry4f > fill_colors_for_write()
MutableSpan< ColorGeometry4f > vertex_colors_for_write()
void set_texture_matrices(Span< float4x2 > matrices, const IndexMask &selection)
TreeNode & add_node(TreeNode &node)
void move_node_down(TreeNode &node, int step=1)
bool unlink_node(TreeNode &link, bool keep_children=false)
Span< const Layer * > layers() const
void add_node_before(TreeNode &node, TreeNode &link)
void add_node_after(TreeNode &node, TreeNode &link)
void move_node_up(TreeNode &node, int step=1)
void print_nodes(StringRefNull header) const
LayerGroup & operator=(const LayerGroup &other)
Span< const LayerGroup * > groups() const
Span< const TreeNode * > nodes() const
const TreeNode * find_node_by_name(StringRefNull name) const
SharedCache< Vector< FramesMapKeyT > > sorted_keys_cache_
Map< FramesMapKeyT, GreasePencilFrame > frames_
SortedKeysIterator sorted_keys_iterator_at(int frame_number) const
void set_parent_bone_name(const char *new_name)
StringRefNull parent_bone_name() const
int sorted_keys_index_at(int frame_number) const
float4x4 to_world_space(const Object &object) const
StringRefNull view_layer_name() const
void set_local_transform(const float4x4 &transform)
void set_view_layer_name(const char *new_name)
bool remove_frame(FramesMapKeyT key)
const Map< FramesMapKeyT, GreasePencilFrame > & frames() const
GreasePencilFrame * add_frame(FramesMapKeyT key, int duration=0)
const GreasePencilFrame * frame_at(const int frame_number) const
bool has_drawing_at(const int frame_number) const
int drawing_index_at(const int frame_number) const
int get_frame_duration_at(const int frame_number) const
std::optional< int > start_frame_at(int frame_number) const
float4x4 to_object_space(const Object &object) const
Span< FramesMapKeyT > sorted_keys() const
const LayerGroup & parent_group() const
Map< FramesMapKeyT, GreasePencilFrame > & frames_for_write()
const TreeNode * parent_node() const
const LayerGroup & as_group() const
const LayerGroup * parent_group() const
const Depsgraph * depsgraph
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
constexpr float LEGACY_RADIUS_CONVERSION_FACTOR
void copy_drawing_array(Span< const GreasePencilDrawingBase * > src_drawings, MutableSpan< GreasePencilDrawingBase * > dst_drawings)
__int64 int64_t
Definition stdint.h:89
GreasePencilDrawingRuntimeHandle * runtime
struct GreasePencilLayerTreeGroup * parent
Map< int, GreasePencilFrame > duplicated_frames_buffer
uint8_t flag
Definition wm_window.cc:138