Historically, the OCIO based color management implementation in Blender
had exceptions to treat specific configurations differently. It was a
compatibility with the legacy "No color management" option.
With time and more development in the area there are better ways of
achieving this goal, if needed.
This commit removes the named-based exception, which also solves confusion
about why certain similar configurations (from OCIO stand point) give
different results. As well as allows to create a cleaner plate for an
upcoming additions in the OCIO configuration such as AgX.
Quite simple and technical change which constant-folds the check for
whether the scene color management enabled or not with "true" value.
Ref #110685
Pull Request: https://projects.blender.org/blender/blender/pulls/110580
The issue was that `CustomData_swap` modifies all layers, but does not ensure
that the layers are actually mutable. This resulted in it modifying shared layers.
Now it ensures that the layers are mutable first (which copies the layers if they
are shared).
Longer term, it would be good to remove `CustomData_swap` since it's not a
good API performance wise, but that is outside of the scope of this patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/110678
#109460 was caused by the introduction of implicit sharing for custom
data layers (7eee378eccc8f87e17). Due to implicit sharing, the vertex
weight layer is now shared between the original and evaluated object in
object/weight paint mode, but not in edit mode because of bmesh. For
that reason, the original data has to be copied to be able to edit it, which
causes its pointer to change. `uiDefButF` can't deal with the situation when
the pointer changes on every redraw.
The solution is to just use an intermediate variable that is passed to the
`uiBut` and to update the vertex weight only when the intermediate value has
changed.
Pull Request: https://projects.blender.org/blender/blender/pulls/109665
The active data-block can now be queried via an `"id"` context member,
just like UI buttons representing a data-block and the Asset Browser do
it already. This is useful for scripts that need this information to
implement own operators. Requested by the Blender Studio for their
pipeline tooling.
Use const arguments for array input arguments as there
is no reason for them to be modified.
Using non-const arguments meant some functions
(uiTemplateNodeSocket for e.g.) couldn't use 'const' qualifier so the
generated type signature would match.
Also use suffix "_num" instead of "_len" for array lengths, ordering
these arguments after the array (in keeping with Blender's conventions).
Commit `c9be925f7d` fixed files for studio, that were saved in incorrect
state. This also attempted to fix unaffected files.
In affected files `seq->startofs` did overflow. Sound strips are not
expected to have negative `startofs` and therefore fix in `c9be925f7d`
can be limited to broken files by checking `startofs` value.
Strip was removed from `seqbase` prior to calling
`SEQ_edit_remove_flagged_sequences()` which resulted in strip not being
actually removed, and it could be seen in timeline while being active.
The curve UI template can display several curves, typically Combined,
Red, Green, and Blue. Each is displayed by clicking a shortened button
C, R, G, B. The equivalent exists for Hue, Saturation, Value.
These single-lettered buttons can be translated using the already
extracted color letters.
R, G, B, H, S, and V all use the default translation context to refer
to the color already, so they do not need an extra context. C however
is already used for the letter in the context of vector
comparisons (as in A, B, C), so we add a Color context to disambiguate
it.
Pull Request: https://projects.blender.org/blender/blender/pulls/110491
To avoid the small jumps during the Pan operation, a feature was
implemented in the `ED_view3d_navigation_do` utility that replaces the
point used for AutoDepth.
As a result, the depth of the pivot point is now used during the
transform.
Also, to ensure minimal disruption to non-AutoDepth users, this feature
is enabled only when "Auto Depth" is enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/109451
In the 3D View, after navigating, the initial cursor position was
updated based on the relative position of the cursor in 3D space.
Now the initial relative position is maintained but moved closer to or
further from the 2d center based on zoom.
Similar to ded695bc73.
Note that the third 'storage' codepath is not affected currently, this
is almost dead code actually, might rather consider removal of it
altogether.
No behavioral nor performance changes are expected with this commit.
The "Distort" socket in the Lens Distortion node should be a noun
instead of a verb, same as "Dispersion" just below. The name was
introduced at the same time as the node itself, in 2a2453d3e2.
Versioning was added to update existing nodes. The Python API
is affected though, if the socket was looked up with the old name.
Pull Request: https://projects.blender.org/blender/blender/pulls/108234
Reduce overhead of copying attribute data into GPU buffers when the
PBVH is active. The existing lambda with a FunctionRef callback had
a significant overhead. While that was reduced by 25917f0165
already, even making the `foreach_faces` lambda into a template gave
significant overhead compared to simpler loops. Instead, separate
value conversion and iteration over visible triangles in a way that the
compiler is able to optimize more easily.
According to the GPU module, it's also better to use raw data access
than `GPU_vertbuf_raw_step`, since the data format strides aren't
meant to vary by platform, and the runtime stride can have a
noticeable performance impact.
Also avoid recalculating face normals, since they're already used to
calculate vertex normals anyway (since ac02f94caf).
I tested the runtime of the initial data-upload after entering sculpt
mode with a 16 million vertex mesh. Before, that took 1350 ms, after
it took 680 ms, which is almost a 2x improvement. In my tests, the
performance improvement was only observable for the initial data
upload, theoretically it is a more general change though.
It's possible that a similar optimization could be applied to multires
or dynamic topology sculpting, but that can be looked at later too.
Pull Request: https://projects.blender.org/blender/blender/pulls/110621
This change fixes crash which happens when a viewer node is used for
backdrop, and the scene render size is modified. After the modification
the render size and the texture size gets out of sync since the texture
was never adapting for the size change.
Pull Request: https://projects.blender.org/blender/blender/pulls/110590
Adapt the `ACTION_OT_select_circle` and `ACTION_OT_select_lasso` operators to take into account grease pencil layer channels. These operators both call `region_select_action_keys` which subsequently calls `region_select_elem` function. In the last function, grease pencil layer needs to be taken into consideration. This resolves#110521
Pull Request: https://projects.blender.org/blender/blender/pulls/110558
The wrong RNA pointers were passed (passing the root ones instead of the
ones actually owning the rna-path-resolved property).
This was likely a harmless mistake, since it only affected RNA
collections of IDs, afaik we currently don't have many (if any) of these
in non-ID RNA structures. The children collections and objects in a
Collection data-block RNA structure e.g. were not affected.
But the potential consequence of that bug would have been missing
automatic detection of some needed liboverride resyncs.