Python scripts could perform actions that created notifiers
which would not be handled until the script was complete.
In the case of adding & removing objects a notifier would be created
for adding the object, then cleared when the ID was removed.
This lead to the notifier queue filling up with cleared notifiers
which were included in the search whenever an ID was removed.
The result of this was that adding and removing objects from a script
would become increasingly slower & use more memory.
Resolve by storing the current notifier being handed which isn't freed
(only cleared). The notifier handling loop detects cleared notifiers
and frees them after use.
Remove a workaround for #23871 which manipulated the module
to prevent classes defined in the text editor from having their
name-space cleared.
This caused the "multiprocessing" module to store the "__main__" module
as "__mp_main__" for later use.
Accessing attributes from this module would then attempt to read from
with a null "mp_dict" which crashed. This happened when showing the
extensions preferences but would have occurred if "__mp_main__" was
accessed from elsewhere too.
Resolve by removing the workaround since it has not been needed
since Python 3.2.
When the compositor is canceled mid-execution, the image node will get
corrupt in future executions in new CPU execution mode. That's because
the image node treated cached images as an intermediate results that can
be passed through, while they should be treated as external resources
since they are managed by the static cache manager.
This patch fixes that by adding another variant of wrap_external that
takes a Result and wraps its data, then we use that in the Image node.
Meta-data are missing on Cryptomatte layers in the GPU compositor, so
they do not get saved using the File Output node. This is due to a use
after free error where a temporary string is used in the meta-data
population logic. This is fixed by assigning the string to a temporary
variable instead.
Thanks to Jorn Visser for finding the cause of the issue.
In GPv2 the parentinv matrix is zero initially and only becomes valid
after setting the layer parent. This matrix must not be copied to the
GPv3 layers unless the parent is set.
In addition the parentinv matrix should also be computed when changing
the layer parent. This has been nominally added, except that a full
computation isn't possible without the actual grease pencil Object. This
means a local RNA property cannot update the parentinv matrix, this
needs to become a full-blown operator. The behavior now should be the
same as in GPv2 at least.
Pull Request: https://projects.blender.org/blender/blender/pulls/129304
Even though this is generally avoided, drivers don't prevent
invalid values being set. Further files from branches or files
written in the future may contain enum values not yet known.
Resolve by range checking enum values which are used to index arrays.
RNA label & description truncation could cause invalid UTF8
which caused BLI_string_search to hang.
Resolve by ensuring truncation of RNA descriptions & labels never
truncates a multi-byte sequences.
The issue with BLI_string_search would still be good to resolve but can
be handled separately.
The `fmtlib` text formatting library, when compiled in C++20 onwards,
requires that the incoming format string is a compile-time constant so
it's able to perform type checks against it[1]. The change here ensures
it can do so.
While we're not set to go to C++20 any time soon, this is a backwards
compatible change that can be done today and allows us to focus on the
harder fmt-related issues later.
No change in performance or functionality was observed.
[1] https://godbolt.org/z/qG5dsf7YG
Pull Request: https://projects.blender.org/blender/blender/pulls/129272
Since GPv3 shader currently uses particle strand/points shader, we
need to modify that slightly to display the grease pencil overlays.
This adds the missing `vflag` attribute to the edit gpencil batch.
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/128116
This removes the need for the geometry shader and the
workaround path for Metal.
Note that creating 2 batches for each stroke might become
a bottleneck in bigger scenes. But currently the bottleneck
is always be the fill algorithm. It can be optimized further
if needed.
Rel #127493
Pull Request: https://projects.blender.org/blender/blender/pulls/129274
Addresses the case when Blender is shutdown before the
parallel compiler has finished processing all the shader batches.
The parallel compiler destructor will now attempt to terminate all
of the outstanding batches and free the shaders.
Authored by Apple: James McCarthy
Pull Request: https://projects.blender.org/blender/blender/pulls/129172
Regression since a904db3ee7 ("skip no-op colorspace transforms for
float images"), the newly added do_display_buffer_apply_no_processor
function did not handle case of both source and destination being
float images. This happens when VSE produces a float image, and
you turn on a Waveform scope.
Pull Request: https://projects.blender.org/blender/blender/pulls/129293