mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-11 02:19:09 +08:00
Fixed assert after try to add Part to Object with several Instances from the ObjectList.
+ Fixed selection on the 3DScene before a context menu showing
This commit is contained in:
parent
2a6de99f06
commit
aa0737fa5e
@ -5308,14 +5308,18 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
&& m_gizmos.get_current_type() != Gizmos::SlaSupports) // disable context menu when the gizmo is open
|
&& m_gizmos.get_current_type() != Gizmos::SlaSupports) // disable context menu when the gizmo is open
|
||||||
{
|
{
|
||||||
// forces the selection of the volume
|
// forces the selection of the volume
|
||||||
if (!m_selection.is_multiple_full_instance())
|
/** #ys_FIXME_to_delete after testing:
|
||||||
|
* Next condition allows a multiple instance selection for the context menu,
|
||||||
|
* which has no reason. So it's commented till next testing
|
||||||
|
*/
|
||||||
|
// if (!m_selection.is_multiple_full_instance()) // #ys_FIXME_to_delete
|
||||||
m_selection.add(m_hover_volume_id);
|
m_selection.add(m_hover_volume_id);
|
||||||
m_gizmos.update_on_off_state(m_selection);
|
m_gizmos.update_on_off_state(m_selection);
|
||||||
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT));
|
||||||
_update_gizmos_data();
|
_update_gizmos_data();
|
||||||
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
wxGetApp().obj_manipul()->update_settings_value(m_selection);
|
||||||
// // forces a frame render to update the view before the context menu is shown
|
// forces a frame render to update the view before the context menu is shown
|
||||||
// render();
|
render();
|
||||||
|
|
||||||
Vec2d logical_pos = pos.cast<double>();
|
Vec2d logical_pos = pos.cast<double>();
|
||||||
#if ENABLE_RETINA_GL
|
#if ENABLE_RETINA_GL
|
||||||
|
@ -1256,8 +1256,11 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode
|
|||||||
|
|
||||||
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
const GLCanvas3D::Selection& selection = wxGetApp().plater()->canvas3D()->get_selection();
|
||||||
assert(obj_idx == selection.get_object_idx());
|
assert(obj_idx == selection.get_object_idx());
|
||||||
// Selected instance index in ModelObject. Only valid if there is only one instance selected in the selection.
|
|
||||||
int instance_idx = selection.get_instance_idx();
|
/** Any changes of the Object's composition is duplicated for all Object's Instances
|
||||||
|
* So, It's enough to take a bounding box of a first selected Instance and calculate Part(generic_subobject) position
|
||||||
|
*/
|
||||||
|
int instance_idx = *selection.get_instance_idxs().begin();
|
||||||
assert(instance_idx != -1);
|
assert(instance_idx != -1);
|
||||||
if (instance_idx == -1)
|
if (instance_idx == -1)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user