mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 12:00:38 +08:00
Added single-object AMF export (with modifier meshes). Extended text on plate AMF export to indicate that it exports modifier meshes.
This commit is contained in:
parent
ad666beac0
commit
af8ae8d268
@ -249,7 +249,7 @@ sub _init_menubar {
|
||||
$self->_append_menu_item($self->{plater_menu}, "Export plate as STL...", 'Export current plate as STL', sub {
|
||||
$plater->export_stl;
|
||||
}, undef, 'brick_go.png');
|
||||
$self->_append_menu_item($self->{plater_menu}, "Export plate as AMF...", 'Export current plate as AMF', sub {
|
||||
$self->_append_menu_item($self->{plater_menu}, "Export plate with modifiers as AMF...", 'Export current plate as AMF, including all modifier meshes', sub {
|
||||
$plater->export_amf;
|
||||
}, undef, 'brick_go.png');
|
||||
$self->_append_menu_item($self->{plater_menu}, "Open DLP Projector…\tCtrl+L", 'Open projector window for DLP printing', sub {
|
||||
|
@ -1539,6 +1539,23 @@ sub export_object_stl {
|
||||
$self->statusbar->SetStatusText("STL file exported to $output_file");
|
||||
}
|
||||
|
||||
# Export function for a single AMF output
|
||||
sub export_object_amf {
|
||||
my $self = shift;
|
||||
|
||||
my ($obj_idx, $object) = $self->selected_object;
|
||||
return if !defined $obj_idx;
|
||||
|
||||
my $local_model = Slic3r::Model->new;
|
||||
my $model_object = $self->{model}->objects->[$obj_idx];
|
||||
# copy model_object -> local_model
|
||||
$local_model->add_object($model_object);
|
||||
|
||||
my $output_file = $self->_get_export_file('AMF') or return;
|
||||
$local_model->write_amf($output_file);
|
||||
$self->statusbar->SetStatusText("AMF file exported to $output_file");
|
||||
}
|
||||
|
||||
sub export_amf {
|
||||
my $self = shift;
|
||||
|
||||
@ -2032,6 +2049,9 @@ sub object_menu {
|
||||
$frame->_append_menu_item($menu, "Export object as STL…", 'Export this single object as STL file', sub {
|
||||
$self->export_object_stl;
|
||||
}, undef, 'brick_go.png');
|
||||
$frame->_append_menu_item($menu, "Export object and modifiers as AMF…", 'Export this single object and all associated modifiers as AMF file', sub {
|
||||
$self->export_object_amf;
|
||||
}, undef, 'brick_go.png');
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user