This way we can query the brush types, e.g. to filter out eraser brushes
in the brush asset selector while the eraser tool is selected, see
https://projects.blender.org/blender/blender/issues/126032.
Technically a brush may have different brush types depending on the
mode. So we store a type for all supported modes.
Ideally the name of the custom metadata property would match the name of the
properties in RNA. They will match after #126796, the names here are the new
ones, to avoid having to version asset metadata.
Pull Request: https://projects.blender.org/blender/blender/pulls/124618
This node hashes various types into an integer. Note that hashes
cannot generally used as unique identifiers because they are not
guaranteed to be unique. It can be used to generate somewhat
stable randomness though in cases where White Noise does not
offer enough flexibility.
It uses hash functions from BLI_noise.hh. These are also used in
the White Noise node.
Pull Request: https://projects.blender.org/blender/blender/pulls/110769
IndexMask iteration from 347ec1acd7 was incorrect
in the cases where we stored temporary data in contiguous sections
per PBVH node. We now call `.local()` once per PBVH node. If that
becomes a bottleneck it's avoidable, for now it's simpler though.
This adds a new launch argument when building with
renderdoc support. It allows to trigger the capture
of a specific capture scope. This allows selective
capture of some commonly captured parts.
Pull Request: https://projects.blender.org/blender/blender/pulls/126791
Solved by not supporting complex reordering at this moment. It
is currently better to focus on quality and add back performance
later. During tests I didn't detect any user noticeable performance
degradation. Could also be because we support rendering
suspending/resuming.
Fixes artifacts in EEVEE volumes and raytracing.
Pull Request: https://projects.blender.org/blender/blender/pulls/126974
The bug was probably harmless in current codebase.
Also added some basic testing of `BKE_main_namemap_get_name` itself,
and not only higher-level ID renaming code.
The issue was that the forward compatibility writing code for channel groups in
layered actions was building a temporary legacy listbase, but was not clearing
it properly afterwards. This was then getting caught by an assert that ensured
that layered-action groups didn't have legacy data in them.
The reason the listbase wasn't getting cleared properly is because the
prev/next listbase pointers were getting cleared using a `LISTBASE_FOREACH`
loop, and thus the loop never progressed past the first item.
Additionally, this mistake wasn't just in the channel groups writing code, but
also the forward compatibility writing code for fcurves.
This fixes the issue in both places by switching the loops to
use`LISTBASE_FOREACH_MUTABLE`.
Based on discussion with @dr.sybren, this also removes the assert that caught
the issue. The situation it guards against is actually completely benign, and
the existence of the assert is contrary to the comments in the forward-compat
writing code explaining why its approach is okay.
Pull Request: https://projects.blender.org/blender/blender/pulls/126970
Previously, all errors, warnings and info messages were propagated from the node
that generates it to the top level node group. This is a good default, but may
not always be desirable. For example, someone may build a node group asset that
generates some warning that is irrelevant to the user to the asset. Now, the
asset author can selectively disable propagating warnings from that node.
Each node has a new `Warning Propagation` setting. It controls if warnings from
this node should be propagated to the parent group node. By default, everything
is propagated. One can also choose to propagate nothing, only errors or only
errors and warnings.
Note, this does not affect whether the warning is shown in the node itself, only
if the warning is propagated one level up!
Pull Request: https://projects.blender.org/blender/blender/pulls/126786
The issue was that the enum property expected a default of `Object`
which wasn't present in the default enum.
Error was: `EnumProperty(..., default='OBJECT'): not found in enum members`
Fixed it by constructing a simple `EnumPropertyItem []` with the `Object` entry.
Pull Request: https://projects.blender.org/blender/blender/pulls/126963
- Resource pools are shared between multiple swap chains to reduce
code complexity
- Fix issue where activating a new graphical context could still leave
the previous context rendering.
- Known issue: opening files with more windows require a redraw.
Reference: #126499
Pull Request: https://projects.blender.org/blender/blender/pulls/126961
Prior to this commit, variables inside `StrokeCache` used either a
`true_` prefix to indicate that the relevant position / normal /
displacement was not modified by symmetry, or a `_symmetry` / `_symm`
suffix to indicate that it was.
This commit changes all such variables to have a `_symm` suffix, as
that has fewer connotations than the `true_` prefix.
Pull Request: https://projects.blender.org/blender/blender/pulls/126902
Commit 8903205dd9 fixed incorrect math, in stream length setting part of
the code, which seemed to force most video files to use safer, but more
complicated codepath.
Even though the math was corrected, the logic was not great. It tried to
use container duration, only stream duration is not significantly (4x!)
longer. This is quite crude.
Instead, check if there is any significant difference between stream and
container durations. The threshold is kept quite high, just to be safe.
This code should be removed in futute cleanup / refactoring.
Pull Request: https://projects.blender.org/blender/blender/pulls/126866
Regression is caused by movie being rendered twice for the same frame
number, but the image is not cached after 5ecb70964e.
The image is rendered first to determine `early_out` in
`seq_render_strip_stack()`, then for the actual image output.
Since VSE cache is not to be used for render job, `ffmpeg_fetchibuf()`
can be optimized to return frame, which is already decoded instead of
re-seeking to last keyframe and decoding all following frames again.
Pull Request: https://projects.blender.org/blender/blender/pulls/126911
Changes to the icons used for document and folder when in thumbnail
view in File Browser. A bit more detail, less chunky, more in tune
with OS versions. Better match for the recent increased fidelity of
the "type" icons that are shown in their centers.
Pull Request: https://projects.blender.org/blender/blender/pulls/126760
- Call the data pointers "elems" and the grid indices "grids"
- Remove null check that really shouldn't be necessary
- Use Span and range based for loops
- Use accessor function instead of raw node field access
Use `IndexMask` for a selection of nodes, and remove the temporarily
added type-agnostic functions for PBVH node data access. This change
results in a lot of boilerplate change since all iteration over nodes is
affected, and the proper types for nodes need to be used to access
their data.
Until leaf and inner nodes are split, the `all_leaf_nodes` function has
an unfortunate signature now since it needs to return an `IndexMask`
as well. That should be simplified in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/126944
The issue was that the `id_root` property can be 0,
but the enum doesn't officially support this value.
The fix is to create a new function `rna_id_root_itemf`
that dynamically creates the enums, which is basically
`rna_enum_id_type_items` + an extra entry for 0.
Pull Request: https://projects.blender.org/blender/blender/pulls/126837
This implements the `Warning` node that allows node groups to communicate
expectations about input values to the user.
By default, the `Warning` node is only evaluated if the node group that contains
it is evaluated in any way. This is better than always evaluating it, because
that could trigger lots of unnecessary evaluation in parts of the potentially
large node tree which should be ignored. In this basic mode, the output of the
node should not be connected to anything and it must not be in a zone.
For more fine-grained control for when the `Warning` node should be evaluated,
one can use the boolean output which is just a pass-through of the `Show` input.
If this output is used, the `Warning` node will only be evaluated if its output
is used. A simple way to use it is to control a Switch node with it that e.g.
"disables" a specific output when the inputs are invalid. In this case, the
`Warning` node may also be in a zone.
The node allows the user to choose between 3 severity levels: Error, Warning and
Info. Those are the same levels that we use internally. Currently, the error and
warning mode are pretty much the same, but that may change in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/125544
The use of `const` for Objective-C object pointer is not standard and
generally unsound. Unlike a C++ class, which has support for const and
non-const methods. An Objective-C object will still respond to mutable
selectors even if its object pointer is const, making it semantically
useless.
Another problem with const Objective-C object is that they cannot be
properly passed into other Objective-C object selectors due to type
differences. Even if that selector didn't modify the underlying object.
For consistency with general Objective-C code style guidelines, usage of
const pointer syntax (`Class *const`) were also removed.
Ref #126772
Pull Request: https://projects.blender.org/blender/blender/pulls/126768
Add new operator `anim.slot_new_for_object`, which creates a new action
slot for the active object. Since this slot is created on the action
used by the object, it requires that this action exists and is a
layered/slotted action (which by definition includes empty actions).
Pull Request: https://projects.blender.org/blender/blender/pulls/126934
The code for filtering slots was still including channel groups even
when `ANIMFILTER_FCURVESONLY` was set. There were no apparent behavioral
issues resulting from this, but the code was semantically incorrect.
This fixes the code by excluding channel groups when
`ANIMFILTER_FCURVESONLY` is set.
Pull Request: https://projects.blender.org/blender/blender/pulls/126926
In layered actions, the channel groups in a channel bag hold a
non-owning pointer to the channel bag they belong to, to allow looking
up the fcurves in the group. However, when a duplicate was made of a
channel bag, those pointers in the (also duplicated) channel groups
weren't updated to point at it, and thus were still pointing at the
original channel bag.
This commit adds the code to properly update those pointers when
duplicating channel bags.
Pull Request: https://projects.blender.org/blender/blender/pulls/126923
Affected NLA, Dopesheet, Timeline
Region needs `ED_KEYMAP_FRAMES` flag to initialize the corresponding
"Frames" keymap.
Basically the same as cd1d6d7770 , but now also for `space_nla` &
`space_action`
Pull Request: https://projects.blender.org/blender/blender/pulls/126918
`collection_collect_data_to_edit` blocks the tree_traverse once a
valid selected collection is found. This prevents delete operation
from deleting child collection when selected. To fix this, introduce a
new boolean `is_recursive`. When this is true, callback function will
return `TRAVERSE_CONTINUE` to continue the walk to children.
Pull Request: https://projects.blender.org/blender/blender/pulls/126883
This patch optimizes `IndexMask::from_bits` by making use of the fact that many
bits can be processed at once and one does not have to look at every bit
individual in many cases. Bits are stored as array of `BitInt` (aka `uint64_t`).
So we can process at least 64 bits at a time. On some platforms we can also make
use of SIMD and process up to 128 bits at once. This can significantly improve
performance if all bits are set/unset.
As a byproduct, this patch also optimizes `IndexMask::from_bools` which is now
implemented in terms of `IndexMask::from_bits`. The conversion from bools to
bits has been optimized significantly too by using SIMD intrinsics.
Pull Request: https://projects.blender.org/blender/blender/pulls/126888
Investigation into #126306 showed that the texture tab shown would actually be
for the active image paint brush, but people used it to set up a texture for
the fluid modifier settings anyway. Now properly register the texture user for
the UI, so the texture properties tab will always be displayed when there is a
fluid modifier with a "Flow" fluid type.
Main issue is that fluid modifiers weren't handled by the
`BKE_modifiers_foreach_tex_link()` iterator.
While this could be handled as another special case in
`buttons_texture_modifier_foreach()`, I updated the texture-link iterators to
support texture properties that are not directly stored in the modifier, but in
some nested data. Seems like this should be supported generally. It's enabled
here by passing a pointer-property pair, rather than just a property name.
Pull Request: https://projects.blender.org/blender/blender/pulls/126893
Fix an issue that was caused by common code used for both these flows:
- 'ensure a slot exists for an ID so keys for it can be inserted' and
- 'assign an Action to an ID'
Both flows search for suitable slots for the ID, but should do so in
subtly different ways. Most importantly, the first case should _not_
search a slot by name (when an Action is already assigned but not a
slot). This is relevant in the following flow:
- Assign an Action to an Object. This auto-selects the most appropriate
slot (by name).
- Un-assign the slot (for whatever reason it's not desired).
- Insert a key.
- This should create a new slot, and not re-assign the slot just
un-assigned above.
Pull Request: https://projects.blender.org/blender/blender/pulls/126850
When 'really' large buffers are allocated the incorrect clamping
function was used and the actual buffer allocated was smaller than
expected.
This was detected during investigation of #126863.
Pull Request: https://projects.blender.org/blender/blender/pulls/126915