Set layers export type when opening export dialog

This commit is contained in:
luboslenco
2020-09-24 19:12:54 +02:00
parent a2cb704d2f
commit 945752ccf5
4 changed files with 16 additions and 4 deletions
+3 -1
View File
@@ -79,7 +79,9 @@ class BoxExport {
ui.enabled = true;
ui.row([0.5, 0.5]);
ui.enabled = !bakeMaterial;
Context.layersExport = ui.combo(Id.handle({position: Context.layersExport}), [tr("Visible"), tr("Selected")], tr("Layers"), true);
var layersExportHandle = Id.handle();
layersExportHandle.position = Context.layersExport;
Context.layersExport = ui.combo(layersExportHandle, [tr("Visible"), tr("Selected")], tr("Layers"), true);
ui.enabled = true;
ui.combo(hpreset, files, tr("Preset"), true);
if (hpreset.changed) preset = null;
+4 -1
View File
@@ -332,7 +332,10 @@ class TabLayers {
UIMenu.draw(function(ui: Zui) {
ui.text(l.name, Right, ui.t.HIGHLIGHT_COL);
if (ui.button(tr("Export"), Left)) BoxExport.showTextures();
if (ui.button(tr("Export"), Left)) {
Context.layersExport = 1;
BoxExport.showTextures();
}
if (l.getChildren() == null && l.fill_layer == null && ui.button(tr("To Fill Layer"), Left)) {
function makeFill(g: kha.graphics4.Graphics) {
+4 -1
View File
@@ -73,7 +73,10 @@ class UIMenu {
if (ui.button(" " + tr("Reimport Mesh"), Left, Config.keymap.file_reimport_mesh)) Project.reimportMesh();
if (ui.button(" " + tr("Reimport Textures"), Left, Config.keymap.file_reimport_textures)) Project.reimportTextures();
ui.fill(0, 0, sepw, 1, ui.t.ACCENT_SELECT_COL);
if (ui.button(" " + tr("Export Textures..."), Left, Config.keymap.file_export_textures_as)) BoxExport.showTextures();
if (ui.button(" " + tr("Export Textures..."), Left, Config.keymap.file_export_textures_as)) {
Context.layersExport = 0;
BoxExport.showTextures();
}
if (ui.button(" " + tr("Export Mesh..."), Left)) BoxExport.showMesh();
if (ui.button(" " + tr("Bake Material..."), Left)) BoxExport.showBakeMaterial();
ui.fill(0, 0, sepw, 1, ui.t.ACCENT_SELECT_COL);
+5 -1
View File
@@ -195,6 +195,7 @@ class UISidebar {
else if (Operator.shortcut(Config.keymap.file_new)) Project.projectNewBox();
else if (Operator.shortcut(Config.keymap.file_export_textures)) {
if (Context.textureExportPath == "") { // First export, ask for path
Context.layersExport = 0;
BoxExport.showTextures();
}
else {
@@ -205,7 +206,10 @@ class UISidebar {
iron.App.notifyOnRender(export);
}
}
else if (Operator.shortcut(Config.keymap.file_export_textures_as)) BoxExport.showTextures();
else if (Operator.shortcut(Config.keymap.file_export_textures_as)) {
Context.layersExport = 0;
BoxExport.showTextures();
}
else if (Operator.shortcut(Config.keymap.file_import_assets)) Project.importAsset();
else if (Operator.shortcut(Config.keymap.edit_prefs)) BoxPreferences.show();