extract png loader from kiri worker so it can be shared with mesh
This commit is contained in:
parent
7e954f5e56
commit
87df96d23f
6 changed files with 280 additions and 245 deletions
|
|
@ -483,13 +483,12 @@ gapp.register("kiri.main", [], (root, exports) => {
|
|||
}
|
||||
|
||||
function loadImage(image, opt = {}) {
|
||||
const info = Object.assign({settings, png:image}, opt);
|
||||
const info = Object.assign({settings: settings.get(), png:image}, opt);
|
||||
kiri.client.image2mesh(info, progress => {
|
||||
api.show.progress(progress, "converting");
|
||||
}, output => {
|
||||
}, vertices => {
|
||||
api.show.progress(0);
|
||||
const { bigv, verts, index } = output;
|
||||
const widget = newWidget().loadVertices(bigv)
|
||||
const widget = newWidget().loadVertices(vertices);
|
||||
widget.meta.file = opt.file;
|
||||
platform.add(widget);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue