This issue specifically happend if sound playback is synchronized by
Audaspace. In this case render engine can't override current frame.
`BKE_sound_sync_scene()` should return NaN as when rendering is in
progress, however viewport render operator doesn't set `G.is_rendering`.
Pull Request: https://projects.blender.org/blender/blender/pulls/111946
There are a couple of functions that create rna pointers. For example
`RNA_main_pointer_create` and `RNA_pointer_create`. Currently, those
take an output parameter `r_ptr` as last argument. This patch changes
it so that the functions actually return a` PointerRNA` instead of using
the output parameters.
This has a few benefits:
* Output parameters should only be used when there is an actual benefit.
Otherwise, one should default to returning the value.
* It's simpler to use the API in the large majority of cases (note that this
patch reduces the number of lines of code).
* It allows the `PointerRNA` to be const on the call-site, if that is desired.
No performance regression has been measured in production files.
If one of these functions happened to be called in a hot loop where
there is a regression, the solution should be to use an inline function
there which allows the compiler to optimize it even better.
Pull Request: https://projects.blender.org/blender/blender/pulls/111976
To reproduce build error, set `WITH_AUDASPACE` to `ON` in `blender_lite.cmake` and build using `make lite`.
The problem is that the function `AUD_Sound_equalize` is declared in `blender/extern/audaspace/bindings/C/AUD_Sound.h` within `WITH_CONVOLUTION` and not `WITH_AUDASPACE`.
Pull Request: https://projects.blender.org/blender/blender/pulls/111994
This fixes a specific crash that would happen to me sometimes when changing
between files (the files may have been saved in older versions of the Blender).
The fix is just to null-check the icon lookup.
Pull Request: https://projects.blender.org/blender/blender/pulls/111670
Change the versioning code so that all bone groups are converted to bone
collections, so also the ones that did not have any bones assigned.
As Demeter[1] put it: While bone groups with 0 bones assigned are
usually unintended, versioning should still preserve them I feel like,
just to be on the safe side. If there was an update to the vertex group
system, I would also expect empty vertex groups to survive, even though
they are strictly speaking pretty much pointless.
[1]: https://projects.blender.org/blender/blender/issues/111711#issuecomment-1013159
Implements part of #111538.
Change the modifier add button to create a menu with submenus.
Extend the submenus dynamically with geometry node group assets.
This makes it much simpler to share and use custom modifiers.
Node groups get a new "Is Modifier" property, which is controllable
in a popover in the node editor header when the group is an asset.
The built in modifier can be rearranged in different categories in
a next step. For now the existing organization is used, except for
the geometry nodes modifier, which is called "Empty Modifier" and
put in the root menu.
The changes in !110855 and !110828 will be important to improve
interaction speed with the new UI. Those are planned for 4.0 as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/111717
When curves were baked, the lock icon wasn't drawn, which resulted in
a misalignment of the other icons.
With this patch, the icons are kept in alignment.
Also removes the comments that are no longer valid.
Pull Request: https://projects.blender.org/blender/blender/pulls/108518
When viewing a curve with a lot of keys totally zoomed out,
the keys might be closer to each other than a pixel.
The code would still draw a line between them,
costing time in the draw code.
This PR skips any keys that are too close to each other in screen space.
## Performance
The setup: 62 bones with 6000f of animation keyed on every frame.
No keys displayed, just the curves.
| - | before | after |
| - | - | - |
| zoomed in | 11μs | 17μs |
| zoomed out | 55μs | 30μs |
So a small performance penalty when zoomed in in exchange for a big gain when zoomed out.
There is a small change in visuals when zoomed out a lot.
Because this change averages keys that are too close together,
it results in a small loss of high frequency detail.
## The logic
If `prevbezt` and `bezt` are too close it will not draw,
but extend a bounding box with `prevbezt` and `bezt` including handles if needed.
Eventually the keys will be far enough apart to draw.
At this point, draw the center of the bounding box and reset it.
Now because there could be the case where `bezt` in the
current loop is super far out (e.g 5 keys with 1f spacing and the 6th key is at f1000)
we need to recalculate the bounding box again.
In case the keys are far away, just draw normally.
If it is close still, the same process repeats.
Pull Request: https://projects.blender.org/blender/blender/pulls/110788
Items in the node group interface need to have unique identifiers.
Copying an item (socket or panel) was not doing this, so the node groups
end up having sockets with the same identifier. Linking sockets was
broken because copies could not be distinguished.
Pull Request: https://projects.blender.org/blender/blender/pulls/111972
No functional changes
`transform_convert_nla.cc` had a few `if`s within
for loops that could be inverted to remove the indentation.
In addition to that I extracted the snapping functionality
so the `if`s there can also be inverted and return.
Pull Request: https://projects.blender.org/blender/blender/pulls/111968
`draw_handler_add` and `draw_handler_remove` method of bpy.types.SpaceXXX
should be class method not method. However, Python API document does not show
the classmethod.
This PR fixes the Python API document of them.
Pull Request: https://projects.blender.org/blender/blender/pulls/111107
In 2.6 the old method of using bNodeSocket lists in bNodeTree directly
as group sockets was replaced with new group input/output nodes. This
required versioning to create those input/output nodes and then redirect
links to the new node sockets. Because creating nodes relies heavily on
node typeinfo this versioning was done in the `_after_linking` section
of the 2.6 versioning code, running after _all other versioning_
(including for much newer versions!) has already happended.
While typinfo is available at that point, doing such late versioning
causes severe problems when the data structure changes, as is the case
with the recent node panels patch (#111348). The new node group
interface also has versioning code for 4.0, but this runs _before_ the
`_after_linking` code for 2.6! Versioning for node panels expects
sockets in bNodeTree to not have any links pointing at them, but this is
not true for old 2.6 files which have not yet been fully versioned at
that point, because of the late versioning stage. Subsequently 2.6
`_after_linking` code crashes when trying to modify node links with
dangling pointers.
The solution here is to move the old versioning code out of the
`after_linking` stage to restore the expected versioning chain. This
requires creating nodes and node sockets without any typeinfo, but
luckily we only need to create simple known group input/output nodes
which don't have much complicated behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/111704
Part of #91973
Moving the snapping code for the
* Graph Editor
* Action Editor
* and NLA editor
into the common system that lives on the scene.
This includes the Magnet icon for turning
snapping on and off.
The old settings translate to the new in the following way:
* `Frame Step` -> `Frame`
* `Second Step` -> `Second`
* `Nearest Frame` -> `Frame` + `Absolute Time Snap`
* `Nearest Second` -> `Second` + `Absolute Time Snap`
* `Nearest Marker` -> `Nearest Marker`
Since this moves the location of the snapping settings
from the editor to the scene, it changes the behavior.
Previously each editor could have different snapping
settings, where now they are all synced.
Pull Request: https://projects.blender.org/blender/blender/pulls/109015
Loading add-ons after key-maps resolves a problem where add-ons would
setup shortcuts before Blender had created the key-maps.
Making add-ons have to declare the key-maps using region & window types
matching Blender's internal values.
This PR a pitfall pointed out in #110030.
Ref !110092
When estimating widget sizes, ui_text_icon_width_ex() assumes that all
items are using the "widget" text style, which is incorrect for labels.
This PR uses widget_label style for uiItemL_ and the label portion of
ui_item_with_label.
Pull Request: https://projects.blender.org/blender/blender/pulls/111908
This fixes#111767
`In Front` objects remain visible even if they are behind non
`In Front` objects.
It is to be expected then that the snap for them is not occluded as if
they were not `In Front`.
It is not fully clear why the object's material accessor does return
'valid' value for out-of-bound indices. In theory, item getter should
return `false` in such case, and not pretend to give valid data. But
this seems to be expected behavior for materials, according to some
comments in BKE underlying code?
In anycase, valid material slot indices can still return empty ('null')
data, if there is no material assigned to the indexed slot.
So this liboverride-specific code does need extra validation of the item
data returned by index, before trying to access it for name matching.