Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
1 changed files with 22 additions and 5 deletions
Showing only changes of commit e38d286f4e - Show all commits

View File

@ -46,12 +46,8 @@ class TreeNode : public ::GreasePencilLayerTreeNode {
if (other.name) {
this->name = BLI_strdup(other.name);
}
children_.reserve(other.children_.size());
for (const std::unique_ptr<TreeNode> &elem : other.children_) {
children_.append(std::make_unique<TreeNode>(*elem));
}
}
TreeNode(TreeNode &&other) : children_(std::move(other.children_))
TreeNode(TreeNode &&other)

Is defining these as constexpr helpful? I sort of doubt any real computation is done on these nodes at compile time. But maybe?

Is defining these as `constexpr` helpful? I sort of doubt any real computation is done on these nodes at compile time. But maybe?

The const in the const bool return type means nothing here

The `const` in the `const bool` return type means nothing here
{
this->name = other.name;
other.name = nullptr;
@ -262,6 +258,7 @@ class Layer : public TreeNode, ::GreasePencilLayer {
}
Layer(const Layer &other) : TreeNode(other)
{
frames_ = other.frames_;
}
Layer(Layer &&other) : TreeNode(std::move(other))
{
@ -350,9 +347,29 @@ class LayerGroup : public TreeNode {
}

Put out of line.

Put out of line.
LayerGroup(const LayerGroup &other) : TreeNode(other)
{
children_.reserve(other.children_.size());
for (const std::unique_ptr<TreeNode> &elem : other.children_) {
if (elem.get()->is_group()) {
children_.append(std::make_unique<LayerGroup>(elem.get()->as_group()));
}
else if (elem.get()->is_layer()) {
children_.append(std::make_unique<Layer>(elem.get()->as_layer()));
}
}
}

This needs to be implemented.

This needs to be implemented.
LayerGroup(LayerGroup &&other) : TreeNode(std::move(other))
{
/* TODO! */
// children_.reserve(other.children_.size());
// for (const std::unique_ptr<TreeNode> &elem : other.children_) {
// if (elem.get()->is_group()) {
// children_.append_as(std::move(*elem));
// }
// else if (elem.get()->is_layer()) {
// children_.append_as(std::move(*elem));
// }
// }
// other.children_.clear();
}
~LayerGroup()
{