Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Slic3r/Model.pm')
-rw-r--r--lib/Slic3r/Model.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Slic3r/Model.pm b/lib/Slic3r/Model.pm
index aba13f230..9b9407c96 100644
--- a/lib/Slic3r/Model.pm
+++ b/lib/Slic3r/Model.pm
@@ -15,6 +15,7 @@ sub read_from_file {
: $input_file =~ /\.amf(\.xml)?$/i ? Slic3r::Format::AMF->read_file($input_file)
: die "Input file must have .stl, .obj or .amf(.xml) extension\n";
+ $_->input_file($input_file) for @{$model->objects};
return $model;
}
@@ -26,6 +27,16 @@ sub add_object {
return $object;
}
+sub set_material {
+ my $self = shift;
+ my ($material_id, $attributes) = @_;
+
+ return $self->materials->{$material_id} = Slic3r::Model::Material->new(
+ model => $self,
+ attributes => $attributes || {},
+ );
+}
+
# flattens everything to a single mesh
sub mesh {
my $self = shift;