fix reload loosing positioning information

This commit is contained in:
Michael Kirsch 2022-07-05 21:20:56 +02:00 committed by Lukas Matena
parent a1e37803f7
commit 6664ba3b80

View File

@ -3861,9 +3861,12 @@ void Plater::priv::reload_from_disk()
new_volume->set_type(old_volume->type());
new_volume->set_material_id(old_volume->material_id());
#if ENABLE_WORLD_COORDINATE
new_volume->set_transformation(Geometry::translation_transform(old_volume->source.transform.get_offset()) *
old_volume->get_transformation().get_matrix_no_offset() * old_volume->source.transform.get_matrix_no_offset());
new_volume->translate(new_volume->get_transformation().get_matrix_no_offset() * (new_volume->source.mesh_offset - old_volume->source.mesh_offset));
new_volume->set_transformation(
old_volume->get_transformation().get_matrix() *
old_volume->source.transform.get_matrix() *
Geometry::translation_transform(new_volume->source.mesh_offset - old_volume->source.mesh_offset) *
new_volume->source.transform.get_matrix().inverse()
);
#else
new_volume->set_transformation(Geometry::assemble_transform(old_volume->source.transform.get_offset()) *
old_volume->get_transformation().get_matrix(true) *