GPencilLayer.select does not select the layer in the Dope Sheet #104226

Closed
opened 2023-01-30 04:41:33 +01:00 by Kevin C. Burke · 6 comments
Contributor

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 528.24

Blender Version
Broken: 2.83 through 3.5.0 Alpha

Short description of error
The Python API for selecting a GPencilLayer appears to be broken

Exact steps for others to reproduce the error
According to the documentation, GPencilLayer.select is a Boolean for a Layer's selection state in the Dope Sheet. This property, however, currently only retrieves the selected state, but does not edit it. I am not referring to the active layer.

  1. Create a Grease Pencil object
  2. Ensure it is the active object and has a layer named GP_Layer
  3. Run this script in the Text Editor
import bpy

gpencil = bpy.context.object
print(gpencil.data.layers["GP_Layer"].select)
gpencil.data.layers["GP_Layer"].select = not gpencil.data.layers["GP_Layer"].select #toggle state

If this is intended behavior (which would be unfortunate), the documentation should mark select as a read-only property.

This issue has appeared in Grease Pencil's Python API before however it is broken again:
https://developer.blender.org/T103329
https://developer.blender.org/D16841

Proposed fix [D17150 ](https://developer.blender.org/D17150)

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 528.24 **Blender Version** Broken: 2.83 through 3.5.0 Alpha **Short description of error** The Python API for selecting a `GPencilLayer` appears to be broken **Exact steps for others to reproduce the error** According to the documentation, [GPencilLayer.select ](https://docs.blender.org/api/current/bpy.types.GPencilLayer.html#bpy.types.GPencilLayer.select) is a Boolean for a Layer's selection state in the Dope Sheet. This property, however, currently only retrieves the selected state, but does not edit it. I am not referring to the active layer. 1. Create a Grease Pencil object 2. Ensure it is the active object and has a layer named `GP_Layer` 3. Run this script in the Text Editor ``` import bpy gpencil = bpy.context.object print(gpencil.data.layers["GP_Layer"].select) gpencil.data.layers["GP_Layer"].select = not gpencil.data.layers["GP_Layer"].select #toggle state ``` If this is intended behavior (which would be unfortunate), the [documentation ](https://docs.blender.org/api/current/bpy.types.GPencilLayer.html#bpy.types.GPencilLayer.select) should mark `select` as a read-only property. This issue has appeared in Grease Pencil's Python API before however it is broken again: https://developer.blender.org/T103329 https://developer.blender.org/D16841 Proposed fix [[D17150](https://archive.blender.org/developer/D17150) ](https://developer.blender.org/D17150)
Author
Contributor

Added subscriber: @KevinCBurke

Added subscriber: @KevinCBurke
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

#103329 has not been fixed yet (since D16841 has not landed).
So, this seems like a duplicate of #103329 then?

Will merge (correct me if I am wrong)

#103329 has not been fixed yet (since [D16841](https://archive.blender.org/developer/D16841) has not landed). So, this seems like a duplicate of #103329 then? Will merge (correct me if I am wrong)
Member

Closed as duplicate of #103329

Closed as duplicate of #103329
Author
Contributor

Ah, thank you, @lichtwerk . I didn't catch that it hadn't landed. I'm happy to know that a more thorough fix is coming!

Ah, thank you, @lichtwerk . I didn't catch that it hadn't landed. I'm happy to know that a more thorough fix is coming!
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#104226
No description provided.