Blender V4.5
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.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};
80
82 public:
83 Drawing();
84 Drawing(const Drawing &other);
85 Drawing(Drawing &&other);
86 Drawing &operator=(const Drawing &other);
87 Drawing &operator=(Drawing &&other);
88 ~Drawing();
89
90 const bke::CurvesGeometry &strokes() const;
95 Span<int3> triangles() const;
100
102
107 void tag_positions_changed(const IndexMask &changed_curves);
108
114 void tag_topology_changed(const IndexMask &changed_curves);
115
125 void set_texture_matrices(Span<float4x2> matrices, const IndexMask &selection);
126
130 VArray<float> radii() const;
132
138 VArray<float> opacities() const;
140
147
154
159 void add_user() const;
164 void remove_user() const;
168 bool is_instanced() const;
172 bool has_users() const;
176 int user_count() const;
177
178 private:
182 OffsetIndices<int> triangle_offsets() const;
183};
184static_assert(sizeof(Drawing) == sizeof(::GreasePencilDrawing));
185
192static_assert(sizeof(DrawingReference) == sizeof(::GreasePencilDrawingReference));
193
200
201class LayerGroup;
202class Layer;
203
204/* Defines the common functions used by #TreeNode, #Layer, and #LayerGroup.
205 * NOTE: Because we cannot mix C-style and C++ inheritance (all of these three classes wrap a
206 * C-struct that already uses "inheritance"), we define and implement these methods on all these
207 * classes individually. This just means that we can call `layer->name()` directly instead of
208 * having to write `layer->as_node().name()`. For #Layer and #LayerGroup the calls are just
209 * forwarded to #TreeNode. */
210#define TREENODE_COMMON_METHODS \
211 StringRefNull name() const; \
212 void set_name(StringRef new_name); \
213 bool is_visible() const; \
214 void set_visible(bool visible); \
215 bool is_locked() const; \
216 void set_locked(bool locked); \
217 bool is_editable() const; \
218 bool is_selected() const; \
219 void set_selected(bool selected); \
220 bool use_onion_skinning() const; \
221 bool use_masks() const; \
222 bool ignore_locked_materials() const; \
223 bool is_child_of(const LayerGroup &group) const;
224
225/* Implements the forwarding of the methods defined by #TREENODE_COMMON_METHODS. */
226#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name) \
227 inline StringRefNull class_name::name() const \
228 { \
229 return this->as_node().name(); \
230 } \
231 inline void class_name::set_name(const StringRef new_name) \
232 { \
233 return this->as_node().set_name(new_name); \
234 } \
235 inline bool class_name::is_visible() const \
236 { \
237 return this->as_node().is_visible(); \
238 } \
239 inline void class_name::set_visible(const bool visible) \
240 { \
241 this->as_node().set_visible(visible); \
242 } \
243 inline bool class_name::is_locked() const \
244 { \
245 return this->as_node().is_locked(); \
246 } \
247 inline void class_name::set_locked(const bool locked) \
248 { \
249 this->as_node().set_locked(locked); \
250 } \
251 inline bool class_name::is_editable() const \
252 { \
253 return this->as_node().is_editable(); \
254 } \
255 inline bool class_name::is_selected() const \
256 { \
257 return this->as_node().is_selected(); \
258 } \
259 inline void class_name::set_selected(const bool selected) \
260 { \
261 this->as_node().set_selected(selected); \
262 } \
263 inline bool class_name::use_onion_skinning() const \
264 { \
265 return this->as_node().use_onion_skinning(); \
266 } \
267 inline bool class_name::use_masks() const \
268 { \
269 return this->as_node().use_masks(); \
270 } \
271 inline bool class_name::ignore_locked_materials() const \
272 { \
273 return this->as_node().ignore_locked_materials(); \
274 } \
275 inline bool class_name::is_child_of(const LayerGroup &group) const \
276 { \
277 return this->as_node().is_child_of(group); \
278 }
279
286 public:
287 TreeNode();
290 TreeNode(const TreeNode &other);
291 ~TreeNode();
292
293 public:
294 /* Define the common functions for #TreeNode. */
299 bool is_group() const;
303 bool is_layer() const;
304
308 const Layer &as_layer() const;
309 Layer &as_layer();
310
314 const LayerGroup &as_group() const;
316
320 const LayerGroup *parent_group() const;
322
323 const TreeNode *parent_node() const;
325
329 int64_t depth() const;
330};
331static_assert(sizeof(TreeNode) == sizeof(::GreasePencilLayerTreeNode));
332
337 public:
338 LayerMask();
339 explicit LayerMask(StringRef name);
340 LayerMask(const LayerMask &other);
341 ~LayerMask();
342};
343static_assert(sizeof(LayerMask) == sizeof(::GreasePencilLayerMask));
344
350
351 /* Map of frame keys describing the transformation of the frames. Keys of the map are the source
352 * frame indices, and the values of the map are the destination frame indices. */
354
355 /* Copy of the layer frames, stored in two separate maps :
356 * - frames_static contains the frames not affected by the transformation,
357 * - frames_transformed contains the frames affected by the transformation.
358 * This allows to display the transformation while running, without removing any drawing.
359 */
362
363 /* Map containing the duration (in frames) for each frame in the layer that has a fixed duration,
364 * i.e. each frame that is not an implicit hold. */
366
367 /* Temporary copy of duplicated frames before we decide on a place to insert them.
368 * Used in the move+duplicate operator. */
370
372};
373
374/*
375 * The key type for a `GreasePencilFrame` in the frames map.
376 *
377 * This is either the start or end frame (scene time) of a `GreasePencilFrame`.
378 *
379 * If the key refers to a end frame, the value in the map for this key is
380 * `GreasePencilFrame::end()`.
381 * Note that end frame is exclusive with regards to the frame duration. E.g. if a frame starts at
382 * 10 and the end frame is at 15, then the duration is 4.
383 */
384using FramesMapKeyT = int;
385
445
451 public:
452 using SortedKeysIterator = const int *;
453
454 Layer();
455 explicit Layer(StringRef name);
456 Layer(const Layer &other);
457 ~Layer();
458
459 /* Define the common functions for #TreeNode. */
464 const TreeNode &as_node() const;
465 TreeNode &as_node();
466
470 const LayerGroup &parent_group() const;
472
478
482 bool is_empty() const;
483
495 GreasePencilFrame *add_frame(FramesMapKeyT key, int duration = 0);
506 bool remove_frame(FramesMapKeyT key);
507
513
518 int drawing_index_at(const int frame_number) const;
519
523 bool has_drawing_at(const int frame_number) const;
524
529 std::optional<int> start_frame_at(int frame_number) const;
530
535 int sorted_keys_index_at(int frame_number) const;
540 SortedKeysIterator sorted_keys_iterator_at(int frame_number) const;
541
545 const GreasePencilFrame *frame_at(const int frame_number) const;
546 GreasePencilFrame *frame_at(const int frame_number);
547
553 int get_frame_duration_at(const int frame_number) const;
554
556
562
567
572
573 float4x4 parent_inverse() const;
574
579
586
590 float4x4 to_object_space(const Object &object) const;
591
595 float4x4 to_world_space(const Object &object) const;
596
602 void set_parent_bone_name(StringRef new_name);
603
609 void set_view_layer_name(StringRef new_name);
610
611 private:
616 std::optional<FramesMapKeyT> frame_key_at(int frame_number) const;
617
618 GreasePencilFrame *add_frame_internal(int frame_number);
619
626 SortedKeysIterator remove_leading_end_frames_in_range(SortedKeysIterator begin,
628
632 float4x4 parent_to_world(const Object &parent) const;
633};
634static_assert(sizeof(Layer) == sizeof(::GreasePencilLayer));
635
661
666 friend struct ::GreasePencil;
667
668 public:
669 LayerGroup();
670 explicit LayerGroup(StringRef name);
671 LayerGroup(const LayerGroup &other);
672 ~LayerGroup();
673
674 LayerGroup &operator=(const LayerGroup &other);
675
676 public:
677 /* Define the common functions for #TreeNode. */
682 const TreeNode &as_node() const;
683 TreeNode &as_node();
684
688 bool is_empty() const;
689
694
698 int64_t num_nodes_total() const;
699
705
711
717
721 const TreeNode *find_node_by_name(StringRef name) const;
723
727 bool is_expanded() const;
731 void set_expanded(bool expanded);
732
736 void print_nodes(StringRef header) const;
737
742
747
748 protected:
752 TreeNode &add_node(TreeNode &node);
753
757 void add_node_before(TreeNode &node, TreeNode &link);
761 void add_node_after(TreeNode &node, TreeNode &link);
762
766 void move_node_up(TreeNode &node, int step = 1);
767 void move_node_down(TreeNode &node, int step = 1);
771 void move_node_top(TreeNode &node);
772 void move_node_bottom(TreeNode &node);
773
778 bool unlink_node(TreeNode &link, bool keep_children = false);
779
780 private:
781 void ensure_nodes_cache() const;
782 void tag_nodes_cache_dirty() const;
783};
784static_assert(sizeof(LayerGroup) == sizeof(::GreasePencilLayerTreeGroup));
785
786inline void Drawing::add_user() const
787{
788 this->runtime->user_count.fetch_add(1, std::memory_order_relaxed);
789}
790inline void Drawing::remove_user() const
791{
792 this->runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
793}
794inline bool Drawing::is_instanced() const
795{
796 return this->runtime->user_count.load(std::memory_order_relaxed) > 1;
797}
798inline bool Drawing::has_users() const
799{
800 return this->runtime->user_count.load(std::memory_order_relaxed) > 0;
801}
802inline int Drawing::user_count() const
803{
804 return this->runtime->user_count.load(std::memory_order_relaxed);
805}
806
807inline bool TreeNode::is_group() const
808{
809 return this->type == GP_LAYER_TREE_GROUP;
810}
811inline bool TreeNode::is_layer() const
812{
813 return this->type == GP_LAYER_TREE_LEAF;
814}
815inline bool TreeNode::is_visible() const
816{
817 return ((this->flag & GP_LAYER_TREE_NODE_HIDE) == 0) &&
818 (!this->parent_group() || this->parent_group()->as_node().is_visible());
819}
820inline void TreeNode::set_visible(const bool visible)
821{
823}
824inline bool TreeNode::is_locked() const
825{
826 return ((this->flag & GP_LAYER_TREE_NODE_LOCKED) != 0) ||
827 (this->parent_group() && this->parent_group()->as_node().is_locked());
828}
829inline void TreeNode::set_locked(const bool locked)
830{
832}
833inline bool TreeNode::is_editable() const
834{
835 return this->is_visible() && !this->is_locked();
836}
837inline bool TreeNode::is_selected() const
838{
839 return (this->flag & GP_LAYER_TREE_NODE_SELECT) != 0;
840}
841inline void TreeNode::set_selected(const bool selected)
842{
844}
845inline bool TreeNode::use_onion_skinning() const
846{
847 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING) == 0) &&
848 (!this->parent_group() || this->parent_group()->as_node().use_onion_skinning());
849}
850inline bool TreeNode::use_masks() const
851{
852 return ((this->flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0) &&
853 (!this->parent_group() || this->parent_group()->as_node().use_masks());
854}
855inline bool TreeNode::ignore_locked_materials() const
856{
858}
859inline bool TreeNode::is_child_of(const LayerGroup &group) const
860{
861 if (const LayerGroup *parent = this->parent_group()) {
862 if (parent == &group) {
863 return true;
864 }
865 return parent->is_child_of(group);
866 }
867 return false;
868}
869inline StringRefNull TreeNode::name() const
870{
871 return (this->GreasePencilLayerTreeNode::name != nullptr) ?
873 StringRefNull();
874}
875inline const TreeNode &LayerGroup::as_node() const
876{
877 return *reinterpret_cast<const TreeNode *>(this);
878}
880{
881 return *reinterpret_cast<TreeNode *>(this);
882}
883inline const TreeNode &Layer::as_node() const
884{
885 return *reinterpret_cast<const TreeNode *>(this);
886}
888{
889 return *reinterpret_cast<TreeNode *>(this);
890}
891
893inline bool Layer::is_empty() const
894{
895 return (this->frames().is_empty());
896}
897inline const LayerGroup &Layer::parent_group() const
898{
899 return *this->as_node().parent_group();
900}
902{
903 return *this->as_node().parent_group();
904}
905
907
909
915void ensure_non_empty_layer_names(Main &bmain, GreasePencil &grease_pencil);
916
917} // namespace greasepencil
918
920 public:
924 void *batch_cache = nullptr;
928 int eval_frame = 0;
933 bool is_drawing_stroke = false;
937 bool temp_use_eraser = false;
938 float temp_eraser_size = 0.0f;
939
940 std::unique_ptr<bake::BakeMaterialsList> bake_materials;
941
942 public:
945};
946
948 public:
951
956 std::optional<Array<float3x3>> deform_mats;
957
958 std::optional<Span<float3>> positions() const;
959 std::optional<MutableSpan<float3>> positions_for_write();
960};
961
966 public:
971
976
981 std::optional<Array<GreasePencilDrawingEditHints>> drawing_hints;
982};
983
984} // namespace blender::bke
985
986inline blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap()
987{
988 return *reinterpret_cast<blender::bke::greasepencil::Drawing *>(this);
989}
990inline const blender::bke::greasepencil::Drawing &GreasePencilDrawing::wrap() const
991{
992 return *reinterpret_cast<const blender::bke::greasepencil::Drawing *>(this);
993}
994
995inline blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
996{
997 return *reinterpret_cast<blender::bke::greasepencil::DrawingReference *>(this);
998}
999inline const blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
1000 const
1001{
1002 return *reinterpret_cast<const blender::bke::greasepencil::DrawingReference *>(this);
1003}
1004
1005inline GreasePencilFrame GreasePencilFrame::end()
1006{
1007 return GreasePencilFrame{-1, 0, 0};
1008}
1009
1010inline bool GreasePencilFrame::is_end() const
1011{
1012 return this->drawing_index == -1;
1013}
1014
1015inline bool GreasePencilFrame::is_implicit_hold() const
1016{
1017 return (this->flag & GP_FRAME_IMPLICIT_HOLD) != 0;
1018}
1019
1020inline bool GreasePencilFrame::is_selected() const
1021{
1022 return (this->flag & GP_FRAME_SELECTED) != 0;
1023}
1024
1025inline blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap()
1026{
1027 return *reinterpret_cast<blender::bke::greasepencil::TreeNode *>(this);
1028}
1029inline const blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap() const
1030{
1031 return *reinterpret_cast<const blender::bke::greasepencil::TreeNode *>(this);
1032}
1033
1034inline blender::bke::greasepencil::Layer &GreasePencilLayer::wrap()
1035{
1036 return *reinterpret_cast<blender::bke::greasepencil::Layer *>(this);
1037}
1038inline const blender::bke::greasepencil::Layer &GreasePencilLayer::wrap() const
1039{
1040 return *reinterpret_cast<const blender::bke::greasepencil::Layer *>(this);
1041}
1042
1043inline blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap()
1044{
1045 return *reinterpret_cast<blender::bke::greasepencil::LayerGroup *>(this);
1046}
1047inline const blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap() const
1048{
1049 return *reinterpret_cast<const blender::bke::greasepencil::LayerGroup *>(this);
1050}
1051
1052inline const GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index) const
1053{
1054 BLI_assert(index >= 0 && index < this->drawings().size());
1055 return this->drawings()[index];
1056}
1057inline GreasePencilDrawingBase *GreasePencil::drawing(const int64_t index)
1058{
1059 BLI_assert(index >= 0 && index < this->drawings().size());
1060 return this->drawings()[index];
1061}
1062
1063inline const blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index) const
1064{
1065 return *this->layers()[index];
1066}
1067inline blender::bke::greasepencil::Layer &GreasePencil::layer(const int64_t index)
1068{
1069 return *this->layers_for_write()[index];
1070}
1071
1072inline const blender::bke::greasepencil::LayerGroup &GreasePencil::root_group() const
1073{
1074 return this->root_group_ptr->wrap();
1075}
1076inline blender::bke::greasepencil::LayerGroup &GreasePencil::root_group()
1077{
1078 return this->root_group_ptr->wrap();
1079}
1080
1081inline bool GreasePencil::has_active_layer() const
1082{
1083 return (this->active_node != nullptr) && (this->active_node->wrap().is_layer());
1084}
1085
1086inline bool GreasePencil::has_active_group() const
1087{
1088 return (this->active_node != nullptr) && (this->active_node->wrap().is_group());
1089}
1090
1092 blender::StringRef name);
1093
1094GreasePencil *BKE_grease_pencil_add(Main *bmain, const char *name);
1099void BKE_grease_pencil_copy_layer_parameters(const blender::bke::greasepencil::Layer &src,
1100 blender::bke::greasepencil::Layer &dst);
1102 const blender::bke::greasepencil::LayerGroup &src,
1103 blender::bke::greasepencil::LayerGroup &dst);
1104
1109 GreasePencil *grease_pencil_dst);
1110
1111void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name);
1112
1113void BKE_grease_pencil_eval_geometry(Depsgraph *depsgraph, GreasePencil *grease_pencil);
1114void BKE_object_eval_grease_pencil(Depsgraph *depsgraph, Scene *scene, Object *object);
1115void BKE_grease_pencil_duplicate_drawing_array(const GreasePencil *grease_pencil_src,
1116 GreasePencil *grease_pencil_dst);
1117
1121int BKE_grease_pencil_stroke_point_count(const GreasePencil &grease_pencil);
1125bool BKE_grease_pencil_has_curve_with_type(const GreasePencil &grease_pencil, CurveType type);
1129void BKE_grease_pencil_point_coords_get(const GreasePencil &grease_pencil,
1130 blender::MutableSpan<blender::float3> all_positions,
1131 blender::MutableSpan<float> all_radii);
1136 blender::Span<blender::float3> all_positions,
1137 blender::Span<float> all_radii);
1142 blender::Span<blender::float3> all_positions,
1143 blender::Span<float> all_radii,
1144 const blender::float4x4 &mat);
1145
1148 Object *ob,
1149 const char *name,
1150 int *r_index);
1153 Object *ob,
1154 const char *name,
1155 int *r_index);
1157 Object *ob,
1158 Brush *brush);
1160 Object *ob,
1161 Brush *brush);
1162void BKE_grease_pencil_material_remap(GreasePencil *grease_pencil, const uint *remap, int totcol);
1163void BKE_grease_pencil_material_index_remove(GreasePencil *grease_pencil, int index);
1164bool BKE_grease_pencil_material_index_used(GreasePencil *grease_pencil, int index);
1165
1167 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
CurveType
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
GreasePencilDrawingRuntimeHandle * runtime
struct GreasePencilLayerTreeGroup * parent
Map< int, GreasePencilFrame > duplicated_frames_buffer
uint8_t flag
Definition wm_window.cc:139