0.1.2 • Published 11 years ago

pusher.blender v0.1.2

Weekly downloads
2
License
-
Repository
bitbucket
Last release
11 years ago

pusher.blender

pusher.blender is a module for parsing data from .blend files saved by Blender. The file format is described on the blender.org site.

Note: please encourage further development by providing feedback on this module and how you use it!

Examples

In the pusher.blender directory, run the examples:

$ node examples/example-01.js
$ node examples/example-02.js
etc.

The examples demonstrate how to extract data from the .blend file. For example, here's some of the partial output from example-01.js

Opening file:  data/unitCube-000.blend
File version:  257
Mesh at 0x2959559940 total vertices/faces/edges: 8/6/12
Object:
{ 
  ...
  mat: 4026607364,
  ...   
  totvert: 8,
  totedge: 12,
  totface: 6,
  ...
  loc: [ 5.960464477539063e-8, -1.1920928955078125e-7, 0 ],
  size: [ 1.0000004768371582, 1.0000004768371582, 1 ],
  rot: [ 0, 0, 0 ],
  texflag: 1,
  drawflag: 67,
  smoothresh: 30,
  ... }

Usage

(See the "examples" folder for in the git repository for more details.)

The parser is fairly low-level: it simply makes it easier to traverse the Blender "SDNA" structures. It works by reading in the index of all types, structures, and blocks.

From there, the client code still needs to traverse the blocks of interest. This is left to the client in order to (a) avoid loading what the client does not need, (b) avoid enforcing use of "intermediate" data structure for 3D point, normals, etc. that might require yet-another format conversion.

The examples are the best way to understand the library:

Unit Tests

Unit testing uses node-unit. The standard command npm install --dev will install the development dependencies. Then run the tests using:

npm test

Benchmarks

Sorry, none exist yet!

License

Licensed under the MIT license.