Mode locked and crash if objects become disabled in viewport while not in object mode #94633
Operating system: Linux-5.15.0-2-amd64-x86_64-with-glibc2.33 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.86
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-03 17:16, hash:
Worked: didn't crash but showed an error message in 2.91.2, branch: master, commit date: 2021-01-19 16:15, hash:
Short description of error
Objects that are in a mode which is not Edit Mode nor Object Mode, will lock the mode setting (so the mode options are greyed out and unusable) if they get disabled in the viewport. Hiding will not cause the this bug, it needs to be disabled in viewport using that display icon in the outliner, not the eye.
The solution for this is probably to make the disable in viewport action switch the mode to object mode if the active objects gets removed (much like delete from outliner). Another solution would be to still allow the mode switch.
Much worse though! Blender crashes sometimes when it gets into this state. I can reliably crash blender as described below.
Exact steps for others to reproduce the error
Go into weightpaint mode of the default cube and disable it in the viewport using the outliner (you need to enable the option first). Now you are stuck and have to enable it in the viewport first to be able to edit anything.
Now restart blender etc. and try this:
- Go into Vertex Paint Mode of the default cube
- Hit Tab to go into Edit Mode
- Disable the cube in the viewport using the outliner as above
- Hit Tab to switch out of Edit Mode -> Crash
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm locked modes and crash on NULL dereference
> blender.exe!sculpt_update_object(Depsgraph * depsgraph, Object * ob, Mesh * me_eval, bool need_pmap, bool need_mask, bool UNUSED_need_colors) Line 1670 C blender.exe!BKE_sculpt_update_object_for_edit(Depsgraph * depsgraph, Object * ob_orig, bool need_pmap, bool need_mask, bool need_colors) Line 1806 C blender.exe!vertex_paint_init_session(Depsgraph * depsgraph, Scene * scene, Object * ob, eObjectMode object_mode) Line 1117 C blender.exe!ed_vwpaintmode_enter_generic(Main * bmain, Depsgraph * depsgraph, Scene * scene, Object * ob, const eObjectMode mode_flag) Line 1256 C blender.exe!ED_object_vpaintmode_enter_ex(Main * bmain, Depsgraph * depsgraph, Scene * scene, Object * ob) Line 1262 C blender.exe!vpaint_mode_toggle_exec(bContext * C, wmOperator * op) Line 2625 C blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1325 C blender.exe!wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const wmOperatorCallContext context, const bool poll_only, wmEvent * event) Line 1520 C blender.exe!WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, wmOperatorCallContext context, PointerRNA * properties) Line 1568 C blender.exe!ED_object_mode_set_ex(bContext * C, eObjectMode mode, bool use_undo, ReportList * reports) Line 219 C blender.exe!object_mode_set_exec(bContext * C, wmOperator * op) Line 1750 C blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1325 C blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2314 C blender.exe!wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2667 C blender.exe!wm_handlers_do_intern(bContext * C, wmWindow * win, wmEvent * event, ListBase * handlers) Line 2994 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 3129 C blender.exe!wm_event_do_handlers(bContext * C) Line 3690 C blender.exe!WM_main(bContext * C) Line 642 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 565 C [External Code]
This issue was referenced by
This issue was referenced by
I am the person who reported this glitch, it is said that it's solved, but it still happens in latest Blender version 3.2.2. Please check it again.
When object has at least one shape key, same glitch happens.
For example there is a cube, and it has a shape key and I select this cube and activate sculpt mode and hide it using "Disable in Viewports" after that move mouse cursor to 3D view port, then Blender crashes.
I checked crash log and it says
ExceptionCode : EXCEPTION_ACCESS_VIOLATION
Exception Address : 0x00007FF791F64EAD
Exception Module : blender.exe
Exception Flags : 0x00000000
Exception Parameters : 0x2
Parameters- [x] : 0x0000000000000000
Parameters- [x] : 0x0000000000000720
No due date set.
No dependencies set.
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?