Fix 3mf export flow through material dialog

This commit is contained in:
ochafik 2024-12-31 17:54:47 +00:00 committed by Olivier Chafik
commit 56173552af
2 changed files with 3 additions and 2 deletions

View file

@ -52,7 +52,7 @@ export default function ExportButton({className, style}: {className?: string, st
{
data: '3mf',
buttonLabel: 'Download 3MF',
label: '3MF (3D Manufacturing Format)',
label: '3MF (Multimaterial)',
icon: 'pi pi-file',
command: () => model!.setFormats(undefined, '3mf'),
},

View file

@ -43,11 +43,12 @@ export default function MultimaterialColorsDialog() {
disabled={!tempExtruderColors.every(c => chroma.valid(c) || c.trim() === '')}
autoFocus
onClick={e => {
const wasExporting = state.view.extruderPickerVisibility === 'exporting';
model!.mutate(s => {
s.params.extruderColors = tempExtruderColors.filter(c => c.trim() !== '');
s.view.extruderPickerVisibility = undefined;
});
if (state.view.extruderPickerVisibility === 'exporting') {
if (wasExporting) {
model!.export();
}
}} />