mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 05:37:52 -06:00
Merged with dev
This commit is contained in:
parent
d934b63424
commit
fe3b92870f
90 changed files with 3310 additions and 1748 deletions
|
@ -648,7 +648,7 @@ std::vector<int> GLVolumeCollection::load_object(
|
|||
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
||||
|
||||
int extruder_id = -1;
|
||||
if (!model_volume->modifier)
|
||||
if (model_volume->is_model_part())
|
||||
{
|
||||
extruder_id = model_volume->config.has("extruder") ? model_volume->config.option("extruder")->getInt() : 0;
|
||||
if (extruder_id == 0)
|
||||
|
@ -661,7 +661,16 @@ std::vector<int> GLVolumeCollection::load_object(
|
|||
volumes_idx.push_back(int(this->volumes.size()));
|
||||
float color[4];
|
||||
memcpy(color, colors[((color_by == "volume") ? volume_idx : obj_idx) % 4], sizeof(float) * 3);
|
||||
color[3] = model_volume->modifier ? 0.5f : 1.f;
|
||||
if (model_volume->is_support_blocker()) {
|
||||
color[0] = 1.0f;
|
||||
color[1] = 0.2f;
|
||||
color[2] = 0.2f;
|
||||
} else if (model_volume->is_support_enforcer()) {
|
||||
color[0] = 0.2f;
|
||||
color[1] = 0.2f;
|
||||
color[2] = 1.0f;
|
||||
}
|
||||
color[3] = model_volume->is_model_part() ? 1.f : 0.5f;
|
||||
this->volumes.emplace_back(new GLVolume(color));
|
||||
GLVolume &v = *this->volumes.back();
|
||||
if (use_VBOs)
|
||||
|
@ -675,16 +684,20 @@ std::vector<int> GLVolumeCollection::load_object(
|
|||
v.composite_id = obj_idx * 1000000 + volume_idx * 1000 + instance_idx;
|
||||
v.set_select_group_id(select_by);
|
||||
v.set_drag_group_id(drag_by);
|
||||
if (!model_volume->modifier)
|
||||
if (model_volume->is_model_part())
|
||||
{
|
||||
v.set_convex_hull(model_volume->get_convex_hull());
|
||||
v.layer_height_texture = layer_height_texture;
|
||||
if (extruder_id != -1)
|
||||
v.extruder_id = extruder_id;
|
||||
}
|
||||
v.is_modifier = model_volume->modifier;
|
||||
v.shader_outside_printer_detection_enabled = !model_volume->modifier;
|
||||
v.is_modifier = ! model_volume->is_model_part();
|
||||
v.shader_outside_printer_detection_enabled = model_volume->is_model_part();
|
||||
#if ENABLE_MODELINSTANCE_3D_OFFSET
|
||||
v.set_offset(instance->get_offset());
|
||||
#else
|
||||
v.set_offset(Vec3d(instance->offset(0), instance->offset(1), 0.0));
|
||||
#endif // ENABLE_MODELINSTANCE_3D_OFFSET
|
||||
v.set_rotation(instance->rotation);
|
||||
v.set_scaling_factor(instance->scaling_factor);
|
||||
}
|
||||
|
@ -2164,6 +2177,11 @@ int _3DScene::get_first_volume_id(wxGLCanvas* canvas, int obj_idx)
|
|||
return s_canvas_mgr.get_first_volume_id(canvas, obj_idx);
|
||||
}
|
||||
|
||||
int _3DScene::get_in_object_volume_id(wxGLCanvas* canvas, int scene_vol_idx)
|
||||
{
|
||||
return s_canvas_mgr.get_in_object_volume_id(canvas, scene_vol_idx);
|
||||
}
|
||||
|
||||
void _3DScene::reload_scene(wxGLCanvas* canvas, bool force)
|
||||
{
|
||||
s_canvas_mgr.reload_scene(canvas, force);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue