bpy.ops.screen.area_join not working anymore #90731
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#90731
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?
System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1060 6GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.40
Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-08-16 16:57, hash:
4dba206011
Worked: 2.93.3 Release Candidate, branch: master, commit date: 2021-08-12 15:05, hash:
1eeae9be15
Short description of error
It seems that area_join operator no longer working after adding new join behavior.
Exact steps for others to reproduce the error
Added subscriber: @DotBow
Added subscriber: @PratikPB2123
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @Harley
Sorry, but not that familiar with using Python for this, so could you explain a bit better how this worked in earlier versions? Your “cursor” here is specifying a singular location at the top-left of one area. The code there has always started at the cursor location and expanded out to find two areas to join. But it could find 0-4 areas depending on where that point is. So I think you’d also have to pass a join direction for it to know what to do, otherwise how do you specify which area is subsumed by the other?
It uses active area as a starting point, so you should only specify a second one using cursor location. It is super weird and unintuitive, but it is what it is...
Here is the doc page:
https://docs.blender.org/api/2.93/bpy.ops.screen.html?highlight=area_join#bpy.ops.screen.area_join
AFAIK it has always been a bit broken, in that the C source not only requires a point (that can be used to locate multiple area neighbors) but also a direction to merge from and to. When called from python the only parameter is that cursor location which isn't enough to do so. When running your example in 2.93 it closes Console (but only seen after forcing a screen draw) and I can't see how you could merge in a different direction.
I think the only real way to fix area_join for python is to add a "Direction" property so in your example you'd also supply a direction='South' (or similar) and could use 'North" top merge Console into 3DView. Or obviously you could use a cursor location at Console right edge and "East" to merge Control into the text editor area. Sound Reasonable?
@Harley yes, that's true - there is no way to set direction, so the only way I found for my add-on is to swap areas and after join them.
Yes, using area corner position and direction sounds like a great way to improve an operator!
Interesting is that for both "Join" and new "Close", I'm pretty sure I can get them working as you want from python, except for the specific example you are showing here. So far I'm not finding a way of having Console destroy itself this way without a ton of hurt. I see solutions that will work with all other areas, but not situations where Console (or Text editor running a script) can close themselves. Not sure if that is a major issue though and I can show a nice error message in this situation.
I used it from Console only for quick demonstration purposes, it's not a real life case.
Using new operator from D12307 works like a charm!
Thanks @Harley !
Is there any news, when
bpy.ops.screen.area_join
will be fixed?I need very much to create area most left and can not do it with Python without area join operator