Improving art pipeline through assimp2json
I just stumbled upon assimp2json that dumps Assimp's datastructure of a 3d asset to a JSON-file. Considering how complicated it was for me for a university project to get animations properly exported and how often questions related to the blender exporter pop up, I thought it would be worth suggesting a (assimp)json2json converter to ease up the export pipeline.
Sounds good to me! Anyone up for writing a loader?
Hi, I'm one of the assimp developers and I'm also the guy who wrote assimp2json. I'd love to help out on this if people would find that useful. Assimp can handle virtually all import cases (except maybe FBX for which going through the FBX SDK is safer) so it would probably be a good addition to Three's toolchain.
Assimp outputs a whole scene (with hierarchy, transformations, animations etc). From what I've seen, the Three.js mesh format only supports meshes? Is there any official way of storing scenes or is that only possible at runtime?
If such a format exists, I could, instead of going json2json (or writing a runtime loader for assimp2json's format), simply write a dedicated assimp2whatever tool that does it directly.
I've been doing some experimenting with efficiently storing mesh data for use with WebGl lately (for my own 3D framework https://github.com/acgessler/medea.js), and I think moving away from pure JSON and using a mixed, streamable representation (JSON to put parts together, binary files to efficiently store 3D data chunks) could also be an option - is there any interest in pursuing that with Three.js and assimp as converter?
Assimp outputs a whole scene (with hierarchy, transformations, animations etc). From what I've seen, the Three.js mesh format only supports meshes? Is there any official way of storing scenes or is that only possible at runtime?
If such a format exists, I could, instead of going json2json (or writing a runtime loader for assimp2json's format), simply write a dedicated assimp2whatever tool that does it directly.
I've been working on such format (easiest way to see the output is to File/Export Scene in the editor), but I've yet to figure out animation, bones and so on... I think writing a runtime loader for assimp2json's format is the best bet right now.
I've been doing some experimenting with efficiently storing mesh data for use with WebGl lately (for my own 3D framework https://github.com/acgessler/medea.js), and I think moving away from pure JSON and using a mixed, streamable representation (JSON to put parts together, binary files to efficiently store 3D data chunks) could also be an option - is there any interest in pursuing that with Three.js and assimp as converter?
I think that's what also the way glTF is going.
Ok, then I'll put together a runtime loader.
I didn't know about glTF - it seems very interesting and very related, I am just a bit worried that it will become as over-specified as Collada has become.
Added PR for this.
So we'll have a universal asset import system soon? Sounds awesome.
How many formats does this cover?
The ones listed here:
https://github.com/assimp/assimp
Assimp2json is not quite "there" yet though - in a long term run, I'm thinking about adding some content processing system that also collects textures, sanitizes texture paths and file names, re-scales them to be square, generates LOD versions of them ... but this is a first step, doing only the raw whatever-to-json conversion.
Assimp itself was always built to fit the needs of game engines and game editors: importing 3D data, cleaning it up, generating utility data ... preprocessing models for use on the web is a topic we haven't been exposed to yet, so I guess there's lots of things we can improve on :-)
should this be closed as http://threejs.org/examples/#webgl_loader_assimp2json is there?
the gltf-like binary optimized things are different but i suppose good to discuss separately exactly for that reason, or? can be continued here of course too, just figured to note in case this had just been forgotten open after the loader was made etc.
Ah yeah, I think it can be closed :)
Actually, now that I look at it. It could be nice to add some metadata to the json so we can figure out it's a assimp2json file at load time.
yes metadata is good.
also, i've found file extensions useful. .. am currently calling my assimp2json file .. tada, myfile.assimp2json :)
also the gltf folks accepted my proposal to change the file extension from .json to .gltf (I had trouble separating three json and gltf json in our loader system otherwise, was easy like that), https://github.com/KhronosGroup/glTF/issues/260
also the gltf folks accepted my proposal to change the file extension from .json to .gltf (I had trouble separating three json and gltf json in our loader system otherwise, was easy like that), https://github.com/KhronosGroup/glTF/issues/260
nice! I also like that it's now in one file.
Yes, I think it'll be good to have a dedicated extension for assimp2json also. .assimp2json is not bad after all :-)
I can update assimp2json itself as well as the three.js sample.
On a somewhat related note: @mrdoob is there an official extension being considered for three? For threeio I have been using .json as I had issues with the .js format (sorry but when I see *.js I expect that to be Javascript) that the original Blender exporter was putting out. Would something like .3js be more intuitive?
Yes, I think it'll be good to have a dedicated extension for assimp2json also. .assimp2json is not bad after all :-)
I think having metadata in the json is more important though (reasoning below)...
On a somewhat related note: @mrdoob is there an official extension being considered for
three? For threeio I have been using.jsonas I had issues with the.jsformat (sorry but when I see *.js I expect that to be Javascript) that the original Blender exporter was putting out. Would something like.3jsbe more intuitive?
The reason behind using .js was because most servers gzip that extension by default. Not as many gzip .json. Eventually I went for .json for clarity. So a extension like .assimp2json won't get gzipped by default.
I've been using this kind of extensions for another project: test.geometry.json, test.material.json, test.object.json, test.scene.json, ...
OK, thanks for the clarity on that one. Everyone I turned on to three would always ask me that question and I never had an answer but now it makes sense.
@acgessler :) i'm not sure yet, .assimp2json is long, compared to something like .a2j
mrdoob's points are good too, was thinking of those back then also when discussed with the gltf folks. however the parallel to collada-xml being .dae (and not .xml) seemed to kind of make it clear but dunno.
.scene.json and such sure are kind of tempting too. but perhaps not assimp2json.json :p
I would suggest test.assimp.json ;)
afaik the additional complexity here is that assimp has some other json format (assimp json or so), and this format is just assimp2json project's own json format for assimp's internal structure - right?
Oh! Why not just load that other assimp json format instead?