provide visual feedback that model is being decimated
This commit is contained in:
parent
317aec919b
commit
a46851fc8c
2 changed files with 13 additions and 3 deletions
|
|
@ -208,6 +208,7 @@
|
||||||
clear: clearWidgetCache
|
clear: clearWidgetCache
|
||||||
},
|
},
|
||||||
hide: {
|
hide: {
|
||||||
|
alert: function(rec) { alert2cancel(rec) },
|
||||||
import: function() { }
|
import: function() { }
|
||||||
},
|
},
|
||||||
language: KIRI.lang,
|
language: KIRI.lang,
|
||||||
|
|
@ -345,7 +346,14 @@
|
||||||
if (message === undefined) {
|
if (message === undefined) {
|
||||||
return updateAlerts(true);
|
return updateAlerts(true);
|
||||||
}
|
}
|
||||||
alerts.push([message, Date.now(), time]);
|
let rec = [message, Date.now(), time, true];
|
||||||
|
alerts.push(rec);
|
||||||
|
updateAlerts();
|
||||||
|
return rec;
|
||||||
|
}
|
||||||
|
|
||||||
|
function alert2cancel(rec) {
|
||||||
|
rec[3] = false;
|
||||||
updateAlerts();
|
updateAlerts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -354,9 +362,9 @@
|
||||||
alerts = [];
|
alerts = [];
|
||||||
}
|
}
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
// filter out by age
|
// filter out by age and active flag
|
||||||
alerts = alerts.filter(alert => {
|
alerts = alerts.filter(alert => {
|
||||||
return (now - alert[1]) < ((alert[2] || 5) * 1000);
|
return alert[3] && (now - alert[1]) < ((alert[2] || 5) * 1000);
|
||||||
});
|
});
|
||||||
// limit to 5 showing
|
// limit to 5 showing
|
||||||
while (alerts.length > 5) {
|
while (alerts.length > 5) {
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,10 @@ KIRI.work = {
|
||||||
},
|
},
|
||||||
|
|
||||||
decimate : function(vertices, callback) {
|
decimate : function(vertices, callback) {
|
||||||
|
let alert = KIRI.api.show.alert('decimating imported model', 1000);
|
||||||
vertices = vertices.buffer.slice(0);
|
vertices = vertices.buffer.slice(0);
|
||||||
send("decimate", vertices, function(output) {
|
send("decimate", vertices, function(output) {
|
||||||
|
KIRI.api.hide.alert(alert);
|
||||||
callback(output);
|
callback(output);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue