Move to use blender::Map container instead std::unordered_map #47

Merged
Bogdan Nagirniak merged 17 commits from Vasyl-Pidhirskyi/blender_bn:BLEN-418 into hydra-render 2023-06-02 12:02:46 +02:00
2 changed files with 8 additions and 10 deletions
Showing only changes of commit 445e628bf3 - Show all commits

View File

@ -386,8 +386,7 @@ void BlenderSceneDelegate::update_instancers(Object *object)
return; return;
} }
instancers_.add_new(id, std::make_unique<InstancerData>(this, object, id)); i_data = instancers_.lookup_or_add(id, std::make_unique<InstancerData>(this, object, id)).get();
i_data = instancer_data(id);
i_data->init(); i_data->init();
i_data->insert(); i_data->insert();
} }

View File

@ -301,15 +301,14 @@ void MeshData::write_materials()
m.mat_data = nullptr; m.mat_data = nullptr;
continue; continue;
} }
pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat); pxr::SdfPath p_id = scene_delegate_->material_prim_id(mat);
m.mat_data = scene_delegate_->material_data(p_id); m.mat_data = scene_delegate_->materials_
if (!m.mat_data) { .lookup_or_add(p_id,
scene_delegate_->materials_.add_new( std::make_unique<MaterialData>(scene_delegate_, mat, p_id))
p_id, std::make_unique<MaterialData>(scene_delegate_, mat, p_id)); .get();
m.mat_data = scene_delegate_->material_data(p_id); m.mat_data->init();
m.mat_data->init(); m.mat_data->insert();
m.mat_data->insert();
}
} }
} }