Commit Graph

15 Commits

Author SHA1 Message Date
48ed23a261 Make blendfile.py reading/parsing slightly more robust/helpful in broken .blend files cases. 2017-04-12 10:57:34 +02:00
a6c32b25e5 Added BlendFile.__repr__() to show more useful info than memory pointer 2017-04-05 12:28:31 +02:00
d046db9c81 Added __repr__() to DNAName and DNAStruct classes 2016-09-15 14:37:30 +02:00
a3747e5a3e Don't set log level in the module itself.
Log levels should be set by the user of the module, usually at the
application level, rather than by each individual Python module.
2016-09-15 14:37:15 +02:00
d6aed3491a Added BlendFileBlock.dna_type_name property 2016-09-15 14:36:37 +02:00
59bbdeb310 PEP8 formatting 2016-09-15 14:36:17 +02:00
e6f6bd6da3 minor edits to blendfile 2016-06-10 02:19:20 +10:00
4d6b5bf4c0 Use tuples for multi-part lookups
Also use real ints instead of extracting from strings.
2016-01-26 18:36:48 +11:00
d54c92b6fb Cleanup: style 2016-01-26 17:20:10 +11:00
4360fa5475 bledfile.py: Port over changes from src_utils repo.
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.).
2016-01-18 22:08:20 +01:00
28429f297b blendfile: "fix" blocks' iteration over values, and add 'user_data' member to Blocks and DNAStruct objects.
Currently blendfile.py does not know how to handle embeded structs - this is solvable for later, but at least
do not raise exception about that when using values()/items() helpers of BlendFileBlock
(for now, return Ellipsis in those cases).

Also, added some user_data member to BlendFileBlock and DNAStruct classes, handy when you need to store
some own data for each of those, and want to avoid having your own list or dict for that.
2015-12-10 16:16:19 +01:00
7d7fede5b2 Support context manager for opening blend file 2015-06-09 03:08:18 +10:00
6b0735e402 blendfile: remove redundant struct use 2015-03-05 09:58:32 +11:00
98f67c5d7f test local replay of edits, needed for local cache 2015-01-28 20:29:29 +11:00
871600312c re-arrange modules, preparing for python-package-index 2014-12-19 11:33:05 +01:00