Fix: GPv3: Wrong layer settings when adding or duplicating a layer #119821
|
@ -89,7 +89,7 @@ class GREASE_PENCIL_MT_grease_pencil_add_layer_extra(Menu):
|
|||
layout.operator("grease_pencil.layer_group_add", text="Add Group")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("grease_pencil.layer_duplicate", text="Duplicate", icon='DUPLICATE')
|
||||
layout.operator("grease_pencil.layer_duplicate", text="Duplicate", icon='DUPLICATE').empty_keyframes = False
|
||||
layout.operator("grease_pencil.layer_duplicate", text="Duplicate Empty Keyframes").empty_keyframes = True
|
||||
|
||||
layout.separator()
|
||||
|
@ -97,7 +97,7 @@ class GREASE_PENCIL_MT_grease_pencil_add_layer_extra(Menu):
|
|||
layout.operator("grease_pencil.layer_hide", icon='RESTRICT_VIEW_ON', text="Hide Others").unselected = True
|
||||
|
||||
layout.separator()
|
||||
layout.operator("grease_pencil.layer_lock_all", icon='LOCKED', text="Lock All")
|
||||
layout.operator("grease_pencil.layer_lock_all", icon='LOCKED', text="Lock All").lock = True
|
||||
layout.operator("grease_pencil.layer_lock_all", icon='UNLOCKED', text="Unlock All").lock = False
|
||||
|
||||
layout.separator()
|
||||
|
|
|
@ -766,7 +766,7 @@ TreeNode::TreeNode()
|
|||
this->parent = nullptr;
|
||||
|
||||
this->GreasePencilLayerTreeNode::name = nullptr;
|
||||
this->flag = 0;
|
||||
this->flag = GP_LAYER_TREE_NODE_HIDE_MASKS;
|
||||
this->color[0] = this->color[1] = this->color[2] = 0;
|
||||
}
|
||||
|
||||
|
@ -880,6 +880,7 @@ Layer::Layer()
|
|||
this->frames_storage.values = nullptr;
|
||||
this->frames_storage.flag = 0;
|
||||
|
||||
this->blend_mode = GP_LAYER_BLEND_NONE;
|
||||
this->opacity = 1.0f;
|
||||
|
||||
this->parent = nullptr;
|
||||
|
|
|
@ -483,9 +483,12 @@ static int grease_pencil_layer_duplicate_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
/* Duplicate layer. */
|
||||
Layer &active_layer = *grease_pencil.get_active_layer();
|
||||
Layer &new_layer = grease_pencil.add_layer(active_layer.name());
|
||||
Layer &new_layer = grease_pencil.add_layer(active_layer);
|
||||
|
||||
/* Clear source keyframes and recreate them with duplicated drawings. */
|
||||
filedescriptor marked this conversation as resolved
Outdated
|
||||
new_layer.frames_for_write().clear();
|
||||
for (auto [key, frame] : active_layer.frames().items()) {
|
||||
const int duration = frame.is_implicit_hold() ? 0 : active_layer.get_frame_duration_at(key);
|
||||
const int drawing_index = grease_pencil.drawings().size();
|
||||
|
|
Loading…
Reference in New Issue
Hi, can confirm the fix about lock and duplicate layer operators are correct.
But this comments looks odd :)
(Should be related to: clear default keyframe before duplicating each drawing of source layer)
Wait for Falk's reply
I made an attempt to improve the comment 🙂
I think this is good now :D