Revision: 40777
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40777
Author:   blendix
Date:     2011-10-03 17:42:24 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
Cycles: fix a few more msvc issues with empty scenes and ustring setting.

Modified Paths:
--------------
    branches/cycles/intern/cycles/blender/blender_mesh.cpp
    branches/cycles/intern/cycles/blender/blender_object.cpp
    branches/cycles/intern/cycles/blender/blender_shader.cpp
    branches/cycles/intern/cycles/bvh/bvh_build.cpp

Modified: branches/cycles/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_mesh.cpp      2011-10-03 
17:29:43 UTC (rev 40776)
+++ branches/cycles/intern/cycles/blender/blender_mesh.cpp      2011-10-03 
17:42:24 UTC (rev 40777)
@@ -110,11 +110,11 @@
                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 @@
 
                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;

Modified: branches/cycles/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_object.cpp    2011-10-03 
17:29:43 UTC (rev 40776)
+++ branches/cycles/intern/cycles/blender/blender_object.cpp    2011-10-03 
17:42:24 UTC (rev 40777)
@@ -177,7 +177,7 @@
 
        /* 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;

Modified: branches/cycles/intern/cycles/blender/blender_shader.cpp
===================================================================
--- branches/cycles/intern/cycles/blender/blender_shader.cpp    2011-10-03 
17:29:43 UTC (rev 40776)
+++ branches/cycles/intern/cycles/blender/blender_shader.cpp    2011-10-03 
17:42:24 UTC (rev 40777)
@@ -568,7 +568,7 @@
                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 @@
 
                        /* 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());

Modified: branches/cycles/intern/cycles/bvh/bvh_build.cpp
===================================================================
--- branches/cycles/intern/cycles/bvh/bvh_build.cpp     2011-10-03 17:29:43 UTC 
(rev 40776)
+++ branches/cycles/intern/cycles/bvh/bvh_build.cpp     2011-10-03 17:42:24 UTC 
(rev 40777)
@@ -270,7 +270,8 @@
        /* 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();
        

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to