Python: overriden context prints out PyContext not found errors #37079
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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-addons#37079
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
%%%--- Blender version with error, and version that worked ---
Blender 2.60 to 2.69rc all fail and probably early versions as well.
[ caution, step (3) will remove all your scene objects ]
3) >>> bpy.ops.object.delete(override)
It seems to be working, but I get a lot of error prints such as:
PyContext 'window' not found
PyContext 'scene' not found
PyContext 'region' not found
PyContext 'area' not found
PyContext 'area' not found
PyContext 'screen' not found
PyContext 'screen' not found
PyContext 'active_object' not found
(...)
Those errors show in Debug and Release versions.
Reference documentation:
http://www.blender.org/documentation/blender_python_api_2_68_release/bpy.ops.html#overriding-context
Thanks%%%
Changed status to: 'Open'
%%%In a related note, I can segfault Blender very easily with this feature:
I realize (now) that it crashes if I pass objects instead of object_bases (whatever the difference is ;).
This is pretty advanced so it's not the end of the world. It would be nice if we could not segfault though.%%%
%%%Hey Dalai, this is not a bug! You should feature those data in your fake pycontext as well!
Note best way if usually to do:
override = C.copy()
override['selected_bases'] = list(C.scene.object_bases)
bpy.ops.object.delete(override)
This just works fine…%%%
Changed status from 'Open' to: 'Archived'
%%%I would say that at least the documentation is 'wrong', don't you agree?
[
and thanks for the instructions, I got what I wanted to do working ;)
https://github.com/dfelinto/addon-samples/blob/master/delete_family.py
]%%%