GPv3: Autolock inactive layers #118323
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118323
Loading…
Reference in New Issue
No description provided.
Delete Branch "PratikPB2123/blender:gpv3-autolock-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?
Port legacy
autolock_layers
property to gpv3Added some comments. I think the double use of
autolock_layers_set
(clearing the locked state for all layers and locking everything but the active layer) makes the code a bit less readable.@ -2189,0 +2199,4 @@
layer->set_locked(false);
continue;
}
layer->set_locked(is_autolock);
Instead of checking the flag, always use
false
.Hmm, then no layers will be locked 🙂
What the code doing is:
when
autolock inactive layers
property is enabled.is_autolock=true
(lock other layers):layer->set_locked(true);
when property is disabled,
is_autolock=flase
(unlock all layers):layer->set_locked(false);
Sorry, I meant
true
@ -488,6 +489,7 @@ typedef struct GreasePencil {
blender::bke::greasepencil::Layer *get_active_layer();
void set_active_layer(const blender::bke::greasepencil::Layer *layer);
bool is_layer_active(const blender::bke::greasepencil::Layer *layer) const;
void autolock_layers_set();
I think it's better to call this
autolock_inactive_layers();
@ -43,0 +43,4 @@
static void rna_grease_pencil_autolock(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
GreasePencil *grease_pencil = rna_grease_pencil(ptr);
grease_pencil->autolock_layers_set();
Instead, check the status of the flag, and if it's true, call the autolock, otherwise iterate over all layers and set the locked to
false
.Didn't understand this 😅
Hi, thanks for the review :)
We're not really clearing the lock state of all layer before locking them
@PratikPB2123 The update function of the property calls
autolock_inactive_layers()
in case the autolock flag is true and when it's false. Basically, I'm suggesting to only callautolock_inactive_layers()
whenGREASE_PENCIL_AUTOLOCK_LAYERS
is set, otherwise just unlock all layers.I see what you mean. In
autolock_inactive_layers()
function, set lock=true for non-active layers (and removeis_autolock
variable)And in property update function, check for the "autolock" flag to lock/unlock non-active layers. but that would be some additional lines which we can avoid 😅
But anyways, I'll update the PR.
Thanks for making the changes :) Looks good
@blender-bot build
@blender-bot build
Merged, thanks for reviewing :)