mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Do not create raycaster when loading the gcode preview (#7596)
This commit is contained in:
parent
3e6835bbc5
commit
3b1c4f9ee4
3 changed files with 11 additions and 7 deletions
|
@ -675,12 +675,13 @@ std::vector<int> GLVolumeCollection::load_object(
|
||||||
int obj_idx,
|
int obj_idx,
|
||||||
const std::vector<int> &instance_idxs,
|
const std::vector<int> &instance_idxs,
|
||||||
const std::string &color_by,
|
const std::string &color_by,
|
||||||
bool opengl_initialized)
|
bool opengl_initialized,
|
||||||
|
bool need_raycaster)
|
||||||
{
|
{
|
||||||
std::vector<int> volumes_idx;
|
std::vector<int> volumes_idx;
|
||||||
for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx)
|
for (int volume_idx = 0; volume_idx < int(model_object->volumes.size()); ++volume_idx)
|
||||||
for (int instance_idx : instance_idxs)
|
for (int instance_idx : instance_idxs)
|
||||||
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized));
|
volumes_idx.emplace_back(this->GLVolumeCollection::load_object_volume(model_object, obj_idx, volume_idx, instance_idx, color_by, opengl_initialized, false, false, need_raycaster));
|
||||||
return volumes_idx;
|
return volumes_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,7 +694,8 @@ int GLVolumeCollection::load_object_volume(
|
||||||
const std::string &color_by,
|
const std::string &color_by,
|
||||||
bool opengl_initialized,
|
bool opengl_initialized,
|
||||||
bool in_assemble_view,
|
bool in_assemble_view,
|
||||||
bool use_loaded_id)
|
bool use_loaded_id,
|
||||||
|
bool need_raycaster)
|
||||||
{
|
{
|
||||||
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
const ModelVolume *model_volume = model_object->volumes[volume_idx];
|
||||||
const int extruder_id = model_volume->extruder_id();
|
const int extruder_id = model_volume->extruder_id();
|
||||||
|
@ -711,7 +713,7 @@ int GLVolumeCollection::load_object_volume(
|
||||||
v.model.init_from(mesh, true);
|
v.model.init_from(mesh, true);
|
||||||
#else
|
#else
|
||||||
v.model.init_from(*mesh);
|
v.model.init_from(*mesh);
|
||||||
v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh);
|
if (need_raycaster) { v.mesh_raycaster = std::make_unique<GUI::MeshRaycaster>(mesh); }
|
||||||
#endif // ENABLE_SMOOTH_NORMALS
|
#endif // ENABLE_SMOOTH_NORMALS
|
||||||
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
v.composite_id = GLVolume::CompositeID(obj_idx, volume_idx, instance_idx);
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,8 @@ public:
|
||||||
int obj_idx,
|
int obj_idx,
|
||||||
const std::vector<int> &instance_idxs,
|
const std::vector<int> &instance_idxs,
|
||||||
const std::string &color_by,
|
const std::string &color_by,
|
||||||
bool opengl_initialized);
|
bool opengl_initialized,
|
||||||
|
bool need_raycaster = true);
|
||||||
|
|
||||||
int load_object_volume(
|
int load_object_volume(
|
||||||
const ModelObject *model_object,
|
const ModelObject *model_object,
|
||||||
|
@ -449,7 +450,8 @@ public:
|
||||||
const std::string &color_by,
|
const std::string &color_by,
|
||||||
bool opengl_initialized,
|
bool opengl_initialized,
|
||||||
bool in_assemble_view = false,
|
bool in_assemble_view = false,
|
||||||
bool use_loaded_id = false);
|
bool use_loaded_id = false,
|
||||||
|
bool need_raycaster = true);
|
||||||
// Load SLA auxiliary GLVolumes (for support trees or pad).
|
// Load SLA auxiliary GLVolumes (for support trees or pad).
|
||||||
void load_object_auxiliary(
|
void load_object_auxiliary(
|
||||||
const SLAPrintObject *print_object,
|
const SLAPrintObject *print_object,
|
||||||
|
|
|
@ -3123,7 +3123,7 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p
|
||||||
instance_ids.resize(instance_index);
|
instance_ids.resize(instance_index);
|
||||||
|
|
||||||
size_t current_volumes_count = m_shells.volumes.volumes.size();
|
size_t current_volumes_count = m_shells.volumes.volumes.size();
|
||||||
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized);
|
m_shells.volumes.load_object(model_obj, object_idx, instance_ids, "object", initialized, false);
|
||||||
|
|
||||||
// adjust shells' z if raft is present
|
// adjust shells' z if raft is present
|
||||||
const SlicingParameters& slicing_parameters = obj->slicing_parameters();
|
const SlicingParameters& slicing_parameters = obj->slicing_parameters();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue