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>2015-10-09 03:04:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-09 08:35:42 +0300
commitff7effdc041cb87997960bd578a126f7f268f1b4 (patch)
treef30d4c0e31a07c104fd2bfa9bdcbdf91246c5871 /source/blender/blenkernel
parente9b9b883fb30172c5fe82b3a254dcb0f0bbf1799 (diff)
Correct own error in editmesh bvh
Flag mix-up and uninitialized var.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index d48635d21d9..9004985aebd 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -597,7 +597,8 @@ BVHTree *bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *dm, float e
static BVHTree *bvhtree_from_mesh_faces_create_tree(
float epsilon, int tree_type, int axis,
- BMEditMesh *em, MVert *vert, MFace *face, const int numFaces,
+ BMEditMesh *em, const bool em_all,
+ MVert *vert, MFace *face, const int numFaces,
BLI_bitmap *mask, int numFaces_active)
{
BVHTree *tree = NULL;
@@ -646,7 +647,7 @@ static BVHTree *bvhtree_from_mesh_faces_create_tree(
insert = insert_prev;
}
else if (insert) {
- if (tree_type == BVHTREE_FROM_FACES_EDITMESH_ALL) {
+ if (em_all) {
/* pass */
}
else if (BM_elem_flag_test(f, BM_ELEM_SELECT) || BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
@@ -786,7 +787,10 @@ BVHTree *bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *dm, float e
BLI_assert(!(numFaces == 0 && dm->getNumPolys(dm) != 0));
}
- tree = bvhtree_from_mesh_faces_create_tree(epsilon, tree_type, axis, em, vert, face, numFaces, NULL, -1);
+ tree = bvhtree_from_mesh_faces_create_tree(
+ epsilon, tree_type, axis,
+ em, (bvhcache_type == BVHTREE_FROM_FACES_EDITMESH_ALL),
+ vert, face, numFaces, NULL, -1);
if (tree) {
/* Save on cache for later use */
/* printf("BVHTree built and saved on cache\n"); */
@@ -818,7 +822,9 @@ BVHTree *bvhtree_from_mesh_faces_ex(
BLI_bitmap *mask, int numFaces_active, float epsilon, int tree_type, int axis)
{
BVHTree *tree = bvhtree_from_mesh_faces_create_tree(
- epsilon, tree_type, axis, NULL, vert, face, numFaces,
+ epsilon, tree_type, axis,
+ NULL, false,
+ vert, face, numFaces,
mask, numFaces_active);
/* Setup BVHTreeFromMesh */
@@ -837,7 +843,8 @@ BVHTree *bvhtree_from_mesh_faces_ex(
static BVHTree *bvhtree_from_mesh_looptri_create_tree(
float epsilon, int tree_type, int axis,
- BMEditMesh *em, const MVert *vert, const MLoop *mloop, const MLoopTri *looptri, const int looptri_num,
+ BMEditMesh *em, const bool em_all,
+ const MVert *vert, const MLoop *mloop, const MLoopTri *looptri, const int looptri_num,
BLI_bitmap *mask, int looptri_num_active)
{
BVHTree *tree = NULL;
@@ -886,7 +893,7 @@ static BVHTree *bvhtree_from_mesh_looptri_create_tree(
insert = insert_prev;
}
else if (insert) {
- if (tree_type == BVHTREE_FROM_FACES_EDITMESH_ALL) {
+ if (em_all) {
/* pass */
}
else if (BM_elem_flag_test(f, BM_ELEM_SELECT) || BM_elem_flag_test(f, BM_ELEM_HIDDEN)) {
@@ -1054,7 +1061,8 @@ BVHTree *bvhtree_from_mesh_looptri(BVHTreeFromMesh *data, DerivedMesh *dm, float
}
tree = bvhtree_from_mesh_looptri_create_tree(
- epsilon, tree_type, axis, em,
+ epsilon, tree_type, axis,
+ em, (bvhcache_type == BVHTREE_FROM_FACES_EDITMESH_ALL),
mvert, mloop, looptri, looptri_num, NULL, -1);
if (tree) {
/* Save on cache for later use */
@@ -1087,7 +1095,9 @@ BVHTree *bvhtree_from_mesh_looptri_ex(
float epsilon, int tree_type, int axis)
{
BVHTree *tree = bvhtree_from_mesh_looptri_create_tree(
- epsilon, tree_type, axis, NULL, vert, mloop, looptri, looptri_num,
+ epsilon, tree_type, axis,
+ NULL, false,
+ vert, mloop, looptri, looptri_num,
mask, looptri_num_active);
/* Setup BVHTreeFromMesh */