From bb61de83795b10f77107e81384b62405ba2bbc89 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 18 Dec 2017 12:14:09 +0100 Subject: Fixed a regression error: The "current_extruder" identifier was not set at the placeholder parser. Implemented a new PlaceholderParser::evaluate_boolean_expression() functionality to evaluate just a boolean expression using the full expressive power of the macro processing syntax. This function will now be used for deciding, which print or filament preset is compatible with which printer preset. --- lib/Slic3r.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 22a6ee389..66039ddf0 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -80,6 +80,10 @@ my $paused = 0; $Slic3r::loglevel = (defined($ENV{'SLIC3R_LOGLEVEL'}) && $ENV{'SLIC3R_LOGLEVEL'} =~ /^[1-9]/) ? $ENV{'SLIC3R_LOGLEVEL'} : 0; set_logging_level($Slic3r::loglevel); +# Let the palceholder parser evaluate one expression to initialize its local static macro_processor +# class instance in a thread safe manner. +Slic3r::GCode::PlaceholderParser->new->evaluate_boolean_expression('1==1'); + sub spawn_thread { my ($cb) = @_; @_ = (); -- cgit v1.2.3