GPv3: New is_layer_active function #110890

Merged
Amélie Fondevilla merged 4 commits from PratikPB2123/blender:gpv3-use-api into main 2023-08-08 11:26:29 +02:00
Member

New GreasePencil function to determine whether the layer
is active.

New GreasePencil function to determine whether the layer is active.
Pratik Borhade added 1 commit 2023-08-07 13:55:10 +02:00
Pratik Borhade requested review from Amélie Fondevilla 2023-08-07 13:55:28 +02:00

Hey, the patch looks good to me. I think it would be even better if this PR included a new grease_pencil->is_layer_active function that we could use everywhere. I was planning to do this after the layer selection pr is merged, but if you want to do that would be great.

Hey, the patch looks good to me. I think it would be even better if this PR included a new `grease_pencil->is_layer_active` function that we could use everywhere. I was planning to do this after the layer selection pr is merged, but if you want to do that would be great.
Author
Member

Sure, I'll do that

Sure, I'll do that
Pratik Borhade added 1 commit 2023-08-08 08:41:11 +02:00
Pratik Borhade changed title from Cleanup: Use GPv3 layer api to Cleanup: New is_layer_active function 2023-08-08 08:41:39 +02:00
Amélie Fondevilla reviewed 2023-08-08 09:10:45 +02:00
@ -1729,2 +1729,4 @@
}
const bool GreasePencil::is_layer_active(const blender::bke::greasepencil::Layer *layer) const
{

Maybe here we could check if the layer is nullptr, and return false in that case.

Maybe here we could check if the layer is `nullptr`, and return false in that case.
filedescriptor marked this conversation as resolved
Pratik Borhade added 1 commit 2023-08-08 09:15:14 +02:00
Amélie Fondevilla approved these changes 2023-08-08 09:16:08 +02:00
Amélie Fondevilla requested review from Falk David 2023-08-08 09:16:48 +02:00
Falk David added this to the Grease Pencil project 2023-08-08 10:18:46 +02:00
Falk David requested changes 2023-08-08 10:22:10 +02:00
Falk David left a comment
Member

One comment about the return type (make sure to also update the header). Otherwise this looks good!

One comment about the return type (make sure to also update the header). Otherwise this looks good!
@ -1728,6 +1728,14 @@ void GreasePencil::set_active_layer(const blender::bke::greasepencil::Layer *lay
reinterpret_cast<const GreasePencilLayer *>(layer));
}
const bool GreasePencil::is_layer_active(const blender::bke::greasepencil::Layer *layer) const
Member

Return type shouldn't be const

Return type shouldn't be `const`
filedescriptor marked this conversation as resolved
Pratik Borhade added 1 commit 2023-08-08 10:41:49 +02:00
Falk David approved these changes 2023-08-08 11:21:49 +02:00
Falk David left a comment
Member

Looks good.

Looks good.
Pratik Borhade changed title from Cleanup: New is_layer_active function to GPv3: New is_layer_active function 2023-08-08 11:25:29 +02:00
Amélie Fondevilla merged commit 6e66125f34 into main 2023-08-08 11:26:29 +02:00
Pratik Borhade deleted branch gpv3-use-api 2023-08-08 11:27:43 +02:00
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110890
No description provided.