The issue was an out-of-bounds read access when checking whether
the world volume emission needs to be accumulated.
Solution is to check for this case. Done in the generic place, so
that the shade_volume kernel is more readable and no branching
added there, and there is no impact on scenes without the light
linking.
Assume that the world emissive volume belongs to the default light
linking group, as there is no way to link it explicitly to anything.
Pull Request: https://projects.blender.org/blender/blender/pulls/110733
Use `parallel_for` instead of the C threading API, extract some
constant checks from hot loops, and use `EnumerableThreadSpecific`
for thread-local storage.
Pull Request: https://projects.blender.org/blender/blender/pulls/105940
Text of preview-tile widgets would change color while pressing the mouse
button on them, this wasn't useful and just made the UI feel glitchy.
The widget background already indicates the state well.
Preview-tile widgets are currently only used in the asset view template.
More usages will be introduced in the asset-shelf patch (#104831).
Caused by 5ed14e9269.
That commit accidentally removed the `copy_v2_v2_int(t->mval, mval);`
line which was responsible for initializing the value of `mval`.
This was because the `ob->runtime.geometry_set_eval` was populated
with the new `GreasePencilComponent` but
`GeometrySet::compute_boundbox_without_instances()` did not compute
the bounding box of the grease pencil geometry.
Thus the bounding box was not correctly set and the object not
correctly rendered.
functions imported from creator.cc still had extern the "C"
attribute causing a linker error due it it looking for the
undecorated symbol for these functions.
Whenever `grow_array` in
`blender/source/blender/blenkernel/intern/grease_pencil.cc` was called,
it would not free the original array after relocating the data to the
newly allocated memory. This fixes the memory leak.
functions imported from creator.c were missing the extern "C"
attribute causing a linker error due it it looking for the
decorated symbol for these functions.
PR adds support for the selection of grease pencil layers in
animation editor.
- selection status is stored in `GreasePencilLayerTreeNode`
- Existing `GP_LAYER_TREE_NODE_SELECT` flag is used for selection
- selection of channel updates the active layer in object properties
Part of #110056
Pull Request: https://projects.blender.org/blender/blender/pulls/110133
Adaptation of the operator `ACTION_OT_keyframe_insert` to take into account grease pencil channels.
Grease pencil keyframes can now be inserted in blank mode, or in additive mode (duplicate the current frame in the new keyframe).
Two API functions were added :
* `add_duplicate_drawings` which copies the data of a drawing to creates a duplicate, and
* `insert_duplicate_frame` which creates a duplicate frame of an existing one either by copy or instance.
The additive mode option is also added to the UI.
The Layer method `frame_key_at` previously private was set to public.
Pull Request: https://projects.blender.org/blender/blender/pulls/110649
Replace `BKE_mesh_face_flip_ex()` with `bke::mesh_flip_faces()`.
This gives better performance since it avoids custom data name
lookups for every face index, and processes data in a more cache
friendly way. Also remove the `CustomData_swap` API function
as mentioned in 09b6eac5c4a0f17cb20e.
Flipping 16 million faces, I observed a 3.25x speedup, from 760 to 230 ms.
Pull Request: https://projects.blender.org/blender/blender/pulls/110702
The C-style API is still in place, but the implementation
is moved to a virtual method.
This is part of unification of viewport and final render
structure.
Should be no functional changes.
Ref #108618
Pull Request: https://projects.blender.org/blender/blender/pulls/110696
Caused by 91b27ab637334383b57b, which caused the final position
arrays to be returned in more situations (in this case, when the final
result is a non-wrapper mesh). Instead, use the cage mesh, which
is more correct anyway-- it just wasn't always available before.
Face set code modifies visibility of faces, then flushes those changes
to vertex and edge visibility. However, then it did an extra flush back
from vertices to faces and edges, which shouldn't be necessary.
Each of the four algorithms is different, and not all of them will
parallelize linearly, but for large meshes these "flushing" operations
begin to become noticeable compared to other multithreaded code.
For example, flushing visibility to vertices and edges after a change
to faces became 3.75x faster, from 90 to 24 ms.
Also avoid duplicating selection interpolation logic, use the attribute
API instead.
The aim is to replace the `BKE_mesh_faces_flip` functions with
this newer C++ function using the attribute API. But that is must
be called by RNA, so move this to blenkernel to avoid a circular
dependency between the geometry module and RNA.
The Library Overrides view of the Outliner was casting a
`TreeElementOverridesData` pointer to an `ID` pointer, which would be
undefined behavior. Make sure it uses the actual ID referenced by the
`TreeElementOverridesData`.
The Repeat Zone operator from the Geometry nodes Add Node -> Utilities
menu was not translated because it used the "Operator" translation
context, instead of the default context.
Since the function displaying the menu item, `add_repeat_zone()`, is
only ever called from the Utilities menu, and the label is specified
there as "Repeat Zone", we know in advance that it will have this
name.
For the same reason, this commit also simplifies the function which
creates the menu entry for simulation zones. This function is also
only called from the Simulation menu with a specific label using the
default context, so it should also use this one.
Pull Request: https://projects.blender.org/blender/blender/pulls/110644
Instead of the default `add` and `remove` functions for the frames map,
use `add_new` and `remove_contained` for when it is known that a value
is or isn't in the map already. This should be slightly more efficient
(and just better practice overall).
This was caused by `mod` not being available to integer
types. It isn't part of the GLSL stadard officially.
In this particular case, it is not needed. so replace it
with the `%` operator.
Adds a user count to drawings to track how many frames use the drawing.
If the user count hits `0` the drawing should be deleted.
Also adds a function to delete a frame in a layer. This will
decrement the user count of the drawing and delete it if there are no
users left. This is consistent with the way GPv2 worked.
Pull Request: https://projects.blender.org/blender/blender/pulls/110579
This is done by forcing the Mesa D3D12 driver (which both use to render
Blender) to report that it is OpenGL 4.3 compatible.
It mostly is, other than a few texture extensions that are not yet
implemented. Blender (currently) does not use those.
There is a discussion pending with the viewport/evee team on those
extentions
Pull Request: https://projects.blender.org/blender/blender/pulls/110582