Commit: 2a448448702a1805a9d249f1a49b5f886feb146c Author: Sergey Sharybin Date: Mon Aug 25 14:05:00 2014 +0600 Branches: master https://developer.blender.org/rB2a448448702a1805a9d249f1a49b5f886feb146c
Fix T41532: Some files bounce back and forth between 'packing BVH nodes' and 'Copying Transforms to Device' This was originally caused by a6ae12a where i didn't foresee unclear distinguishing between empty and non-synced meshes will give issues for the viewport. They're the same for final rendering, but for viewport we need to be accurate here. =================================================================== M intern/cycles/blender/blender_mesh.cpp M intern/cycles/render/mesh.cpp M intern/cycles/render/mesh.h =================================================================== diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 0f7d14e..a5e4b7b 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -529,14 +529,12 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri Mesh *mesh; if(!mesh_map.sync(&mesh, key)) { - bool have_geometry = mesh->verts.size() != 0; - /* if transform was applied to mesh, need full update */ if(object_updated && mesh->transform_applied); /* test if shaders changed, these can be object level so mesh * does not get tagged for recalc */ else if(mesh->used_shaders != used_shaders); - else if(use_mesh_geometry != have_geometry); + else if(use_mesh_geometry != mesh->geometry_synced); else { /* even if not tagged for recalc, we may need to sync anyway * because the shader needs different mesh attributes */ @@ -599,6 +597,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri /* free derived mesh */ b_data.meshes.remove(b_mesh); } + mesh->geometry_synced = true; } /* displacement method */ diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 2734430..8299cd0 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -132,6 +132,7 @@ void Mesh::clear() transform_applied = false; transform_negative_scaled = false; transform_normal = transform_identity(); + geometry_synced = false; } int Mesh::split_vertex(int vertex) diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h index 5ee774b..d459056 100644 --- a/intern/cycles/render/mesh.h +++ b/intern/cycles/render/mesh.h @@ -71,6 +71,9 @@ public: ustring name; /* Mesh Data */ + bool geometry_synced; /* used to distinguish meshes with no verts + and meshed for which geometry is not created */ + vector<float3> verts; vector<Triangle> triangles; vector<uint> shader; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs