Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-10-15 09:14:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-15 09:14:05 +0300
commit27389362a48a7d79df7c7f6df46760f27d421e6f (patch)
tree937c5820ee0ca1c9def9afab685b2aa878e066eb /source/blender/blenkernel/intern/DerivedMesh.c
parent0941d9932352f5070d209ac7398bf5494c55a869 (diff)
Mesh: remove DerivedMesh for boundbox calculation
Fixes edit-mesh not having a boundbox calculated for it.
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index e4ab70e52b3..01908031431 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2218,13 +2218,11 @@ static void mesh_build_data(
mesh_finalize_eval(ob);
+ /* TODO(campbell): remove these copies, they are expected in various places over the code. */
ob->derivedDeform = CDDM_from_mesh_ex(ob->runtime.mesh_deform_eval, CD_REFERENCE, CD_MASK_MESH);
ob->derivedFinal = CDDM_from_mesh_ex(ob->runtime.mesh_eval, CD_REFERENCE, CD_MASK_MESH);
- DM_set_object_boundbox(ob, ob->derivedFinal);
- /* TODO(sergey): Convert bounding box calculation to use mesh, then
- * we can skip this copy.
- */
+ BKE_object_boundbox_calc_from_mesh(ob, ob->runtime.mesh_eval);
BKE_mesh_texspace_copy_from_object(ob->runtime.mesh_eval, ob);
ob->derivedFinal->needsFree = 0;
@@ -2262,9 +2260,7 @@ static void editbmesh_build_data(
em->mesh_eval_final = me_final;
em->mesh_eval_cage = me_cage;
-#if 0
- DM_set_object_boundbox(obedit, em->derivedFinal);
-#endif
+ BKE_object_boundbox_calc_from_mesh(obedit, em->mesh_eval_final);
em->lastDataMask = dataMask;
@@ -2694,22 +2690,6 @@ void DM_calc_loop_tangents(
&dm->tangent_mask);
}
-/* Set object's bounding box based on DerivedMesh min/max data */
-void DM_set_object_boundbox(Object *ob, DerivedMesh *dm)
-{
- float min[3], max[3];
-
- INIT_MINMAX(min, max);
- dm->getMinMax(dm, min, max);
-
- if (!ob->bb)
- ob->bb = MEM_callocN(sizeof(BoundBox), "DM-BoundBox");
-
- BKE_boundbox_init_from_minmax(ob->bb, min, max);
-
- ob->bb->flag &= ~BOUNDBOX_DIRTY;
-}
-
void DM_init_origspace(DerivedMesh *dm)
{
const float default_osf[4][2] = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};