How to create/load asset from Json variable (not from file or url)?

Here’s how I would do it (excuse the commented out code, I was doing some investigation)

https://playcanvas.com/editor/scene/709011

Code is:

var parser = new pc.JsonModelParser(self.app.graphicsDevice);
var model = parser.parse(data);
var entity = new pc.Entity();
entity.addComponent("model");
entity.model.model = model;
pc.app.root.addChild(entity);

Edit: Note that this is a bit of a hack and working around how the engine was intended to be used.