Commit Graph

12 Commits

Author SHA1 Message Date
Campbell Barton e8df5cec83 PyAPI: free internal Python data using sys.exit(..)
Previously BPY_python_end wasn't called when scripts called sys.exit()
because BPY_python_end exited the Python interpreter.

Change this behavior to call BPY_python_end without exiting the Python
interpreter while freeing Blender/Python data.

While leaks in the context of sys.exit aren't especially important
it's generally preferable for sys.exit() to match Blender's code-paths
for exiting to avoid unexpected behavior.
2023-09-19 15:50:41 +10:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 52acf6a6ec Cleanup: correct file names in comments after C -> C++ renaming
Use back-tick quotes to differentiate these from plain text.
2023-07-31 13:02:30 +10:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Campbell Barton 28b8ceea7c ByAPI: add "all" argument to bpy.app.help_text, to show all help text
Optionally extract all help text, even for options not available
on the current platform or with the current build options.

Useful so it's possible to extract help text for the user-manual
which doesn't depend on the blender build used for extraction.
2023-05-27 17:37:49 +10:00
Campbell Barton 3a5ba15c79 PyAPI: add bpy.app.help_text() for accessing output from `--help`
Simplify help text extraction which may be used by the manual &
man-page generation.
2023-05-27 16:36:52 +10: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
Campbell Barton 63f8d18c0f Cleanup: move public doc-strings into headers for 'python/intern'
Ref T92709
2021-12-10 21:40:53 +11:00
Campbell Barton 5531697f6d Cleanup: remove duplicate context variable (__py_context)
The context was stored both in __py_context & bpy_context_module.

This avoids duplicate functions to update them too.
2020-10-15 19:00:16 +11:00
Sebastian Parborg 2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
Campbell Barton 397cec6a4d Cleanup: Pass 'FILE *' instead of 'void *' for BPY_python_backtrace
This was committed as a temporary workaround in 82150f5641
as release builds were failing (only debug builds worked).

This adds `stdio.h` to the header which is now split into a file that
contains more specialized functionality.

Also move function body inside BPY_python_backtrace,
removing PyC_StackPrint as we have PyC_StackSpit() for
similar functionality that can be called from a debugger.
2020-08-17 18:31:04 +10:00
Campbell Barton f8c0d63cdb Cleanup: split BPY_extern_python into it's own header
Currently BPY_extern.h includes too much mixed functionality.
2020-08-17 17:20:12 +10:00