Skip to content

compatibility fix for overriding context - #134

Merged
hannesdelbeke merged 2 commits into
techartorg:masterfrom
Jerakin:fix/blender4.0-context-override
Dec 15, 2025
Merged

hannesdelbeke merged 2 commits into
techartorg:masterfrom
Jerakin:fix/blender4.0-context-override

Conversation

@Jerakin

@Jerakin Jerakin commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Quitting with unsaved changes causes crash in 4.0 and higher.

@hannesdelbeke

hannesdelbeke commented Dec 14, 2025

Copy link
Copy Markdown
Collaborator

hi, this looks good.
i'd like to test it. Since there's no linked issue, could you give some info please?

  • what is the error you get from the crash?
  • how to repro it. just close an unsaved scene?
  • versions. blender 4.0, is that pyside6? and what bqt version

@Jerakin

Jerakin commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

Happens in 4.0 and above due to how overriding context works.

Repro is

Using Blender 4.0 and above (not tested 5.0 but assume it would crash there too)

  • Open Blender
  • Make a change (if you have default cube just move it)
  • Press window [X] button to exit blender.
  • In the dialog chose to save your local changes
  • Result is the stacktrace
Traceback (most recent call last):
  File "projects\bqt\bqt\ui\quit_dialogue.py", line 24, in execute
    bpy.ops.wm.save_mainfile({"window": bpy.context.window_manager.windows[0]}, 'INVOKE_AREA', check_existing=False)
  File "blender\4.2.14\4.2\scripts\modules\bpy\ops.py", line 106, in __call__
    C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "blender\4.2.14\4.2\scripts\modules\bpy\ops.py", line 60, in _parse_args
    raise ValueError("1-2 args execution context is supported")
ValueError: 1-2 args execution context is supported
Error: Python: Traceback (most recent call last):
  File "projects\bqt\bqt\ui\quit_dialogue.py", line 24, in execute
    bpy.ops.wm.save_mainfile({"window": bpy.context.window_manager.windows[0]}, 'INVOKE_AREA', check_existing=False)
  File "blender\4.2.14\4.2\scripts\modules\bpy\ops.py", line 106, in __call__
    C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "blender\4.2.14\4.2\scripts\modules\bpy\ops.py", line 60, in _parse_args
    raise ValueError("1-2 args execution context is supported")
ValueError: 1-2 args execution context is supported

@Jerakin

Jerakin commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

Do note that #130 fixes the same issue in a different location, as there was already an PR for it I didn't re-implement it here. But that should also be accepted if this PR is accepted.

@Jerakin
Jerakin force-pushed the fix/blender4.0-context-override branch 2 times, most recently from 3cd2d85 to a2c13ad Compare December 15, 2025 11:43
@Jerakin
Jerakin force-pushed the fix/blender4.0-context-override branch from a2c13ad to e9f759c Compare December 15, 2025 11:57
@hannesdelbeke

Copy link
Copy Markdown
Collaborator

just merged 130 in

@hannesdelbeke

Copy link
Copy Markdown
Collaborator

managed to repro issue, seems indeed same as 130

@hannesdelbeke

hannesdelbeke commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

tested, this PR now triggers the save dialogue as expected.
this is a major PR since it could potentially lose user's save data!

thanks a lot

@hannesdelbeke
hannesdelbeke merged commit c3d42e2 into techartorg:master Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants