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

Open
opened 2019-11-10 13:27:59 +01:00 by Stanislav Blinov · 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

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes

#86079 was marked as duplicate of this issue

#86079 was marked as duplicate of this issue

#71727 was marked as duplicate of this issue

#71727 was marked as duplicate of this issue
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

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...]
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

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.
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

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.
Member
Added subscribers: @ChristopherAnderssarian, @WilliamReynish, @dr.sybren, @mano-wii

Added subscriber: @Hologram

Added subscriber: @Hologram

Removed subscriber: @dr.sybren

Removed subscriber: @dr.sybren
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:25:05 +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
7 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#71472
No description provided.