window_manager.progress
doesn't work after .invoke
+ wm.read_homefile
#113051
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113051
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?
Blender 3.6.3
The usecase for this was
bpy.ops.wm.read_homefile
because imported file is some other separate format, not .blendbpy.ops.wm.read_homefile
we're starting to import actual file and do stuff in new session.bpy.context.window_manager.progress_begin
,bpy.context.window_manager.progress_update
,bpy.context.window_manager.progress_end
.The issue is that progress doesn't seem to work in this case and it doesn't add display progress percent at the user's cursor (below is an example how it usually displays it).
Steps to reproduce the issue.
Run the code below in default blender session.
Go to modifiers and try to run "test with handler" or "test w/o" handler.
Select some other file in the system, it doesn't matter which.
There will be 3 seconds loading during which you won't be able see the progress value on the cursor which is the issue.
In real life example of this code since
wm.read_homefile
purges the context, I useload_handler
the way described here. But this issue is unrelated to handlers as you can see running both buttons on step 2.Comment out the entire operator's
invoke
method so it would go straight to.execute()
and the issue is gone. So issue seems to be related to operator's invoke or operator running modal.And perhaps a bit similar issue -
window_manager.progress
also doesn't work if you start it from--python-expr
. Which would also useful since I've associated some file format with Blender python expression andprogress
would indiciate the loading progress. I guess other usecase for this is starting render from command line and being able to see it's progress.It can reproduced with this rather hacky example (usually you would just call operator that does that under the hood).
The progress cursor display is fragile as it depends on
winactive
which can becomenullptr
during an operator when any changes to the windows are made. Whenwinactive
isnullptr
, the progress cursor is not displayed.See the comment at:
https://projects.blender.org/blender/blender/blame/src/main/source/blender/makesdna/DNA_windowmanager_types.h#L130-L135
Also see https://projects.blender.org/blender/blender/src/branch/main/source/blender/makesrna/intern/rna_wm_api.cc#L191-L192
Perhaps this could be resolved/improved if we used
context.window
instead, but this code is old and would need to be carefully reviewed.@mano-wii Is there some way to update
winactive
manually from the python code? Thought that perhaps screen update can help (bpy.ops.wm.redraw_timer(type="DRAW_WIN_SWAP", iterations=1)
) but it didn't worked