Cycles: fix a few more msvc issues with empty scenes and ustring setting.

This commit is contained in:
Brecht Van Lommel 2011-10-03 17:42:24 +00:00
parent da8f71bffb
commit 1ab9fc59b7
4 changed files with 8 additions and 7 deletions

@ -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;

@ -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;

@ -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());

@ -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();