This patch adds warnings when view transform or FPS values are changed
by dragging in an initial strip with "Set Scene Frame Rate" or "Set View
Transform" enabled.
In the case that both occur at the same time, reports are not
interweaved but both still show up in the info viewer -- this is a
limitation of `BKE_report` itself. Future work could modify the report
system to support queuing, but this is still an improvement over
previous behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/135494
The Alembic file in the issue had 0 points, and 4 widths, defined for
frame 33 which is certainly incorrect from whichever software produced
said file. However, our import code should have proper guards in place
to more gracefully handle the situation.
Pull Request: https://projects.blender.org/blender/blender/pulls/135548
When using Alembic procedurals, the Mesh Sequence Cache attempts to
replace the original geometry with a plain old cube. However, it never
frees this new cube geometry. Transfer ownership to the underlying
GeometrySet instead.
Investigating the scenario also showed that the `~AlembicProcedural`
dtor was removing an item from the `nodes` vector while iterating over
it, which triggers debug asserts on at least MSVC. I believe the removal
is unnecessary since this is the dtor and ASAN appears clean now.
Pull Request: https://projects.blender.org/blender/blender/pulls/134085
This avoid having to flush explicitely and the need for syncing.
It also removes a lot of complexity in the process.
These updates are not granular and do not need to so much
boiler plate code.
The depsgraph update counter now becomes atomic to avoid
undefined behavior when a depsgraph is being destroyed and
its memory reused (same thinking as the non-copy-on-eval IDs).
I tested some use cases (object update, sculpt update,
shading update) and they are all working.
Pull Request: https://projects.blender.org/blender/blender/pulls/135580
Screen initialization is more context dependent than it used to be
because of region polling, so the context needs to be set up correctly.
Here was a case where the initialized window/screen passed to polling
didn't match what's in context (UI context was unset in fact).
Some asserts could be added to ensure data passed to screen
initialization matches context, but can do that separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/135568
As a small addition to the import node features for 4.5,
this simple node imports a text file as a string. Potential
use cases include retrieving text for motion graphics.
Currently this just allows .txt files. More extensions could
be allowed in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/135459
Identifying layout-panels using strings and storing their open-state in their
parent panel is generally very convenient. However, right now there is no
mechanism to free the open-close state of panels that are not in use anymore.
It's generally not possible to know if a panel is not used anymore (e.g. it may
also belong to a temporarily disabled add-on). So every mechanism here will be
based on heuristics. A simple but typically very good heuristic is to just
remove the least-recently-used panel states when there are too many. So that's
what is implemented here.
This introduces a logical clock that increases whenever a panel state is used
and stores the last usage time on the panel state. This allows us to remove the
least-recently-used states later on. Specifically, that is done when the .blend
file is loaded the next time. It's not done at another time, because it quite
difficult to be sure that freeing panel states wouldn't cause dangling pointers
in such cases. I think doing it on-load should be good enough for all practical
use-cases.
Note, I don't know if the lack of such garbage collection has ever caused a
problem anywhere. However, it seems better to have some solution now than trying
to solve it after the problem has occurred and made someone's file unusable.
Pull Request: https://projects.blender.org/blender/blender/pulls/135569
When iterating over the layers in a Grease Pencil object,
removing the layers can lead to crashes.
This PR is a better alternative to !135253.
Instead of checking if the layer is valid, simply fetch the latest layer
cache for each iteration and check if the index is valid.
This means that we will skip over layers if they get removed during
iteration, but we no longer can crash. If users want to remove multiple
layers at once, it's better to do this in two passes. E.g. by first
collecting the names of the layers to remove, iterating over
these names and then removing the layers by getting it by its name.
Pull Request: https://projects.blender.org/blender/blender/pulls/135574
The Mesh to Grease Pencil conversion would convert every edge into a stroke.
This was not the case prior to Blender 4.3. Edges with no branches would be
converted into a single stroke instead of mutliple ones.
This fix uses `geometry::mesh_to_curve_convert` from geometry nodes to
achieve more optimal result with edges connected into one stroke when
possible.
Pull Request: https://projects.blender.org/blender/blender/pulls/135557
When inserting keys in the viewport by pressing `I`,
certain custom properties would not get keyed if their name
was identical to existing properties (for example `scale`).
That was because we use the name of the property to resolve
an rna path and check if the path resolved. This was of course
true in the described case and the square brackets would never be added.
The solution is to check for `RNA_property_is_runtime` which is false
for properties defined inside Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/135304
The owner of the context is now always the local context.
The `DRWContext` is now a temporary object that owns
no data.
The draw debug API is being put in a non-working state by
this PR as it conflicts with the new lifetime / ownership of
the `DRWContext` class.
A new design with a global (threadsafe) debug module is needed
to add back support for these debug features. Note that these
are not user facing features.
Some parts of EEVEE are still calling the global context and that
caused crashes in the volume probe baking pipeline where
the context is not yet known. Sort circuiting these function
calls in this case fixes the issue, but a more longer term
solution would be to alway have a `DRWContext` available inside
`eevee::Instance`.
I did some testing and didn't find much of a difference in frame time.
However, we should still strive to remove all global access in the future
to avoid potential overhead of `thread_local`.
Pull Request: https://projects.blender.org/blender/blender/pulls/135521
The versioning of legacy-to-modern Grease Pencil is using slotted
Actions (because that's the current animation API), and therefore
assumes that the Action & Slot assignments have been versioned as well.
The latter now actually happens before the former, so that assumption is
now actually valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/135466
The issue was that sometimes the group inputs of a node group were shuffled
around unexpectedly and thus inputs were passed to the wrong sockets.
The `or_socket_usages` function sorts the given span so that the key is more
likely to be reused, reducing the number of nodes inserted in the graph. The
issue was that `build_warning_node` passes `group_output_used_sockets_` into the
function the order of which is important. It thus should not be reordered.
The fix is to just never reorder the span passed to `or_socket_usages` but to
make a local copy instead which can be sorted without problems. Often this copy
is done already anyway when the span is inserted into
`graph_params.socket_usages_combination_cache` as `Vector`.
This fix also makes an assumption about `Map.lookup_or_add_cb` which was not
documented before. Namely it assumes that the key is moved into the map only
after the callback has been called. This behavior is now documented and there is
a unit test for it.
Pull Request: https://projects.blender.org/blender/blender/pulls/135528
This PR creates 2 namespaces for VSE code:
- `blender::seq` for sequencer core code
- `blender::ed::vse` for editor code
These names are chosen to not be in conflict with each other.
No namespace was used for RNA.
Finally, file `BKE_sequencer_offscreen.h` was moved from BKE to sequencer.
Pull Request: https://projects.blender.org/blender/blender/pulls/135500
The ternary operator that selecting between `const char *` and
`std::string`, assigning to a `StringRefNull` seems to cause freed
stack memory use (reported by ASAN).
The likely cause looks to be that the `const char *` is converted to a
`std::string` then to a `StringRefNull`.
With the intermediate `std::string` going out of scope before use.
Resolve by explicitly converting both sides of the ternary operator
to a StringRefNull before assignment.
Vertex weight smooth was running on meshes without any vertex groups
the operation to apply the weights to mirrored vertices was asserting
in this case.
Resolve by only operating on meshes with vertex groups,
also add a warning when no objects were changed.
Smoothing vertices with symmetry wasn't recalculating normals
before re-tessellating, meaning the faces would use an incorrect
2D projection for tessellation.
The error was exposed by an assert.
With 4da5377e17 control characters are shown as space characters. But
word wrapping code will use the codepoint from the glyph if available,
which means a soft wrap on space instead of a hard wrap on line feed.
Just oversight, no need to use the glyph for that. In fact we always
want to deal with the character, not the visual representation of it.
Pull Request: https://projects.blender.org/blender/blender/pulls/135541