Hello, I’m developing a extension using the editor api.
I’m generating a model based on some examples that i found here in the forum and docs.
this is the result so far
i’ve started to look on how to Save this model that is being generated in runtime.
when i say “save” i mean create an asset in the project, something similar when you upload a model, this way i can use it without the need to generate the same model every time the application runs.
as i mentioned i generated it base in some examples/docs
so along with all the code at the end i’m doing this
// .... rest of implementation
const normals = pc.calculateNormals(positions, indices);
_mesh.setPositions(positions);
_mesh.setIndices(indices);
_mesh.setNormals(normals);
_mesh.setUvs(0, uvs);
_mesh.update(pc.PRIMITIVE_TRIANGLES);
_instance.node = view;
_model.graph = view;
_model.meshInstances = [_instance];
app.scene.addModel(_model);
is there any example or doc on how to create and model asset that i can look at it or any idea where can i start ?
i took a look on pcx.GltfExporter
but couldnt go far.
any attempt to save (using this function or not) i’m saving a file
but of course… the content is not correct