HappyPandaFace Posted November 25, 2013 Share Posted November 25, 2013 This may not be a useful post but I wanted to record my progress with this. I've been trying to get a system to be able to define positions in blender and load those positions with the JSONLoader. I believe that Three.js merges the geometries when it loads them from a json file, so discerning the original position of the object is impossible. Loading in the .js files with "JSONLoader.load" I thought the "geometryGroups" member of geometry would be useful as it had the same length as the number of objects in my blender scene. But still to my surprise, this member always would log out blank. So I searched for a new method. And eventually I looked to the source code and made this modification. change this line (line number 10796 of r61):callback( result.geometry, result.materials );to this:callback( result.geometry, result.materials, json );Now I have access to the loaded json that was exported from blender.I'm working in blender 2.66 with the respective three.js json exporter and I'm not sure if it will work with other version/exporters. I'll post my exporter if requested. In the version of blender/json exporter that I have, it exports the bones in the json file. So to export a position all I need to do is make an armature where I want the 3d position to be recorded and now that I have access to the json object all I need to do is look through the bones for the position. You can name specific bones loaded this way in blender by twisting open the armature until you get to the "Bone" object and the double clicking it. There may be a better way to do this, and if there is I'd like to know. Also if you can separate the meshes and move/rotate/raycast them individually after loading a json file I'd REALLY like to hear about that. Quote Link to comment Share on other sites More sharing options...
HappyPandaFace Posted November 25, 2013 Author Share Posted November 25, 2013 The exporter only reads one armature, so if you want to export multiple positions you have to make them all a parent of the first armature. Also you probably cant put any animations in this json file (I'm using this just for game levels so it's not necessary). Also remember, if you scale or rotate the original meshes, this will not affect the armature vertices extracted from the json file. Using matrices might help that. Anyway, this is an extremely hacky way to put level design in blender. If you find an easier way, please tell me. Quote Link to comment Share on other sites More sharing options...
HappyPandaFace Posted December 16, 2013 Author Share Posted December 16, 2013 I think this is possible with the threejs scene exporter. But I'm not sure. I'm going to test it out with clara.io Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.