diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-17 16:12:13 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-17 16:12:13 +0300 |
commit | fe3b92870f217a3356094a0a6ad60b25ccf18996 (patch) | |
tree | dd9ebd271884eef3be0270cbb34809738950b390 /xs/src/slic3r/GUI/3DScene.cpp | |
parent | d934b63424ab76ddcd8a87f272838df611dfcd0c (diff) |
Merged with dev
Diffstat (limited to 'xs/src/slic3r/GUI/3DScene.cpp')
-rw-r--r-- | xs/src/slic3r/GUI/3DScene.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/xs/src/slic3r/GUI/3DScene.cpp b/xs/src/slic3r/GUI/3DScene.cpp index a488bfcde..b9f6a59bc 100644 --- a/xs/src/slic3r/GUI/3DScene.cpp +++ b/xs/src/slic3r/GUI/3DScene.cpp @@ -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); |