Refactor how tooltips are sized, items placed, margins calculated, etc.
Current code has some mistakes that we use kludges to compensate for,
and it doesn't properly consider the font size in calculating margins.
The result shown to users in normal circumstances (changing resolution
scale only) with this PR applied should look identical to current.
Small changes when the text style size is changed. However, this is
mostly to allow later adjustments to padding, which currently _breaks_
when changed.
Pull Request: https://projects.blender.org/blender/blender/pulls/134205
The issue also happens on macOS 15.3.
This is a Metal driver bug, a fix is coming in macOS 15.4. Until then
disable refitting the viewport. There is no perceptible benefit from
refitting, so while it might be less that ideal it allows to side step
the problem and still benefit from the HWRT.
Pull Request: https://projects.blender.org/blender/blender/pulls/134399
It would both set the dome light color and export a texture with that
same color, which would double up. It was also using the World.exposure
member which is not used anywhere else in Blender.
Pull Request: https://projects.blender.org/blender/blender/pulls/134411
Implement the USD Plane Shape for import, mirroring what was done for
the others. See #134138
Additional tests will be added afterwards but a simple test is simply to
import the resulting file:
```python
from pxr import Usd, UsdGeom
stage = Usd.Stage.CreateNew('plane.usd')
xform_prim = UsdGeom.Xform.Define(stage, '/world')
plane_prim = UsdGeom.Plane.Define(stage, '/world/plane')
stage.GetRootLayer().Save()
```
Co-authored-by: Nig3l <nig3lpro@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134275
This patch adds the texture pool functionality that was previously
only available in the DRW module to the GPU module.
This allows to not rely on global `DST` variable for the managment
of these temporary textures.
Moreover, this can be extended using dedicated GPU backend
specific behavior to reduce the amount of memory needed
to render.
The implementation is mostly copy pasted from the draw implementation
but with more documentation. Also it is simplified since the
`DRW_texture_pool_query` functionality is not needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/134403
Intersect mode needs to set everything **outside** of the selection mask
to non-selected and leave the rest untouched.
We already had the comment to "un-set all elements not in the mask" but
that was actually unsetting **everything**.
In theory, we could also early out for `SEL_OP_AND` since the following
`apply_mask_as_` calls are not doing anything for `SEL_OP_AND` really
(but left the change to be minimal).
Pull Request: https://projects.blender.org/blender/blender/pulls/134400
Another case of C-style allocation of non-trivial objects hidden
with casting. To fix, give explicit member defaults to a few of
the UI interaction structs.
In setups where only very few elements are processed at once, the lazy-threading
hints that come from `parallel_for` are not triggered. However, often it can
still be worth to use multi-threading in such cases. Therefore, we need to find
additional places where the lazy-threading hints are sent. There are many
possibilities and we probably have to add them step by step as we find .blend
files that show missing multi-threading.
In this patch I choose to send the hint at the beginning of evaluating a repeat
zone if it has 10 or more iterations. The exact number here is just a guess and
could be fine tuned over time if necessary.
A slightly modified version of the file in #134230 speeds up from ~1100ms to
~100ms with this change. The exact speedup changes quite a bit each run, but is
always between 5 and 20x, so it's quite noticable.
Pull Request: https://projects.blender.org/blender/blender/pulls/134408
This replaces the `set_listbasepointers` function with `BKE_main_lists_get`
which returns an array of `ListBase *`. This simplifies the caller a bit. In
some cases, it can be simplifed further by changing the order in which we iterate
over the listbase. For historical reasons, we iterate from the back to front in
most cases but sometimes the order does not matter. I did keep the iteration order
in this patch though, to avoid regressions.
Pull Request: https://projects.blender.org/blender/blender/pulls/134242
Currently, tree, node and socket types are always freed immediately when the
Python code unregisters them. This is problematic, because there may still be
references to those type pointers in evaluated data owned by potentially various
depsgraphs. It's not possible to change data in these depsgraphs, because they
may be independent from the original data and might be worked on by a separate
thread. So when the type pointers are freed directly, there will be a lot of
dangling pointers in evaluated copies. Since those are used to free the nodes,
there will be a crash when the depsgraph updates. In practice, this does not
happen that often, because typically custom node tree addons are not disabled
while in use. They still used to crash often, but only when Blender exits and
unregisters all types.
The solution is to just keep the typeinfo pointers alive and free them all at
the very end. This obviously has the downside that the list of pointers we need
to keep track of can grow endlessly, however in practice that doesn't really
happen under any normal circumstances.
I'm still getting some other crashes when enabling/disabling Sverchok while
testing, but not entirely reliably and also without this patch (the crash there
happens in RNA code). So some additional work will probably be needed later to
make this work properly in all cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/134360
Previously, all the layers were part of the evaluated state, even if
they were hidden.
Hidden layers should be treated as "disabled" meaning that we should
not evaluate them and/or render them at all.
This fixes this by removing hidden layers from the evaluated data before
layer adjustments and modifier evaluation starts.
As a consequence, hidden layers are no longer accessible in Geometry
Nodes. Technically, this is a breaking change. In the unlikely case that
a user relied on hidden layers to be evaluated within modifiers, they
need to make sure that the layer is visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/133973
Currently, all save operations show the same `Saved "Filed.blend"` message.
Improve wording to tell apart different save actions such as:
* Save As
* Save Copy
* Save Incremental
Pull Request: https://projects.blender.org/blender/blender/pulls/134114
In certain setups where passes are used in the viewport compositor,
blender will crash. This happens because passes may not be available
when the compositor first run but then become available in later runs.
Possibly because EEVEE is still compiling shaders. This is problematic
for the compositor because it caches the result of node tree compilation
for the specific data available, like passes, and the compositor does
not get informed when data becomes available like in the case of EEVEE
to invalidate the cached node tree compilation result.
Caching of node tree compilation was always a source of bugs but we
managed to workaround them in the past, so before we work on a fix for
this crash, we first evaluate the removal of caching to see if we can
live without it. Especially since a fix will be rather involved for the
release branch at this stage.
The time it takes to compile the node tree is:
- Small Tree (~10 nodes): 0.3ms.
- Medium Tree (~50 nodes): 0.6ms.
- Huge Tree (~300 nodes): 3ms.
The difference is not noticeable to the eye, probably since as the tree
becomes bigger, the evaluation time becomes more dominant, and small
trees are fast to compile.
It should be noted that we intended to remove caching in the future to
support things like lazy evaluation of node inputs, but we though a few
optimization needs to be done on the GPUMaterial compiler side to make
compilation faster, since it is the main bottleneck during compilation.
So considering this, I think it is acceptable to disable caching of node
tree compilations for the time being. I intend to optimize it such that
it always becomes less than 1ms, but we will have to delay that to 4.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/134394
Not really sure why only type and owner_id were cleared here?
Especially when code like `pyrna_struct_CreatePyObject` would check
for both `data` and `type` to be null to consider the pointer as None...
Happens to 'fix' #134311, since now cleared PointerRNA are 'just'
reset to `PointerRNA_NULL`. Would not work if the data was not an
ID PointerRNA though...
NOTE: In general, what is considered an invalid PointerRNA is still very
loosely designed in our code-base, we'll have to address this.
Pull Request: https://projects.blender.org/blender/blender/pulls/134393
Not really sure why only type and owner_id were cleared here?
Especially when code like `pyrna_struct_CreatePyObject` would check
for both `data` and `type` to be null to consider the pointer as None...
Happens to 'fix' #134311, since now cleared PointerRNA are 'just'
reset to `PointerRNA_NULL`. Would not work if the data was not an
ID PointerRNA though...
NOTE: In general, what is considered an invalid PointerRNA is still very
loosely designed in our code-base, we'll have to address this.
Pull Request: https://projects.blender.org/blender/blender/pulls/134393
This was probably caused by 3ef2ee7c53.
Now `build_layer_group_buttons` doens't need to
select a specific icon anymore. It's handled by the
RNA property.
Likely caused by d94a56bdad. In `ANIMDATA_FILTER_CASES` macro,
function call to `animfilter_nla` is not made due to legacy action
condition checks. Since legacy actions are already converted to new
layered action structure in `convert_legacy_animato_actions`, it seems
safe to remove those conditions from macro.
Pull Request: https://projects.blender.org/blender/blender/pulls/134209
Writing a blend file to a path that references a directory wasn't
being handled correctly.
When the save "versions" was greater than zero the directory would
be renamed (adding a 1), otherwise there would be a
"Version backup failed" error.
Resolve by exiting with an error in the unlikely event the user saves
over a directory.
Part of a fix for #134101.
Ref !134384
This adds two properties `next_node` and `prev_node` to the
`GreasePencilTreeNode` RNA struct.
This reflects how the tree nodes are stored in DNA (as a linked list).
Pull Request: https://projects.blender.org/blender/blender/pulls/134353