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
Showing only changes of commit c47f08f2e1 - Show all commits

View File

@ -361,7 +361,7 @@ void InstancerData::write_instances()
if (ob->type == OB_LAMP) {
LightInstance *inst = light_instance(p_id);
if (!inst) {
inst = light_instances_.lookup_ptr(p_id);
inst = &light_instances_.lookup_or_add_default(p_id);
inst->data = std::make_unique<LightData>(scene_delegate_, ob, p_id);
inst->data->init();
}
@ -371,18 +371,16 @@ void InstancerData::write_instances()
else {
MeshInstance *inst = mesh_instance(p_id);
if (!inst) {
inst = mesh_instances_.lookup_ptr(p_id);
if (inst) {
inst = &mesh_instances_.lookup_or_add_default(p_id);
inst->data = std::make_unique<MeshData>(scene_delegate_, ob, p_id);
inst->data->init();
inst->data->insert();
}
ID_LOG(2, "Mesh %s %d", inst->data->id->name, mesh_transforms_.size());
inst->indices.push_back(mesh_transforms_.size());
mesh_transforms_.push_back(gf_matrix_from_transform(dupli->mat));
}
}
}
}
free_object_duplilist(lb);
/* Remove mesh intances without indices */