Modifier menu and text switch places #81227

Closed
opened 2020-09-27 12:56:34 +02:00 by Zachary · 29 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 950M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-26 20:04, hash: 8c81b3fb8b

Short description of error
Moving modifiers makes the properties text and modifier menu switch places.

text_switch.jpg

Exact steps for others to reproduce the error
1: Add multiple modifiers
2: Drag to move modifiers

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 950M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.38 **Blender Version** Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-26 20:04, hash: `8c81b3fb8b` **Short description of error** Moving modifiers makes the properties text and modifier menu switch places. ![text_switch.jpg](https://archive.blender.org/developer/F8928135/text_switch.jpg) **Exact steps for others to reproduce the error** 1: Add multiple modifiers 2: Drag to move modifiers
Author

Added subscriber: @AFWS

Added subscriber: @AFWS

#81401 was marked as duplicate of this issue

#81401 was marked as duplicate of this issue
Member

Closed as duplicate of #81161

Closed as duplicate of #81161
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

This should be fixed, please try an updated daily build.

This should be fixed, please try an updated daily build.
Author

In #81227#1024290, @Blendify wrote:
This should be fixed, please try an updated daily build.

Seems to be the same or at least related ,but did you look at the date and hash? I just did a make update and build the latest 2 hours ago. If that fixed worked, it shouldn't be doing this still.

> In #81227#1024290, @Blendify wrote: > This should be fixed, please try an updated daily build. Seems to be the same or at least related ,but did you look at the date and hash? I just did a `make update` and build the latest 2 hours ago. If that fixed worked, it shouldn't be doing this still.
Member

Changed status from 'Duplicate' to: 'Needs Developer To Reproduce'

Changed status from 'Duplicate' to: 'Needs Developer To Reproduce'
Hans Goudey was assigned by Aaron Carlisle 2020-09-27 14:25:00 +02:00
Member

Based on the description this is not a duplicate of the other report, it would be a different problem.

However, I can't reproduce this. Does it happen if you load the default settings and startup file? (File->Defaults->Load Factory Settings)

Based on the description this is not a duplicate of the other report, it would be a different problem. However, I can't reproduce this. Does it happen if you load the default settings and startup file? (File->Defaults->Load Factory Settings)
Author

In #81227#1024356, @HooglyBoogly wrote:
Based on the description this is not a duplicate of the other report, it would be a different problem.

However, I can't reproduce this. Does it happen if you load the default settings and startup file? (File->Defaults->Load Factory Settings)

It could be the same problem. Does it if you move any panels and not just modifiers. Yeah, I tried Load Factory Settings and it made no difference. Even does it if I open the startup.blend from here C:\blender-git\blender\release\datafiles\startup.blend

2020-09-27 11-34-40.mp4

> In #81227#1024356, @HooglyBoogly wrote: > Based on the description this is not a duplicate of the other report, it would be a different problem. > > However, I can't reproduce this. Does it happen if you load the default settings and startup file? (File->Defaults->Load Factory Settings) It could be the same problem. Does it if you move any panels and not just modifiers. Yeah, I tried Load Factory Settings and it made no difference. Even does it if I open the startup.blend from here `C:\blender-git\blender\release\datafiles\startup.blend` [2020-09-27 11-34-40.mp4](https://archive.blender.org/developer/F8928897/2020-09-27_11-34-40.mp4)

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Member

Added subscriber: @iss

Added subscriber: @iss
Member

@iss I guess you were able to reproduce this? I wonder if it's a windows thing.

@iss I guess you were able to reproduce this? I wonder if it's a windows thing.
Member

Added subscribers: @aicedor, @HooglyBoogly

Added subscribers: @aicedor, @HooglyBoogly

Added subscriber: @rjg

Added subscriber: @rjg

@HooglyBoogly I can reproduce this behavior as well.

@HooglyBoogly I can reproduce this behavior as well.
Member

What OS?

What OS?

Windows as well.

Windows as well.
Member

In that case I'd guess that this comes down to platform differences in the implementation of qsort. When headerless panels are compared to normal panels they are placed above, but it's sort of arbitrary what happens when two headerless panels are compared. I'm guessing I'll have to tag one of them as "first," although I wonder how it worked in 2.79... Requires a bit more testing. But I have no windows dev setup to reproduce this.

In that case I'd guess that this comes down to platform differences in the implementation of `qsort`. When headerless panels are compared to normal panels they are placed above, but it's sort of arbitrary what happens when two headerless panels are compared. I'm guessing I'll have to tag one of them as "first," although I wonder how it worked in 2.79... Requires a bit more testing. But I have no windows dev setup to reproduce this.

@HooglyBoogly That would be a possible explanation of the issue, qsort is not a stable sorting algorithm. From a quick glance at the code this probably means a change to find_highest_panel or compare_panel?

@HooglyBoogly That would be a possible explanation of the issue, qsort is not a stable sorting algorithm. From a quick glance at the code this probably means a change to `find_highest_panel` or `compare_panel`?
Member

@rjg Yes, probably just switching to a stable sorting algorithm would work. But maybe it's better to fix it more elegantly.

find_highest_panel is needed to properly sort panels based on where you drag them.

There's a variety of small changes to the logic of find_highest_panel I would try here. For example, this disables sorting by offset unless one panel in the comparison is being dragged:

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index ec4e2c03e85..25094b52372 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1703,11 +1703,13 @@ static int find_highest_panel(const void *a, const void *b)
     return 1;
   }
 
-  if (panel_a->ofsy + panel_a->sizey < panel_b->ofsy + panel_b->sizey) {
-    return 1;
-  }
-  if (panel_a->ofsy + panel_a->sizey > panel_b->ofsy + panel_b->sizey) {
-    return -1;
+  if (panel_a->flag & PNL_SELECT || panel_b->flag & PNL_SELECT) {
+    if (panel_a->ofsy + panel_a->sizey < panel_b->ofsy + panel_b->sizey) {
+      return 1;
+    }
+    if (panel_a->ofsy + panel_a->sizey > panel_b->ofsy + panel_b->sizey) {
+      return -1;
+    }
   }
   if (panel_a->sortorder > panel_b->sortorder) {
     return 1;
@rjg Yes, probably just switching to a stable sorting algorithm would work. But maybe it's better to fix it more elegantly. `find_highest_panel` is needed to properly sort panels based on where you drag them. There's a variety of small changes to the logic of `find_highest_panel` I would try here. For example, this disables sorting by offset unless one panel in the comparison is being dragged: ``` diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index ec4e2c03e85..25094b52372 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1703,11 +1703,13 @@ static int find_highest_panel(const void *a, const void *b) return 1; } - if (panel_a->ofsy + panel_a->sizey < panel_b->ofsy + panel_b->sizey) { - return 1; - } - if (panel_a->ofsy + panel_a->sizey > panel_b->ofsy + panel_b->sizey) { - return -1; + if (panel_a->flag & PNL_SELECT || panel_b->flag & PNL_SELECT) { + if (panel_a->ofsy + panel_a->sizey < panel_b->ofsy + panel_b->sizey) { + return 1; + } + if (panel_a->ofsy + panel_a->sizey > panel_b->ofsy + panel_b->sizey) { + return -1; + } } if (panel_a->sortorder > panel_b->sortorder) { return 1; ```

@HooglyBoogly That change doesn't solve the issue for me. If I have some time later on I'll take another look and see if I can find a solution.

@HooglyBoogly That change doesn't solve the issue for me. If I have some time later on I'll take another look and see if I can find a solution.
Member

This should be resolved for 2.91. Although I don't have a way to reproduce this, and I only have a few smaller ideas I want to test.

This should be resolved for 2.91. Although I don't have a way to reproduce this, and I only have a few smaller ideas I want to test.

@HooglyBoogly This is not resolved, same behavior as before in master build from today.

@HooglyBoogly This is not resolved, same behavior as before in master build from today.
Member

@rjg Yes, I meant "I should work on resolving this for 2.91," not that it was already resolved.

@rjg Yes, I meant "I should work on resolving this for 2.91," not that it was already resolved.

@HooglyBoogly Sorry, misinterpreted your comment.

@HooglyBoogly Sorry, misinterpreted your comment.

Added subscriber: @MikhailRachinskiy

Added subscriber: @MikhailRachinskiy

This issue was referenced by 0724fabcf5

This issue was referenced by 0724fabcf52ad9b97649969ab3c830b9fd5ac9ea

This issue was referenced by fd78f8699e

This issue was referenced by fd78f8699e034d52d5d0921a7b4c722f68b213cc
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Thomas Dinges added this to the 2.91 milestone 2023-02-08 16:20:22 +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
8 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#81227
No description provided.