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
3 changed files with 8 additions and 14 deletions
Showing only changes of commit 8cc26b97fd - Show all commits

View File

@ -187,12 +187,6 @@ class Layer : public ::GreasePencilLayer {
const Map<int, GreasePencilFrame> &frames() const;
Map<int, GreasePencilFrame> &frames_for_write();
/**
* \returns the layer masks.
*/
// Span<LayerMask> masks() const;
// Vector<LayerMask> &masks_for_write();
bool is_visible() const;
bool is_locked() const;

View File

@ -306,9 +306,10 @@ Layer &TreeNode::as_layer_for_write()
LayerMask::LayerMask()
{
this->layer_name = nullptr;
this->flag = 0;
}
LayerMask::LayerMask(StringRefNull name)
LayerMask::LayerMask(StringRefNull name) : LayerMask()
{
this->layer_name = BLI_strdup(name.c_str());
}

View File

@ -210,13 +210,12 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
new_layer.blend_mode = static_cast<int8_t>(gpl->blend_mode);
/* Convert the layer masks. */
// Vector<LayerMask> masks = new_layer.masks_for_write();
// LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {
// LayerMask new_mask = LayerMask(mask->name);
// new_mask.flag = mask->flag;
// masks.append(std::move(new_mask));
// }
// new_layer.opacity = gpl->opacity;
LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {
LayerMask *new_mask = new LayerMask(mask->name);
new_mask->flag = mask->flag;
BLI_addtail(&new_layer.masks, new_mask);
}
new_layer.opacity = gpl->opacity;
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
grease_pencil.drawing_array[i] = reinterpret_cast<GreasePencilDrawingBase *>(