Page MenuHome

Problem with the mask option "mask slice to new object"
Confirmed, NormalPublicBUG


System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92

Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: rB02948a2cab44
Worked: This problem happens to me with 2.92, the pc that I use now I formatted it, unfortunately before I used version 2.82

Short description of error
My problem is that when I use the option "mask slice to new object" and then I use ctrl + Z the blender closes !! I formatted the PC a few weeks ago, unfortunately I didn't use version 2.92 before. What I realized is that when I use the "mask slice to new object" option and then go to edit mode, I can use control + Z without any problem, that is, it does not close.]

Exact steps for others to reproduce the error
This happens to me in any file:

  1. Sculpture mode.

2.Use the "mask" or "box mask" brushes

  1. I paint the mask.

4.I go to the "MASK" menu.

  1. I click on "mask slice to new object".
  2. Press CTRL + Z.
  3. Blender closes.

Event Timeline

I can confirm the crash, but only after pressing Ctrl + Z a second time (or more...).

I can confirm the crash, but only after pressing Ctrl + Z a second time (or more...).

Yes, it closes me with the third ctrl + z, that is to say that I cannot return to the moment I painted the mask.

Germano Cavalcante (mano-wii) changed the task status from Needs Triage to Confirmed.Apr 7 2021, 5:55 PM
Germano Cavalcante (mano-wii) changed the subtype of this task from "Report" to "Bug".

I can confirm the crash after 3 undo steps.
In addition to the visual glitch reported in T81726: Bug when opening a file in sculpt mode, making N strokes, and undoing N times
Crash log:

 	KernelBase.dll!00007ff81d0f4b59()	Unknown
 	clang_rt.asan_dbg_dynamic-x86_64.dll!00007fff9ec2c375()	Unknown
 	ntdll.dll!00007ff81f568a4c()	Unknown
 	ntdll.dll!00007ff81f541276()	Unknown
 	ntdll.dll!00007ff81f590a9e()	Unknown
>	blender.exe!BKE_scene_object_base_flag_sync_from_base(Base * base) Line 2923	C
 	blender.exe!BKE_scene_set_background(Main * bmain, Scene * scene) Line 2127	C
 	blender.exe!setup_app_data(bContext * C, BlendFileData * bfd, const BlendFileReadParams * params, ReportList * reports) Line 381	C
 	blender.exe!setup_app_blend_file_data(bContext * C, BlendFileData * bfd, const BlendFileReadParams * params, ReportList * reports) Line 419	C
 	blender.exe!BKE_blendfile_read_setup_ex(bContext * C, BlendFileData * bfd, const BlendFileReadParams * params, ReportList * reports, const bool startup_update_defaults, const unsigned char * startup_app_template) Line 456	C
 	blender.exe!BKE_blendfile_read_setup(bContext * C, BlendFileData * bfd, const BlendFileReadParams * params, ReportList * reports) Line 465	C
 	blender.exe!BKE_memfile_undo_decode(MemFileUndoData * mfu, const eUndoStepDir undo_direction, const bool use_old_bmain_data, bContext * C) Line 97	C
 	blender.exe!memfile_undosys_step_decode(bContext * C, Main * bmain, UndoStep * us_p, const eUndoStepDir undo_direction, bool UNUSED_is_final) Line 195	C
 	blender.exe!undosys_step_decode(bContext * C, Main * bmain, UndoStack * ustack, UndoStep * us, const eUndoStepDir dir, bool is_final) Line 216	C
 	blender.exe!BKE_undosys_step_load_data_ex(UndoStack * ustack, bContext * C, UndoStep * us_target, UndoStep * us_reference, const bool use_skip) Line 814	C
 	blender.exe!BKE_undosys_step_undo_with_data_ex(UndoStack * ustack, bContext * C, UndoStep * us_target, bool use_skip) Line 875	C
 	blender.exe!BKE_undosys_step_undo_with_data(UndoStack * ustack, bContext * C, UndoStep * us_target) Line 885	C
 	blender.exe!BKE_undosys_step_undo(UndoStack * ustack, bContext * C) Line 893	C
 	blender.exe!ed_undo_step_direction(bContext * C, eUndoStepDir step, ReportList * reports) Line 301	C
 	blender.exe!ed_undo_exec(bContext * C, wmOperator * op) Line 511	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 1362	C
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2178	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 2503	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2799	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2931	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3456	C
 	blender.exe!WM_main(bContext * C) Line 649	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 231	C
 	[External Code]
Bastien Montagne (mont29) triaged this task as High priority.Oct 4 2021, 4:23 PM
Bastien Montagne (mont29) edited projects, added BF Blender (3.0); removed Core, BF Blender.

There is a lot to say about the MESH_OT_paint_mask_slice code... for a starter, it triggers an assert (mesh.c:1035, BKE_mesh_copy_parameters_for_eval(), at 'me_dst->id.tag & (LIB_TAG_NO_MAIN | LIB_TAG_COPIED_ON_WRITE)'), and from a quick look it seems to be doing fairly un-efficient things with multiple copies of the mesh, if not fully illegal stuff.

My bet would be it also misses some depsgraph update flags, but hard to tell for sure.

This is responsibility of the Sculpt, Paint & Texture module, and this code should be sanitized before 3.0 release, so raising the priority.

@Joseph Eagar (joeedh) maybe you'd be interested in having a look at this one?

Actually, this code has been in Blender for two years already (sigh!!!), so down-grading severity related to 3.0 release since this is not a regression. But it should really be addressed none the less.

@Bastien Montagne (mont29) , can we remove 3.0.0 tag? Report doesn't look correct in present state.

Yes indeed... Will keep the priority to high though, since this is a fairly severe bug & usability issue, albeit in a limited area.

Julien Kaspar (JulienKaspar) lowered the priority of this task from High to Normal.

This has been an issue for a while so I'll lower the priority. @Joseph Eagar (joeedh) will look into the issue further.