diff options
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index ad91022de07..16e4ceded89 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -46,7 +46,7 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< float3 *N = attr_N->data_float3(); for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v, ++N) - *N= get_float3(v->normal()); + *N = get_float3(v->normal()); /* create faces */ BL::Mesh::tessfaces_iterator f; @@ -68,8 +68,8 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< } /* create generated coordinates. todo: we should actually get the orco - coordinates from modifiers, for now we use texspace loc/size which - is available in the api. */ + * coordinates from modifiers, for now we use texspace loc/size which + * is available in the api. */ if(mesh->need_attribute(scene, ATTR_STD_GENERATED)) { Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED); float3 loc = get_float3(b_mesh.texspace_location()); @@ -82,7 +82,6 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< loc = loc*size - make_float3(0.5f, 0.5f, 0.5f); float3 *fdata = attr->data_float3(); - BL::Mesh::vertices_iterator v; size_t i = 0; for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end(); ++v) @@ -176,13 +175,15 @@ static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, con for(b_mesh.tessfaces.begin(f); f != b_mesh.tessfaces.end(); ++f) { int4 vi = get_int4(f->vertices_raw()); - int n= (vi[3] == 0)? 3: 4; + int n = (vi[3] == 0) ? 3: 4; //int shader = used_shaders[f->material_index()]; if(n == 4) sdmesh.add_face(vi[0], vi[1], vi[2], vi[3]); - /*else - sdmesh.add_face(vi[0], vi[1], vi[2]);*/ +#if 0 + else + sdmesh.add_face(vi[0], vi[1], vi[2]); +#endif } /* finalize subd mesh */ @@ -210,8 +211,6 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) BL::Object::material_slots_iterator slot; for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) { - BL::Material material_override = render_layer.material_override; - if(material_override) find_shader(material_override, used_shaders, scene->default_surface); else @@ -232,7 +231,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) /* 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 */ + * does not get tagged for recalc */ else if(mesh->used_shaders != used_shaders); else { /* even if not tagged for recalc, we may need to sync anyway @@ -319,7 +318,7 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion) AttributeStandard std = (motion == -1)? ATTR_STD_MOTION_PRE: ATTR_STD_MOTION_POST; Attribute *attr_M = mesh->attributes.add(std); float3 *M = attr_M->data_float3(); - size_t i = 0, size = mesh->verts.size(); + size_t i = 0; for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end() && i < size; ++v, M++, i++) *M = get_float3(v->co()); |