After #139075, since dual handle translation always selects two strips
at a time, any later handle movement on one of the strips would affect
both, which is unintuitive and likely not what the user intended.
We can fix this for now by checking for strips that directly border one
another and removing them from the `copy_to` list.
But in the future, if we change selection logic so that strip and handle
selection states are mutually incompatible, we could also fix this by
making sure that dual handle tweaking only selects the handles and not
the strips themselves.
Pull Request: https://projects.blender.org/blender/blender/pulls/142916
Previously with adaptive subdivision this happened to work with the N
attribute, but that was not meant to be undisplaced. This adds a new
undisplaced_N attribute specifically for this purpose.
For backwards compatibility in Blender 4.5, this also keeps N undisplaced.
But that will be changed in 5.0.
Pull Request: https://projects.blender.org/blender/blender/pulls/142090
Caused by 7688677e29, which replaced `DRW_draw_depth_object` with
`DRW_draw_depth_loop`.
`DRW_draw_depth_object` simply rendered the object without actually
using the DRW manager capabilities.
Now, with `DRW_draw_depth_loop`, the depth is rendered based on what
the engine sees with overlays disabled, which doesn't hide the
particles.
The solution to this issue is to skip particle rendering in the overlay
engine in `DRW_draw_depth_loop`.
Co-authored-by: Miguel Pozo <pragma37@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141981
This includes a new list structure type and socket shape, a node
to create lists, a node to retrieve values from lists, and a node to
retrieve the length of lists. It also implements multi-function support
so that function nodes work on lists.
There are three nodes included in this PR.
- **List** Creates a list of elements with a given size. The values
are computed with a field that can use the index as an input.
- **Get List Item** A field node that retrieves an element from a
a list at a given index. The index input is dynamic, so if the input
is a list, the output will be a list too.
- **List Length** Just gives the length of a list.
When a function node is used with multiple list inputs, the shorter
lists are repeated to extend it to the length of the longest.
The list nodes and structure type are hidden behind an experimental
feature until we can be sure they're useful for an actual use case.
Pull Request: https://projects.blender.org/blender/blender/pulls/140679
Ever since [0], ReportList is not actually used in any DNA structs.
That makes sense, since reports are conceptually only necessary
at runtime. Move the definition of the struct to BKE_report.hh, and
fix a bunch of include errors where types were previously available
transitively. Besides adding some clarity, theoretically this change
could reduce compile times because of less header parsing.
[0]: 1bf6d8b0b9
Pull Request: https://projects.blender.org/blender/blender/pulls/138872
If free normals already exist, the `custom_normal` attribute already
exists with a different type, so the attribute writer is not created
properly in `mesh_set_custom_normals` and the process fails. Instead,
setting tangent space custom normals should clear existing free normals.
Pull Request: https://projects.blender.org/blender/blender/pulls/142961
The calculation for `endptr` would overflow when multiplying `length`
and `itemsize`. A similar issue was spotted for `rna_array_lookup_int`.
Ref !141061
This patch replaces the Composite node with the Group Output node as the
primary compositor output. The old node was removed and versioned. This
was done for consistency with Geometry Nodes and in preparation for more
generic use of the compositor in VSE modifiers, layered compositing, NPR
multi-stage compositing, and more.
The Group Output node relies on the node tree interface, so we now have
a default interface of a single input and a single output. For now, only
the first input is considered while the rest are ignored, just like the
Geometry Nodes design. Furthermore, the input is required to be of type
color. Warnings and errors are issues if any of those are not met, also
similar to Geometry Nodes.
This introduces a new limitation: Composite outputs can no longer exist
in node groups, since they obviously then act as their respective group
outputs.
A refactor for the compositor scheduler is needed to simplify the logic
after this change, but this will be done in a separate patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/142232
This commit renames the GHOST Metal graphic context class and related
files / references from `GHOST_ContextCGL` to `GHOST_ContextMTL`. When
the Metal backend was first introduced, this context file contained
both the old OpenGL context (CGL, for macOS Core OpenGL API), and the
newer Metal context. Since #110185 all CGL related code was removed
from the class, making it Metal only, and thus rendering the old class
name outdated and potentially misleading. In addition to the rename,
unused OpenGL related forward declarations and old TODOs were also
removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/142519
Currently MetalRT renders always use extended limits, which is needed to correctly render scenes where the max primitive count can exceed 2^28 or the instance count can exceed 2^24. This patch adopts Metal best practices of only enabling this flag if it is needed.
This PR is similar to #133364, but there are some notable differences:
1) The old PR made an overly optimistic assumption that all the relevant visibility bits could be squeezed into 8 bits. This new PR adopts the same approach that Optix takes of using 8 bits as a primary HW filter, and checking the full 32 bit mask inside the SW intersection handler.
~~2) I moved the scene scanning check from Scene into MetalDevice. This avoids platform specific details leaking into platform agnostic areas.~~
~~3) In live viewport mode, we always use extended limits in case we tip over the threshold.~~
_EDIT:_
2) The limits are scanned in `Scene::update_kernel_features`, and given to the device by a new `set_bvh_limits` method which returns true if the BVH and kernels need to be reloaded.
Pull Request: https://projects.blender.org/blender/blender/pulls/142401
Blender crashes when opening a file with undefined Translate nodes due
to a missing storage. The crash happens during versioning, as the nodes
are not yet undefined at this point. To fix this, we make the versioning
code more corruption proof and skip versioning nodes with no storage.
Pull Request: https://projects.blender.org/blender/blender/pulls/143055
This allows to store a number of vertex to draw
per batch without specifying any attribute.
This allows to create batches that are empty but
still holds the amount of geometry to produce.
Needed for new curve drawing #142969.
Pull Request: https://projects.blender.org/blender/blender/pulls/143052
This adds copy to selected support for Shape Keys.
That means Alt+drag on a property influences all selected.
Also the copy to selected operator is now available in the context menu.
Part of #136838
Pull Request: https://projects.blender.org/blender/blender/pulls/138611
Since 4.5 the point clouds are out of experimental.
The drawing of pointcloud did not allow for correct volume
estimation as the shape are not rendered as closed objects
(i.e. the backfaces were not rendered).
This patch renders the backfaces for the volume occupancy
pass by rendering the pointcloud twice and flipping the
shape alignment matrix. This reverse the winding and
does a backface hit as it would do for a sphere primitive.
This solution even if not perfect avoids adding more
geometry in the Index Buffer. The geometry approach might
be preferable in the future if we find a way to render
the spheres without an IBO or with a JIT generated IBO.
Rel #141490
Pull Request: https://projects.blender.org/blender/blender/pulls/142095
This was caused by the hardware derivatives output being affected
by render resolution. Scaling them back to the full resolution
value fixes the issue.
This also fixes the Wireframe node that also relies on derivatives.
Pull Request: https://projects.blender.org/blender/blender/pulls/142101
Blender crashes when versioning the Translate node due to a nullptr
storage. This happens due to an inverted nullptr check.
Additionally, we remove redundant assignments from other versioning code
for safety.
Pull Request: https://projects.blender.org/blender/blender/pulls/143046
It was not taking into account actual selection in the asset browser
("selected_assets"), thus failing in bringing things over.
To resolve, add a case for `RNA_AssetMetaData` in
`UI_context_copy_to_selected_list`.
Since "selected_assets" will give us `AssetRepresentation`, we need to
remap to `AssetMetaData` to get this working.
Pull Request: https://projects.blender.org/blender/blender/pulls/142862
The issue was that the tooltip function arguments were sometimes allocated but
not freed. The solution is to handle the lifetime of the argument better. The
code now makes a copy of the argument when it's passed to a layout function. In
an idea world, one could just use something like `std::function` instead of
manual memory management, but the API does not support it yet.
This was caused by f3a1d8fad5.
Pull Request: https://projects.blender.org/blender/blender/pulls/143043
Currently, the `NodeTreeInterface` only allows lookup via the item names, and not
their identifiers. This is problematic when there are multiple items with the
same name, they can only be selected via index and not name / identifier.
The following examples are done on a default Geometry Nodes tree that just has a
`Geometry` input and `Geometry` output.
Pull Request: https://projects.blender.org/blender/blender/pulls/140196
The core issue here seems to be that the pasted object is turned into an Empty
but it still has all the modifiers. Later when the object is copied by the
depsgraph, the modifiers are not copied along, confusing some code.
Right now, this patch is rather defensive, so it solves the specific crash and
maybe similar cases that could come up in the future. One could separately also
clear all modifiers when turning the object into an Empty.
Pull Request: https://projects.blender.org/blender/blender/pulls/143029
Commit 9e221a10d3 made it so that IMM shader is unbound
while drawing a scope, and added assert to ensure it is unbound.
But it missed one place where waveform_draw_one is used, and did
not unbind the IMM shader around that.
With Vulkan now having general feature parity with OpenGL, but with
some stability issues, it has become more important to offer ways for
users to quickly launch Blender with the OpenGL or Vulkan backend
in case Blender is unable to open with one of them.
This commit adds three new batch files to help with this:
- `blender_factory_startup_vulkan.cmd`
- Launches Blender with factory settings, but with Vulkan enabled.
Useful for helping test if a Vulkan crash at startup is related to
a addon.
- `blender_startup_opengl.cmd`
- Simply launches Blender with the OpenGL backend. It does not change
any other settings. Useful in case a user has complex user
preferences, enabled Vulkan for testing, and now Blender crashes on
startup. Now they want to switch back to OpenGL and they don't want
to lose their complex user preferences by using
`blender_factory_startup.cmd`
- `blender_startup_vulkan.cmd`
- Simply launches Blender with the Vulkan backend. It does not change
any other settings. Useful for people that encounter #127835 after
a Windows update. This issue can be worked around by using Vulkan.
But if you are experiencing the issue and are on the OpenGL
backend, you can't use the Blender interface and so you can't
easily switch to the Vulkan backend without the command line
or a script like this.
Pull Request: https://projects.blender.org/blender/blender/pulls/142169
Looks like almost everywhere else, the v2d mask size is calculated
as "v2d->mask size plus one". This is the zoom ratio that the V2D
resizing tries to keep constant, etc.
However the VSE timeline drawing code, when calculating the pixel
scaling factors, used the v2d->mask size without adding +1.
This resulted in a very slight zoom ratio change when resizing the
timeline area, which is made larger because thumbnails are often more
wide than narrow, and many of them are laid out next to each other.
Pull Request: https://projects.blender.org/blender/blender/pulls/142952
The performance test was added in 6d93bf6b44, but I don't think
anyone has ever ran it since then. And due to how IMB library
depends on BKE, this drags in "almost all of blender" into the test
executable, resulting in non-trivial link times that everyone
pays for. Just remove it.
The call to `BKE_keyblock_convert_from_mesh` can leave the KeyBlock's
data field null if the passed in mesh has no verts.
Continue to allow the shape keys to be created, but do not attempt to
actually fill them in with data. This seems to match the old FBX
importer's behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/142995
Separates export_frame() into individual functions for opening file streams
and writing .mtl and .obj data. This makes the code clearer in what and when
data is written to each stream by not interleaving .obj/.mtl writing. It also
simplifies the logic by separating out handling/branching for file streams
and .mtl writing.
Pull Request: https://projects.blender.org/blender/blender/pulls/142918
Previously, we used `SocketInterfaceKey` as identifier for bundle and closure
items. It contained multiple identifiers (although only one was ever used so
far). The idea was that multiple identifiers could provide more flexibility.
E.g. an Evaluate Closure node could work with closures with slightly different
identifier names, or a bundle could be passed into different systems that expect
the same data but named differently.
The added complexity by allowing for this is greater than I anticipated even
though most places didn't even support multiple identifiers yet. In addition to
that, it seems like there may be simpler workaround for many situations where
multiple identifiers were supposed to help. E.g. one could just add the same
value to a bundle twice with different names or one can build a node group that
maps a bundle for one system to one for another system.
Overall, the complexity of `SocketInterfaceKey` didn't seem worth it, and we can
probably just build a better system when we don't allow multiple identifiers per
item.
Pull Request: https://projects.blender.org/blender/blender/pulls/142947