Fix bake button scheduling

This commit is contained in:
Lubos Lenco
2021-04-28 16:37:37 +02:00
parent 2947aad4e8
commit 541998a3dd
+8 -5
View File
@@ -85,21 +85,24 @@ class UIHeader {
else if (Context.tool == ToolBake) {
ui.changed = false;
var rtBake = Context.bakeType == BakeAO || Context.bakeType == BakeLightmap || Context.bakeType == BakeBentNormal || Context.bakeType == BakeThickness;
var baking = false;
#if (kha_direct3d12 || kha_vulkan)
baking = Context.pdirty > 0;
var baking = Context.pdirty > 0;
var rtBake = Context.bakeType == BakeAO || Context.bakeType == BakeLightmap || Context.bakeType == BakeBentNormal || Context.bakeType == BakeThickness;
if (baking && ui.button(tr("Stop"))) {
Context.pdirty = 0;
Context.rdirty = 2;
}
#else
var baking = false;
var rtBake = false;
#end
if (!baking && ui.button(tr("Bake"))) {
Context.pdirty = rtBake ? Context.bakeSamples : 1;
Context.rdirty = 3;
Context.layerPreviewDirty = true;
App.notifyOnNextFrame(function() {
Context.layerPreviewDirty = true;
});
UISidebar.inst.hwnd0.redraws = 2;
History.pushUndo = true;
}