mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Render non printable instances with a darker color
This commit is contained in:
parent
b1a1ed6394
commit
03820a38cf
6 changed files with 67 additions and 7 deletions
|
@ -1459,6 +1459,32 @@ std::vector<unsigned int> Selection::get_unselected_volume_idxs_from(const std::
|
|||
return idxs;
|
||||
}
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
void Selection::toggle_instance_printable_state()
|
||||
{
|
||||
int instance_idx = get_instance_idx();
|
||||
if (instance_idx == -1)
|
||||
return;
|
||||
|
||||
int obj_idx = get_object_idx();
|
||||
if ((0 <= obj_idx) && (obj_idx < (int)m_model->objects.size()))
|
||||
{
|
||||
ModelObject* model_object = m_model->objects[obj_idx];
|
||||
if ((0 <= instance_idx) && (instance_idx < (int)model_object->instances.size()))
|
||||
{
|
||||
ModelInstance* instance = model_object->instances[instance_idx];
|
||||
instance->printable = !instance->printable;
|
||||
|
||||
for (GLVolume* volume : *m_volumes)
|
||||
{
|
||||
if ((volume->object_idx() == obj_idx) && (volume->instance_idx() == instance_idx))
|
||||
volume->printable = instance->printable;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
void Selection::update_valid()
|
||||
{
|
||||
m_valid = (m_volumes != nullptr) && (m_model != nullptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue