context.collection not available in Object/Object Data Properties #86822

Closed
opened 2021-03-22 15:21:59 +01:00 by Erik Abrahamsson · 6 comments

System Information
Operating system:
Graphics card:

Blender Version
Broken: 2.93
Worked: 2.92

When trying to access context.collection from the Object Properties or Object Data Properties tab it returns None. This seems to be related to 3e87d8a431

This breaks some addons that adds panels in these tabs like for example Tissue.

When I comment out the code on lines 888-891 in buttons_context.c it works like in 2.92 (but probably breaks something new).

  if (CTX_data_equals(member, "collection")) {
    set_pointer_type(path, result, &RNA_Collection);
    return 1;
  }

Reproduce by opening the attached Blend file and run the script in the script editor. This will create a new "Hello World Panel" in Object Data Properties that shows the name of context.collection.

context-collection.blend

**System Information** Operating system: Graphics card: **Blender Version** Broken: 2.93 Worked: 2.92 When trying to access context.collection from the Object Properties or Object Data Properties tab it returns None. This seems to be related to 3e87d8a431 This breaks some addons that adds panels in these tabs like for example Tissue. When I comment out the code on lines 888-891 in buttons_context.c it works like in 2.92 (but probably breaks something new). ``` if (CTX_data_equals(member, "collection")) { set_pointer_type(path, result, &RNA_Collection); return 1; } ``` Reproduce by opening the attached Blend file and run the script in the script editor. This will create a new "Hello World Panel" in Object Data Properties that shows the name of context.collection. [context-collection.blend](https://archive.blender.org/developer/F9904053/context-collection.blend)
Author
Member

Added subscriber: @erik85

Added subscriber: @erik85
Member

Added subscribers: @ChengduLittleA, @ZedDB, @lichtwerk

Added subscribers: @ChengduLittleA, @ZedDB, @lichtwerk
Member

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

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

Eh, yes, this is messing with the context collection in unexpected ways, see for example where this was formerly set in OBJECT_PT_collections:

col.context_pointer_set("collection", collection)

CC @ZedDB
CC @ChengduLittleA

Eh, yes, this is messing with the context collection in unexpected ways, see for example where this was formerly set in `OBJECT_PT_collections`: ``` col.context_pointer_set("collection", collection) ``` CC @ZedDB CC @ChengduLittleA

This issue was referenced by 7d4dcfe879

This issue was referenced by 7d4dcfe879953298bb0a2baaec1dbb5ca7886d64

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sebastian Parborg self-assigned this 2021-03-22 17:39:07 +01: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
4 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#86822
No description provided.