Keeps modifier transparent while layer editing tool is enabled

This commit is contained in:
Enrico Turri 2019-01-31 14:25:11 +01:00
parent 1605c23e25
commit fb6ef1d20f
3 changed files with 13 additions and 0 deletions

View File

@ -252,6 +252,7 @@ GLVolume::GLVolume(float r, float g, float b, float a)
, is_modifier(false)
, is_wipe_tower(false)
, is_extrusion_path(false)
, force_transparent(false)
, tverts_range(0, size_t(-1))
, qverts_range(0, size_t(-1))
{
@ -293,6 +294,9 @@ void GLVolume::set_render_color()
set_render_color(OUTSIDE_COLOR, 4);
else
set_render_color(color, 4);
if (force_transparent)
render_color[3] = color[3];
}
void GLVolume::set_color_from_model_volume(const ModelVolume *model_volume)

View File

@ -295,6 +295,8 @@ public:
bool is_wipe_tower;
// Wheter or not this volume has been generated from an extrusion path
bool is_extrusion_path;
// Wheter or not to always render this volume using its own alpha
bool force_transparent;
// Interleaved triangles & normals with indexed triangles & quads.
GLIndexedVertexArray indexed_vertex_array;

View File

@ -4286,6 +4286,13 @@ bool GLCanvas3D::is_reload_delayed() const
void GLCanvas3D::enable_layers_editing(bool enable)
{
m_layers_editing.set_enabled(enable);
const Selection::IndicesList& idxs = m_selection.get_volume_idxs();
for (unsigned int idx : idxs)
{
GLVolume* v = m_volumes.volumes[idx];
if (v->is_modifier)
v->force_transparent = enable;
}
}
void GLCanvas3D::enable_warning_texture(bool enable)