Page MenuHome

Fixing T57070 bug
Needs ReviewPublic

Authored by Kalle-Samuli Riihikoski (haikalle) on Oct 6 2018, 1:18 AM.

Diff Detail

Event Timeline

Thanx for the patch!
Can confirm this fixes T57070.

Still unsure though why ob->bb is actually NULL there -- further investigation needed...

Also: if we use BKE_pbvh_bounding_box(), we could get rid of

const float *bbMin = ob->bb->vec[0];
const float *bbMax = ob->bb->vec[6];

then?

Yes. I agree that this fixes the the crash but not maybe the main bug. I'm a beginner programmer so I tried to find why ob->bb is NULL. ob is pointing into right object but missing the bb info. BB info is
there if I turn off Dyntopo. Any ideas where to begin to find the root of the issue.

Ok I found the reason why there is no ob->bb info. Sculpt_dynamic_topology_toggle_exec functions leads into BKE_object_free_derived_caches function where is this part:

 	if (ob->bb) {
		MEM_freeN(ob->bb);
		ob->bb = NULL;

If I delete this part then ob->bb way works ok. But I really don't know what is the purpuse of BKE_object_free_derived_caches function so
I don't wan't to modify it. So it's up to you guys what is the best way to handle this. But I hope this info helps to fix this bug.