提交 f4f425ea 编写于 作者: R repsac

Updated readme files

Preparing for PR
上级 1c3025de
# Three.js Blender Import/Export # Three.js Blender Export
Imports and exports Three.js' ASCII JSON format. Exports Three.js' ASCII JSON format.
## IMPORTANT
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 ## Installation
Copy the io_mesh_threejs folder to the scripts/addons folder. If it doesn't exist, create it. The full path is OS-dependent (see below). Copy the io_mesh 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 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. Addons, search for `three`, enable the checkbox next to the `Import-Export: three.js format` entry.
...@@ -40,4 +44,12 @@ For Ubuntu users who installed Blender 2.68 via apt-get, this is the location: ...@@ -40,4 +44,12 @@ For Ubuntu users who installed Blender 2.68 via apt-get, this is the location:
## Usage ## Usage
Activate the Import-Export addon under "User Preferences" > "Addons" and then use the regular Import and Export menu within Blender, select `Three.js (js)`. Activate the Import-Export addon under "User Preferences" > "Addons" and then use the regular Import and 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.
# Running tests
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/python 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 execute 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.
#!/bin/bash #!/bin/bash
# you must have blender setup to run from the command line # you must have blender setup to run from the command line
if [[ `which blender` == "" ]]; then command -v blender >/dev/null 2>&1 || { echo >&2 "Blender is not accessible from the command line. Aborting."; exit 1; }
echo "No 'blender' executable found on the command line"
fi
export JSON=`python -c "import tempfile;print(tempfile.mktemp(prefix='$TAG.', suffix='.json'))"` export JSON=`python -c "import tempfile;print(tempfile.mktemp(prefix='$TAG.', suffix='.json'))"`
......
...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/setup_test_env.bash" source "$DIR/setup_test_env.bash"
blender --background $BLEND/planeA.blend --python $PYSCRIPT -- \ blender --background $BLEND/planeA.blend --python $PYSCRIPT -- \
$JSON --vertices --faces --faceMaterials --uvs --maps $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures
makereview $@ --tag $(tagname) makereview $@ --tag $(tagname)
...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/setup_test_env.bash" source "$DIR/setup_test_env.bash"
blender --background $BLEND/cubeA.blend --python $PYSCRIPT -- \ blender --background $BLEND/cubeA.blend --python $PYSCRIPT -- \
$JSON --vertices --faces --faceMaterials --uvs --maps $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures
makereview $@ --tag $(tagname) makereview $@ --tag $(tagname)
...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...@@ -4,5 +4,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/setup_test_env.bash" source "$DIR/setup_test_env.bash"
blender --background $BLEND/lightmap.blend --python $PYSCRIPT -- \ blender --background $BLEND/lightmap.blend --python $PYSCRIPT -- \
$JSON --vertices --faces --faceMaterials --uvs --maps $JSON --vertices --faces --faceMaterials --uvs --maps --copyTextures
makereview $@ --tag $(tagname) makereview $@ --tag $(tagname)
...@@ -4,5 +4,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ...@@ -4,5 +4,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/setup_test_env.bash" source "$DIR/setup_test_env.bash"
blender --background $BLEND/planeB.blend --python $PYSCRIPT -- \ blender --background $BLEND/planeB.blend --python $PYSCRIPT -- \
$JSON --vertices --faces --faceMaterials --uvs --maps --normals $JSON --vertices --faces --faceMaterials --uvs --maps --normals \
--copyTextures
makereview $@ --tag $(tagname) makereview $@ --tag $(tagname)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册