exporting options for fbx objects created in Blender and used in libgdx - libgdx

This is the options panel for FBX export in Blender. I have no animations, just an UV unwrapped object ready for export. What checkboxes should be checked to correctly export objects for libGDX use to FBX file format.

If you're not exporting all the objects in your Scene, checking "Selected objects" will only export those that you have selected.
For certain shaders, "Tangent Space" is also needed for UV exporting, if your materials look okay after import without tangent space included, you probably don't need it. But, it does increase file size.
If the mesh is not skinned, you can uncheck "Add leaf Bones".
You'll get a better idea of everything that is exported if you convert your fbx to .g3dj rather than .g3db. .g3dj is a JSON file, which you can open in a text editor and check everything out, and/or edit if need be. Play around with the settings in the exporter, convert, and see what you get!

Related

Update 3D Scene Programmatically to be Showed in Blend4Web WebPlayer (JSON)

I created a blender project, exported it as JSON+BIN files and showed it through the blend4web webplayer. Everything goes fine until my need to change the JSON file programmatically to add/remove a new 3D object (e.g. a cube or rectangle). I want to renderize the already showed 3D model adding or removing a 3D object. However, since the exportation of a project to blend4web generate a .bin file, if I change only the .json the model was not showed as expected. Considering this scenario, the unique way to change the model is modifing the .blend file and exports it again from Blender. But based on my need, I can't add a new 3D object in a Blender project programmatically considering the .json file. Additionally, the .json file which I am updating/using is considering data retrieved from a Database, such data indicates how and the position where the new 3D object will be displayed in the scene, which hinder me to use Blender to create a 3D Model modificated.
In this perspective, I need help to identify:
Which is the best way to change the scene and show it in blend4web programmatically and mainly considering a .json as an input for the model?
Is there any python script to user a blend4web .json file as an input to be compiled, without the Blender project and regenerate the .bin file, making it possible to show correctly my 3D model using the blend4web webplayer for JSON files?
Or, is there some (easy) way to modify a project from Blender considering data in JSON format, compile and generate the files to be shown programmatically by the blend4web webplayer (for JSON)?
Thanks in advance.

Easy tool for drawing graphs and export as xml, json?

Do you know a tool/application that allows me to draw a directed graph (with drag and drop would be ideally) and than easily export it into an XML or JSON file?
I tried using http://cmap.ihmc.us/ but it exports the picture into an XML not the graph's content, which it makes it horrible to parse.
The main goal is to draw a graph and then somehow construct it in memory (in C++/Java).
Gephi is a good free tool to create and export graphs:
https://gephi.org/
User made addons are available and allow you to export in multiple formats :
https://marketplace.gephi.org/plugin/json-exporter/

Blender export to three.js JSON only processing one geometry object

I'm pretty new to three.js so bear with me!
I'm a seasoned user of Blender and have looking for the best way to export to a three.js importer.
So far, the most successful has been the obj importer, although I would love to include animations. With this in mind, I have tried the Collada dae importer (a bit hit and miss) and am now on the JSON route.
I have successfully (I hope) added the JSON export addon into Blender (2.74) which does now export JSON files. These work OK when imported into three.js, but for some reason, it is only exporting one object when I have several in the scene. I have also checked the JSON file and there is only one set of vertices.
I have read on older posts that it has something to do with parenting, but I can't export the scene as it breaks when imported for some reason.
The reason I want multiple objects is because I want to animate various objects within a scene using keyframes. Sounds easy? Not so much.
Are there any specific limitations of bone-based (on armatures) animations. I have a feeling it may have something to do with the object parenting to the bones?
My error could be in the JSON importer in the three.js file...
The documentation on this is a bit limited so any advice would be welcome.

Three.js (r64) - Blender JSON export miss normals for smooth shading

Using Three.js r64 I'd like to import from Blender an animated object with its smoothing groups, the file is exported as JSON through Three.js Blender exporter.
The animation part is working fine.
In Blender, the model looks fine (there is a small smoothing group around the central part).
Picture: http://www.defresne.fr/demo/so/three/smooth_shading/gears.png
I can achive to get the same result when exporting in OBJ with 'Smooth Groups' and 'Include Normals' options checked. However I can't get it working correctly while exporting a JSON file (with normals). Next are pictures of the scene, with a live demo.
Picture: (append next link with) three_gears.png
Live demo: http://www.defresne.fr/demo/so/three/smooth_shading/
I did intense lookup all over the web and couldn't find correct informations. Best is another question on SO which is a bit old (r55) and never got any accepted answer.
I did try to compute the object's normals with
geometry.computeFaceNormals();
geometry.computeVertexNormals();
but, obviously, it computes the whole object normals and result in a completly smoothed object.
So, what should be a correct approach to make JSON smoothing groups work in three.js ? Wait for a built-in function ? build it myself ? Modify the exporter ?
As three.js seems to load correctly OBJ and Collada models with smoothing groups, maybe I could borrow some of the code in these loaders to get the logic ?
Thanks for your help
[EDIT]
I just found something great !
In Blender, produce 2 exports of the model: first a JSON file, second an OBJ file. Load the second one with three.js online editor then convert it to get the geometry JSON...
I can collect the vertices, normals and faces of this freshly exported geometry and copy it to the first exported file.
It works fine ! I got nice shading groups. Even skinning works fine.
But it's a tedious way of processing and I wish I could save myself some extra conversions.
So does that mean there is a problem while exporting geometry from Blender ? Any idea why ?
Any help would be greatly appreciated !
Ok, I finally found what happens.
The r64 Three.js Blender exporter doesn't export smoothing groups so if you need to preserve these, there is no other solution than export the geometry to an OBJ file, then convert it with the python script 'convert_obj_three.py' avaible within Three.js repository. Converted file will have correct normals. (don't forget to check normal option while exporting the OBJ file)

3d models -> JSON for WebGL/Three JS

So I have tried to use the three.js editor to convert an .obj file to JSON. When I click export Geometry, though, it doesn't do anything...
http://mrdoob.github.io/three.js/editor/
When I export the scene, though, I get a whole bunch of numbers like so:
"2,1615,1614,1671,1672,1615,3683,3563,3682,3684,3567,57,1615,1672,1673,1616,1615,1672,1673,1616,3685,3567,3684,3686,3570,57,1616,1673,1674,1617,1616,1673,1674,1617,3687,3570,3686,3688,3573,57,1617,1674,1675,1618,1617,1674,1675,1618,3689,3573,3688,3690,3575,57,1618,1675,1676,1619,1618,1675,1676,1619,3691,3575,3690,3692,3577,57,1619,1676,1677,1620,1619,1676,1677,1620,3693,3577,3692,3694,3579,57,1620,1677,1678,1621,1620,1677,1678,1621,3695,3579,3694,3696,3581,57,1624,1679,1680,1625,1624,1679,1680,1625,3697,3587,3698,3698,3587,57,1625,1680,1681,1626,1625,1680,1681,1626,3699,3589,3700,3701,3590,57,1626,1681,1682,1627,1626,1681,1682,1627,3702,3590,3701,3703,3592,57,1627,1682,1683,1628,1627,1682,1683,1628,3704,3592,3703,3705,3594,57,1628,1683,1684,1629,1628,1683,1684,1629,3706,3594,3705,3707,3596,57,1629,1684,1685,1630,1629,1684,1685,1630,3708,3596,3707,3709,3598,57,1630,1685,1686,1631,1630,1685,1686,1631,3710,3598,3709,3711,3600,57,1631,1686,1687,1632,1631,1686,1687,1632,3712,3600,3711,3713,3602,57,1632,1687,1688,1633,1632,1687,1688,1633,3714,3602,3713,3715,3604,57,1633,1688,1689,1634,1633,1688,1689,1634,3716,3604,3715,3717,3606,57,1634,1689,1690,1635,1634,1689,1690,1635,3718,3608,3719,3720,3609,57,1635,1690,1691,1636,1635,1690,1691,1636,3721,3609,3720,3722,3611,57,1636,1691,1692,1637,1636,1691,1692,1637,3723,3611,3722,3724,3613,57,1637,1692,1693,1638,1637,1692,1693,1638,3725,3613,3724,3726,3615,57,1638,1693,1694,1639,1638,1693,1694,1639,3727,3615,3726,3728,3617,57,1639,1694,1695,1640,1639,1694,1695,1640,3729,3617,3728,3730,3619,57,1640,1695,169"
Is this the content of the JSON file I'm trying to look for? If so, do I just save it as nameofmodel.json?
Yes. That's the content of the json file. And yes, you just need to save that into a nameofmodel.json file.