No longer importing, then deleting, then re-importing modules all over the
place. Just import at the top of the file.
Also removed some superfluous return statements.
This avoid having to raise (and catch) an Exception instance. Catching
such an exception is unnecessarily broad, as it'll also catch things like
SyntaxError and AttributeError.
At the bottom of the file, an exception is raised when __name__ ==
'__main__', stating that it's not allowed to run the file in that way.
It's silly to then still set up logging in that case.
This allows us to run "setup.py bdist_wheel", put the wheel on the
PYTHONPATH, and run BAM pack without having to install it on a virtualenv.
The main purpose is to be able to ship this wheel with Blender. Updating
Blender's version of BAM thus requires only putting in a new wheel file,
rather than the old error-prone approach of copy-and-edit.
Without __init__.py those are namespaces, not packages, which can be merged
with the same namespaces that are defined on different places in sys.path.
This is flexibility we don't need.
This is a bad idea, since it requires bam to be installable even before
running setup.py. Furthermore, it requires bam to be importable before
being installed, which is also a bad idea.
`bam_cli.py pack` command now takes two more (optional) parameters, one
to specify the base directory of the repository, and one to enable
warnings when 'external' dependencies (to given base dir) are found.
Note that by default, base directory is the directory of the packed
.blend file (such that default behavior does not change at all).
See CLI help for more.
commit 45e3ba4a4f8fb39d2a090f1f67c10d6132939d8e
blendfile.py: add BlendFileBlock.get_data_hash() 'pointer-invariant' hash generator.
This aims at giving some kind of uid to replace addr_old, that does not changes on
every .blend saving.
commit 81c92e60195f9ff3ce327c26278d07eafb4a0596
blendfile.py: fix/add some 'basic data' reading (mostly arrays of ints/floats/...), add utils to recursively get all items of a struct.
New `BlendFileBlock.items_recursive_iter()` will yield all valid key/values pair of a given struct,
including sub ones (e.g. 'id.next', 'id.name', etc.).