Skip to content

Commit

Permalink
Parse options from AMF metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
alranel committed Dec 30, 2013
1 parent ca29520 commit d29e341
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Slic3r/Format/AMF/Parser.pm
Expand Up @@ -97,6 +97,12 @@ sub end_element {
} elsif ($data->{LocalName} eq 'material') {
$self->{_material} = undef;
} elsif ($data->{LocalName} eq 'metadata' && $self->{_material}) {
if ($self->{_material_metadata_type} =~ /^slic3r\.(.+)/) {
my $opt_key = $1;
if (exists $Slic3r::Config::Options->{$opt_key}) {
$self->{_material}->set_deserialize($opt_key, $self->{_material}->attributes->{$opt_key});
}
}
$self->{_material_metadata_type} = undef;
} elsif ($data->{LocalName} eq 'constellation') {
$self->{_constellation} = undef;
Expand Down

0 comments on commit d29e341

Please sign in to comment.