The blend project provides support for reading blend files, which are used by Blender.
Documentation provided by GoDoc.
go get github.com/mewmew/blend
To parse more complex blend files "block/struct.go" and "block/parse.go" may need to be regenereted. To regenerate these two files for any given blend file, use the blendef
tool.
go get github.com/mewmew/blend/cmd/blendef
cd $GOPATH/src/github.com/mewmew/blend/block
blendef /path/to/complex.blend
A more detailed description is given in the "self-describing format" section.
-
Extract an embedded thumbnail from a blend file.
go get github.com/mewmew/blend/examples/blendview cd $GOPATH/src/github.com/mewmew/blend/testdata blendview block.blend
-
Parse a single block in a blend file.
-
Parse all blocks in a blend file and access the data of a pointer.
http://godoc.org/github.com/mewmew/blend/block#example-Pointer
One unique feature of blend files is that they contain a full definition of every structure used in its file blocks. The structure definitions are stored in the DNA block.
All block structure definitions ("block/struct.go") and the block parsing logic ("block/parse.go") have been generating by parsing the DNA block of "testdata/block.blend".
The tool which was used to generate these two files is located at:
github.com/mewmew/blend/cmd/blendef
More complex blend files may contain structures which are not yet defined in the block package. If so, use blendef
to regenerate "struct.go" and "parse.go" for the given blend file.
The source code and any original content of this repository is hereby released into the public domain.