forked from blender/blender
Move to use blender::Map container instead std::unordered_map #47
@ -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);
|
||||
Vasyl-Pidhirskyi marked this conversation as resolved
Outdated
|
||||
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);
|
||||
Vasyl-Pidhirskyi marked this conversation as resolved
Outdated
Georgiy Markelov
commented
`lookup` instead of `lookup_ptr`
|
||||
inst->data = std::make_unique<MeshData>(scene_delegate_, ob, p_id);
|
||||
Vasyl-Pidhirskyi marked this conversation as resolved
Outdated
Georgiy Markelov
commented
check logic here check logic here
|
||||
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 */
|
||||
|
Loading…
Reference in New Issue
Block a user
lookup
instead oflookup_ptr
also crash here due toinst
is empty