mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 19:57:55 -06:00
Modifiers should load at object offset like in Prusaslicer (#3802)
* fix precedence errors Fix a handful of precedence errors and 1 logic/precedence error. None of the code will compile as intended without these changes. * Update GUI_ObjectList.cpp Modifiers should load at same offset as object they are created against. Based on prusaslicer ObjectList::load_from_files where it works correctly. --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
55b6f2a588
commit
afb89c4309
1 changed files with 6 additions and 3 deletions
|
@ -2030,9 +2030,10 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
|||
ModelVolume* new_volume = model_object.add_volume(std::move(mesh), type);
|
||||
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
||||
|
||||
// BBS: object_mesh.get_init_shift() keep the relative position
|
||||
TriangleMesh object_mesh = model_object.volumes[0]->mesh();
|
||||
new_volume->set_offset(new_volume->mesh().get_init_shift() - object_mesh.get_init_shift());
|
||||
// adjust offset as prusaslicer ObjectList::load_from_files does (works) instead of BBS method
|
||||
//// BBS: object_mesh.get_init_shift() keep the relative position
|
||||
//TriangleMesh object_mesh = model_object.volumes[0]->mesh();
|
||||
//new_volume->set_offset(new_volume->mesh().get_init_shift() - object_mesh.get_init_shift());
|
||||
|
||||
// set a default extruder value, since user can't add it manually
|
||||
// BBS
|
||||
|
@ -2056,6 +2057,8 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
|||
const Vec3d offset = Vec3d(instance_bb.max.x(), instance_bb.min.y(), instance_bb.min.z()) + 0.5 * mesh_bb.size() - instance_offset;
|
||||
new_volume->set_offset(inv_inst_transform * offset);
|
||||
}
|
||||
else
|
||||
new_volume->set_offset(new_volume->source.mesh_offset - model_object.volumes.front()->source.mesh_offset);
|
||||
|
||||
added_volumes.push_back(new_volume);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue