diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-03 21:42:24 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-03 21:42:24 +0400 |
commit | 1ab9fc59b750b1dc5ebaacd30c6891949895a10d (patch) | |
tree | 8ec4f21a0f7124aef255d5519fb3ac2fb3ad0d3b | |
parent | da8f71bffb1a33c695a368c1243b8aa9ac54c21d (diff) |
Cycles: fix a few more msvc issues with empty scenes and ustring setting.
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 3 |
4 files changed, 8 insertions, 7 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index 6e99b380c29..0dc0b91be79 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -110,11 +110,11 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< BL::Mesh::vertex_colors_iterator l; for(b_mesh.vertex_colors.begin(l); l != b_mesh.vertex_colors.end(); ++l) { - if(!mesh_need_attribute(scene, mesh, ustring(l->name()))) + if(!mesh_need_attribute(scene, mesh, ustring(l->name().c_str()))) continue; Attribute *attr = mesh->attributes.add( - ustring(l->name()), TypeDesc::TypeColor, Attribute::CORNER); + ustring(l->name().c_str()), TypeDesc::TypeColor, Attribute::CORNER); BL::MeshColorLayer::data_iterator c; float3 *fdata = attr->data_float3(); @@ -142,7 +142,7 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector< for(b_mesh.uv_textures.begin(l); l != b_mesh.uv_textures.end(); ++l) { Attribute::Standard std = (l->active_render())? Attribute::STD_UV: Attribute::STD_NONE; - ustring name = ustring(l->name()); + ustring name = ustring(l->name().c_str()); if(!(mesh_need_attribute(scene, mesh, name) || mesh_need_attribute(scene, mesh, std))) continue; diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index a4944a378e0..de41484975d 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -177,7 +177,7 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, /* object sync */ if(object_map.sync(&object, b_ob, b_parent, key)) { - object->name = b_ob.name(); + object->name = b_ob.name().c_str(); object->tfm = tfm; object->visibility = object_ray_visibility(b_ob) & visibility; diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index 0c962e3c5f0..c7eda0a0160 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -568,7 +568,7 @@ void BlenderSync::sync_materials() if(shader_map.sync(&shader, *b_mat)) { ShaderGraph *graph = new ShaderGraph(); - shader->name = b_mat->name(); + shader->name = b_mat->name().c_str(); /* create nodes */ if(b_mat->use_nodes() && b_mat->node_tree()) { @@ -660,7 +660,7 @@ void BlenderSync::sync_lamps() /* create nodes */ if(b_lamp->use_nodes() && b_lamp->node_tree()) { - shader->name = b_lamp->name(); + shader->name = b_lamp->name().c_str(); PtrSockMap sock_to_node; BL::ShaderNodeTree b_ntree(b_lamp->node_tree()); diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index d3e84e11d53..67cff3f5873 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -270,7 +270,8 @@ BVHNode* BVHBuild::create_leaf_node(const NodeSpec& spec) /* while there may be multiple triangles in a leaf, for object primitives * we want them to be the only one, so we */ int ob_num = spec.num - num; - BVHNode *oleaf = create_object_leaf_nodes(&references.back() - (ob_num - 1), ob_num); + const Reference *ref = (ob_num)? &references.back() - (ob_num - 1): NULL; + BVHNode *oleaf = create_object_leaf_nodes(ref, ob_num); for(int i = 0; i < ob_num; i++) references.pop_back(); |