The Vectorcall protocol avoids creating a tuple, and also provides the
number of arguments in advance, providing a ~1.6x speedup for creation
of mathutils types.
Ref !146237
Each dupli is given a PersistentId which is 8 integers, 1 for each level
of recursive duplication that Blender supports. When an instance belongs
to fewer than 8 levels, the id is padded with sentinel values for the
remaining levels. For example, a 2 level dupli may have a persistent id
like:`[7, 4, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX, INT_MAX]`
When calculating the instance's `random_id` we were considering all 8
values of the Persistent Id which is unnecessary and wasteful. Now we
only use the minimal values necessary. This does mean that the Object
Info: Random material socket changes values from prior versions however.
This improves the performance of the viewport in some instancing
scenes by roughly 4-6%.
Co-authored-by: Bastien Montagne <mont29@noreply.localhost>
Pull Request: https://projects.blender.org/blender/blender/pulls/145150
For some reason, the `underwater_caustics` test was failing on Metal
after #140480 even though that test doesn't use the Sky Texture.
After messing with the file for a while, going back to the previous version
and adding the changes back one at a time, I've now arrived at a version
that behaves the same way as the #140480 version without breaking the test.
No idea what is the underlying issue, but we've had problems with the MNEE
kernels before so maybe just a compiler thing.
Pull Request: https://projects.blender.org/blender/blender/pulls/146335
A aspect ratio less than or equal to zero will cause point to not be
displayed.
This behavior problematic because use strokes create by Geometry Nodes
(or bugs) can cause the `aspect_ratio` to default to zero.
And as there is currently no operator to set `aspect_ratio` this
invisible geometry can not be fixed by most users.
This PR fixes this by returning `1.0f` when the `aspect_ratio` is
invalided.
Pull Request: https://projects.blender.org/blender/blender/pulls/146279
The default value for the `vertex_color` attribute is `0.0f` not `1.0f`
so the `Reset Vertex Color` operator should set zero, to no obstruct
the base material.
Candidate for backport to 4.5 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/146277
Follow up to !146169
- Add versioning so the new sidebar shows up in old files.
- Remove the hidden flag so it shows up in new Preferences editors.
- Add "Sidebar" toggle to the View menu, and expose region toggle.
Pull Request: https://projects.blender.org/blender/blender/pulls/146321
This mode is based on the same athmospheric model as the previous one, but now
also accounts for multiple scattering and reflections from the ground.
This increases the accuracy, especially at low elevations.
Also renames some options for consistency:
- The previous "Nishita" model is now "Single Scattering"
- "Dust" is now "Aerosols"
- Default altitude is now 100m.
Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/140480
Prefilter the position float data similar to what was done recently for
point caches in 3d9155eb0a (more information about this
compression technique is linked there). Also avoid reallocating an
array for temporary data when processing each BVH node. The results
are great relative to the size of the change:
- Building the compressed undo step data gets 5.2x faster (25 to 5 ms)
- Restoring the compressed undo step on undo is 1.8x faster (10 to 5 ms)
- The memory usage for an undo step is 1.6x smaller (23 to 14 MB)
I Tested on a mesh with 1.8 million vertices, with an operation affecting
the entire mesh. The mesh data affected will have an affect on the results.
Pull Request: https://projects.blender.org/blender/blender/pulls/146093
Adjust the poll function of the 'Set Active Modifier' operator
(`object.modifier_set_active`) to only return `true` when it's run in a
context that actually may have a modifier. This makes it work in the
Modifiers panels, but not in other panels, so that the 'mouse click'
event can be used for other operators (like tree view selection).
This is not a perfect solution, as the modifier panel may use tree views
in some future as well, but at least it seems to fix the 'unbreak now'
issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/146325
Fixes several validation errors when using VMA.
- Always enable buffer device address in VMA as it is already a Blender
requirement.
- Add host access hints when host access is needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/146312
This commit builds off of 5f8311f596 to support collapsing the custom
paint curve to reduce the amount of information shown to the user.
To support this, a new field is added to the `Paint` struct for this
visibility flag. This value is stored on a per-mode level, not a
per-brush level, as a user editing this curve is likely to not need
the visibility granularity on a per-brush basis.
Additionally, changes are included here to draw the curve button
itself as inactive if the parent layout it is part of is inactive.
Notably, this does not make the curve read only - it only changes
the appearance.
Pull Request: https://projects.blender.org/blender/blender/pulls/145699
Various runtime fields were being accessed before the runtime struct
itself was created in a newly allocated ID block. Additionally, the
call to `BKE_reports_init` is already handled by the
`WindowManagerRuntime` constructor.
Pull Request: https://projects.blender.org/blender/blender/pulls/146258
The Render Layers node doesn't work if a viewlayer other than the first
is selected. This was hard coded in code, so we just allow any view
layer, on the condition that it is the active one.
Pull Request: https://projects.blender.org/blender/blender/pulls/146285
This patch extends the usage_by_menu method to also consider the usage
of the menu socket in the make available and usage inference callbacks.
This essentially means that if a socket depends on menu B which, in
turn, depends on menu A, it will be sufficiently to check the value of
menu B, while A will be checked recursively.
The single variant of the usage_by_menu function is now implemented in
terms of its overloaded vector variant for code deduplication since the
new code increase the size quite a bit.
Pull Request: https://projects.blender.org/blender/blender/pulls/146141
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.
This PR removes "Use Nodes" for object materials.
For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.
Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
- `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
- `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.
Forward compatibility:
Always enable 'Use Nodes' when writing blend files.
Known Issues:
Some UI tests are failing on macOS
Pull Request: https://projects.blender.org/blender/blender/pulls/141278
The intent of the Curve and Line stroke types is generally to perform
a set of equally spaced points. Unlike drawing with a tablet using the
Spacing stroke type, pressure should have no influence on this input.
Previously, the code would pass in a hardcoded value of 1.0f for the
line & curve pressure. This is incorrect, as it results in a factor of
0.5f, not 1.0f, causing behavior to differ on this stroke type depending
on if the corresponding brush pressure flag was enabled or not.
Additionally, an extra check is used to ensure that only the Spacing
stroke type can have pressure modulated in this way.
Pull Request: https://projects.blender.org/blender/blender/pulls/146120
Introduced with 5f8311f596
When using the Spacing stroke type, the exact spacing between brush
daubs becomes modified by the brush size. In the case of users using
a non default brush size curve with size pressure, we need to use the
evaluated pressure factor for the size, not the raw pressure value.
Additionally, this commit renames the parameters in a helper method
to more clearly differentiate between the two float parameters.
Pull Request: https://projects.blender.org/blender/blender/pulls/146054
Introduced with 7f3aa617ce
The `PaintMode` is needed when activating the default tool. There were
two things that caused this field on the `PaintRuntime` to be in an
invalid state on duplication:
* The original values for `PaintRuntime` were not copied to the new
instance.
* When copying `ToolSettings`, the incorrect old value of `Paint` was
passed to `BKE_paint_copy`, leading to the inability to copy the right
data.
Pull Request: https://projects.blender.org/blender/blender/pulls/146199
This commit implements the design task #78398
- Box region
- Set Custom UV Region (Ctrl-B).
- Disabled with Custom Region checkbox in the menu or (Ctrl-Alt-B).
- Box Select (Pinned) changed to (Alt-B).
- When the Custom Region enum is chosen the islands are packed
into the bounding box of the drawn region.
Ref !140020
Currently, the frame scrub area shows different frame numbers based on
the zoom level. But they would not show frame 24 until you zoom in. Since 24
is the most used frame rate for animation that's inconvenient because you never
see the spot with the full second.
With this PR the numbers and lines depend on the frame rate, and will favor
full seconds, then divide by either 2, 3 or 5 to break down the number.
This works for most FPS values, however custom FPS may hit a prime number, in which case
this logic is aborted and the next step down when zooming in will be 1. This can
result in quite large gaps where no frame numbers are displayed. But I think the impact
will be small since large prime number frame rates are rare.
This patch also reduces UI jumping because the major lines will always be turned into minor lines before disappearing.
When zooming in, any minor line will become a major line eventually.
To reduce the bunching up of minor lines when dividing by a large prime number,
they are only drawn if the distance between them is large enough.
Note that the line drawing in the VSE is not quite following the zoom level. Since this doesn't use the code path i modified in this PR I left it as is. Info from the Sequencer module is appreciated.
Pull Request: https://projects.blender.org/blender/blender/pulls/143562
* Fix: OpenColorIO config defined working space disappears from menu. It
was incorrectly using the current scene linear instead of default space.
* Warn users about missing working space.
* Don't detect lin_ap0_scene working space, we don't offer it in the menu.
Pull Request: https://projects.blender.org/blender/blender/pulls/146149
Prior to 5.0, "Bundle" used to mean only the reconstructed data from
tracking.
Since then, bundles are a new data type in Geometry Nodes. It has many
occurrences, so it's easier to give it the default translation
context, and to use the "MovieClip" context for the tracking sense.