Skip to content

Commit

Permalink
Follow up on #5219 (comment)
Browse files Browse the repository at this point in the history
Initializing random generator in PlacholderParser from system clock.
  • Loading branch information
bubnikv committed Mar 15, 2021
1 parent 00db3dc commit f3f10ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include <algorithm>
#include <cstdlib>
#include <chrono>
#include <math.h>
#include <string_view>

Expand Down Expand Up @@ -1129,6 +1130,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
// Prepare the helper object for replacing placeholders in custom G-code and output filename.
m_placeholder_parser = print.placeholder_parser();
m_placeholder_parser.update_timestamp();
m_placeholder_parser_context.rng = std::mt19937(std::chrono::high_resolution_clock::now().time_since_epoch().count());
print.update_object_placeholders(m_placeholder_parser.config_writable(), ".gcode");

// Get optimal tool ordering to minimize tool switches of a multi-exruder print.
Expand Down

0 comments on commit f3f10ff

Please sign in to comment.