Sybren A. Stüvel
b6c0d01e45
bat pack --help improvements
2018-11-27 14:37:15 +01:00
Sybren A. Stüvel
521c7e1916
Added --compress option for 'bat pack' command
...
This compresses all packed Blend files. Other files, as well as already-
compressed Blend files, are left as-is.
2018-11-27 14:29:37 +01:00
Sybren A. Stüvel
c1aaa3aab3
Add some log level configuration to py.test config
...
Not sure if we want a global DEBUG setting; if it becomes annoying, change it.
2018-11-27 14:29:37 +01:00
Sybren A. Stüvel
0b5e034a92
Fix MyPy errors when running without boto3 installed
2018-11-07 13:03:07 +01:00
Sybren A. Stüvel
43e8a7e370
Include version in --help output
2018-07-11 12:44:29 +02:00
Sybren A. Stüvel
439f727815
Bumped version to 0.5-dev
2018-07-10 16:03:30 +02:00
Sybren A. Stüvel
0e7411a42b
Bumped version to 0.4
2018-07-10 16:03:00 +02:00
Sybren A. Stüvel
d7b06f0644
Blender 2.8 compatibility of image datablock
2018-07-10 16:02:14 +02:00
Sybren A. Stüvel
504b50178b
Moved from requirements.txt to pipenv for package management
2018-07-10 16:02:14 +02:00
Sybren A. Stüvel
38b3e2b55c
Fixed a whole bunch of MyPy errors
...
New release of mypy picks up more.
2018-07-10 16:02:14 +02:00
Sybren A. Stüvel
893c1f2231
Convert hexified ID name to upper case
...
Our test case accidentally has a numerical-only hex representation, which
doesn't show this issue.
2018-07-05 11:53:38 +02:00
Sybren A. Stüvel
63118d250c
Bumped version to 0.4-dev
2018-07-03 15:07:34 +02:00
Sybren A. Stüvel
8a308ef6e4
Bumped version to 0.3
2018-07-03 15:06:27 +02:00
Sybren A. Stüvel
0b96635953
Fix T55539: BAT doesn't pack particle caches
2018-07-03 15:05:15 +02:00
Sybren A. Stüvel
aa8e2a8cdd
Tracer fix for T55539
...
This only fixes the tracer; the problem with the packer still exists.
2018-07-03 15:05:15 +02:00
Sybren A. Stüvel
f75f35ae77
Swap 'expected' and 'actual' arguments
...
Python itself doesn't make any distinction (it just logs 'a != b') but
PyCharm does.
2018-07-03 14:30:59 +02:00
Sybren A. Stüvel
26c5d2dbfc
Unignore some paths
2018-07-03 14:00:53 +02:00
Sybren A. Stüvel
d103056558
Flush the Packer callback queue when closing
2018-07-03 13:01:36 +02:00
Sybren A. Stüvel
f1cfc28a1c
Report skipped files
2018-07-03 13:00:10 +02:00
Sybren A. Stüvel
7fe06c247b
Also report transfer progress on MOVE
...
Previously transfers were only reported when copying files.
2018-07-03 12:56:08 +02:00
Sybren A. Stüvel
6edc15594d
Added utility function to fetching structs by name
2018-07-03 12:34:00 +02:00
Sybren A. Stüvel
f7a18ba07d
Support nested collections in Blender 2.8
2018-06-13 17:40:05 +02:00
Sybren A. Stüvel
5f966934df
Blender 2.8 fixes because of removed Material.mtex and Material.group
2018-06-07 15:18:18 +02:00
Sybren A. Stüvel
dfa07e19cc
Fix T55007: Support fluid simulation cache files
...
This also adds support for entire directory paths to be assets, in
addition to globs and numbered file sequences.
2018-06-05 15:12:10 +02:00
Sybren A. Stüvel
fc144138d0
Better transfer error handling
2018-06-05 15:12:10 +02:00
Sybren A. Stüvel
44c4ce3a69
Speed up packing
...
The .get() function raises a queue.Empty exception anyway, so there was
no real need for the .empty() call. Furthermore, it turned out to really
slow things down.
2018-06-05 15:12:10 +02:00
Sybren A. Stüvel
7e4fa34aae
Added missing image in documentation
2018-06-05 15:12:10 +02:00
Sybren A. Stüvel
acfd8357e1
Bumped version to 0.3-dev
2018-05-08 12:51:00 +02:00
Sybren A. Stüvel
7ce2c3094a
Bumped version to 0.2
2018-05-08 12:50:37 +02:00
Sybren A. Stüvel
285a88793a
Debug-log skipping of packed datablocks.
2018-05-08 12:15:56 +02:00
Sybren A. Stüvel
c35a6fac09
Added BAT logo to documentation
2018-03-27 12:28:34 +02:00
Sybren A. Stüvel
099d51c4ff
Slightly slower flushing/queue checking on the main thread
2018-03-26 17:14:10 +02:00
Sybren A. Stüvel
21fb18247d
Find textures and images of various modifiers
...
- Wave
- UV Project
- Weight VG Edit
- Weight VG Mix
- Weight VG Proximity
2018-03-26 17:14:08 +02:00
Sybren A. Stüvel
0d82dc7fd0
Find texture of displacement modifier
2018-03-26 16:46:13 +02:00
Sybren A. Stüvel
c515509b24
Use decorator to register modifier walker.
2018-03-26 16:43:32 +02:00
Sybren A. Stüvel
08ed33ef81
Written some documentation with Sphinx
2018-03-22 12:12:30 +01:00
Sybren A. Stüvel
8b73b86734
Reduce cyclomatic complexity of Struct.field_get()
2018-03-22 10:56:02 +01:00
Sybren A. Stüvel
85840faf70
Added docstring
2018-03-22 10:10:50 +01:00
Sybren A. Stüvel
8d1bd89583
Allow packing to ZIP files
2018-03-22 10:06:48 +01:00
Sybren A. Stüvel
e53470d898
Add a pack-info.txt file at the top of the BAT Pack
...
This file explains which blend file this pack was created for.
2018-03-21 16:33:41 +01:00
Sybren A. Stüvel
3a3dbb5042
Added TODO
2018-03-20 18:13:16 +01:00
Sybren A. Stüvel
1111465061
Report progress of S3 uploads while the upload is happening
...
Previously it only reported progress after uploading each file.
2018-03-20 17:58:49 +01:00
Sybren A. Stüvel
cd32442f5a
Fixed issues with relative paths to blend files
2018-03-20 17:57:41 +01:00
Sybren A. Stüvel
56fb89da3d
S3Packer now takes a URL as endpoint, not a hostname
2018-03-20 16:36:29 +01:00
Sybren A. Stüvel
c4a57039f1
Bumped version to 0.2-dev
2018-03-16 13:40:29 +01:00
Sybren A. Stüvel
6e7acb9425
Bumped version to 0.1
2018-03-16 13:39:51 +01:00
Sybren A. Stüvel
3b3fb0e3ef
improve 'bat --help' message
2018-03-16 13:39:34 +01:00
Sybren A. Stüvel
b78ca35786
Little bit of usage info in package description
2018-03-16 13:36:58 +01:00
Sybren A. Stüvel
fd02b0165f
Updated setup.py in preparation of first upload to pypi
2018-03-16 13:29:08 +01:00
Sybren A. Stüvel
53e22a4a2f
Added GPL comment blocks with proper attibution.
2018-03-16 13:25:20 +01:00
Sybren A. Stüvel
da9f04240e
Added CHANGELOG and updated README
2018-03-16 12:31:50 +01:00
Sybren A. Stüvel
f7150c0d29
Allow aborting a pack operation.
...
For this to work well I also had to remove the sorting of blocks in
trace.deps(). The sorting caused the first `yield` to be executed only
after each blend file was opened, which means that the consuming for-loop
takes a long time to hit its first iteration. As a result, it would respond
slowly to abort requests. By not sorting the first `yield` is much sooner,
resolving this issue.
2018-03-16 12:12:15 +01:00
Sybren A. Stüvel
4f4a67784d
Small cleanups
...
- No more shadowing of `blendfile` name.
- Removed unused import
- Formatting
2018-03-16 10:10:29 +01:00
Sybren A. Stüvel
889f3abd25
Implemented reporting callbacks.
...
Both the dependency Tracer class and the Packer class now support a
callback object, where the latter is a subclass of the former.
For file transfers running in a separate thread, there is a thread-safe
wrapper for progress callbacks. This wrapper can be called from any thread,
and calls the wrapped callback object from the main thread. This way the
callback implementation itself doesn't have to worry about threading
issues.
2018-03-15 17:59:55 +01:00
Sybren A. Stüvel
d2e13750e9
Moved comment to correct location
2018-03-15 16:28:34 +01:00
Sybren A. Stüvel
88eb883989
Include subpackages in the distribution wheel.
2018-03-15 16:28:32 +01:00
Sybren A. Stüvel
59189aab5f
Removed unused imports
2018-03-15 14:30:46 +01:00
Sybren A. Stüvel
6b51183095
Packer: store the output path of the blend file in the target directory
...
This allows the Flamenco Add-on to get the final path of the blend file.
2018-03-14 16:06:21 +01:00
Sybren A. Stüvel
73b264f6bc
Allow relative project path
2018-03-14 16:06:21 +01:00
Sybren A. Stüvel
9ceb42af2f
Moved some code into its own function
2018-03-14 16:06:21 +01:00
Sybren A. Stüvel
8340df129d
BAT Pack can now exclude files based on glob patterns
2018-03-14 16:06:21 +01:00
Sybren A. Stüvel
0e9de7753c
Allow Packer to be used as context manager + test for rewriting img seqs
2018-03-14 12:50:27 +01:00
Sybren A. Stüvel
d2ac0fa919
Added test for Packer.close()
2018-03-14 12:30:18 +01:00
Sybren A. Stüvel
c9664ca045
Report missing files in Packer.strategise()
2018-03-14 12:24:26 +01:00
Sybren A. Stüvel
575a0921c1
bat.pack.queued_copy → bat.pack.filesystem
2018-03-09 17:04:29 +01:00
Sybren A. Stüvel
ea832cd666
Added support for uploads to S3 by using the boto3 client.
2018-03-09 16:48:34 +01:00
Sybren A. Stüvel
4a0673918d
Formatting
2018-03-09 16:31:01 +01:00
Sybren A. Stüvel
15ca2f98ab
Better handling of KeyboardInterrupt to abort file transfers
2018-03-09 16:30:46 +01:00
Sybren A. Stüvel
a2ca66a2f6
Nicer transfer queue iteration
2018-03-09 16:30:17 +01:00
Sybren A. Stüvel
ef5c46eba5
Some mypy & test tweaks
2018-03-09 16:29:30 +01:00
Sybren A. Stüvel
53a2ca4373
Only set the log level on our own logger.
...
Otherwise debug logging will be completely swamped with logs from other
libraries. Maybe that's nice too at some point, but that would need another
CLI arg.
2018-03-09 16:28:31 +01:00
Sybren A. Stüvel
1a37cb5ba1
Moved common code to FileTransferer class
...
Many implementations will want to use the same queueing mechanism.
2018-03-09 15:08:50 +01:00
Sybren A. Stüvel
3ae39104a9
Allow subclasses of Packer to specify a different file transferer class
2018-03-09 14:25:43 +01:00
Sybren A. Stüvel
4c3d288be9
Add mypy invocation to unit test
...
This way it's easy to run both the tests and mypy.
2018-03-09 14:24:06 +01:00
Sybren A. Stüvel
cc06a191a1
Added more annotations for mypy
...
Function declarations that have no type annotations at all will be skipped
by mypy. Adding an explicit `-> None` tells mypy to run on those functions
too.
2018-03-09 14:23:43 +01:00
Sybren A. Stüvel
4dc0dedff1
Removed version pinning from requirements-dev.txt + added mypy
...
The development should be done with recent versions, and if any issues
arise those should be fixed.
2018-03-09 13:51:12 +01:00
Sybren A. Stüvel
38978537bc
Removed some unused code + different line wrap style
2018-03-09 13:04:26 +01:00
Sybren A. Stüvel
0778b3a6ec
Defined file transferer abstract base class
...
This will allow for different file transfer classes uploading to different
services.
2018-03-09 13:04:14 +01:00
Sybren A. Stüvel
ac3f6142b3
Move rewritten blend files instead of copying them
...
This will cause a nice speedup if the temporary directory happens to be on
the same file system as the target directory for the BAT Pack. This can be
influenced by setting an environment variable; see the documentation for
[tempfile.gettempdir](https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir )
2018-03-09 12:47:50 +01:00
Sybren A. Stüvel
824ca4bcb7
Rewrite blend files in temporary directory, before copying
...
This allows us to later support uploading to a non-local filesystem, such
as Amazon S3 cloud storage, after path rewriting is complete.
2018-03-09 12:33:15 +01:00
Sybren A. Stüvel
384f1d5107
Compare float with assertAlmostEqual
2018-03-09 11:20:38 +01:00
Sybren A. Stüvel
fdbbc3a20d
Static type checking with mypy
...
This does introduce some not-so-nice things, like having to annotate each
`__init__` function with `-> None`. However, the benefits of having static
type checking in a complex bit of software like BAT outweigh the downsides.
2018-03-09 11:09:47 +01:00
Sybren A. Stüvel
632d01334c
Renamed module tracer → trace
...
This is consistent with the other module names.
2018-03-09 10:02:44 +01:00
Sybren A. Stüvel
e8f41f2735
Store rewrites in AssetAction
...
This is in preparation of interchanging copying and rewriting.
2018-03-09 10:00:46 +01:00
Sybren A. Stüvel
d984870155
Don't repeat superclass name
2018-03-09 09:59:54 +01:00
Sybren A. Stüvel
d10264695a
Tweaked logging
2018-03-08 15:30:31 +01:00
Sybren A. Stüvel
e03e0fb4d7
Reduced some log levels
2018-03-08 14:53:25 +01:00
Sybren A. Stüvel
0dab872289
Truncate UTF-8 in a way that produces valid UTF-8.
2018-03-08 14:47:41 +01:00
Sybren A. Stüvel
898f79a951
Removed unused imports
2018-03-08 14:35:35 +01:00
Sybren A. Stüvel
c80bb8232e
Fix bad reference
2018-03-08 14:27:17 +01:00
Sybren A. Stüvel
bfc1421df9
Updated README
2018-03-08 14:24:16 +01:00
Sybren A. Stüvel
be747ffa6e
Ignore build & dist dirs
2018-03-08 14:19:29 +01:00
Sybren A. Stüvel
e9ee5b69ec
Disallow BlendPath(str)
2018-03-08 14:18:07 +01:00
Sybren A. Stüvel
f2f824ad85
Speed up BlendFileBlock instantiation with __slots__
...
Due to the huge number of BlendFileBlock objects created for packing a
production-size blend file, using slots here actually makes the
dependency tracer significantly (p<0.001) faster. In my test case the
speed improvement was 16% for a 'bam list' command.
2018-03-08 13:59:28 +01:00
Sybren A. Stüvel
88f23a4097
Also test bat pack --noop
2018-03-08 13:02:18 +01:00
Sybren A. Stüvel
b6527ec1ee
Moved file copy queue to separate module.
...
Also transformed into a threading.Thread subclass, rather than using a
function + module-global state variables.
2018-03-08 13:00:56 +01:00
Sybren A. Stüvel
0df94c74cd
Also test Packer.execute()
2018-03-08 12:41:19 +01:00
Sybren A. Stüvel
08f538d8c8
File I/O improvements
...
- Tracer now iterates over blocks in disk order.
- Packer copies files per directory, in a separate thread.
- Packer only copies files if they don't exist yet.
- Packer also copies file permissions.
2018-03-08 12:33:15 +01:00
Sybren A. Stüvel
b5418e1f5f
Removed Packer._packed_paths
...
The info in that dict is also available in Packer._actions[...].new_path
2018-03-08 11:15:38 +01:00
Sybren A. Stüvel
8fc1072144
Formatting
2018-03-08 11:08:57 +01:00