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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-01 19:12:10 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-07-01 19:12:10 +0400
commit93bdba9b21d2e7dd860bff486e81dcb0bc9c3377 (patch)
tree9db8d8ac983543fb57e121ee70ee50a04ea236ae /source/blender/blenlib
parent6cc4160df9ce024319ace2db2f0200835603f473 (diff)
Fix for crash with PBVH in background mode, patch by Campbell.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/pbvh.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index 92e2c88e8a1..82e2090c432 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -30,6 +30,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_mesh.h" /* for mesh_calc_normals */
+#include "BKE_global.h" /* for mesh_calc_normals */
#include "gpu_buffers.h"
@@ -350,12 +351,14 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
if(node->face_vert_indices[i] < 0)
node->face_vert_indices[i]= -node->face_vert_indices[i] + node->uniq_verts - 1;
- node->draw_buffers =
- GPU_build_mesh_buffers(map, bvh->verts, bvh->faces,
+ if(!G.background) {
+ node->draw_buffers =
+ GPU_build_mesh_buffers(map, bvh->verts, bvh->faces,
node->prim_indices,
node->totprim, node->vert_indices,
node->uniq_verts,
node->uniq_verts + node->face_verts);
+ }
node->flag |= PBVH_UpdateDrawBuffers;
@@ -364,10 +367,11 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
static void build_grids_leaf_node(PBVH *bvh, PBVHNode *node)
{
- node->draw_buffers =
- GPU_build_grid_buffers(bvh->grids, node->prim_indices,
+ if(!G.background) {
+ node->draw_buffers =
+ GPU_build_grid_buffers(bvh->grids, node->prim_indices,
node->totprim, bvh->gridsize);
-
+ }
node->flag |= PBVH_UpdateDrawBuffers;
}