mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-10 00:59:10 +08:00
SLA gizmo now forces objects to use their normal color (not SELECTED_COLOR)
This commit is contained in:
parent
2728e45646
commit
df01af975a
@ -249,6 +249,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
|
|||||||
, is_wipe_tower(false)
|
, is_wipe_tower(false)
|
||||||
, is_extrusion_path(false)
|
, is_extrusion_path(false)
|
||||||
, force_transparent(false)
|
, force_transparent(false)
|
||||||
|
, force_native_color(false)
|
||||||
, tverts_range(0, size_t(-1))
|
, tverts_range(0, size_t(-1))
|
||||||
, qverts_range(0, size_t(-1))
|
, qverts_range(0, size_t(-1))
|
||||||
{
|
{
|
||||||
@ -280,6 +281,9 @@ void GLVolume::set_render_color(const float* rgba, unsigned int size)
|
|||||||
|
|
||||||
void GLVolume::set_render_color()
|
void GLVolume::set_render_color()
|
||||||
{
|
{
|
||||||
|
if (force_native_color)
|
||||||
|
set_render_color(color, 4);
|
||||||
|
else {
|
||||||
if (selected)
|
if (selected)
|
||||||
set_render_color(is_outside ? SELECTED_OUTSIDE_COLOR : SELECTED_COLOR, 4);
|
set_render_color(is_outside ? SELECTED_OUTSIDE_COLOR : SELECTED_COLOR, 4);
|
||||||
else if (hover)
|
else if (hover)
|
||||||
@ -290,6 +294,7 @@ void GLVolume::set_render_color()
|
|||||||
set_render_color(OUTSIDE_COLOR, 4);
|
set_render_color(OUTSIDE_COLOR, 4);
|
||||||
else
|
else
|
||||||
set_render_color(color, 4);
|
set_render_color(color, 4);
|
||||||
|
}
|
||||||
|
|
||||||
if (force_transparent)
|
if (force_transparent)
|
||||||
render_color[3] = color[3];
|
render_color[3] = color[3];
|
||||||
|
@ -302,6 +302,8 @@ public:
|
|||||||
bool is_extrusion_path;
|
bool is_extrusion_path;
|
||||||
// Wheter or not to always render this volume using its own alpha
|
// Wheter or not to always render this volume using its own alpha
|
||||||
bool force_transparent;
|
bool force_transparent;
|
||||||
|
// Whether or not always use the volume's own color (not using SELECTED/HOVER/DISABLED/OUTSIDE)
|
||||||
|
bool force_native_color;
|
||||||
|
|
||||||
// Interleaved triangles & normals with indexed triangles & quads.
|
// Interleaved triangles & normals with indexed triangles & quads.
|
||||||
GLIndexedVertexArray indexed_vertex_array;
|
GLIndexedVertexArray indexed_vertex_array;
|
||||||
|
@ -2231,8 +2231,10 @@ void GLCanvas3D::toggle_model_objects_visibility(bool visible, const ModelObject
|
|||||||
{
|
{
|
||||||
for (GLVolume* vol : m_volumes.volumes) {
|
for (GLVolume* vol : m_volumes.volumes) {
|
||||||
if ((mo == nullptr || m_model->objects[vol->composite_id.object_id] == mo)
|
if ((mo == nullptr || m_model->objects[vol->composite_id.object_id] == mo)
|
||||||
&& (instance_idx == -1 || vol->composite_id.instance_id == instance_idx))
|
&& (instance_idx == -1 || vol->composite_id.instance_id == instance_idx)) {
|
||||||
vol->is_active = visible;
|
vol->is_active = visible;
|
||||||
|
vol->force_native_color = (instance_idx != -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (visible && !mo)
|
if (visible && !mo)
|
||||||
toggle_sla_auxiliaries_visibility(true);
|
toggle_sla_auxiliaries_visibility(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user