The recommended format for importing and exporting assets is glTF (GL Transmission Format). Because glTF is focused on runtime asset delivery, it is compact to transmit and fast to load.
The recommended format for importing and exporting assets is glTF (GL Transmission Format). Because glTF is focused on runtime asset delivery, it is compact to transmit and fast to load.
</p>
</p>
<p>
<p>
- three.js provides loaders for many other popular formats like FBX, Collada or OBJ as well. Nevertheless, you should always try to establish a glTF based workflow in your projects first.
+ three.js provides loaders for many other popular formats like FBX, Collada or OBJ as well. Nevertheless, you should always try to establish a glTF based workflow in your projects first. For more information, see [link:#manual/introduction/Loading-3D-models loading 3D models].
-The exporter (r69 and earlier) has been completely replaced. Please ensure you have removed the io_three_mesh addon from your Blender addons directory before installing the current addon (io_three).
-
-## Installation
-
-
-Recommended Blender version **>= 2.73.0**
-
-Copy the io_three folder to the scripts/addons folder. If it doesn't exist, create it. The full path is OS-dependent (see below).
-
-Once that is done, you need to activate the plugin. Open Blender preferences, look for
-Addons, search for `three`, enable the checkbox next to the `Import-Export: Three.js Format` entry.
-For Ubuntu users who installed Blender 2.68 via apt-get, this is the location:
-
- /usr/lib/blender/scripts/addons
-
-For Ubuntu users who installed Blender 2.7x via apt-get, this is the location:
-
- /usr/share/blender/scripts/addons
-
-
-## Usage
-
-Activate the Import-Export addon under "User Preferences" > "Addons" and then use the regular Export menu within Blender, select `Three.js (json)`.
-
-
-## Enabling msgpack
-
-To enable msgpack compression copy the msgpack to scripts/modules.
-
-
-## Importer
-
-Currently there is no import functionality available.
+> **NOTICE:** The Blender exporter for the Three.js JSON format has been removed, to focus on better support for other workflows. For recommended alternatives, see [Loading 3D Models](https://threejs.org/docs/#manual/introduction/loading-3d-models). The Three.js JSON format is still fully supported for use with [Object3D.toJSON](https://threejs.org/docs/#api/core/Object3D.toJSON), the [Editor](https://threejs.org/editor/), [THREE.ObjectLoader](https://threejs.org/docs/#api/loaders/ObjectLoader), [THREE.JSONLoader](https://threejs.org/docs/#api/loaders/JSONLoader), and [converters](https://github.com/mrdoob/three.js/tree/dev/utils/converters).
- #manthrax: Disable the following logic that attempts to find only the used materials on this mesh
- #for face in mesh.tessfaces:
- # if face.material_index not in indices:
- # indices.append(face.material_index)
- # instead, export all materials on this object... they are probably there for a good reason, even if they aren't referenced by the geometry at present...
- for index in range(len( mesh.materials )):
- indices.append(index)
-
-
- material_sets = [(mesh.materials[index], index) for index in indices]
- materials_ = []
-
- maps = options.get(constants.MAPS)
-
- mix = options.get(constants.MIX_COLORS)
- use_colors = options.get(constants.COLORS)
- logger.info("Colour mix is set to %s", mix)
- logger.info("Vertex colours set to %s", use_colors)
-
- for mat, index in material_sets:
- if mat == None: # undefined material for a specific index is skipped
- continue
-
- try:
- dbg_color = constants.DBG_COLORS[index]
- except IndexError:
- dbg_color = constants.DBG_COLORS[0]
-
- logger.info("Compiling attributes for %s", mat.name)
- # Grab any properties except those marked private (by underscore
- # prefix) or those with types that would be rejected by the JSON
- # serializer object model.
- return {K: obj[K] for K in obj.keys() if K[:1] != '_' and isinstance(obj[K], constants.VALID_DATA_TYPES)} # 'Empty' Blender objects do not use obj.data.items() for custom properties, using obj.keys()
-static inline int unpack_callback_map(unpack_user* u, unsigned int n, msgpack_unpack_object* o)
-{
- PyObject *p;
- if (u->has_pairs_hook) {
- p = PyList_New(n); // Or use tuple?
- }
- else {
- p = PyDict_New();
- }
- if (!p)
- return -1;
- *o = p;
- return 0;
-}
-
-static inline int unpack_callback_map_item(unpack_user* u, unsigned int current, msgpack_unpack_object* c, msgpack_unpack_object k, msgpack_unpack_object v)
-In order to use the test scripts you must have your shell setup to execute Blender from the command line using `$ blender`. This either done by setting up your own wrapper scripts or by symlinking /usr/bin/blender directly to $BLENDER_ROOT/blender.
-
-## OS X
-Make sure your do not point to blender.app as it will not pass the arguments corrently. It is required to execute on $BLENDER_ROOT/blender.app/Contents/MacOS/blender in order for the tests to function correctly.
-
-# Testing
-Each test script focuses on a specific context and feature of the exporter.
-
-## Context
-Context determines whether an entire scene is being exported or a single mesh node.
-
-## Features
-Features should be tested separately (whenever possible), example: animations should be tested separately from bump maps.
-
-## Review
-When a test is executed a new root directory, if it doesn't already exist, is created at three.js/utils/exporters/blender/tests/review. Inside will contain subdirectories of each test (named the same as the script but with the `test_` prefix removed. The test directory will contain the exported JSON file(s), index.html, and textures (if textures are being tested). The index.html is already setup to source the required libraries and load the JSON file. There is nothing else that a user should need to do in order to test their export.
-
-The review directory has been added to the .gitignore and will not be included when committing changes.