When running tests `WITH_GTESTS` and `WITH_GPU_DRAW_TESTS` the
GPUShaderCreateInfo's specfically created for the tests could not be
found. This failed running tests on any backend.
This PR fixes this. The root cause what that the name of the compile
directive was incorrect. It should have been `WITH_GTESTS` but was
`WITH_GTEST`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131956
Originally intended to be a code cleanup that makes the code shorter
(part of VSE quality project #130975), but as a side effect many
modifiers are now faster since they no longer do many branches in
the innermost pixel loop.
Main part is having apply_modifier_op that given the "modifier op"
functor object, instantiates the correct processing function based
on type of image (byte vs float) and mask (none, byte, float), for
a total of 6 possible cases. And then a helper like
apply_and_advance_mask that applies mask based on input and result
in a consistent and not "literal copy paste of code" way across the
modifiers.
Brightness/Contrast, Color Balance, Tonemap modifiers were already
optimized to move branches out of inner loops previously; their
performance remains unchanged. Mask modifier performance remains
unchanged; it is very simple and memory bandwidth limited on my
machine.
Other modifiers, tested on 4K resolution, Win10 / Ryzen 5950X, time
in milliseconds taken to apply the modifier calculation, on a byte
image with no mask:
- Curves: 12.1 -> 7.7ms
- Hue Correct: 24.5 -> 15.8ms
- White Balance: 20.5 -> 13.8ms
Same as above, but on a float image with a byte mask:
- Curves: 13.5 -> 12.3ms
- Hue Correct: 19.7 -> 16.4ms
- White Balance: 19.3 -> 15.9ms
Pull Request: https://projects.blender.org/blender/blender/pulls/131736
UNICODE code points were named "ascii" or "cha",
use the term "charcode" as used elsewhere in BLF and FreeType.
Also use char32_t internally and add a utility function to apply the
small-caps flag.
Resolve by welding overaps between adjacent underline glyphs.
Besides avoiding overlap, this makes underlines work better when the
text follows a curve.
Also remove increased underline width which was originally added in [0].
This may have been done to avoid gaps - which is no longer needed.
Further, underlines typically don't extend beyond the glyphs bounds
so the increased width isn't expected behavior.
[0]: a07394ef2c
This adds a new `bl_use_group_interface` property that can be set on custom node
group types. By default it is `true` to avoid this being a breaking change. If
it's set to `false` some UI elements related to the built-in node group
interface are hidden.
Pull Request: https://projects.blender.org/blender/blender/pulls/131877
Refactoring functions out of the 3D text layout funciton was
becoming difficult because vfont.cc mixed API's that use VFont
for different purposes (clipboard, text layout, ID management.. etc).
Split VFont to character & text layout into its own file.
Resolve multiple inconsistencies when 3D text could not load fonts.
- When the font wasn't found:
The default font was used.
- When the font existed but could not be loaded:
The 3D text would fail to display anything.
- When only the VFont assosiated with a style failed to load:
The 3D text would fail to display only when the stype existed.
So toggling bold for example could cause all 3D text to vanish.
Instead of falling back to defaults, display a placeholder glyph
(a hollow rectangle) displayed when the font can't be used.
For the UI fallbacks are fine, for user content, it indicates something
is wrong as needs to be corrected - similar to a bright magenta in
renders when images fail to load. This means it's clear to users when
they have broken paths which need to be corrected.
This also simplifies vfont_to_curve, removing a "goto" to go to the
end of the function to cancel 3D text rendering entirely.
Introduced in 750e3a6fba
The commit above incorrectly passes the `grids` `Span` into the
`calc_front_face` function, causing the calculation to miss vertices in
certain cases, as the function attempts to index instead of reading the
`normals` `Span` directly.
This has the potential to cause crashes too, as the indices of the grid
are not guaranteed to be bounded by the size of the `factors` array.
Pull Request: https://projects.blender.org/blender/blender/pulls/131886
Cursor snapping operators does not support undo/is not designed to be
undo-able, and currently you can't undo moving of the cursor anyway, so
remove the `OPTYPE_UNDO` flag to make it not show in the undo history.
Pull Request: https://projects.blender.org/blender/blender/pulls/131427
This adds material propagation in two places to fix the bug:
* Conversion from legacy to new curves.
* From the main curve input to the output mesh in the Curve to Mesh node.
Pull Request: https://projects.blender.org/blender/blender/pulls/131862
Give the `IDWALK_CB_…` enum an explicit name:
`LibraryForeachIDCallbackFlag`. This way the flags are type-safe, and
it's known where values come from. This is much preferred (at least by
me) to just having `int flags`.
Uses of `0` have been replaced with `IDWALK_CB_NOP` as that has the same
value and is of the right type.
One invalid use of `IDWALK_NOP` was detected by this change, and is
replaced by `IDWALK_CB_NOP`.
This change might be incomplete; I gave the enum a name, fixed the
compiler errors, and then also updated assignments like `int cb_flag =
cb_data->cb_flag`. I might have missed some assignments to `int` though.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131865
Give the `IDWALK_…` enum an explicit name: `LibraryForeachIDFlag`. This way
the flags are type-safe, and it's known where values come from. This is
much preferred (at least by me) to just having `int flags`.
Uses of `0` have been replaced with `IDWALK_NOP` as that has the same value
and is of the right type.
One invalid use of `IDWALK_CB_NOP` was detected by this change, and is
replaced by `IDWALK_NOP`.
This change might be incomplete; I gave the enum a name, and then fixed
the compiler errors.
No functional changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/131865
Supporting a new on_material_import() USDHook callback.
Also added support for import_texture() and export_texture()
utility functions which can be called from on_material_import() and
on_material_export() Python implementations, respectively.
Pull Request: https://projects.blender.org/blender/blender/pulls/131559
Previous method of doing the projection from the spot of the camera
was not reliable (depending on where the view/camera was located).
Instead, use the same ray origin for all methods and define the plane at
the placement location (with the view direction).
This is also easier to read I think.
Pull Request: https://projects.blender.org/blender/blender/pulls/131790
Previous implemenation of 5 < d < 50 was taken from the main paper,
fitting for smaller sizes are found in the supplemental. They are less
forward-scattering.
Pull Request: https://projects.blender.org/blender/blender/pulls/130234
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.
This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.
This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.
Pull Request: https://projects.blender.org/blender/blender/pulls/131761
This PR improves the animation editor's display of node socket property
animation names, and names from geometry nodes modifier inputs. In both
cases, the names currently displayed are not very useful.
For geometry nodes inputs, the we now look up the name of the the input
rather than just displaying the identifier from the IDProperty name.
For node sockets, we now display the name of the socket instead of just
"Default Value" (which is technically the name of the RNA property).
We also display the label of the node if it's available. We also display
node labels instead of names for node properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/131766
Add a comment that documents the assumption that a node tree can only be
embedded by animatable ID types. At this moment this assumption holds.
`blender::animrig::internal::rebuild_slot_user_cache()` uses this for an
optimisation. It fully skips all non-animatable IDs, and would therefore
also not see any hypothetically animated node tree embedded in a
non-animatable ID type.
Pull Request: https://projects.blender.org/blender/blender/pulls/131844
`OtherInlineBufferCapacity <= InlineBufferCapacity` implies
`size <= InlineBufferCapacity` and can be done at compile time.
So if that is true already (as it commonly is), the `else` branch
is not necessary. This can improve performance in theory, although
I couldn't measure that in practice.
Additionally, this change also reduces the binary size (because of the
omitted else branch). Since this code is inlined fairly often, the impact
is measurable: the binary size is reduced by 50kb.
All restriction toggles supports:
- isolating active element with ctrl click
- Recursively set values to child when holding `shift`,
except "exclude" property. Now added support for `exclude` property in
this PR. When clicked on property of active collection, excute
`view_layer__layer_collection_set_flag_recursive_fn`.
Resolves#131366
Pull Request: https://projects.blender.org/blender/blender/pulls/131423
Requesting an icon from an invalid icon ID was always handled
gracefully, resulting in the icon not being shown and an error print in
debug mode. 2b7a968909 caused a null pointer dereference in that case,
leading to a crash.
button created from python (`ui_def_but_rna`) does not seem to assign
free/copy callbacks to the menu with rnaprop. So instead of an assert
check, assign callback functions in `ui_but_rna_menu_convert_to_menu_type`.
Pull Request: https://projects.blender.org/blender/blender/pulls/131719
Instead of using `BKE_library_foreach_ID_link()` as a way to find
embedded IDs in a generic way, explicitly just get the embedded node
tree. That's the only animatable embeddable ID anyway. And calling
`BKE_library_foreach_ID_link()` can have some unwanted side-effects
(especially when the rebuilding happens while already using a similar
function to loop over IDs).
Pull Request: https://projects.blender.org/blender/blender/pulls/131807