mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
Added method const GLVolume* Selection::get_first_volume() const to simplify client code
(cherry picked from commit prusa3d/PrusaSlicer@0e3490620e)
This commit is contained in:
parent
9dbb2dfe0d
commit
049dfd3e08
9 changed files with 29 additions and 30 deletions
|
@ -1950,7 +1950,7 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
||||||
const BoundingBoxf3 instance_bb = model_object.instance_bounding_box(instance_idx);
|
const BoundingBoxf3 instance_bb = model_object.instance_bounding_box(instance_idx);
|
||||||
|
|
||||||
// First (any) GLVolume of the selected instance. They all share the same instance matrix.
|
// First (any) GLVolume of the selected instance. They all share the same instance matrix.
|
||||||
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
const Geometry::Transformation inst_transform = v->get_instance_transformation();
|
const Geometry::Transformation inst_transform = v->get_instance_transformation();
|
||||||
const Transform3d inv_inst_transform = inst_transform.get_matrix(true).inverse();
|
const Transform3d inv_inst_transform = inst_transform.get_matrix(true).inverse();
|
||||||
const Vec3d instance_offset = v->get_instance_offset();
|
const Vec3d instance_offset = v->get_instance_offset();
|
||||||
|
@ -2086,7 +2086,7 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode
|
||||||
ModelVolume *new_volume = model_object.add_volume(std::move(mesh), type);
|
ModelVolume *new_volume = model_object.add_volume(std::move(mesh), type);
|
||||||
|
|
||||||
// First (any) GLVolume of the selected instance. They all share the same instance matrix.
|
// First (any) GLVolume of the selected instance. They all share the same instance matrix.
|
||||||
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
// Transform the new modifier to be aligned with the print bed.
|
// Transform the new modifier to be aligned with the print bed.
|
||||||
const BoundingBoxf3 mesh_bb = new_volume->mesh().bounding_box();
|
const BoundingBoxf3 mesh_bb = new_volume->mesh().bounding_box();
|
||||||
new_volume->set_transformation(Geometry::Transformation::volume_to_bed_transformation(v->get_instance_transformation(), mesh_bb));
|
new_volume->set_transformation(Geometry::Transformation::volume_to_bed_transformation(v->get_instance_transformation(), mesh_bb));
|
||||||
|
@ -4350,7 +4350,7 @@ void ObjectList::update_selections()
|
||||||
sels.Add(m_objects_model->GetItemById(selection.get_object_idx()));
|
sels.Add(m_objects_model->GetItemById(selection.get_object_idx()));
|
||||||
}
|
}
|
||||||
else if (selection.is_single_volume() || selection.is_any_modifier()) {
|
else if (selection.is_single_volume() || selection.is_any_modifier()) {
|
||||||
const auto gl_vol = selection.get_volume(*selection.get_volume_idxs().begin());
|
const auto gl_vol = selection.get_first_volume();
|
||||||
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
|
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4426,8 +4426,7 @@ void ObjectList::update_selections()
|
||||||
{
|
{
|
||||||
if (m_selection_mode & smSettings)
|
if (m_selection_mode & smSettings)
|
||||||
{
|
{
|
||||||
const auto idx = *selection.get_volume_idxs().begin();
|
const auto gl_vol = selection.get_first_volume();
|
||||||
const auto gl_vol = selection.get_volume(idx);
|
|
||||||
if (gl_vol->volume_idx() >= 0) {
|
if (gl_vol->volume_idx() >= 0) {
|
||||||
// Only add GLVolumes with non-negative volume_ids. GLVolumes with negative volume ids
|
// Only add GLVolumes with non-negative volume_ids. GLVolumes with negative volume ids
|
||||||
// are not associated with ModelVolumes, but they are temporarily generated by the backend
|
// are not associated with ModelVolumes, but they are temporarily generated by the backend
|
||||||
|
|
|
@ -621,7 +621,7 @@ void GLGizmoAdvancedCut::perform_cut(const Selection& selection)
|
||||||
wxCHECK_RET(instance_idx >= 0 && object_idx >= 0, "GLGizmoAdvancedCut: Invalid object selection");
|
wxCHECK_RET(instance_idx >= 0 && object_idx >= 0, "GLGizmoAdvancedCut: Invalid object selection");
|
||||||
|
|
||||||
// m_cut_z is the distance from the bed. Subtract possible SLA elevation.
|
// m_cut_z is the distance from the bed. Subtract possible SLA elevation.
|
||||||
const GLVolume* first_glvolume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* first_glvolume = selection.get_first_volume();
|
||||||
|
|
||||||
// perform cut
|
// perform cut
|
||||||
{
|
{
|
||||||
|
|
|
@ -341,7 +341,7 @@ BoundingBoxf3 GLGizmoPainterBase::bounding_box() const
|
||||||
void GLGizmoPainterBase::update_contours(const TriangleMesh& vol_mesh, float cursor_z, float max_z, float min_z) const
|
void GLGizmoPainterBase::update_contours(const TriangleMesh& vol_mesh, float cursor_z, float max_z, float min_z) const
|
||||||
{
|
{
|
||||||
const Selection& selection = m_parent.get_selection();
|
const Selection& selection = m_parent.get_selection();
|
||||||
const GLVolume* first_glvolume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* first_glvolume = selection.get_first_volume();
|
||||||
const BoundingBoxf3& box = first_glvolume->transformed_convex_hull_bounding_box();
|
const BoundingBoxf3& box = first_glvolume->transformed_convex_hull_bounding_box();
|
||||||
|
|
||||||
const ModelObject* model_object = wxGetApp().model().objects[selection.get_object_idx()];
|
const ModelObject* model_object = wxGetApp().model().objects[selection.get_object_idx()];
|
||||||
|
|
|
@ -432,7 +432,7 @@ Transform3d GLGizmoRotate::local_transform(const Selection& selection) const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.is_single_volume() || selection.is_single_modifier() || selection.requires_local_axes())
|
if (selection.is_single_volume() || selection.is_single_modifier() || selection.requires_local_axes())
|
||||||
ret = selection.get_volume(*selection.get_volume_idxs().begin())->get_instance_transformation().get_matrix(true, false, true, true) * ret;
|
ret = selection.get_first_volume()->get_instance_transformation().get_matrix(true, false, true, true) * ret;
|
||||||
|
|
||||||
return Geometry::assemble_transform(m_center) * ret;
|
return Geometry::assemble_transform(m_center) * ret;
|
||||||
}
|
}
|
||||||
|
@ -466,7 +466,7 @@ Vec3d GLGizmoRotate::mouse_position_in_local_plane(const Linef3& mouse_ray, cons
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection.is_single_volume() || selection.is_single_modifier() || selection.requires_local_axes())
|
if (selection.is_single_volume() || selection.is_single_modifier() || selection.requires_local_axes())
|
||||||
m = m * selection.get_volume(*selection.get_volume_idxs().begin())->get_instance_transformation().get_matrix(true, false, true, true).inverse();
|
m = m * selection.get_first_volume()->get_instance_transformation().get_matrix(true, false, true, true).inverse();
|
||||||
|
|
||||||
m.translate(-m_center);
|
m.translate(-m_center);
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ std::string GLGizmoScale3D::get_tooltip() const
|
||||||
|
|
||||||
Vec3f scale = 100.0f * Vec3f::Ones();
|
Vec3f scale = 100.0f * Vec3f::Ones();
|
||||||
if (single_instance)
|
if (single_instance)
|
||||||
scale = 100.0f * selection.get_volume(*selection.get_volume_idxs().begin())->get_instance_scaling_factor().cast<float>();
|
scale = 100.0f * selection.get_first_volume()->get_instance_scaling_factor().cast<float>();
|
||||||
else if (single_volume)
|
else if (single_volume)
|
||||||
scale = 100.0f * selection.get_volume(*selection.get_volume_idxs().begin())->get_volume_scaling_factor().cast<float>();
|
scale = 100.0f * selection.get_first_volume()->get_volume_scaling_factor().cast<float>();
|
||||||
|
|
||||||
if (m_hover_id == 0 || m_hover_id == 1 || m_grabbers[0].dragging || m_grabbers[1].dragging)
|
if (m_hover_id == 0 || m_hover_id == 1 || m_grabbers[0].dragging || m_grabbers[1].dragging)
|
||||||
return "X: " + format(scale.x(), 4) + "%";
|
return "X: " + format(scale.x(), 4) + "%";
|
||||||
|
@ -105,7 +105,7 @@ void GLGizmoScale3D::data_changed()
|
||||||
if (enable_scale_xyz) {
|
if (enable_scale_xyz) {
|
||||||
// all volumes in the selection belongs to the same instance, any of
|
// all volumes in the selection belongs to the same instance, any of
|
||||||
// them contains the needed data, so we take the first
|
// them contains the needed data, so we take the first
|
||||||
const GLVolume *volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume *volume = selection.get_first_volume();
|
||||||
if (selection.is_single_full_instance()) {
|
if (selection.is_single_full_instance()) {
|
||||||
set_scale(volume->get_instance_scaling_factor());
|
set_scale(volume->get_instance_scaling_factor());
|
||||||
} else if (selection.is_single_volume() ||
|
} else if (selection.is_single_volume() ||
|
||||||
|
@ -211,7 +211,7 @@ void GLGizmoScale3D::on_render()
|
||||||
}
|
}
|
||||||
|
|
||||||
// gets transform from first selected volume
|
// gets transform from first selected volume
|
||||||
const GLVolume* v = selection.get_volume(*idxs.begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
m_transform = v->get_instance_transformation().get_matrix();
|
m_transform = v->get_instance_transformation().get_matrix();
|
||||||
// gets angles from first selected volume
|
// gets angles from first selected volume
|
||||||
angles = v->get_instance_rotation();
|
angles = v->get_instance_rotation();
|
||||||
|
@ -220,7 +220,7 @@ void GLGizmoScale3D::on_render()
|
||||||
m_offsets_transform = offsets_transform;
|
m_offsets_transform = offsets_transform;
|
||||||
}
|
}
|
||||||
else if (single_volume) {
|
else if (single_volume) {
|
||||||
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
m_box = v->bounding_box();
|
m_box = v->bounding_box();
|
||||||
m_transform = v->world_matrix();
|
m_transform = v->world_matrix();
|
||||||
angles = Geometry::extract_euler_angles(m_transform);
|
angles = Geometry::extract_euler_angles(m_transform);
|
||||||
|
|
|
@ -652,7 +652,7 @@ void GLGizmoText::on_render_input_window(float x, float y, float bottom_limit)
|
||||||
|
|
||||||
const Selection &selection = m_parent.get_selection();
|
const Selection &selection = m_parent.get_selection();
|
||||||
if (selection.is_single_full_instance() || selection.is_single_full_object()) {
|
if (selection.is_single_full_instance() || selection.is_single_full_object()) {
|
||||||
const GLVolume * gl_volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume * gl_volume = selection.get_first_volume();
|
||||||
int object_idx = gl_volume->object_idx();
|
int object_idx = gl_volume->object_idx();
|
||||||
if (object_idx != m_object_idx || (object_idx == m_object_idx && m_volume_idx != -1)) {
|
if (object_idx != m_object_idx || (object_idx == m_object_idx && m_volume_idx != -1)) {
|
||||||
m_object_idx = object_idx;
|
m_object_idx = object_idx;
|
||||||
|
@ -917,7 +917,7 @@ ModelVolume *GLGizmoText::get_selected_single_volume(int &out_object_idx, int &o
|
||||||
{
|
{
|
||||||
if (m_parent.get_selection().is_single_volume() || m_parent.get_selection().is_single_modifier()) {
|
if (m_parent.get_selection().is_single_volume() || m_parent.get_selection().is_single_modifier()) {
|
||||||
const Selection &selection = m_parent.get_selection();
|
const Selection &selection = m_parent.get_selection();
|
||||||
const GLVolume * gl_volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume * gl_volume = selection.get_first_volume();
|
||||||
out_object_idx = gl_volume->object_idx();
|
out_object_idx = gl_volume->object_idx();
|
||||||
ModelObject *model_object = selection.get_model()->objects[out_object_idx];
|
ModelObject *model_object = selection.get_model()->objects[out_object_idx];
|
||||||
out_volume_idx = gl_volume->volume_idx();
|
out_volume_idx = gl_volume->volume_idx();
|
||||||
|
|
|
@ -119,7 +119,7 @@ void SelectionInfo::on_update()
|
||||||
const Selection& selection = get_pool()->get_canvas()->get_selection();
|
const Selection& selection = get_pool()->get_canvas()->get_selection();
|
||||||
if (selection.is_single_full_instance()) {
|
if (selection.is_single_full_instance()) {
|
||||||
m_model_object = selection.get_model()->objects[selection.get_object_idx()];
|
m_model_object = selection.get_model()->objects[selection.get_object_idx()];
|
||||||
m_z_shift = selection.get_volume(*selection.get_volume_idxs().begin())->get_sla_shift_z();
|
m_z_shift = selection.get_first_volume()->get_sla_shift_z();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_model_object = nullptr;
|
m_model_object = nullptr;
|
||||||
|
|
|
@ -86,7 +86,7 @@ void GizmoObjectManipulation::update_settings_value(const Selection& selection)
|
||||||
ObjectList* obj_list = wxGetApp().obj_list();
|
ObjectList* obj_list = wxGetApp().obj_list();
|
||||||
if (selection.is_single_full_instance()) {
|
if (selection.is_single_full_instance()) {
|
||||||
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
|
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_first_volume();
|
||||||
m_new_position = volume->get_instance_offset();
|
m_new_position = volume->get_instance_offset();
|
||||||
|
|
||||||
if (m_world_coordinates) {
|
if (m_world_coordinates) {
|
||||||
|
@ -118,7 +118,7 @@ void GizmoObjectManipulation::update_settings_value(const Selection& selection)
|
||||||
}
|
}
|
||||||
else if (selection.is_single_modifier() || selection.is_single_volume()) {
|
else if (selection.is_single_modifier() || selection.is_single_volume()) {
|
||||||
// the selection contains a single volume
|
// the selection contains a single volume
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_first_volume();
|
||||||
m_new_position = volume->get_volume_offset();
|
m_new_position = volume->get_volume_offset();
|
||||||
m_new_rotation = volume->get_volume_rotation() * (180. / M_PI);
|
m_new_rotation = volume->get_volume_rotation() * (180. / M_PI);
|
||||||
m_new_scale = volume->get_volume_scaling_factor() * 100.;
|
m_new_scale = volume->get_volume_scaling_factor() * 100.;
|
||||||
|
@ -217,7 +217,7 @@ void GizmoObjectManipulation::update_reset_buttons_visibility()
|
||||||
const Selection& selection = m_glcanvas.get_selection();
|
const Selection& selection = m_glcanvas.get_selection();
|
||||||
|
|
||||||
if (selection.is_single_full_instance() || selection.is_single_modifier() || selection.is_single_volume()) {
|
if (selection.is_single_full_instance() || selection.is_single_modifier() || selection.is_single_volume()) {
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_first_volume();
|
||||||
Vec3d rotation;
|
Vec3d rotation;
|
||||||
Vec3d scale;
|
Vec3d scale;
|
||||||
double min_z = 0.;
|
double min_z = 0.;
|
||||||
|
@ -331,14 +331,14 @@ void GizmoObjectManipulation::change_size_value(int axis, double value)
|
||||||
|
|
||||||
Vec3d ref_size = m_cache.size;
|
Vec3d ref_size = m_cache.size;
|
||||||
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
||||||
Vec3d instance_scale = wxGetApp().model().objects[selection.get_volume(*selection.get_volume_idxs().begin())->object_idx()]->instances[0]->get_transformation().get_scaling_factor();
|
Vec3d instance_scale = wxGetApp().model().objects[selection.get_first_volume()->object_idx()]->instances[0]->get_transformation().get_scaling_factor();
|
||||||
ref_size = selection.get_volume(*selection.get_volume_idxs().begin())->bounding_box().size();
|
ref_size = selection.get_first_volume()->bounding_box().size();
|
||||||
ref_size = Vec3d(instance_scale[0] * ref_size[0], instance_scale[1] * ref_size[1], instance_scale[2] * ref_size[2]);
|
ref_size = Vec3d(instance_scale[0] * ref_size[0], instance_scale[1] * ref_size[1], instance_scale[2] * ref_size[2]);
|
||||||
}
|
}
|
||||||
else if (selection.is_single_full_instance())
|
else if (selection.is_single_full_instance())
|
||||||
ref_size = m_world_coordinates ?
|
ref_size = m_world_coordinates ?
|
||||||
selection.get_unscaled_instance_bounding_box().size() :
|
selection.get_unscaled_instance_bounding_box().size() :
|
||||||
wxGetApp().model().objects[selection.get_volume(*selection.get_volume_idxs().begin())->object_idx()]->raw_mesh_bounding_box().size();
|
wxGetApp().model().objects[selection.get_first_volume()->object_idx()]->raw_mesh_bounding_box().size();
|
||||||
|
|
||||||
this->do_scale(axis, 100. * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2)));
|
this->do_scale(axis, 100. * Vec3d(size(0) / ref_size(0), size(1) / ref_size(1), size(2) / ref_size(2)));
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ void GizmoObjectManipulation::reset_position_value()
|
||||||
Selection& selection = m_glcanvas.get_selection();
|
Selection& selection = m_glcanvas.get_selection();
|
||||||
|
|
||||||
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
||||||
GLVolume* volume = const_cast<GLVolume*>(selection.get_volume(*selection.get_volume_idxs().begin()));
|
GLVolume* volume = const_cast<GLVolume*>(selection.get_first_volume());
|
||||||
volume->set_volume_offset(Vec3d::Zero());
|
volume->set_volume_offset(Vec3d::Zero());
|
||||||
}
|
}
|
||||||
else if (selection.is_single_full_instance()) {
|
else if (selection.is_single_full_instance()) {
|
||||||
|
@ -414,7 +414,7 @@ void GizmoObjectManipulation::reset_rotation_value()
|
||||||
Selection& selection = m_glcanvas.get_selection();
|
Selection& selection = m_glcanvas.get_selection();
|
||||||
|
|
||||||
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
if (selection.is_single_volume() || selection.is_single_modifier()) {
|
||||||
GLVolume* volume = const_cast<GLVolume*>(selection.get_volume(*selection.get_volume_idxs().begin()));
|
GLVolume* volume = const_cast<GLVolume*>(selection.get_first_volume());
|
||||||
volume->set_volume_rotation(Vec3d::Zero());
|
volume->set_volume_rotation(Vec3d::Zero());
|
||||||
}
|
}
|
||||||
else if (selection.is_single_full_instance()) {
|
else if (selection.is_single_full_instance()) {
|
||||||
|
@ -450,7 +450,7 @@ void GizmoObjectManipulation::set_uniform_scaling(const bool new_value)
|
||||||
if (selection.is_single_full_instance() && m_world_coordinates && !new_value) {
|
if (selection.is_single_full_instance() && m_world_coordinates && !new_value) {
|
||||||
// Verify whether the instance rotation is multiples of 90 degrees, so that the scaling in world coordinates is possible.
|
// Verify whether the instance rotation is multiples of 90 degrees, so that the scaling in world coordinates is possible.
|
||||||
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
|
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_first_volume();
|
||||||
// Is the angle close to a multiple of 90 degrees?
|
// Is the angle close to a multiple of 90 degrees?
|
||||||
|
|
||||||
if (! Geometry::is_rotation_ninety_degrees(volume->get_instance_rotation())) {
|
if (! Geometry::is_rotation_ninety_degrees(volume->get_instance_rotation())) {
|
||||||
|
|
|
@ -4033,7 +4033,7 @@ int Plater::priv::get_selected_volume_idx() const
|
||||||
int idx = selection.get_object_idx();
|
int idx = selection.get_object_idx();
|
||||||
if ((0 > idx) || (idx > 1000))
|
if ((0 > idx) || (idx > 1000))
|
||||||
return-1;
|
return-1;
|
||||||
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
if (model.objects[idx]->volumes.size() > 1)
|
if (model.objects[idx]->volumes.size() > 1)
|
||||||
return v->volume_idx();
|
return v->volume_idx();
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4844,7 +4844,7 @@ void Plater::priv::replace_with_stl()
|
||||||
if (selection.is_wipe_tower() || get_selection().get_volume_idxs().size() != 1)
|
if (selection.is_wipe_tower() || get_selection().get_volume_idxs().size() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const GLVolume* v = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* v = selection.get_first_volume();
|
||||||
int object_idx = v->object_idx();
|
int object_idx = v->object_idx();
|
||||||
int volume_idx = v->volume_idx();
|
int volume_idx = v->volume_idx();
|
||||||
|
|
||||||
|
@ -7154,7 +7154,7 @@ bool Plater::priv::can_edit_text() const
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (selection.is_single_volume()) {
|
if (selection.is_single_volume()) {
|
||||||
const GLVolume *gl_volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume *gl_volume = selection.get_first_volume();
|
||||||
int out_object_idx = gl_volume->object_idx();
|
int out_object_idx = gl_volume->object_idx();
|
||||||
ModelObject * model_object = selection.get_model()->objects[out_object_idx];
|
ModelObject * model_object = selection.get_model()->objects[out_object_idx];
|
||||||
int out_volume_idx = gl_volume->volume_idx();
|
int out_volume_idx = gl_volume->volume_idx();
|
||||||
|
@ -10334,7 +10334,7 @@ void Plater::export_stl(bool extended, bool selection_only)
|
||||||
if (selection.get_mode() == Selection::Instance)
|
if (selection.get_mode() == Selection::Instance)
|
||||||
mesh = mesh_to_export(*model_object, (model_object->instances.size() > 1) ? -1 : selection.get_instance_idx());
|
mesh = mesh_to_export(*model_object, (model_object->instances.size() > 1) ? -1 : selection.get_instance_idx());
|
||||||
else {
|
else {
|
||||||
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
|
const GLVolume* volume = selection.get_first_volume();
|
||||||
mesh = model_object->volumes[volume->volume_idx()]->mesh();
|
mesh = model_object->volumes[volume->volume_idx()]->mesh();
|
||||||
mesh.transform(volume->get_volume_transformation().get_matrix(), true);
|
mesh.transform(volume->get_volume_transformation().get_matrix(), true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue