GPv3: Basic layer channel selection #110133
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110133
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:gpv3-active-layer-channel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR adds support for the selection of grease pencil layers in
animation editor.
GreasePencilLayerTreeNode
GP_LAYER_TREE_NODE_SELECT
flag is used for selectionPart of #110056
@filedescriptor hi, changing active layer from properties tab do not change the layer selection in anim-editors. Any idea how to send notifier after execution of
on_activate()
function ofLayerViewItem
?Thank you for the patch :) Some comments about the
GP_LAYER_TREE_NODE_ACTIVE
flag.@ -299,1 +305,3 @@
case ANIMTYPE_GREASE_PENCIL_LAYER: {
GreasePencilLayer *layer = (GreasePencilLayer *)channel_data;
layer->base.flag |= GP_LAYER_TREE_NODE_ACTIVE;
Instead of setting a flag here, this needs to set the
active_layer
pointer.Hi, thanks for the review.
Right now this is done in
click_select_channel_grease_pencil_layer
But if we want this change in
ANIM_set_active_channel()
function, I think we'd need to passbAnimListElem
instead ofale->data
(otherwise GreasePencil can not be obtained in this function)Can you check if
ale->id
is the right data here? Maybe that works.No.
ale
itself is null here.because we first iterate over all the present/visible channels to clear active flag
Then after exiting for loop (from here),
ale
is nullRight, maybe this is actually not needed for grease pencil then. Since changing the pointer to another layer does not require any change in all the other layers.
@ -234,6 +234,7 @@ typedef enum GreasePencilLayerTreeNodeFlag {
GP_LAYER_TREE_NODE_MUTE = (1 << 3),
GP_LAYER_TREE_NODE_USE_LIGHTS = (1 << 4),
GP_LAYER_TREE_NODE_USE_ONION_SKINNING = (1 << 5),
GP_LAYER_TREE_NODE_ACTIVE = (1 << 6),
I don't think this flag is needed. We should just check the
active_layer
pointer in the grease pencil data.Make sense. I thought this might be helpful for further selection operations (extend, invert, range select).
@PratikPB2123 I think the active layer is now changed directly. Instead, the properties panel should call an operator or Python API function to change the active layer. That will both handle undo and also sending notifiers.
Done here: #110378
Comment about casts.
@ -3653,0 +3656,4 @@
const short /* eEditKeyframes_Select or -1 */ selectmode,
const int filter)
{
GreasePencilLayer *layer = (GreasePencilLayer *)ale->data;
Use
static_cast
for newly added code.Another comment. This PR should also be rebase on top of
main
.@ -3653,0 +3653,4 @@
bContext *C,
bAnimContext *ac,
bAnimListElem *ale,
const short /* eEditKeyframes_Select or -1 */ selectmode,
I'm getting some warnings about
selectmode
andfilter
being unused.I think
selectmode
should be used. The different selection modes like shift+select and ctrl+select should work.selectmode
andfilter
is for future use (for other channel selection operations)I don't think extend and extend range selection should be part of this PR (because this PR only changes the active channel and syncs it with layer in object properties panel)
Let me know if you want it within this PR or separate PR.
Ok I'm ok with this coming in a later PR. But in this case the parameters need to be commented out e.g.
const short /*selectmode*/, const int /*filter*/
and there should be aTODO
comment in this function stating that the selection modes need to be implemented.@ -3653,0 +3652,4 @@
static int click_select_channel_grease_pencil_layer(bContext *C,
bAnimContext *ac,
bAnimListElem *ale,
const short /* selectmode */,
Formatting looks off. Make sure to run
clang-format
.clang-format itself changed this alignment (Visual studio formats the code after saving particular file) 😅
Hm there shouldn't be any spaces around
selectmode
. Doesmake format
lead to a different result?no difference with
make format
.Will change comment style manually
Looks good. Thanks :)
Pratik Borhade referenced this pull request2023-08-02 12:39:12 +02:00
Looks good to me.
Merged, thanks for reviewing :)