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.
Support name-spaced add-ons, exposed via user configurable extension
repositories.
Directories for add-ons can be added at run-time and are name-spaced to
avoid name-collisions with Python modules or add-ons from other
repositories.
This is exposed as an experimental feature "Extension Repositories".
Details:
- A `bUserExtensionRepo` type which represents a repository which is
listed in the add-ons repository.
- `JunctionModuleHandle` class to manage a package with sub-modules
which can point to arbitrary locations.
- `bpy.app.handlers._extension_repos_update_{pre/post}` internal
callbacks run before/after changes to extension repositories,
callbacks are used to sync the changes to the Python package that
exposes these to add-ons.
- The size of an add-on name has been increased so a user-defined package
prefix can be included without enforcing shorter add-on names.
- Functionality relating to package management has been left out of this
change and will be developed separately.
Further work:
- While a repository can be renamed, enabled add-ons aren't renamed.
Eventually we might want to support this although we could also
disallow renaming repositories with add-ons enabled as the name isn't
all that significant.
- Removing a repository should remove all the add-ons located in this
repository.
- Sub-module names are currently restricted to `[A-Za-z]+[A-Za-z0-9_]*`
we might want to relax this to allow unicode characters (we might
still want to disallow `-` or any characters that would prevent
attribute access in code).
Ref !110869.
Reviewed By: brecht
Since d8388ef36a, the "frame_change_post" handler could not be used
anymore to detect when animation playback stopped.
This functionality is needed by certain addons though and is generally
usefull to have, so this is now added.
Related reports : #109168, #109218
Pull Request: https://projects.blender.org/blender/blender/pulls/109232
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/
Add a filepath argument to load/save pre/post.
Also add save_post_failed and load_post_failed handlers so it's always
possible to for the pre handlers to run a matching post action.
This makes it possible to know the filepath of the blend file mean
loaded/saved as well as supporting running an action when load/save
operations fail.
When loading and saving the startup-file, the path argument is set to
an empty string.
Details:
New RNA types were added to support storing primitive values in
PointerRNA. Primitive{String/Int/Float/Boolean}RNA. These will likely
only be used in some limited cases, in the case of BKE_callback_exec it
allows strings to be included as part of the PointerRNA **pointers
argument.
Ref !104769.
Main motivation is from T54314 where there was no way to read from a
Viewer image datablock after the compositor has run.
The only solution there was to do a full rerender (which obviously takes
much longer). Adding a handler avoids having to rerender.
This uses new syntax from rBf4456a4d3c97 and also adds "COMPOSITE" as a
job type that can be queried by `bpy.app.is_job_running`.
NOTE: there is another issue when multiple viewers are used and these
get active via RNA (compo execution is not triggered there yet -- unlike
when a viewer is selected in the Editor -- this is an issue of
`ED_node_set_active` vs. only `nodeSetActive`, but this will be tackled
separately)
Maniphest Tasks: T54314
Differential Revision: https://developer.blender.org/D15078
Add `bpy.app.is_job_running(job_type)` as high-level indicator. Job
types currently exposed are `WM_JOB_TYPE_RENDER`,
`WM_JOB_TYPE_RENDER_PREVIEW`, and `WM_JOB_TYPE_OBJECT_BAKE`, as strings
with the `WM_JOB_TYPE_` prefix removed. The functions can be polled by
Python code to determine whether such background work is still ongoing
or not.
Furthermore, new app handles are added for
`object_bake_{pre,complete,canceled}`, which are called respectively
before an object baking job starts, completes sucessfully, and stops due
to a cancellation.
Motivation: There are various cases where Python can trigger the
execution of a background job, without getting notification that that
background job is done. As a result, it's hard to do things like
cleanups, or auto-quitting Blender after the work is done.
The approach in this commit can easily be extended with other job types,
when the need arises. The rendering of asset previews is one that's
likely to be added sooner than later, as there have already been
requests about this.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14587
- Missing star prefix.
- Unnecessary indentation.
- Blank line after dot-points
(otherwise doxygen merges with the previous dot-point).
- Use back-slash for doxygen commands.
- Correct spelling.
Annotation tool is used as a general mark tool for many add-ons. To be able to detect when an annotation is done is very handy to integrate the annotation tool in add-ons and other studio workflows.
The new callback names are: `annotation_pre` and `annotation_post`
Both callbacks are exposed via the Python module `bpy.app.handlers`
Example use:
```
import bpy
def annotation_starts(gpd):
print("Annotation starts")
def annotation_done(gpd):
print("Annotation done")
bpy.app.handlers.annotation_pre.clear()
bpy.app.handlers.annotation_pre.append(annotation_starts)
bpy.app.handlers.annotation_post.clear()
bpy.app.handlers.annotation_post.append(annotation_done)
```
Note: The handlers are called for any annotation tool, including eraser.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14221
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
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Introduce `BKE_callback_remove()`, which undoes the effect of
`BKE_callback_add()`. It also respects `funcstore->alloc` by freeing the
removed `funcstore` when needed.
This allows for shorter-lived objects in memory to unregister their
callbacks at the end of their lifespan.
`BKE_callback_global_finalize()` has been adjusted so that the
responsibility "remove a callback" is given to one function only.
Reviewed by: campbellbarton
Differential Revision: https://developer.blender.org/D12625
Add a doc-string explaining the purpose of each call back and
how they should be used.
Also add a currently unused callback 'POST_FAIL' that is to be used in
cases the action fails - giving script authors, a guarantee that a
call to `pre` will always have a matching `post/post_fail` call.
- D11422: adds a callback that can use 'post_fail'.
- T88696: proposed these conventions.
Adds internal API for creating and managing OpenXR actions at the
GHOST and WM layers. Does not bring about any changes for users since
XR action functionality is not yet exposed in the Python API (will be
added in a subsequent patch).
OpenXR actions are a means to communicate with XR input devices and
can be used to retrieve button/pose states or apply haptic feedback.
Actions are bound to device inputs via a semantic path binding
(https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles),
which serves as an XR version of keymaps.
Main features:
- Abstraction of OpenXR action management functions to GHOST-XR,
WM-XR APIs.
- New "xr_session_start_pre" callback for creating actions at
appropriate point in the XR session.
- Creation of name-identifiable action sets/actions.
- Binding of actions to controller inputs.
- Acquisition of controller button states.
- Acquisition of controller poses.
- Application of controller haptic feedback.
- Carefully designed error handling and useful error reporting
(e.g. action set/action name included in error message).
Reviewed By: Julian Eisel
Differential Revision: http://developer.blender.org/D10942
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
The goal is to make it possible to access evaluated datablocks at a
corresponding context. For example, be able to check evaluated state
if an object used for rendering.
Allows to write scripts in a safe manner for T63548 and T60094.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5726
Preparing for the bigger changes which will be related on passing
dependency graph to various callbacks which need it.
Differential Revision: https://developer.blender.org/D5725