16 Commits

Author SHA1 Message Date
Campbell Barton
b3101abcce blend_render_info: Zstd support, skip redundant file reading & cleanup
- Use a context manager to handle file handlers (closing both in the
  case of compressed files).

- Seek past BHead data instead of continually reading
  (checking for 'REND').

- Write errors to the stderr (so callers can differentiate it from the
  stdout).

- Use `surrogateescape` in the unlikely event of encoding errors
  so the result is always a string (possible with files pre 2.4x).

- Remove '.blend' extension check as it excludes `.blend1` files
  (we can assume the caller is passing in blend files).

- Define `__all__` to make it clear only one function is intended
  to be used.
2022-06-07 13:15:56 +10:00
Campbell Barton
3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
Campbell Barton
bff0cf1030 Cleanup: remove white-space before headers 2022-02-11 14:23:54 +11:00
Campbell Barton
c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Brecht Van Lommel
4da2acae3a Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3668
2018-09-03 16:55:01 +02:00
Campbell Barton
b66aa0b0a6 Cleanup: pep8 2018-07-03 06:48:44 +02:00
Dmitry Dygalo
87c08fa681 Small speedup for blend_render_info.py
Do not close and re-open the file in case it's compressed, gzip module can now directly take a file object as parameter.

Differential Revision: https://developer.blender.org/D2235
2016-09-20 12:38:54 +02:00
Campbell Barton
6e131ce075 Call to python3 for stand-alone scripts
Needed since Debian & FreeBSD both move away from keeping a synlink to `python`.
2016-07-26 05:18:00 +10:00
Campbell Barton
995d4d803a Maintenance: Shebang lines fix for some python scripts 2013-11-18 20:41:22 +11:00
Campbell Barton
7d673ef0d2 fix for blend_render_info.py not closing file & some edits to comments. 2012-08-22 10:29:30 +00:00
Campbell Barton
98e6912480 style cleanup 2012-06-19 22:17:19 +00:00
Campbell Barton
af7eb3f210 fix for buffer overrun crash with saving scene name longer then 24 characters.
writing render info would try write= 64 length string into 24 length buffer.

updated py script to extract render info too.
2012-04-26 04:03:25 +00:00
Campbell Barton
fda2045150 correct spelling errors in comments 2011-10-17 06:58:07 +00:00
Campbell Barton
115b256738 ran through pep8 checker 2010-09-07 15:17:42 +00:00
Campbell Barton
d9f86e3c73 pedantic pep8 warnings, mostly white space. 2010-07-05 22:22:22 +00:00
Campbell Barton
927aac74ab - module for reading blend start/end frames and scene name (useful for finding the total frame count without loading a blend file)
- added render api as unstable to the docs.
2010-06-15 12:06:30 +00:00