GPv3: Show and hide layers operators #114348
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#114348
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mendio/blender:GPv3_Show_Hide_Layers"
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?
Note: Operator names were changed for consistency with other layers operators that use layer on their names
Hi, thanks for the PR.
@ -247,0 +315,4 @@
for (Layer *layer : grease_pencil.layers_for_write()) {
layer->set_visible(true);
if (select) {
layer->set_selected(true);
select
property should select points of revealed layers.As far as I understand,
set_selected()
selects the layer, which is wrong.You are right, in GPv2 the behaviour is that when you unhide a Layer all the strokes of the unhided Layer are selected. But this is destructive of all the selections you had in the Layer before it was hidden, IMO we should follow what meshes do and mantain selections.
I removed Layer selection after unhide the layer
But
select
is false by default. So the selection prior of hiding is always preserved even after unhiding the layer.I'm not aware about the use cases of "selecting all points of unhidden layer" (you guys know better about it :) )
If plan is to not use
select
property for GPv3, I'd suggest to remove following code.@ -247,0 +306,4 @@
using namespace blender::bke::greasepencil;
Object *object = CTX_data_active_object(C);
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(object->data);
const bool select = RNA_boolean_get(op->ptr, "select");
this is unused now. We can remove it
@ -247,0 +338,4 @@
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* props */
PropertyRNA *prop = RNA_def_boolean(
same here
Looks correct to me 🙂
LGTM
As a side note, IMHO the
unselected
name of the parameter is not the best name because really means if you hide de active or the others, but in any case this parameter is hidden, so the name is not used in any other place.I used the GPv2 name for the property but I can change that. In GPv2 selected and active layer is the same, but maybe this will change for GPv3 allowing multiple layers selection?
One comment from me. Otherwise looks good 👍
@ -247,0 +258,4 @@
if (unselected) {
/* hide unselected */
for (Layer *layer : grease_pencil.layers_for_write()) {
if (layer != grease_pencil.active_layer) {
We can remove the
if/else
here and replace it:@blender-bot build
Doing a quick build and then I'll merge this.
Looks like some recent merges of other PRs lead to conflics here. So this needs a merge with
main
.