Page MenuHome

Sculpt mode: freezes after each stroke
Confirmed, NormalPublicBUG

Description

System Information
Operating system: Windows-7-6.1.7601-SP1 64 Bits
Graphics card: GeForce GTX 660 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.20

Blender Version
Broken: version: 2.82 (sub 6), branch: master, commit date: 2020-01-13 17:12, hash: rBc56526d8b68a

Short description of error
It happens pretty often. I am starting to sculpt, and even with not so high polycount (~500k) brush start to freeze after each stroke.
Stroke can be long and without any lag. My pipeline includes all types of sculpt: deform, remesh, dyntopo.
Also after importing the same mesh into new file, I can sculpt it easy without any lag. Even import whole old scene clear these freezes.
What reason there can be?

File with freezes:

Video:

Event Timeline

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Wed, Jan 15, 12:33 PM

Stack during lag:

Main:

>	blender.exe!BLI_condition_wait(pthread_cond_t_ * * cond, pthread_mutex_t_ * * mutex) Řádek 629	C
 	blender.exe!BLI_task_pool_work_and_wait(TaskPool * pool) Řádek 958	C
 	blender.exe!DEG::deg_evaluate_on_refresh(DEG::Depsgraph * graph) Řádek 402	C++
 	blender.exe!DEG_evaluate_on_refresh(Main * bmain, Depsgraph * graph) Řádek 65	C++
 	blender.exe!scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain, bool only_if_tagged) Řádek 1353	C
 	blender.exe!BKE_scene_graph_update_tagged(Depsgraph * depsgraph, Main * bmain) Řádek 1391	C
 	blender.exe!wm_event_do_depsgraph(bContext * C, bool is_after_open_file) Řádek 376	C
 	blender.exe!wm_event_do_refresh_wm_and_depsgraph(bContext * C) Řádek 403	C
 	blender.exe!wm_event_do_notifiers(bContext * C) Řádek 569	C
 	blender.exe!WM_main(bContext * C) Řádek 423	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Řádek 520	C

Thread:

>	blender.exe!min_ff(float a, float b) Řádek 379	C
 	blender.exe!BB_expand_with_bb(BB * bb, BB * bb2) Řádek 91	C
 	blender.exe!update_vb(PBVH * bvh, PBVHNode * node, BBC * prim_bbc, int offset, int count) Řádek 346	C
 	blender.exe!build_leaf(PBVH * bvh, int node_index, BBC * prim_bbc, int offset, int count) Řádek 401	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 464	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 501	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 501	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 503	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 501	C
 	blender.exe!build_sub(PBVH * bvh, int node_index, BB * cb, BBC * prim_bbc, int offset, int count) Řádek 501	C
 	blender.exe!pbvh_build(PBVH * bvh, BB * cb, BBC * prim_bbc, int totprim) Řádek 528	C
 	blender.exe!BKE_pbvh_build_mesh(PBVH * bvh, const Mesh * mesh, const MPoly * mpoly, const MLoop * mloop, MVert * verts, int totvert, CustomData * vdata, CustomData * ldata, const MLoopTri * looptri, int looptri_num) Řádek 587	C
 	blender.exe!build_pbvh_from_regular_mesh(Object * ob, Mesh * me_eval_deform) Řádek 1526	C
 	blender.exe!BKE_sculpt_object_pbvh_ensure(Depsgraph * depsgraph, Object * ob) Řádek 1587	C
 	blender.exe!sculpt_update_object(Depsgraph * depsgraph, Object * ob, Mesh * me_eval, bool need_pmap, bool need_mask) Řádek 1256	C
 	blender.exe!BKE_sculpt_update_object_after_eval(Depsgraph * depsgraph, Object * ob_eval) Řádek 1357	C
 	blender.exe!mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Řádek 1830	C
 	blender.exe!makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Řádek 1931	C
 	blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Řádek 186	C
 	blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Řádek 356	C
 	[Externí kód]	
 	blender.exe!DEG::`anonymous namespace'::evaluate_node(const DEG::`anonymous-namespace'::DepsgraphEvalState * state, DEG::OperationNode * operation_node) Řádek 116	C++
 	blender.exe!DEG::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata, int thread_id) Řádek 128	C++
 	blender.exe!handle_local_queue(TaskThreadLocalStorage * tls, const int thread_id) Řádek 421	C
 	blender.exe!task_scheduler_thread_run(void * thread_p) Řádek 460	C
 	[Externí kód]
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".

This is produced by a PBVH rebuild, freeing the PBVH in BKE_sculpt_update_object_before_eval. This happened to me in some blend files, but it is not reproducible in the default file, so I'm still trying to guess what is causing in on those particular files.

Today I found main reason of my freezes: they appear when instance or even fake user for the same mesh exist. Look at this!