In this example there are three drawings (drawing #0, drawing #1 and drawing #2). The first drawing starts at frame 0 and ends at frame 5 (exclusive). The second drawing starts at frame 5 and ends at frame 10. Finally, the third drawing starts at frame 12 and ends at frame 16.
#pragma once
#include <atomic>
struct Depsgraph;
struct BakeMaterialsList;
}
namespace greasepencil {
class DrawingRuntime {
public:
};
public:
const bke::CurvesGeometry &
strokes()
const;
VArray<float>
radii()
const;
private:
OffsetIndices<int> triangle_offsets() const;
};
public:
};
MutableSpan<GreasePencilDrawingBase *> dst_drawings);
class LayerGroup;
class Layer;
#define TREENODE_COMMON_METHODS \
StringRefNull name() const; \
void set_name(StringRefNull new_name); \
bool is_visible() const; \
void set_visible(bool visible); \
bool is_locked() const; \
void set_locked(bool locked); \
bool is_editable() const; \
bool is_selected() const; \
void set_selected(bool selected); \
bool use_onion_skinning() const; \
bool use_masks() const; \
bool ignore_locked_materials() const; \
bool is_child_of(const LayerGroup &group) const;
#define TREENODE_COMMON_METHODS_FORWARD_IMPL(class_name) \
inline StringRefNull class_name::name() const \
{ \
return this->as_node().name(); \
} \
inline void class_name::set_name(StringRefNull new_name) \
{ \
return this->as_node().set_name(new_name); \
} \
inline bool class_name::is_visible() const \
{ \
return this->as_node().is_visible(); \
} \
inline void class_name::set_visible(const bool visible) \
{ \
this->as_node().set_visible(visible); \
} \
inline bool class_name::is_locked() const \
{ \
return this->as_node().is_locked(); \
} \
inline void class_name::set_locked(const bool locked) \
{ \
this->as_node().set_locked(locked); \
} \
inline bool class_name::is_editable() const \
{ \
return this->as_node().is_editable(); \
} \
inline bool class_name::is_selected() const \
{ \
return this->as_node().is_selected(); \
} \
inline void class_name::set_selected(const bool selected) \
{ \
this->as_node().set_selected(selected); \
} \
inline bool class_name::use_onion_skinning() const \
{ \
return this->as_node().use_onion_skinning(); \
} \
inline bool class_name::use_masks() const \
{ \
return this->as_node().use_masks(); \
} \
inline bool class_name::ignore_locked_materials() const \
{ \
return this->as_node().ignore_locked_materials(); \
} \
inline bool class_name::is_child_of(const LayerGroup &group) const \
{ \
return this->as_node().is_child_of(group); \
}
public:
public:
};
public:
};
struct LayerTransformData {
};
using FramesMapKeyT =
int;
class LayerRuntime {
public:
Map<FramesMapKeyT, GreasePencilFrame>
frames_;
public:
};
public:
explicit Layer(StringRefNull name);
Layer(
const Layer &other);
const Map<FramesMapKeyT, GreasePencilFrame> &
frames()
const;
private:
std::optional<FramesMapKeyT> frame_key_at(int frame_number) const;
};
class LayerGroupRuntime {
public:
};
friend struct ::GreasePencil;
public:
public:
Span<const TreeNode *>
nodes()
const;
Span<const Layer *>
layers()
const;
Span<const LayerGroup *>
groups()
const;
protected:
bool unlink_node(TreeNode &link,
bool keep_children =
false);
private:
void ensure_nodes_cache() const;
void tag_nodes_cache_dirty() const;
};
{
this->
runtime->user_count.fetch_add(1, std::memory_order_relaxed);
}
{
this->
runtime->user_count.fetch_sub(1, std::memory_order_relaxed);
}
{
return this->
runtime->user_count.load(std::memory_order_relaxed) > 1;
}
{
return this->
runtime->user_count.load(std::memory_order_relaxed) > 0;
}
{
return this->
runtime->user_count.load(std::memory_order_relaxed);
}
{
}
{
}
inline bool TreeNode::is_visible() const
{
}
inline void TreeNode::set_visible(const bool visible)
{
}
inline bool TreeNode::is_locked() const
{
}
inline void TreeNode::set_locked(const bool locked)
{
}
inline bool TreeNode::is_editable() const
{
return this->is_visible() && !this->is_locked();
}
inline bool TreeNode::is_selected() const
{
}
inline void TreeNode::set_selected(const bool selected)
{
}
inline bool TreeNode::use_onion_skinning() const
{
}
inline bool TreeNode::use_masks() const
{
}
inline bool TreeNode::ignore_locked_materials() const
{
}
inline bool TreeNode::is_child_of(const LayerGroup &group) const
{
return true;
}
return parent->is_child_of(group);
}
return false;
}
{
StringRefNull();
}
{
return *reinterpret_cast<const TreeNode *>(this);
}
{
return *reinterpret_cast<TreeNode *>(this);
}
{
}
{
return *reinterpret_cast<const TreeNode *>(this);
}
{
return *reinterpret_cast<TreeNode *>(this);
}
{
}
{
}
{
}
}
class GreasePencilRuntime {
public:
public:
};
class GreasePencilDrawingEditHints {
public:
std::optional<Span<float3>>
positions()
const;
};
class GreasePencilEditHints {
public:
{
}
std::optional<Array<GreasePencilDrawingEditHints>>
drawing_hints;
};
}
{
}
{
}
{
}
const
{
}
{
}
inline bool GreasePencilFrame::is_end() const
{
return this->drawing_index == -1;
}
inline bool GreasePencilFrame::is_implicit_hold() const
{
}
inline bool GreasePencilFrame::is_selected() const
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
return this->drawings()[index];
}
{
return this->drawings()[index];
}
{
return *this->layers()[index];
}
{
return *this->layers_for_write()[index];
}
{
return this->root_group_ptr->wrap();
}
{
return this->root_group_ptr->wrap();
}
inline bool GreasePencil::has_active_layer() const
{
return (this->active_node != nullptr) && (this->active_node->wrap().is_layer());
}
inline bool GreasePencil::has_active_group() const
{
return (this->active_node != nullptr) && (this->active_node->wrap().is_group());
}
float co[3];
float radius;
};
const char *name,
int *r_index);
const char *name,
int *r_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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define SET_FLAG_FROM_TEST(value, test, flag)
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
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
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
SharedCache< Vector< uint3 > > triangles_cache
std::atomic< int > user_count
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< uint3 > 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_
Vector< TreeNode * > nodes_cache_
CacheMutex nodes_cache_mutex_
void move_node_top(TreeNode &node)
void prepare_for_dna_write()
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()
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(StringRefNull header) const
LayerGroup & operator=(const LayerGroup &other)
Span< const LayerGroup * > groups() const
Span< LayerGroup * > groups_for_write()
Span< const TreeNode * > nodes() const
const TreeNode * find_node_by_name(StringRefNull name) const
SharedCache< Vector< FramesMapKeyT > > sorted_keys_cache_
Map< FramesMapKeyT, GreasePencilFrame > frames_
LayerTransformData trans_data_
Vector< LayerMask > masks_
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)
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()
const TreeNode * parent_node() const
const LayerGroup & as_group() const
const Layer & as_layer() 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)
MatBase< float, 4, 4 > float4x4
GreasePencilDrawingRuntimeHandle * runtime
struct GreasePencilLayerTreeGroup * parent