Is it possible to construct a model in the editor? I’m currently doing mesh combining at run time, but to save the planet from all that extra energy I take up doing the same thing again and again on every device - I was thinking of doing the combining in the editor and creating a combined model (of course it’s improved load speed I’m really after).
I could I guess create and download an FBX but that’s a pretty big job. It’s not so difficult to create with entities or even the .json format - but I can’t see a way of getting that recognised. Is there any one of the editor hooks that would let me do this?
Currently there is no such feature, but as you are familiar with model format already, you could in Editor get model data (asset.resource) and combine it, preserving mesh instances, and combining vertex buffer if needed. Then to upload it back you could use Editor API method for that.
That is just an example of JSON data. It should be a JSON object with your model data, that is stringified. Updated it a bit, as new Blob was incorrect.
Materials are being meta information of the asset, and stored in data field of the asset.
To look at the examples, select any model asset and try in console:
editor.call('selector:items')[0].get('data');
This will console log the data field, and you can see its format.
Then simply add data field to argument object you are passing to assets:create method.