UILayout.box does not align correctly #28391
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#28391
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?
%%%In the python api it is possible to create boxes in which other properties or operators may be put. The elements of a panel can generally be aligned. But the boxes have some problems dealing with alignment. A simple script is attached with this issue to demonstrate the problem.
Changed status to: 'Open'
blender/blender#43286 was marked as duplicate of this issue
%%%looks like you used API not very correct -- i can't see where you're placing properties in the box. They're adding to layout or column in attached script. If you want property be added to box you should do the following:
box = layout.box() # create box
box.prop(...) # add property to box (place valid arguments here)
Attaching modified script which works.
All works fine with api usage i showed, so closing report. Feel free to poke me here if there'll be more issues noticed.%%%
%%%Hi Sergey,
yes, I know how to use the box() object and put some properties or other things in it, I use it often. I wrote this script as simple as it can be to demonstrate the issue. I was not talking about aligning properties inside a box. The bug I am describing is not present in your script.
My issue:
In fact, I was talking about aligning the box ITSELF to another object (property, operator...). If you look carefully to my example, you'll see that there is three boxes which are aligned with other properties inside a column(align=True).
The first has nothing inside of it and alignes correctly. The lower corners of the box are smoothed with the upper corners of the x location property. This is working correctly but is useless since there is nothing inside the box.
The second one does not align correctly. And the only difference between the first one is that the box is placed under the properties. The box does align with the properties, but the corners are not smoothed. Why does it smooth when it is above and not when it is under.
The third one is the same as the first one except that there is a label in it. But the simple fact to put something in the box breaks the smoothed corners.
I develped an addon where I expected a box to align smoothly with other properties. The addon is paint_palette.py it is on projects.blender.org and it is now also in the trunk. You can look at it to see an example of a situation using what I am talking about.
UIlayout.box, as an ui object, has the possibility to align itself with other ui objects inside a column or a row. It would be inconsistent to not allow it to smooth correctly as the other objects do.
Thank you for your time and considering my issue.%%%
%%%Pardon, nisunderstand initial issue, re-opening.%%%
%%%Old 2011 reports gets a bit dusty. :)
I attached "box_align_2013.py" which shows the issue. Open the script in text editor and check the panel in the scene tab.
Comment the one prop line (line 20) and the box looks fine. But in the current config it fails. %%%
%%%Note: the error is caused by ui_item_align() adding the buttons to the head of the list. Attempted to fix by changing the order but this just gives other similar problems.
Looks like we should really have ui_block_do_align() be able to check for adjacent boxes without them being together in the button list.%%%
Changed status from 'Open' to: 'Archived'
There're quite enough osf things related on widgets alignment.. Perhaps at some point we'll need to revisit interface engine. For now moving to TODO http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#UI_Widgets
Added subscribers: @Leon95, @JulianEisel
Changed status from 'Archived' to: 'Open'
Merged in blender/blender#43286, another example of alignment failing (though not
box
)Changed status from 'Open' to: 'Resolved'
Solved with {D1573}/rB3d39b98f94a6cd3d4445226dd04d5ba3261bf10b