Fixes behavior for #137057 when sampling single point curves.
Previous behavior just checked the evaluated length cache size and
called fill_invalid(), it will now fill using the point value and terminate.
Pull Request: https://projects.blender.org/blender/blender/pulls/138153
Previously to handle unevaluated objects in line art "load all"
iteration, a `include_objects` variable is added in depsgraph
iteration settings, and this was only processed by object iterator
but not for any of the dupli objects. Now `make_duplis_collection`
will also handle `include_objects`
The only case where this border case can lead to crash is that a
line art grease pencil object is inside one of the dupli collection,
which isn't a valid use in the first place. But this fix makes it
more robust.
Pull Request: https://projects.blender.org/blender/blender/pulls/137323
When copying a brush from a linked library to the current main, the fake
user flag is set, but the user count is set to 0. This later means that
saving such a file does not persist the brush datablock, and the
associated invariants are violated.
Related to / Found in #138105
Pull Request: https://projects.blender.org/blender/blender/pulls/138243
This converts the public `uiLayoutSplit` function to an object oriented
API (`uiLayout::split`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
`uiLayout::split` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138361
Behavior of select all operator invoked by shortcut was inconsistent
with menu. This was, because operator context was not set.
Also the selection in timeline is cleared when running this operator
as not doing it may cause unexpected behavior for users.
Selection invert also follows the same behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/137713
This converts the public `uiLayoutBox` function to an object oriented
API (`uiLayout::box`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.
`uiLayout::box` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.
Pull Request: https://projects.blender.org/blender/blender/pulls/138334
Regression from 368c737fe7. Forgot to fully move to using
`BKE_id_new_nomain` at some point for default materials, instead
of doing more low-level set of 'alloc liblock, initialize it with
default values'.
Enable optimizations on Debug builds for executables used for the build
process (datatoc and glsl_preprocess) and enable unity builds for
shader preprocessing targets.
Debug: From 28.9s to 5.7s
Release: From 4.9s to 3.5s
Pull Request: https://projects.blender.org/blender/blender/pulls/138274
Checking whether relations already existed was a bottleneck when building
collection -> object hierarchy relations. The duplicate checking would be
unnecessary since an object can only be in a collection once, but this function
to build relations can be called multiple times for the same collection.
To avoid the need to check for duplicates, only run the relation creation
once for each collection. The `BuilderMap` gives a simple way to do that.
Note that because a collection might be built separately as a non-layer
collection, there may still be duplicate hierarchy relations.
Building a Depsgraph for 60k simple objects became 1.86x faster, from 2.39
to 1.29 seconds.
Pull Request: https://projects.blender.org/blender/blender/pulls/137737
The current code doesn't include selection boundary points in non-
selected curves after separation, causing some segments to be lost.
Legacy curves do include those points. The second issue is with cyclic
curves. The current version leaves the separated part cyclic, though
the more intuitive behavior would be cut off the result. This is also
different from legacy curves. This commit fixes both issues.
Pull Request: https://projects.blender.org/blender/blender/pulls/135035
Previous conversion to scene linear was done in the display transform
shader. Having a separate shader to convert texture to scene linear
allows drawing input textures with different color spaces into a
viewport and apply display transform on all of them.
Currently unused, but is required for !138094. It could also be used
in the future to avoid host-side linearization in the image engine.
Internally it uses a lot of the same logic for shader caching and
binding, but the code is refactored a bit to make it easier to have
a stronger separation in the future if needed.
Ref #138094
Pull Request: https://projects.blender.org/blender/blender/pulls/138308
Fixes incorrect render of lookdev on macOS.
There might have been some other issues caused by the mistake, hard to say,
seems to be hitting some platform-specific behavior and such.
There were two issues:
* Some rna properties to access members in the layer tree were missing
`PROPOVERRIDE_NO_COMPARISON`.
* In `rna_Attributes_noncolor_layer_skip` the wrong `AttributeOwner`
was created.
Pull Request: https://projects.blender.org/blender/blender/pulls/138324
Use the safer VArraySpan instead of get_internal_span(). And remove
the size check for the output data. If the callback inside `ensure` is
called it means that recomputing the data is necessary, regardless of
the array's current size.
The goal is to make issues like the ones fixed in #138310 become visible
much earlier in the development cycle.
This PR covers the most obvious places where it could be applied. There
are probably more places, but they can be covered later.
Pull Request: https://projects.blender.org/blender/blender/pulls/138315
* Remove `DEG_get_evaluated_object` in favor of `DEG_get_evaluated`.
* Remove `DEG_is_original_object` in favor of `DEG_is_original`.
* Remove `DEG_is_evaluated_object` in favor of `DEG_is_evaluated`.
Pull Request: https://projects.blender.org/blender/blender/pulls/138317
'Fixes' the "curveprofile" case of #137870, by immediately crashing
on nullptr access instead of allowing readfile code to further access
memory detected as invalid (which would most likely lead to a crash
later anyway).
I don't think we can expect readfile code to gracefully abort at such a
low-level error detection, not without using some form of exception
handling at least? Otherwise the whole readfile code would have to
constantly check for invalid flag in the Mains.
Pull Request: https://projects.blender.org/blender/blender/pulls/138145
These were handled mostly completely outside of IDManagement code, yet
(ab)using the same ID management system in some cases, adding hacks to
address some issues, etc.
Also address a similar issue in the eevee lookdev `LookdevWorld` code.
Since initializing pre-allocated (or static) buffers as valid IDs is not
currently supported, and these use-cases do not seem common enough to be
worth supporting it currently, instead switch to storing allocated IDs
into static pointers.
This allows to use proper 'out-of-main' ID creation code API.
NOTE: There are still some remaining issues, especially in the GP
material BKE api. These are noted in comments for now, as it would be
out of scope to address them in this commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/138263
Comparing paths is tricky, especially when different operating systems
are involved, with different slashes, encodings, etc. So often a string
comparison is not good enough. Use asset weak reference comparison for
this case, which performs more careful path comparisons.
Not sure if this makes a difference in practice. But it might solve some subtle
issues, and it makes some more sense semantically. So I think it's worth
trying. Originally I was hoping this would fix#123508, but apparently didn't
Pull Request: https://projects.blender.org/blender/blender/pulls/127685
Implemented the VKSamplers based on the documentation in GPU_texture.hh.
They used to be reversed engineered from the OpenGL backend, however
Vulkan has better control over mipmap filtering and OpenGL needed to
combine some flexibility inside the min/mag filtering.
Changes:
- Mipmap filtering was always on, not only when `GPU_SAMPLER_FILTERING_MIPMAP`
is used.
- Mipmap filter mode is always set to linear. This is not according to the
documentation, but matches OpenGL and the render tests.
Fixes#136439, #138111
Partial fix#137436 - seam isn't there, inf can still be part of the
texture.
Pull Request: https://projects.blender.org/blender/blender/pulls/138313
This patch removes the Use Alpha option from Composite and Viewer nodes.
The reasoning for the removal is as follows:
- It has an unintuitive complicated design at the moment.
- If the Alpha Input is unlinked, the output alpha is not adjusted
even if Use Alpha is enabled, leaving users wondering why their
adjustments have no effect.
- Disabled Use Alpha means output an opaque image, that is, it
actually means Ignore Alpha. Which is confusing because users might
think that it controls alpha adjustments based on input.
- It always does alpha replacement without premultiplication, which is
not clear to the user and is not what the user wants in most cases.
- Adding a Set Alpha node before the output is pretty easy and clear, so
the option seems redundant considering the above.
Pull Request: https://projects.blender.org/blender/blender/pulls/138309
Update descriptor pool sizes to be better for smaller scenes. Creating,
resetting and destroying pools are expensive operations. In smaller
scenes this can lead to lower performance.
The improvements may differ per platforms or not be visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/138300
The "material_index" attribute is expected to exist by many operations,
but that is not always the case. Using a fallback value prevents crashing
in case the attribute has been removed. A default material is already
supported when the index is not in range of the actual material slots on
an object or grease pencil data block respectively.
Pull Request: https://projects.blender.org/blender/blender/pulls/138303
Wrong since the Overlay Next implementation in ce28af7352
We cannot write to things like `.xy()`, these are for reading only.
Not aware of a version that is for writing, so for now, write to [0] and
[1] separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/138310
Navigating with mouse executes the respective modal function where it
handles autokeying the locked camera. But navigating with trackpad just
executes invoke function (for eg: see event_code in `viewrotate_invoke_impl`).
To fix this, Call `ED_view3d_camera_lock_autokey` inside invoke() to handle
autokeying.
Pull Request: https://projects.blender.org/blender/blender/pulls/138179
Allow assign/select operators to execute when armature tab is pinned.
For assign operators, pinned armature should be active in 3D view
because we cannot assign bones of one armature to the bone collection of
different armature. Added extra condition in poll function to control
the above case.
For select operators, use `ED_armature_context` to obtain pinned Armature.
These operators are now hidden in object modes.
Pull Request: https://projects.blender.org/blender/blender/pulls/137587
Reordering layers via drag-and-drop in the layer tree couldn't be
undone. With this patch an undo step is pushed when the layer order
changes via drag-and-drop, so the action can be undone.
Pull Request: https://projects.blender.org/blender/blender/pulls/138214
The use-case of this blend mode is to be able to make parts of an
viewport overlay transparent.
The future user of this blend mode is sequencer preview drawing
where frame will be drawn to an HDR render frame-buffer, and overlays
drawn on-top. In a way it is similar to the image engine, but without
need to have custom shader.
Ref #138094
Pull Request: https://projects.blender.org/blender/blender/pulls/138307
Currently unused, but allows areas outside of DRW to render to the
color render and depth texture.
The primary user of this new API will be Sequencer preview to draw
HDR images.
Ref #138094
Pull Request: https://projects.blender.org/blender/blender/pulls/138306
Resolve a theoretical null pointer de-reference. In practice this is
unlikely as the result of `fd->file->read()` would need to fail to read
the requested data from memory.
Also use `UNLIKELY(...)` with checks that the expected amount of data
could be read.
After 5f7d5c0809, just translate gizmo is listening to protection flags
in global orientation. Commit doesn't specify the reason behind the
change. It intentionally ignores scale/rotate lock flags in global
orientation. Added a code comment to explicitly mention the reason
behind it.
Resolves#116666
Pull Request: https://projects.blender.org/blender/blender/pulls/133286
Calling `brush.asset_save_as` both creates an asset and also activates
the corresponding brush. When run while Blender is in background mode,
the `active_tool->runtime` field may be null. To avoid crashing in this
case, check for null when comparing active tool data.
Pull Request: https://projects.blender.org/blender/blender/pulls/138245
This PR adds an option to only show the onion skins of the active
object. The option is added to the Grease Pencil overlay menu in the
3D viewport.
When enabled, only the onion skins of the active object are shown.
This keeps the viewport a lot cleaner when working with multiple
Grease Pencil objects.
This resolves#136820.
Pull Request: https://projects.blender.org/blender/blender/pulls/137405
Part of #135062.
This PR adds an Auto Normalize option in the Vertex Group panel that
when checked will normalize the other deform-bone vertex groups' weights
when assigning the weight of a deform-bone vertex group. For example if
a selected vertex has the following weights:
| Name | Weight |
|---------|--------|
| Group 1 | 0.2 |
| Group 2 | 0.2 |
| Group 3 | 0.6 |
And the user selects Group 3, checks the Auto Normalize checkbox, sets
the weight to 0.8, and clicks Assign, the new weights will be:
| Name | Weight |
|---------|--------|
| Group 1 | 0.1 |
| Group 2 | 0.1 |
| Group 3 | 0.8 |
Co-authored-by: Andy Beers <acbeers1@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138133