Blender V5.0
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
11
12#include <atomic>
13
14#include "BLI_color_types.hh"
16#include "BLI_map.hh"
19#include "BLI_offset_indices.hh"
20#include "BLI_shared_cache.hh"
22
24
25struct Brush;
26struct Main;
27struct Depsgraph;
28struct Scene;
29struct Object;
30struct Material;
31
32namespace blender::bke::bake {
34}
35
36namespace blender::bke {
38
39namespace greasepencil {
40
41/* Previously, Grease Pencil used a radius convention where 1 `px` = 0.001 units. This `px`
42 * was the brush size which would be stored in the stroke thickness and then scaled by the
43 * point pressure factor. Finally, the render engine would divide this thickness value by
44 * 2000 (we're going from a thickness to a radius, hence the factor of two) to convert back
45 * into blender units. With Grease Pencil 3, the radius is no longer stored in `px` space,
46 * but in blender units (world space) directly. Also note that there is no longer a stroke
47 * "thickness" attribute, the radii are directly stored on the points.
48 * For compatibility, legacy thickness values have to be multiplied by this factor. */
49constexpr float LEGACY_RADIUS_CONVERSION_FACTOR = 1.0f / 2000.0f;
50
52 public:
61
66
67 /*
68 * Matrices that transform from a 3D point in layer-space to a 2D point in texture-space. This is
69 * stored per curve.
70 */
72
78 mutable std::atomic<int> user_count = 1;
79
84 mutable bool fake_user = false;
85};
86
88 public:
89 Drawing();
90 Drawing(const Drawing &other);
91 Drawing(Drawing &&other);
92 Drawing &operator=(const Drawing &other);
93 Drawing &operator=(Drawing &&other);
94 ~Drawing();
95
96 const bke::CurvesGeometry &strokes() const;
101 Span<int3> triangles() const;
106
108
113 void tag_positions_changed(const IndexMask &changed_curves);
114
120 void tag_topology_changed(const IndexMask &changed_curves);
121
131 void set_texture_matrices(Span<float4x2> matrices, const IndexMask &selection);
132
136 VArray<float> radii() const;
138
144 VArray<float> opacities() const;
146
153
160
165 void add_user() const;
170 void remove_user() const;
174 bool is_instanced() const;
178 bool has_users() const;
182 int user_count() const;
183
184 private:
188 OffsetIndices<int> triangle_offsets() const;
189};
190static_assert(sizeof(Drawing) == sizeof(::GreasePencilDrawing));
191
198static_assert(sizeof(DrawingReference) == sizeof(::GreasePencilDrawingReference));
199
206
207class LayerGroup;
208class Layer;
209
210/* Defines the common functions used by #TreeNode, #Layer, and #LayerGroup.
211 * NOTE: Because we cannot mix C-style and C++ inheritance (all of these three classes wrap a
212 * C-struct that already uses "inheritance"), we define and implement these methods on all these
213 * classes individually. This just means that we can call `layer->name()` directly instead of
214 * having to write `layer->as_node().name()`. For #Layer and #LayerGroup the calls are just
215 * forwarded to #TreeNode. */
216#define TREENODE_COMMON_METHODS \
217 StringRefNull name() const; \
218 void set_name(StringRef new_name); \
219 bool is_visible() const; \
220 void set_visible(bool visible); \
221 bool is_locked() const; \
222 void set_locked(bool locked); \
223 bool is_editable() const; \
224 bool is_selected() const; \
225 void set_selected(bool selected); \
226 bool use_onion_skinning() const; \
227 bool use_masks() const; \
228 bool ignore_locked_materials() const; \
229 bool is_child_of(const LayerGroup &group) const;
230
231/* Implements the forwarding of the methods defined by #TREENODE_COMMON_METHODS. */
232#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name) \
233 inline StringRefNull class_name::name() const \
234 { \
235 return this->as_node().name(); \
236 } \
237 inline void class_name::set_name(const StringRef new_name) \
238 { \
239 return this->as_node().set_name(new_name); \
240 } \
241 inline bool class_name::is_visible() const \
242 { \
243 return this->as_node().is_visible(); \
244 } \
245 inline void class_name::set_visible(const bool visible) \
246 { \
247 this->as_node().set_visible(visible); \
248 } \
249 inline bool class_name::is_locked() const \
250 { \
251 return this->as_node().is_locked(); \
252 } \
253 inline void class_name::set_locked(const bool locked) \
254 { \
255 this->as_node().set_locked(locked); \
256 } \
257 inline bool class_name::is_editable() const \
258 { \
259 return this->as_node().is_editable(); \
260 } \
261 inline bool class_name::is_selected() const \
262 { \
263 return this->as_node().is_selected(); \
264 } \
265 inline void class_name::set_selected(const bool selected) \
266 { \
267 this->as_node().set_selected(selected); \
268 } \
269 inline bool class_name::use_onion_skinning() const \
270 { \
271 return this->as_node().use_onion_skinning(); \
272 } \
273 inline bool class_name::use_masks() const \
274 { \
275 return this->as_node().use_masks(); \
276 } \
277 inline bool class_name::ignore_locked_materials() const \
278 { \
279 return this->as_node().ignore_locked_materials(); \
280 } \
281 inline bool class_name::is_child_of(const LayerGroup &group) const \
282 { \
283 return this->as_node().is_child_of(group); \
284 }
285
292 public:
293 TreeNode();
296 TreeNode(const TreeNode &other);
297 ~TreeNode();
298
299 public:
300 /* Define the common functions for #TreeNode. */
305 bool is_group() const;
309 bool is_layer() const;
310
314 const Layer &as_layer() const;
315 Layer &as_layer();
316
320 const LayerGroup &as_group() const;
322
326 const LayerGroup *parent_group() const;
328
329 const TreeNode *parent_node() const;
331
335 int64_t depth() const;
336};
337static_assert(sizeof(TreeNode) == sizeof(::GreasePencilLayerTreeNode));
338
343 public:
344 LayerMask();
345 explicit LayerMask(StringRef name);
346 LayerMask(const LayerMask &other);
347 ~LayerMask();
348};
349static_assert(sizeof(LayerMask) == sizeof(::GreasePencilLayerMask));
350
356
357 /* Map of frame keys describing the transformation of the frames. Keys of the map are the source
358 * frame indices, and the values of the map are the destination frame indices. */
360
361 /* Copy of the layer frames, stored in two separate maps :
362 * - frames_static contains the frames not affected by the transformation,
363 * - frames_transformed contains the frames affected by the transformation.
364 * This allows to display the transformation while running, without removing any drawing.
365 */
368
369 /* Map containing the duration (in frames) for each frame in the layer that has a fixed duration,
370 * i.e. each frame that is not an implicit hold. */
372
373 /* Temporary copy of duplicated frames before we decide on a place to insert them.
374 * Used in the move+duplicate operator. */
376
378};
379
380/*
381 * The key type for a `GreasePencilFrame` in the frames map.
382 *
383 * This is either the start or end frame (scene time) of a `GreasePencilFrame`.
384 *
385 * If the key refers to a end frame, the value in the map for this key is
386 * `GreasePencilFrame::end()`.
387 * Note that end frame is exclusive with regards to the frame duration. E.g. if a frame starts at
388 * 10 and the end frame is at 15, then the duration is 4.
389 */
390using FramesMapKeyT = int;
391
451
457 public:
458 using SortedKeysIterator = const int *;
459
460 Layer();
461 explicit Layer(StringRef name);
462 Layer(const Layer &other);
463 ~Layer();
464
465 /* Define the common functions for #TreeNode. */
470 const TreeNode &as_node() const;
471 TreeNode &as_node();
472
476 const LayerGroup &parent_group() const;
478
484
488 bool is_empty() const;
489
501 GreasePencilFrame *add_frame(FramesMapKeyT key, int duration = 0);
512 bool remove_frame(FramesMapKeyT key);
513
519
524 int drawing_index_at(const int frame_number) const;
525
529 bool has_drawing_at(const int frame_number) const;
530
535 std::optional<int> start_frame_at(int frame_number) const;
536
541 int sorted_keys_index_at(int frame_number) const;
546 SortedKeysIterator sorted_keys_iterator_at(int frame_number) const;
547
551 const GreasePencilFrame *frame_at(const int frame_number) const;
552 GreasePencilFrame *frame_at(const int frame_number);
553
559 int get_frame_duration_at(const int frame_number) const;
560
562
568
573
578
579 float4x4 parent_inverse() const;
580
585
592
596 float4x4 to_object_space(const Object &object) const;
597
601 float4x4 to_world_space(const Object &object) const;
602
608 void set_parent_bone_name(StringRef new_name);
609
615 void set_view_layer_name(StringRef new_name);
616
617 private:
622 std::optional<FramesMapKeyT> frame_key_at(int frame_number) const;
623
624 GreasePencilFrame *add_frame_internal(int frame_number);
625
632 SortedKeysIterator remove_leading_end_frames_in_range(SortedKeysIterator begin,
634
638 float4x4 parent_to_world(const Object &parent) const;
639};
640static_assert(sizeof(Layer) == sizeof(::GreasePencilLayer));
641
667
672 friend struct ::GreasePencil;
673
674 public:
675 LayerGroup();
676 explicit LayerGroup(StringRef name);
677 LayerGroup(const LayerGroup &other);
678 ~LayerGroup();
679
680 LayerGroup &operator=(const LayerGroup &other);
681
682 public:
683 /* Define the common functions for #TreeNode. */
688 const TreeNode &as_node() const;
689 TreeNode &as_node();
690
694 bool is_empty() const;
695
700
704 int64_t num_nodes_total() const;
705
711
717
723
729
733 bool is_expanded() const;
737 void set_expanded(bool expanded);
738
742 void print_nodes(StringRef header) const;
743
748
753
754 protected:
758 TreeNode &add_node(TreeNode &node);
759
763 void add_node_before(TreeNode &node, TreeNode &link);
767 void add_node_after(TreeNode &node, TreeNode &link);
768
772 void move_node_up(TreeNode &node, int step = 1);
773 void move_node_down(TreeNode &node, int step = 1);
777 void move_node_top(TreeNode &node);
778 void move_node_bottom(TreeNode &node);
779
784 bool unlink_node(TreeNode &link, bool keep_children = false);
785
786 private:
787 void ensure_nodes_cache() const;
788 void tag_nodes_cache_dirty() const;
789};
790static_assert(sizeof(LayerGroup) == sizeof(::GreasePencilLayerTreeGroup));
791
792inline void Drawing::add_user() const
793{
794 this->runtime->user_count.fetch_add(1, std::memory_order_relaxed);
795}
796inline void Drawing::remove_user() const
797{
798 this->runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
799}
800inline bool Drawing::is_instanced() const
801{
802 return this->runtime->user_count.load(std::memory_order_relaxed) > 1;
803}
804inline bool Drawing::has_users() const
805{
806 return this->runtime->user_count.load(std::memory_order_relaxed) > 0;
807}
808inline int Drawing::user_count() const
809{
810 return this->runtime->user_count.load(std::memory_order_relaxed);
811}
812
813inline bool TreeNode::is_group() const
814{
815 return this->type == GP_LAYER_TREE_GROUP;
816}
817inline bool TreeNode::is_layer() const
818{
819 return this->type == GP_LAYER_TREE_LEAF;
820}
821inline bool TreeNode::is_visible() const
822{
823 return ((this->flag & GP_LAYER_TREE_NODE_HIDE) == 0) &&
824 (!this->parent_group() || this->parent_group()->as_node().is_visible());
825}
826inline void TreeNode::set_visible(const bool visible)
827{
829}
830inline bool TreeNode::is_locked() const
831{
832 return ((this->flag & GP_LAYER_TREE_NODE_LOCKED) != 0) ||
833 (this->parent_group() && this->parent_group()->as_node().is_locked());
834}
835inline void TreeNode::set_locked(const bool locked)
836{
838}
839inline bool TreeNode::is_editable() const
840{
841 return this->is_visible() && !this->is_locked();
842}
843inline bool TreeNode::is_selected() const
844{
845 return (this->flag & GP_LAYER_TREE_NODE_SELECT) != 0;
846}
847inline void TreeNode::set_selected(const bool selected)
848{
850}
851inline bool TreeNode::use_onion_skinning() const
852{
853 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING) == 0) &&
854 (!this->parent_group() || this->parent_group()->as_node().use_onion_skinning());
855}
856inline bool TreeNode::use_masks() const
857{
858 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0) &&
859 (!this->parent_group() || this->parent_group()->as_node().use_masks());
860}
861inline bool TreeNode::ignore_locked_materials() const
862{
864}
865inline bool TreeNode::is_child_of(const LayerGroup &group) const
866{
867 if (const LayerGroup *parent = this->parent_group()) {
868 if (parent == &group) {
869 return true;
870 }
871 return parent->is_child_of(group);
872 }
873 return false;
874}
875inline StringRefNull TreeNode::name() const
876{
877 return (this->GreasePencilLayerTreeNode::name != nullptr) ?
879 StringRefNull();
880}
881inline const TreeNode &LayerGroup::as_node() const
882{
883 return *reinterpret_cast<const TreeNode *>(this);
884}
886{
887 return *reinterpret_cast<TreeNode *>(this);
888}
889inline const TreeNode &Layer::as_node() const
890{
891 return *reinterpret_cast<const TreeNode *>(this);
892}
894{
895 return *reinterpret_cast<TreeNode *>(this);
896}
897
899inline bool Layer::is_empty() const
900{
901 return (this->frames().is_empty());
902}
903inline const LayerGroup &Layer::parent_group() const
904{
905 return *this->as_node().parent_group();
906}
908{
909 return *this->as_node().parent_group();
910}
911
913
915
921void ensure_non_empty_layer_names(Main &bmain, GreasePencil &grease_pencil);
922
923} // namespace greasepencil
924
926 public:
930 void *batch_cache = nullptr;
934 int eval_frame = 0;
939 bool is_drawing_stroke = false;
943 bool temp_use_eraser = false;
944 float temp_eraser_size = 0.0f;
945
946 std::unique_ptr<bake::BakeMaterialsList> bake_materials;
947
948 public:
951};
952
954 public:
956 /* Deformed positions for original points. Data has the same topology as the original curves. */
958
963 std::optional<Array<float3x3>> deform_mats;
964
965 std::optional<Span<float3>> positions() const;
966 std::optional<MutableSpan<float3>> positions_for_write();
967};
968
973 public:
978
983
988 std::optional<Array<GreasePencilDrawingEditHints>> drawing_hints;
989};
990
991} // namespace blender::bke
992
993inline blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap()
994{
995 return *reinterpret_cast<blender::bke::greasepencil::Drawing *>(this);
996}
997inline const blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap() const
998{
999 return *reinterpret_cast<const blender::bke::greasepencil::Drawing *>(this);
1000}
1001
1002inline blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
1003{
1004 return *reinterpret_cast<blender::bke::greasepencil::DrawingReference *>(this);
1005}
1006inline const blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
1007 const
1008{
1009 return *reinterpret_cast<const blender::bke::greasepencil::DrawingReference *>(this);
1010}
1011
1012inline GreasePencilFrame GreasePencilFrame::end()
1013{
1014 return GreasePencilFrame{-1, 0, 0};
1015}
1016
1017inline bool GreasePencilFrame::is_end() const
1018{
1019 return this->drawing_index == -1;
1020}
1021
1022inline bool GreasePencilFrame::is_implicit_hold() const
1023{
1024 return (this->flag & GP_FRAME_IMPLICIT_HOLD) != 0;
1025}
1026
1027inline bool GreasePencilFrame::is_selected() const
1028{
1029 return (this->flag & GP_FRAME_SELECTED) != 0;
1030}
1031
1032inline blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap()
1033{
1034 return *reinterpret_cast<blender::bke::greasepencil::TreeNode *>(this);
1035}
1036inline const blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap() const
1037{
1038 return *reinterpret_cast<const blender::bke::greasepencil::TreeNode *>(this);
1039}
1040
1041inline blender::bke::greasepencil::Layer &GreasePencilLayer::wrap()
1042{
1043 return *reinterpret_cast<blender::bke::greasepencil::Layer *>(this);
1044}
1045inline const blender::bke::greasepencil::Layer &GreasePencilLayer::wrap() const
1046{
1047 return *reinterpret_cast<const blender::bke::greasepencil::Layer *>(this);
1048}
1049
1050inline blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap()
1051{
1052 return *reinterpret_cast<blender::bke::greasepencil::LayerGroup *>(this);
1053}
1054inline const blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap() const
1055{
1056 return *reinterpret_cast<const blender::bke::greasepencil::LayerGroup *>(this);
1057}
1058
1059inline const GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index) const
1060{
1061 BLI_assert(index >= 0 && index < this->drawings().size());
1062 return this->drawings()[index];
1063}
1064inline GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index)
1065{
1066 BLI_assert(index >= 0 && index < this->drawings().size());
1067 return this->drawings()[index];
1068}
1069
1070inline const blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index) const
1071{
1072 return *this->layers()[index];
1073}
1074inline blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index)
1075{
1076 return *this->layers_for_write()[index];
1077}
1078
1079inline const blender::bke::greasepencil::LayerGroup &GreasePencil::root_group() const
1080{
1081 return this->root_group_ptr->wrap();
1082}
1083inline blender::bke::greasepencil::LayerGroup &GreasePencil::root_group()
1084{
1085 return this->root_group_ptr->wrap();
1086}
1087
1088inline bool GreasePencil::has_active_layer() const
1089{
1090 return (this->active_node != nullptr) && (this->active_node->wrap().is_layer());
1091}
1092
1093inline bool GreasePencil::has_active_group() const
1094{
1095 return (this->active_node != nullptr) && (this->active_node->wrap().is_group());
1096}
1097
1099 blender::StringRef name);
1100
1101GreasePencil *BKE_grease_pencil_add(Main *bmain, const char *name);
1106void BKE_grease_pencil_copy_layer_parameters(const blender::bke::greasepencil::Layer &src,
1107 blender::bke::greasepencil::Layer &dst);
1109 const blender::bke::greasepencil::LayerGroup &src,
1110 blender::bke::greasepencil::LayerGroup &dst);
1111
1116 GreasePencil *grease_pencil_dst);
1117
1118void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name);
1119
1120void BKE_grease_pencil_eval_geometry(Depsgraph *depsgraph, GreasePencil *grease_pencil);
1121void BKE_object_eval_grease_pencil(Depsgraph *depsgraph, Scene *scene, Object *object);
1122void BKE_grease_pencil_duplicate_drawing_array(const GreasePencil *grease_pencil_src,
1123 GreasePencil *grease_pencil_dst);
1124
1128int BKE_grease_pencil_stroke_point_count(const GreasePencil &grease_pencil);
1132bool BKE_grease_pencil_has_curve_with_type(const GreasePencil &grease_pencil, CurveType type);
1136void BKE_grease_pencil_point_coords_get(const GreasePencil &grease_pencil,
1137 blender::MutableSpan<blender::float3> all_positions,
1138 blender::MutableSpan<float> all_radii);
1143 blender::Span<blender::float3> all_positions,
1144 blender::Span<float> all_radii);
1149 blender::Span<blender::float3> all_positions,
1150 blender::Span<float> all_radii,
1151 const blender::float4x4 &mat);
1152
1155 Object *ob,
1156 const char *name,
1157 int *r_index);
1160 Object *ob,
1161 const char *name,
1162 int *r_index);
1164 Object *ob,
1165 Brush *brush);
1167 Object *ob,
1168 Brush *brush);
1169void BKE_grease_pencil_material_remap(GreasePencil *grease_pencil, const uint *remap, int totcol);
1170void BKE_grease_pencil_material_index_remove(GreasePencil *grease_pencil, int index);
1171bool BKE_grease_pencil_material_index_used(GreasePencil *grease_pencil, int index);
1172
1174 const GreasePencil *grease_pencil);
void BKE_grease_pencil_point_coords_apply(GreasePencil &grease_pencil, blender::Span< blender::float3 > all_positions, blender::Span< float > all_radii)
#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name)
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)
void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name)
Material * BKE_grease_pencil_object_material_alt_ensure_from_brush(Main *bmain, Object *ob, Brush *brush)
void BKE_grease_pencil_point_coords_apply_with_mat4(GreasePencil &grease_pencil, blender::Span< blender::float3 > all_positions, blender::Span< float > all_radii, const blender::float4x4 &mat)
void BKE_grease_pencil_point_coords_get(const GreasePencil &grease_pencil, blender::MutableSpan< blender::float3 > all_positions, blender::MutableSpan< float > all_radii)
void BKE_object_eval_grease_pencil(Depsgraph *depsgraph, Scene *scene, Object *object)
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)
GreasePencil * BKE_grease_pencil_add(Main *bmain, const char *name)
Material * BKE_grease_pencil_object_material_ensure_from_brush(Main *bmain, Object *ob, Brush *brush)
void BKE_grease_pencil_nomain_to_grease_pencil(GreasePencil *grease_pencil_src, GreasePencil *grease_pencil_dst)
void BKE_grease_pencil_eval_geometry(Depsgraph *depsgraph, GreasePencil *grease_pencil)
void BKE_grease_pencil_duplicate_drawing_array(const GreasePencil *grease_pencil_src, GreasePencil *grease_pencil_dst)
bool BKE_grease_pencil_has_curve_with_type(const GreasePencil &grease_pencil, CurveType type)
Material * BKE_grease_pencil_object_material_from_brush_get(Object *ob, 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)
bool BKE_grease_pencil_drawing_attribute_required(const GreasePencilDrawing *, blender::StringRef name)
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:46
unsigned int uint
#define SET_FLAG_FROM_TEST(value, test, flag)
struct Brush Brush
struct GreasePencilDrawingBase GreasePencilDrawingBase
struct GreasePencilFrame GreasePencilFrame
struct GreasePencil GreasePencil
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
struct GreasePencilDrawing GreasePencilDrawing
struct Material Material
struct Object Object
struct Scene Scene
iter begin(iter)
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
long long int int64_t
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
std::optional< Array< float3x3 > > deform_mats
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< int3 > > 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)
const TreeNode * find_node_by_name(StringRef name) const
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(StringRef header) const
LayerGroup & operator=(const LayerGroup &other)
Span< const LayerGroup * > groups() const
Span< const TreeNode * > nodes() const
SharedCache< Vector< FramesMapKeyT > > sorted_keys_cache_
Map< FramesMapKeyT, GreasePencilFrame > frames_
SortedKeysIterator sorted_keys_iterator_at(int frame_number) const
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(StringRef 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()
void set_parent_bone_name(StringRef new_name)
const TreeNode * parent_node() const
const LayerGroup & as_group() const
const LayerGroup * parent_group() const
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
void ensure_non_empty_layer_names(Main &bmain, GreasePencil &grease_pencil)
constexpr float LEGACY_RADIUS_CONVERSION_FACTOR
const AttributeAccessorFunctions & get_attribute_accessor_functions()
void copy_drawing_array(Span< const GreasePencilDrawingBase * > src_drawings, MutableSpan< GreasePencilDrawingBase * > dst_drawings)
MatBase< float, 4, 4 > float4x4
const char * name
GreasePencilDrawingRuntimeHandle * runtime
struct GreasePencilLayerTreeGroup * parent
Map< int, GreasePencilFrame > duplicated_frames_buffer
uint8_t flag
Definition wm_window.cc:145