Skip to content

Commit

Permalink
Added the [scale] placeholder. #2791
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed May 2, 2015
1 parent 00acd32 commit 7d81aee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Slic3r/Print.pm
Expand Up @@ -432,6 +432,11 @@ sub expanded_output_filepath {
$self->placeholder_parser->set(input_filename => $filename);
$self->placeholder_parser->set(input_filename_base => $filename_base);

# set other variables from model object
$self->placeholder_parser->set_multiple(
scale => [ map $_->model_object->instances->[0]->scaling_factor * 100 . "%", @{$self->objects} ],
);

if ($path && -d $path) {
# if output path is an existing directory, we take that and append
# the specified filename format
Expand Down
2 changes: 2 additions & 0 deletions xs/xsp/PlaceholderParser.xsp
Expand Up @@ -14,6 +14,8 @@
void apply_config(DynamicPrintConfig *config)
%code%{ THIS->apply_config(*config); %};
void set(std::string key, std::string value);
void set_multiple(std::string key, std::vector<std::string> values)
%code%{ THIS->set(key, values); %};

void _single_set(std::string k, std::string v)
%code%{ THIS->_single[k] = v; %};
Expand Down

0 comments on commit 7d81aee

Please sign in to comment.