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) {
|
if (ob->type == OB_LAMP) {
|
||||||
LightInstance *inst = light_instance(p_id);
|
LightInstance *inst = light_instance(p_id);
|
||||||
if (!inst) {
|
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 = std::make_unique<LightData>(scene_delegate_, ob, p_id);
|
||||||
inst->data->init();
|
inst->data->init();
|
||||||
}
|
}
|
||||||
@ -371,16 +371,14 @@ void InstancerData::write_instances()
|
|||||||
else {
|
else {
|
||||||
MeshInstance *inst = mesh_instance(p_id);
|
MeshInstance *inst = mesh_instance(p_id);
|
||||||
if (!inst) {
|
if (!inst) {
|
||||||
inst = mesh_instances_.lookup_ptr(p_id);
|
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`
|
|||||||
if (inst) {
|
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 = std::make_unique<MeshData>(scene_delegate_, ob, p_id);
|
inst->data->init();
|
||||||
inst->data->init();
|
inst->data->insert();
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
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);
|
free_object_duplilist(lb);
|
||||||
|
Loading…
Reference in New Issue
Block a user
lookup
instead oflookup_ptr
also crash here due toinst
is empty