Fix cycles computing UV map tangents when they weren't needed.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 1 Feb 2013 18:00:30 +0000 (18:00 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 1 Feb 2013 18:00:30 +0000 (18:00 +0000)
intern/cycles/blender/blender_mesh.cpp

index 1dd7800..cdbd2fa 100644 (file)
@@ -313,7 +313,7 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
                        std = (active_render)? ATTR_STD_UV_TANGENT: ATTR_STD_NONE;
                        name = ustring((string(l->name().c_str()) + ".tangent").c_str());
 
-                       if(mesh->need_attribute(scene, name) || mesh->need_attribute(scene, std)) {
+                       if(mesh->need_attribute(scene, name) || (active_render && mesh->need_attribute(scene, std))) {
                                std = (active_render)? ATTR_STD_UV_TANGENT_SIGN: ATTR_STD_NONE;
                                name = ustring((string(l->name().c_str()) + ".tangent_sign").c_str());
                                bool need_sign = (mesh->need_attribute(scene, name) || mesh->need_attribute(scene, std));