Adjust last operation: can't reset properties to default value #71472

Open
opened 3 years ago by Stan_Pancakes · 12 comments

Blender Version
Broken: 2.8x

Short description of error
In the Adjust Last Operation panel, the context menu for any property has the Reset to Default Value options disabled, although they are enabled in the operator panel.

Exact steps for others to reproduce the error

  1. Load the default scene
  2. Enter edit mode on the cube
  3. Bevel an edge
  4. Expand the operator panel in the bottom left
  5. Right click any property, note that Reset to Default Value option is enabled and works
  6. Go Edit -> Adjust Last Operation
  7. Right click the same property in that panel, note that Reset to Default Value option is disabled
**Blender Version** Broken: 2.8x **Short description of error** In the Adjust Last Operation panel, the context menu for any property has the Reset to Default Value options disabled, although they are enabled in the operator panel. **Exact steps for others to reproduce the error** 1. Load the default scene 2. Enter edit mode on the cube 3. Bevel an edge 4. Expand the operator panel in the bottom left 5. Right click any property, note that Reset to Default Value option is enabled and works 6. Go Edit -> Adjust Last Operation 7. Right click the same property in that panel, note that Reset to Default Value option is disabled
Poster

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes
Collaborator

#86079 was marked as duplicate of this issue

#86079 was marked as duplicate of this issue
Collaborator

#71727 was marked as duplicate of this issue

#71727 was marked as duplicate of this issue
Collaborator

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Collaborator

Can confirm this one also.

Note #71470 is very related [even though in this case -- opposed to #71470 -- it doesnt work well when called via F9 either...]

Can confirm this one also. Note #71470 is very related [even though in this case -- opposed to #71470 -- it doesnt work well when called via F9 either...]
Collaborator

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Collaborator

The poll function of the "Reset to Default Value" operator fails in the popup menu.
This is because it cannot find the active uiBut.
This is because CTX_wm_region(C) does not return the region of the currently open menu popup in ui_context_rna_button_active.

A quick hack to make this particular case work is to replace the function with:

static uiBut *ui_context_rna_button_active(const bContext *C)
{
  bScreen *screen = CTX_wm_screen(C);
  if (screen && screen->regionbase.first) {
    return ui_context_button_active(screen->regionbase.first, ui_context_rna_button_active_test);
  }
  return ui_context_button_active(CTX_wm_region(C), ui_context_rna_button_active_test);
}

This breaks other cases though. I assume the real fix would have to make sure that CTX_wm_region(C) actually returns the popup region, don't know for sure.

The `poll` function of the "Reset to Default Value" operator fails in the popup menu. This is because it cannot find the active `uiBut`. This is because `CTX_wm_region(C)` does not return the region of the currently open menu popup in `ui_context_rna_button_active`. A quick hack to make this particular case work is to replace the function with: ``` static uiBut *ui_context_rna_button_active(const bContext *C) { bScreen *screen = CTX_wm_screen(C); if (screen && screen->regionbase.first) { return ui_context_button_active(screen->regionbase.first, ui_context_rna_button_active_test); } return ui_context_button_active(CTX_wm_region(C), ui_context_rna_button_active_test); } ``` This breaks other cases though. I assume the real fix would have to make sure that `CTX_wm_region(C)` actually returns the popup region, don't know for sure.
Collaborator

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Collaborator

The preferable way to achieve this is using CTX_wm_menu(), it returns the menu region if there is one. If it returns NULL, the current CTX_wm_region() can be used.

However I don't know if this change is safe to do, after all this is called from many different places.

The preferable way to achieve this is using `CTX_wm_menu()`, it returns the menu region if there is one. If it returns `NULL`, the current `CTX_wm_region()` can be used. However I don't know if this change is safe to do, after all this is called from many different places.
Collaborator
Added subscribers: @ChristopherAnderssarian, @WilliamReynish, @dr.sybren, @mano-wii
Collaborator

Added subscriber: @Hologram

Added subscriber: @Hologram
Collaborator

Removed subscriber: @dr.sybren

Removed subscriber: @dr.sybren
lichtwerk removed the
legacy module/User Interface
label 5 hours ago
lichtwerk removed the
Interest/User Interface
label 5 hours ago
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/Collada
Interest/Compositing
Interest/Core
Interest/Cycles
Interest/Dependency Graph
Interest/Development Management
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/Modeling
Interest/Modifiers
Interest/Motion Tracking
Interest/Nodes & Physics
Interest/Overrides
Interest/Performance
Interest/Performance
Interest/Physics
Interest/Pipeline, Assets & I/O
Interest/Platforms, Builds, Tests & Devices
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
legacy module/Animation & Rigging
legacy module/Core
legacy module/Development Management
legacy module/Eevee & Viewport
legacy module/Grease Pencil
legacy module/Modeling
legacy module/Nodes & Physics
legacy module/Pipeline, Assets & IO
legacy module/Platforms, Builds, Tests & Devices
legacy module/Python API
legacy module/Rendering & Cycles
legacy module/Sculpt, Paint & Texture
legacy module/Triaging
legacy module/User Interface
legacy module/VFX & Video
legacy project/1.0.0-beta.2
legacy project/Asset Browser (Archived)
legacy project/BF Blender: 2.8
legacy project/BF Blender: After Release
legacy project/BF Blender: Next
legacy project/BF Blender: Regressions
legacy project/BF Blender: Unconfirmed
legacy project/Blender 2.70
legacy project/Code Quest
legacy project/Datablocks and Libraries
legacy project/Eevee
legacy project/Game Animation
legacy project/Game Audio
legacy project/Game Data Conversion
legacy project/Game Engine
legacy project/Game Logic
legacy project/Game Physics
legacy project/Game Python
legacy project/Game Rendering
legacy project/Game UI
legacy project/GPU / Viewport
legacy project/GSoC
legacy project/Infrastructure: Websites
legacy project/LibOverrides - Usability and UX
legacy project/Milestone 1: Basic, Local Asset Browser
legacy project/Nodes
legacy project/OpenGL Error
legacy project/Papercut
legacy project/Pose Library Basics
legacy project/Retrospective
legacy project/Tracker Curfew
legacy project/Wintab High Frequency
Meta/Good First Issue
Meta/Papercut
migration/requires-manual-verification
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 & Devices
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 Information 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
7 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71472
Loading…
There is no content yet.