When GLSL sources were first included in Blender they were treated as
data (like blend files) and had no license header.
Since then GLSL has been used for more sophisticated features
(EEVEE & real-time compositing)
where it makes sense to include licensing information.
Add SPDX copyright headers to *.glsl files, matching headers used for
C/C++, also include GLSL files in the license checking script.
As leading C-comments are now stripped,
added binary size of comments is no longer a concern.
Ref !111247
Since these are operations rather than new nodes, they don't make
sense in the add menu. They are also available in the "Node" menu
in the editor's header and in the context menu.
The code ensuring that an object (or obdata) is not made local if it is
used by linked data that is not tagged to be made local was blatantly
buggy, leading to over-detecting such cases.
Note that this code remains fairly fragile imho, think the whole Main
data-base of IDs should be checked, other data-types than Objects can
use objects! But this is for another day.
based on concentric disk mapping.
Concentric disk mapping was already present, but not used everywhere.
Now `sample_cos_hemisphere()`, `sample_uniform_hemisphere()`, and
`sample_uniform_cone()` use concentric disk mapping.
This changes the noise in many test images.
Pull Request: https://projects.blender.org/blender/blender/pulls/109774
New code exposing ID Pointers CustomProperties to the UI (b3c7f3c8a9)
would cause invalid data access when calling `as_dict()` on py-defined ID
pointers ID properties, since these have no ID type defined by default.
The code of `as_dict()` will now forcefully generate a valid ID type
value, either by using the type of the currently assigned ID, or falling
back to the Object ID type.
Found while opening some lighting production files from the Pets
Project.
The `expand` callback is 'trivial' to replace, since it is only iterating
over ID pointers and calling a callback.
The only change in behavior here is that some pointers that were not
processed previously will now be.
In practice this is not expected to have any real effect (usually
the IDs used by these pointers would have been expanded through other
usages anyway). But it may solve a few corner cases, undocumented issues
though.
Part of implementing #105134: Removal of readfile's lib_link & expand code.
There are actually cases where you do not want to access the original
ID pointers, even though the callback will not modify them. One example
is the incoming generic 'expand' readfile callback, which will replace the
dedicated one for all ID types.
Related to #105134: Removal of readfile's lib_link & expand code.
This patch refactors most of the code of the hard eraser, both for readability purpose, and to prepare the integration of the soft mode of the eraser.
The refactoring includes :
- the use of specific structures and enum types `SegmentCircleIntersection`, `PointCircleSide`, and `PointTransferData` to handle the data more easily,
- improve readability of the intersections functions (better naming, and more accurate and generic comments),
- definition of a more generic `compute_topology_change` function that handles point insertion, removal, and curve splitting for curves geometry.
Pull Request: https://projects.blender.org/blender/blender/pulls/111390
This reverts commit 206ab6437b.
Seems that the illegal address error should be covered elsewhere, but it's not directly
clear where. Revert the commit for further investigation.
Caused by 351034891e
This change is a partial revert of the change.
The SCULPT_cube_tip_init() does not deal with the symmetry passes.
Additionally, the commit changed the way how the Z component of
the matrix was constructed: displaced vs. non-displaced area
coordinate.
While the code duplication is often to be avoided, sometimes it is
more clear than a centralized place with a lot of arguments passed
to a function. We can have a pass of de-duplication later on, and
make a better decision, but for now restore user level behavior to
what it is expected to be.
Pull Request: https://projects.blender.org/blender/blender/pulls/111425
This makes the asset shelf available as a standard, non-experimental
feature. Currently no script makes use of it, so it will still not be
available. However the pose library will be updated to use this for its
UI instead.
Initially the asset shelf was committed as experimental feature, even
though it seemed ready for non-experimental. After double checking with
some people (Dalai and Brecht) we decided to go ahead with this.
There are still some futher changes planned, see #107881.
Discovered during an investigation into #111277
in rare situations (E.G. When normals are NaN), an emitter
won't be selected as part of `light_tree_cluster_select_emitter()`
and as a result of that, an `emitter_index` of `-1` is passed to
`kernel_data_fetch(light_tree_emitters, emitter_index)` resulting in
an "illegal address" error on some devices.
Pull Request: https://projects.blender.org/blender/blender/pulls/111292
Specifying the correct operator context (`INVOKE_REGION_CHANNELS` in
this case) is mandatory, otherwise looking up the shortcut in
`wm_keymap_item_find_props` will fetch the wrong region
(`RGN_TYPE_WINDOW` not `RGN_TYPE_CHANNELS`) and thus wont find the keymap
item in that region keymap.
This was already done for the other menus, not for the context menu
though.
Pull Request: https://projects.blender.org/blender/blender/pulls/111376
Miscellaneous improvements to the Statistics 3DView Overlay. Shows
internal details for selected objects while in Object Mode, including
triangles. Removes the useless "0" shown in the stats while in Sculpt
mode.
Pull Request: https://projects.blender.org/blender/blender/pulls/104663
In readfile context, some ID pointers have to be ignored: typically the
'owner_id' pointers of embedded data.
Currently unused, but required for replacing `blend_read_lib`/
`blend_read_expand` by `foreach_id` (#105666).
The fact that this pointer may be either to a regular ID, or an embedded
one, without any way to tell it withour accessing the nodetree data,
makes it tricky to handle properly when such 'other ID' access is not
allowed. Here there can still be assumptions and heuristics based on
other data, but this remains fragile and really sub-optimal code.
Should not have any behavioral change in current code, but required for
replacing `blend_read_lib`/`blend_read_expand` by `foreach_id`
(#105666).
Call functions directly in lambdas rather than passing their
arguments in a separate void * argument. This can be changed
more in the future to move callback arguments out of smaller
structs.
Adjust the width, dash length and amount of anti-aliasing of node links
so they look the same independent of the UI scaling.
Adding another parameter to the shader exceeded the limit of 16
attributes. Therefore the parameters to describe the dashes (length,
factor, alpha) are passed in together as a vector.
Ref #102919
Pull Request: https://projects.blender.org/blender/blender/pulls/111270
This commit adds a new option flag to the lib_query foreach_id code,
which will make deprecated ID pointers to be processed as well.
NOTE: Currently there is no report to the callbakcs about the fact that
it is processing a deprecated ID. This can be easily added later if it
becomes necessary.
Part of implementing #105134: Removal of readfile's lib_link & expand code.
When choosing the new 'overwrite' option when trying to save a blendfile
from a newer version of Blender, it would cause invalid (use-after-free)
memory access.
Issue caused by the main commit (a1d7ec7139) of the new blendfile
compatibility handling. No idea how it was not detected earlier.
Many thanks to @weizhen for spotting the issue and doing some initial
investigation on it.
The stroke mode of the eraser only tests distance with segments of the strokes, so it does not take into account strokes that only have one point, and thus no segment. This patch fixes the issue by testing if the point is inside the eraser in the case of a one-point stroke.
Pull Request: https://projects.blender.org/blender/blender/pulls/111387
This is in prevision of EEVEE panoramic projection support.
EEVEE-Next is planned to add support for these parameters.
Not having these parameters in Blender DNA will make Cycles
and EEVEE not share the same parameters and will be confusing
for the user.
We handle forward compatibility by still writing the parameters
as ID properties as previous cycles versions expect.
Since this change will break the API compatibility it is crucial
to make it for the 4.0 release.
Related Task #109639
Pull Request: https://projects.blender.org/blender/blender/pulls/111310