Automatically set --gltf when processing with WebODM

pull/197/head
Piero Toffanin 2023-01-28 11:18:05 -05:00
rodzic d3ee44dfee
commit ca61927ef1
2 zmienionych plików z 15 dodań i 27 usunięć

Wyświetl plik

@ -118,44 +118,32 @@ module.exports = class Task{
} }
setPostProcessingOptsSteps(){ setPostProcessingOptsSteps(){
return [
cb => {
// If we need to post process results
// if pc-ept is supported (build entwine point cloud)
// we automatically add the pc-ept option to the task options by default
if (this.skipPostProcessing) cb();
else{
odmInfo.supportsOption("pc-ept", (err, supported) => {
if (err){
console.warn(`Cannot check for supported option pc-ept: ${err}`);
}else if (supported){
if (!this.options.find(opt => opt.name === "pc-ept")){
this.options.push({ name: 'pc-ept', value: true });
}
}
cb();
});
}
},
cb => { const autoSet = (opt) => {
return cb => {
// If we need to post process results // If we need to post process results
// if cog is supported (build cloud optimized geotiffs) // if opt is supported
// we automatically add the cog option to the task options by default // we automatically add the opt to the task options by default
if (this.skipPostProcessing) cb(); if (this.skipPostProcessing) cb();
else{ else{
odmInfo.supportsOption("cog", (err, supported) => { odmInfo.supportsOption(opt, (err, supported) => {
if (err){ if (err){
console.warn(`Cannot check for supported option cog: ${err}`); console.warn(`Cannot check for supported option ${opt}: ${err}`);
}else if (supported){ }else if (supported){
if (!this.options.find(opt => opt.name === "cog")){ if (!this.options.find(o => o.name === opt)){
this.options.push({ name: 'cog', value: true }); this.options.push({ name: opt, value: true });
} }
} }
cb(); cb();
}); });
} }
} }
};
return [
autoSet("pc-ept"),
autoSet("cog"),
autoSet("gltf")
]; ];
} }

Wyświetl plik

@ -1,6 +1,6 @@
{ {
"name": "NodeODM", "name": "NodeODM",
"version": "2.2.1", "version": "2.2.2",
"description": "REST API to access ODM", "description": "REST API to access ODM",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {