Skip to content
Snippets Groups Projects
Commit 2dd28b20 authored by Sebastien DUMETZ's avatar Sebastien DUMETZ
Browse files

add a filter function to the "Add Derivative" menu

parent 00985162
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,11 @@ export default class DerivativeMenu extends Popup
</div>`;
}
private hasModel = (node :IAssetEntry)=>{
return /\.(gltf|glb|usdz)$/.test(node.info.name)
|| node.children.some(this.hasModel);
}
protected render()
{
const language = this.system.getComponent(CVLanguageManager);
......@@ -142,7 +147,7 @@ export default class DerivativeMenu extends Popup
</div>
<div class="ff-splitter-section">
<div class="ff-scroll-y">
<ff-asset-tree class="ff-flex-item-stretch" .system=${this.system} path=""></ff-asset-tree>
<ff-asset-tree class="ff-flex-item-stretch" .filter=${this.hasModel} .system=${this.system} path=""></ff-asset-tree>
</div>
</div>
<div class="ff-flex-row sv-centered">
......
......@@ -103,6 +103,6 @@ export default class DerivativesTaskView extends TaskView<CVDerivativesTask>
this.model.ins.quality.setValue(quality);
this.model.outs.updated.set();
this.system.getMainComponent(CSelection).selectNode(this.model.node);
}).catch(e=>Notification.show("Failed to add derivative : "+e.message, "error"));
}).catch(e=>{if(e) Notification.show("Failed to add derivative : "+e.message, "error")});
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment