{
Light::GenericLoader ldr(get_collection());
load_sub_with(ldr);
- RefPtr<Light> lgt = ldr.get_object();
- get_collection().add(format("%s/%d.light", FS::basename(get_source()), obj.lights.size()), lgt.get());
- obj.attach(*lgt.release());
+ Light *lgt = ldr.store_object(get_collection(), format("%s/%d.light", FS::basename(get_source()), obj.lights.size()));
+ obj.attach(*lgt);
}
} // namespace GL
{
Material::GenericLoader ldr(get_collection());
load_sub_with(ldr);
- RefPtr<Material> mat = ldr.get_object();
- get_collection().add(inline_base_name+".mat", mat.get());
- obj.material = mat.release();
+ obj.material = ldr.store_object(get_collection(), inline_base_name+".mat");
obj.set_material_textures();
}