Regression in [0] caused the outliner not to draw at the clamped scroll
position. This meant searching in the outliner could show no results
even when results were found. It also meant deleting objects could show
nothing until the user manually forced the outliner to redraw.
Workaround the problem by detecting when outliner drawing changes the
scroll position and draw again. While inelegant this doesn't happen
often in practice.
Fixing without a second draw likely involves resolving the order of
initialization problem by separating bounds calculating from drawing.
[0]: a63ac425d0
The goal is to reduce the startup time cost of
all of these parsing and string replacement.
All comments are now stripped at compile time.
This comment check added noticeable slowdown at
startup in debug builds and during preprocessing.
Put all metadatas between start and end token.
Use very simple parsing using `StringRef` and
hash all identifiers.
Move all the complexity to the preprocessor that
massagess the metadata into a well expected input
to the runtime parser.
All identifiers are compile time hashed so that no string
comparison is made at runtime.
Speed up the source loading:
- from 10ms to 1.6ms (6.25x speedup) in release
- from 194ms to 6ms (32.3x speedup) in debug
Follow up #129009
Pull Request: https://projects.blender.org/blender/blender/pulls/128927
The `u_scale` should be given a default value of `1.0f` so that newly drawn
strokes with the drawing already having `u_scale` attributes will have
correct texture mapping size instead of a default of `0.0f`.
Pull Request: https://projects.blender.org/blender/blender/pulls/129060
This avoid cmake shenanigans to try to make proper
dependency tracking.
The previous code was not tracking changes inside
the create info files.
There is no real benefit for having these headers listed in
the cmakefile itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/129027
This commit takes the 'Slotted Actions' out of the experimental phase.
As a result:
- All newly created Actions will be slotted Actions.
- Legacy Actions loaded from disk will be versioned to slotted Actions.
- The new Python API for slots, layers, strips, and channel bags is
available.
- The legacy Python API for accessing F-Curves and Action Groups is
still available, and will operate on the F-Curves/Groups for the first
slot only.
- Creating an Action by keying (via the UI, operators, or the
`rna_struct.keyframe_insert` function) will try and share Actions
between related data-blocks. See !126655 for more info about this.
- Assigning an Action to a data-block will auto-assign a suitable Action
Slot. The logic for this is described below. However, There are cases
where this does _not_ automatically assign a slot, and thus the Action
will effectively _not_ animate the data-block. Effort has been spent
to make Action selection work both reliably for Blender users as well
as keep the behaviour the same for Python scripts. Where these two
goals did not converge, reliability and understandability for users
was prioritised.
Auto-selection of the Action Slot upon assigning the Action works as
follows. The first rule to find a slot wins.
1. The data-block remembers the slot name that was last assigned. If the
newly assigned Action has a slot with that name, it is chosen.
2. If the Action has a slot with the same name as the data-block, it is
chosen.
3. If the Action has only one slot, and it has never been assigned to
anything, it is chosen.
4. If the Action is assigned to an NLA strip or an Action constraint,
and the Action has a single slot, and that slot has a suitable ID
type, it is chosen.
This last step is what I was referring to with "Where these two goals
did not converge, reliability and understandability for users was
prioritised." For regular Action assignments (like via the Action
selectors in the Properties editor) this rule doesn't apply, even though
with legacy Actions the final state ("it is animated by this Action")
differs from the final state with slotted Actions ("it has no slot so is
not animated"). This is done to support the following workflow:
- Create an Action by animating Cube.
- In order to animate Suzanne with that same Action, assign the Action
to Suzanne.
- Start keying Suzanne. This auto-creates and auto-assigns a new slot
for Suzanne.
If rule 4. above would apply in this case, the 2nd step would
automatically select the Cube slot for Suzanne as well, which would
immediately overwrite Suzanne's properties with the Cube animation.
Technically, this commit:
- removes the `WITH_ANIM_BAKLAVA` build flag,
- removes the `use_animation_baklava` experimental flag in preferences,
- updates the code to properly deal with the fact that empty Actions are
now always considered slotted/layered Actions (instead of that relying
on the user preference).
Note that 'slotted Actions' and 'layered Actions' are the exact same
thing, just focusing on different aspects (slot & layers) of the new
data model.
The "Baklava phase 1" assumptions are still asserted. This means that:
- an Action can have zero or one layer,
- that layer can have zero or one strip,
- that strip must be of type 'keyframe' and be infinite with zero
offset.
The code to handle legacy Actions is NOT removed in this commit. It will
be removed later. For now it's likely better to keep it around as
reference to the old behaviour in order to aid in some inevitable
bugfixing.
Ref: #120406
When grease pencil has no actions (ale->adt), id data block channel is
still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if
operator is accessing the AnimData (ale->adt). To fix this, make sure
adt exists before creating an animchannel.
Pull Request: https://projects.blender.org/blender/blender/pulls/128841
The build modifier crashes when getting lengths of cyclic curves because `evaluated_points_by_curve`
was previously always called with `cyclic` parameter set to `false`.
The `cyclic` parameter necessary for `curves::segments_num` to return correct number of segments.
Pull Request: https://projects.blender.org/blender/blender/pulls/128955
Caused by 364d62e59b.
In draw mode, we want to make sure to show vertex colors by default
because users can draw with them. Otherwise this can lead to unexpected
behavior in solid shading mode when vertex colors used to not be
rendered in draw mode.
The previous fix tried to do this by enforcing the `V3D_SHADING_VERTEX_COLOR`
mode in draw mode. But this has the side effect that the material
stroke and fill color are overriden with pure white.
To fix the issue correctly, simply ensure that `vert_col_opacity` in
`grease_pencil_layer_cache_add` is set to 1.0f. This means that
vertex colors and material colors are shown just like in the render.
Also resolves#128680.
Pull Request: https://projects.blender.org/blender/blender/pulls/129054
WITH_VULKAN_GUARDEDALLOC is a development option to use Blenders guarded
allocator when allocating internal vulkan driver resources. It does not provide any benefits
as this should be covered by vulkan validation and drivers are often ignoring this. This
change will remove the option from cmake and source code.
Pull Request: https://projects.blender.org/blender/blender/pulls/129039
Intel Windows drivers for 10th gen and lower has some strange behavior
when using dynamic rendering. It requires pipeline conditions to be met,
when beginning a new rendering scope. This is strange as specs + VVL
notes that these conditions should be met during vkCmdDraw* commands.
Pull Request: https://projects.blender.org/blender/blender/pulls/129055
This change makes unused attachments extension optional.
This extension is fairly new and not all drivers have support for it.
The workaround will create additional pipelines when attachments are
not set.
Pull Request: https://projects.blender.org/blender/blender/pulls/129046
This patch adjusts the GLSL compositor code to avoid writing to
inputting as variables. This is to make it easier to port the code to
CPU. Also, write to the output directly instead of per channel.
Previous fix to make VP9 lossless work (98689f51c0) applied it to
all videos that happen to be in WebM containers. While it is typical
that WebM would be used for VP9, it is not necessarily so (WebM can
have H.264 or really any other video). Do the check based on video
codec being VP9.
Pull Request: https://projects.blender.org/blender/blender/pulls/129045
For Texture baking, there is a CPU-bound preparation step needed to
establish a mapping between the Hi-Res and Low-Res Meshes before the
rendering engine can take over and start the bake.
Part of this process is now taking advantage of parallel_for,
speeding up this step of the Bake process for many/large textures almost
linearly to the number of CPU-cores.
Pull Request: https://projects.blender.org/blender/blender/pulls/128964
The versioning code that upgrades legacy actions to new slotted actions
also needs to properly assign slots to the IDs that use those upgraded
actions. It was doing this correctly except for not traversing into and
assigning slots to embedded IDs.
This commit adds the code to handle embedded IDs as well.
Additionally, this changes how mismatched `id_type`s are handled when upgrading
actions. Rather than refusing to assign the slot created during the upgrade if
the `id_type` doesn't match the ID, we assign it anyway with a warning. The
rationale is that this represents a case where the Action `idroot` was already
mismatched, and it turns out that has always been possible. So we now opt to
simply preserve that state of affairs rather than attempt to "fix" it.
Pull Request: https://projects.blender.org/blender/blender/pulls/129002
It looks like this specific case never really worked. This wasn't found before,
because in the large majority of cases, execution uses a more optimized code
path instead of this general one.
Pull Request: https://projects.blender.org/blender/blender/pulls/128993
This patch implements the multi-function procedure operation for the new
CPU compositor, which is a concrete implementation of the PixelOperation
abstraction, much like ShaderOperation, but uses the FN system to more
efficiently evaluate a group of pixel-wise operations.
A few changes were done to FN to support development. The multi-function
builder now allows retrieving the built function. A new builder method
construct_and_set_matching_fn_cb was added to allow using the SI_SO
builders with non static functions. A few other SI_SO were added to. And
a CPP type for float4 was added.
Additionally, the Gamma, Math, Brightness, and Normal nodes were
implemented as an example. The Math node implementation reused the
existing GN math node implementation, so the code was moved to a common
file.
Reference #125968.
Pull Request: https://projects.blender.org/blender/blender/pulls/126988
During development of Collection Export, it was noticed that our various
IO formats deal with errors in vastly different ways [1]. The crashes
were all fixed but now the motivating scenario is as follows:
If you setup a Collection Exporter for OBJ, STL, or PLY, and if it
runs into an error during processing, the C++ operator will return
"FINISHED" to the caller but the operator will also RPT_ERROR. This
causes the caller, Collection Export, to indicate "success" to the user
but the RPT_ERROR then causes a UI report that indicates failure.
This PR chooses to use the presence of the RPT_ERROR as indication of
"CANCELLED" operator status and should be safe enough to also apply
to 4.2 LTS.
This aligns with what Python does [2] and with what the new GSoC import
nodes have chosen to do [3]. Though doing this on import isn't quite
correct so this PR does not add that in to the base import operators.
Alembic and USD are better behaved in this scenario already. However,
they have their own quirks to follow-up afterwards.
[1] https://projects.blender.org/blender/blender/issues/117881
[2] https://projects.blender.org/blender/blender/src/branch/main/source/blender/python/intern/bpy_capi_utils.cc#L25
[3] https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/geometry/nodes/node_geo_import_obj.cc#L49
Pull Request: https://projects.blender.org/blender/blender/pulls/127525
Any brush that used the `restore_position_from_undo_step` codepath (i.e.
brushes that use `OrigPositionData` to calculate their deformations) had
the possibility to cause artifacts due to the nested tbb parallelization
causing incorrect usage of TLS data.
To fix this we add a call to `threading::isolate_task` to prevent thread
stealing.
Pull Request: https://projects.blender.org/blender/blender/pulls/129020
* Use const where possible
* Use C++ math types where possible
* Use std::array of vector types instead of raw arrays where possible
The main areas untouched here are functions which currently do not have
a C++ equivalent (math_geom.cc) and some clip plane arguments which are
wider-reaching than just this file (PBVHFrustumPlanes).
Pull Request: https://projects.blender.org/blender/blender/pulls/128931
In the Action editor header, change the "Show All Slots" filter to
become "Only Show Slot of Active Object". The default state remains
"off".
This means that any new/upgraded Action editor will show all slots in
the Action by default. I think this is a good idea, especially since
cb6ed12ef1 makes related data-blocks share
the same Action, and thus the Action will have a mixture of Object and
non-Object animation. I suspect that it'll help in understanding the new
functionality of slotted Actions when they are most visible, i.e. when
the multiple slots are all shown.
Since slotted Actions are so new, I don't think we need to add
versioning code to accomodate this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/129011
When un-assigning an Action, do not depend on the Dope Sheet space data
`action` pointer. Instead, Blender now just sets the RNA property
`id.animation_data.action = None` to un-assign the Action. Using RNA this
way will ensure that the messagebus gets notified of this change as well.
The Dope Sheet space data 'action' pointer is still set to `nullptr`, but
it is now no longer used as primary way to clear the Action.
Pull Request: https://projects.blender.org/blender/blender/pulls/129006