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;
232#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name) \
233 inline StringRefNull class_name::name() const \
235 return this->as_node().name(); \
237 inline void class_name::set_name(const StringRef new_name) \
239 return this->as_node().set_name(new_name); \
241 inline bool class_name::is_visible() const \
243 return this->as_node().is_visible(); \
245 inline void class_name::set_visible(const bool visible) \
247 this->as_node().set_visible(visible); \
249 inline bool class_name::is_locked() const \
251 return this->as_node().is_locked(); \
253 inline void class_name::set_locked(const bool locked) \
255 this->as_node().set_locked(locked); \
257 inline bool class_name::is_editable() const \
259 return this->as_node().is_editable(); \
261 inline bool class_name::is_selected() const \
263 return this->as_node().is_selected(); \
265 inline void class_name::set_selected(const bool selected) \
267 this->as_node().set_selected(selected); \
269 inline bool class_name::use_onion_skinning() const \
271 return this->as_node().use_onion_skinning(); \
273 inline bool class_name::use_masks() const \
275 return this->as_node().use_masks(); \
277 inline bool class_name::ignore_locked_materials() const \
279 return this->as_node().ignore_locked_materials(); \
281 inline bool class_name::is_child_of(const LayerGroup &group) const \
283 return this->as_node().is_child_of(group); \
622 std::optional<FramesMapKeyT> frame_key_at(
int frame_number)
const;
672 friend struct ::GreasePencil;
787 void ensure_nodes_cache()
const;
788 void tag_nodes_cache_dirty()
const;
794 this->
runtime->user_count.fetch_add(1, std::memory_order_relaxed);
798 this->
runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
802 return this->
runtime->user_count.load(std::memory_order_relaxed) > 1;
806 return this->
runtime->user_count.load(std::memory_order_relaxed) > 0;
810 return this->
runtime->user_count.load(std::memory_order_relaxed);
821inline bool TreeNode::is_visible()
const
826inline void TreeNode::set_visible(
const bool visible)
830inline bool TreeNode::is_locked()
const
835inline void TreeNode::set_locked(
const bool locked)
839inline bool TreeNode::is_editable()
const
841 return this->is_visible() && !this->is_locked();
843inline bool TreeNode::is_selected()
const
847inline void TreeNode::set_selected(
const bool selected)
851inline bool TreeNode::use_onion_skinning()
const
856inline bool TreeNode::use_masks()
const
861inline bool TreeNode::ignore_locked_materials()
const
865inline bool TreeNode::is_child_of(
const LayerGroup &group)
const
871 return parent->is_child_of(group);
883 return *
reinterpret_cast<const TreeNode *
>(
this);
887 return *
reinterpret_cast<TreeNode *
>(
this);
891 return *
reinterpret_cast<const TreeNode *
>(
this);
895 return *
reinterpret_cast<TreeNode *
>(
this);
965 std::optional<Span<float3>>
positions()
const;
1002inline blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
1004 return *
reinterpret_cast<blender::bke::greasepencil::DrawingReference *
>(
this);
1006inline const blender::bke::greasepencil::DrawingReference &GreasePencilDrawingReference::wrap()
1009 return *
reinterpret_cast<const blender::bke::greasepencil::DrawingReference *
>(
this);
1017inline bool GreasePencilFrame::is_end()
const
1019 return this->drawing_index == -1;
1022inline bool GreasePencilFrame::is_implicit_hold()
const
1027inline bool GreasePencilFrame::is_selected()
const
1032inline blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap()
1034 return *
reinterpret_cast<blender::bke::greasepencil::TreeNode *
>(
this);
1036inline const blender::bke::greasepencil::TreeNode &GreasePencilLayerTreeNode::wrap()
const
1038 return *
reinterpret_cast<const blender::bke::greasepencil::TreeNode *
>(
this);
1041inline blender::bke::greasepencil::Layer &GreasePencilLayer::wrap()
1043 return *
reinterpret_cast<blender::bke::greasepencil::Layer *
>(
this);
1045inline const blender::bke::greasepencil::Layer &GreasePencilLayer::wrap()
const
1047 return *
reinterpret_cast<const blender::bke::greasepencil::Layer *
>(
this);
1050inline blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap()
1052 return *
reinterpret_cast<blender::bke::greasepencil::LayerGroup *
>(
this);
1054inline const blender::bke::greasepencil::LayerGroup &GreasePencilLayerTreeGroup::wrap()
const
1056 return *
reinterpret_cast<const blender::bke::greasepencil::LayerGroup *
>(
this);
1062 return this->drawings()[index];
1067 return this->drawings()[index];
1070inline const blender::bke::greasepencil::Layer &GreasePencil::layer(
const int64_t index)
const
1072 return *this->layers()[index];
1074inline blender::bke::greasepencil::Layer &GreasePencil::layer(
const int64_t index)
1076 return *this->layers_for_write()[index];
1079inline const blender::bke::greasepencil::LayerGroup &GreasePencil::root_group()
const
1081 return this->root_group_ptr->wrap();
1083inline blender::bke::greasepencil::LayerGroup &GreasePencil::root_group()
1085 return this->root_group_ptr->wrap();
1088inline bool GreasePencil::has_active_layer()
const
1090 return (this->active_node !=
nullptr) && (this->active_node->wrap().is_layer());
1093inline bool GreasePencil::has_active_group()
const
1095 return (this->active_node !=
nullptr) && (this->active_node->wrap().is_group());
1099 blender::StringRef
name);
1107 blender::bke::greasepencil::Layer &dst);
1109 const blender::bke::greasepencil::LayerGroup &src,
1110 blender::bke::greasepencil::LayerGroup &dst);
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,
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 SET_FLAG_FROM_TEST(value, test, flag)
struct GreasePencilDrawingBase GreasePencilDrawingBase
struct GreasePencilFrame GreasePencilFrame
struct GreasePencil GreasePencil
GreasePencilLayerTreeNodeType
@ 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
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
std::optional< MutableSpan< float3 > > positions_for_write()
const greasepencil::Drawing * drawing_orig
std::optional< Span< float3 > > positions() const
ImplicitSharingPtrAndData positions_data
std::optional< Array< float3x3 > > deform_mats
GreasePencilEditHints(const GreasePencil &grease_pencil_id_orig)
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
std::atomic< int > user_count
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< float > radii() const
void tag_positions_changed()
void tag_texture_matrices_changed()
Span< int3 > triangles() const
bool is_instanced() const
void tag_topology_changed()
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)
Vector< LayerGroup * > layer_group_cache_
Vector< Layer * > layer_cache_
bool is_visibility_animated_
Vector< TreeNode * > nodes_cache_
CacheMutex nodes_cache_mutex_
void move_node_top(TreeNode &node)
void prepare_for_dna_write()
void set_expanded(bool expanded)
TreeNode & add_node(TreeNode &node)
void move_node_down(TreeNode &node, int step=1)
void move_node_bottom(TreeNode &node)
bool unlink_node(TreeNode &link, bool keep_children=false)
const TreeNode & as_node() const
int64_t num_direct_nodes() const
int64_t num_nodes_total() const
Span< TreeNode * > nodes_for_write()
const TreeNode * find_node_by_name(StringRef name) const
Span< const Layer * > layers() const
void update_from_dna_read()
Span< Layer * > layers_for_write()
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< LayerGroup * > groups_for_write()
Span< const TreeNode * > nodes() const
SharedCache< Vector< FramesMapKeyT > > sorted_keys_cache_
Map< FramesMapKeyT, GreasePencilFrame > frames_
LayerTransformData trans_data_
bool is_visibility_animated_
Vector< LayerMask > masks_
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)
void tag_frames_map_keys_changed()
bool remove_frame(FramesMapKeyT key)
const Map< FramesMapKeyT, GreasePencilFrame > & frames() const
float4x4 local_transform() const
GreasePencilFrame * add_frame(FramesMapKeyT key, int duration=0)
const TreeNode & as_node() const
const GreasePencilFrame * frame_at(const int frame_number) const
void tag_frames_map_changed()
bool has_drawing_at(const int frame_number) const
const int * SortedKeysIterator
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
void update_from_dna_read()
Span< FramesMapKeyT > sorted_keys() const
float4x4 parent_inverse() const
void prepare_for_dna_write()
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 Layer & as_layer() 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