Commit Graph

105543 Commits

Author SHA1 Message Date
Campbell Barton 0ec50b56ad Extensions: add option to enable/disable an extensions repo
Note that this option isn't used from Blender, it's up to
scripts that use extensions repositories to respect the setting.
2023-12-19 18:11:17 +11:00
Campbell Barton dfce570198 Cleanup: move extensions flag to DNA_userdef_types.h, rename flag 2023-12-19 18:11:15 +11:00
Campbell Barton 69d22a42d0 Fix #116297: Context override error passing in a window without a screen
When overriding the contexts window but not the screen, the context
override would attempt to use the current screen with the new window.

This raised an error and could crash when editing properties in the
key-map editor for the "context toggle" operator.
2023-12-19 11:09:28 +11:00
Campbell Barton 9f05144fc9 Cleanup: specify defines for enum values stored in blend-files 2023-12-19 10:19:20 +11:00
Campbell Barton 7949b68e5e Cleanup: remove unused include 2023-12-19 10:17:50 +11:00
Campbell Barton 866d092994 Cleanup: use doxygen comments for usd.h
Avoid awkwardly wrapped multi-line trailing comment.
2023-12-19 10:17:48 +11:00
Campbell Barton 482ba7806d Cleanup: spelling correction: "adjacent" & spelling in comments 2023-12-19 09:54:53 +11:00
Jacques Lucke e51126500e Fix: compile error in debug build
Caused by 8bf73a7a97
2023-12-18 22:46:18 +01:00
Hans Goudey 4ee151e204 Cleanup: Remove unnecessary function and data in PBVH 2023-12-18 15:36:55 -05:00
Hans Goudey 8bf73a7a97 Cleanup: Tweak PBVH grid faces update retrieval
The function really just gives an index mask of all the faces in the
provided nodes. The multires usage of the function didn't need that,
since it just passed all nodes. Also pass the SubdivCCG directly rather
than the PBVH. And rename the function to make this clearer.
2023-12-18 15:29:17 -05:00
Miguel Pozo 25102af766 Fix: EEVEE-Next: Metal shader compilation
Pull Request: https://projects.blender.org/blender/blender/pulls/116310
2023-12-18 20:50:31 +01:00
Iliya Katueshenock c106066900 Geometry Nodes: Improve Shortest Edge Paths node performance
Speedup of node Shortest Edge Paths node by creating an array for
other_edge_vert's and computing them in parallel separate loop.
This also provides better CPU cache by avoiding reading edges in main
loop to find other vertex (which happen multiple time for each vertex).

For cuboid with `700`x`700`x`700` points and `0.066667%` random
selection of `Edge Vertex` this will change `1012.4 ms` -> `618.9 ms`
the in `shortest_paths` function.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/114707
2023-12-18 20:32:14 +01:00
Miguel Pozo 89ec7f5360 Fix #116031: EEVEE-Next: Nishita sky does not work
Add missing sky texture binding to the new draw manager.
2023-12-18 19:36:44 +01:00
Pratik Borhade 592c884e52 Fix #116270: Sculpt: Simplify brush crash
Crash is due to garbage value stored in `vd->cd_vert_mask_offset`
This is because `BKE_pbvh_vertex_iter_begin` is removed so `vd` became
unused/unassigned.

Pull Request: https://projects.blender.org/blender/blender/pulls/116291
2023-12-18 16:33:30 +01:00
Miguel Pozo 97785b6fbb EEVEE-Next: Irradiance Grid smooth transitions
Smooth the transition at grid bounds.

The transition size is fixed at 1 grid cell,
but it may be useful to expose a user setting for controlling this.

Pull Request: https://projects.blender.org/blender/blender/pulls/112842
2023-12-18 16:25:20 +01:00
Hans Goudey 5de57e7001 Refactor: Move evaluate on domain field input to be reusable
This is used in #116066 to find the curve selection on the point
domain without having a user-visible difference in behavior.
2023-12-18 10:06:38 -05:00
Hans Goudey 0ceb272832 Curves: Support View Selected in edit mode
The operator was working in sculpt mode but not object mode. Avoid the
"transverts" abstraction for this since we already have the necessary
positions array and selection readily accessible.
2023-12-18 08:46:25 -05:00
Germano Cavalcante 0b00b360f7 Fix #116058: 'Align Rotation to Target' does not consider object orientation
Correction of 3612e0ef04.

`ElementRotation_ex` only works with matrix in global space.
Therefore convert the vectors to global space.
2023-12-18 10:27:18 -03:00
Philipp Oeser f2cd1873ea Fix #116275: Snap (align to target) crash without valid target location
Caused by 9c2e768f5b

Since above commit, drawing of the normal is not done in
`ED_view3d_cursor_snap_draw_util` anymore [that function checked the
existence of a valid target location], now add the check back.

Pull Request: https://projects.blender.org/blender/blender/pulls/116292
2023-12-18 14:18:39 +01:00
Jeroen Bakker e1cec452da Lookdev: Use Mid Grey for Diffuse HDRI Sphere
When the lookdev balls where initially added we didn't had the
experience community compared to now and reused a value we
used for our default materials.

Nowadays we have actually industry experts asking to use a mid grey
albedo of 18% as that is widely used in the vfx studios. This PR
changes the default diffuse HDRI sphere to be 50% grey.

For references see:
- https://en.wikipedia.org/wiki/Middle_gray

![image](/attachments/f7dc5943-84e9-4aa0-900c-8eb9ddf1f557)

Pull Request: https://projects.blender.org/blender/blender/pulls/116175
2023-12-18 13:43:43 +01:00
Jacques Lucke 00eaddbd51 Geometry Nodes: new Bake node
This adds a new `Bake` node which allows saving and loading intermediate geometries.
Typical use cases we want address with this currently are:
* Bake some data for use with a render engine.
* Bake parts of the node tree explicitly for better performance.

For now, the format that is written to disk is not considered to be an import/export format.
It's not guaranteed that data written with one Blender version can be read by another
Blender version. For that it's better to use proper interchange formats. Better support for
those will be added eventually as well. We also plan an `Import Bake` node that allows
reading the blender-specific baked data independent of the Bake node and at different frames.

The baking works very similar to the baking in the simulation zone (UI and implementation
wise). Major differences are:
* The Bake node has a `Bake Still` and `Bake Animation` mode.
* The Bake node doesn't do automatic caching.

Implementation details:
* Refactored how we create the Python operators for moving socket items so that it also
  makes sense for non-zones.
* The `ModifierCache` stores an independent map of `SimulationNodeCache` and
  `BakeNodeCache`, but both share a common data structure for the actually baked data.
* For baking, the `Bake` node is added as a side-effect-node in the modifier. This will make
  sure that the node is baked even if it's currently not connected to the output.
* Had to add a new `DEG_id_tag_update_for_side_effect_request` function that is used
  during baking. It's necessary because I want to evaluate the object again even though none
  of its inputs changed. The reevaluation is necessary to create the baked data. Using
  `DEG_id_tag_update` technically works as well, but has the problem that it also uses the
  `DEG_UPDATE_SOURCE_USER_EDIT` flag which (rightly) invalidates simulation caches
  which shouldn't happen here.
* Slightly refactored the timeline drawing so that it can also show the baked ranges of
  Bake nodes. It does not show anything for baked nodes with a in Still mode though.
* The bake operator is refactored to bake a list of `NodeBakeRequest` which makes the
  code easier to follow compared to the previous nested
  `ObjectBakeData > ModifierBakeData > NodeBakeData` data structure.
* The bake operators are disabled when the .blend file is not yet saved. This is technically
  only necessary when the bake path depends on the .blend file path but seems ok to force
  the user anyway (otherwise the bake path may be lost as well if it's set explicitly).
* The same operators are used to bake and delete single bakes in `Bake` nodes and
  `Simulation Zones`. On top of that, there are separate operators of baking and deleting all
  simulation bakes (those ignore bake nodes).
* The `Bake` node remembers which inputs have been fields and thus may be baked as attributes.
  For that it uses an `Is Attribute` flag on the socket item. This is needed because the baked data
  may still contain attribute data, even if the inputs to the bake node are disconnected.
* Similar to simulation zones, the behavior of `Bake` nodes is passed into the geometry nodes
  evaluation from the outside (from the modifier only currently). This is done by providing the
  new `GeoNodesBakeParams` in `GeoNodesCallData` when executing geometry nodes.

Next Steps (mostly because they also involve simulations):
* Visualize nodes that have not been evaluated in the last evaluation.
* Fix issue with seemingly loosing baked data after undo.
* Improve error handling when baked data is not found.
* Show bake node in link drag search.
* Higher level tools for managing bakes.

Pull Request: https://projects.blender.org/blender/blender/pulls/115466
2023-12-18 13:01:06 +01:00
Jacques Lucke 2189a34312 Fix: crash when there is no tree logger in geometry nodes 2023-12-18 12:19:13 +01:00
Hoshinova f7e8021b2a Fix #116256: Unintentional override of node type property in API
Rename new noise node type to avoid conflict with node type.

Pull Request: https://projects.blender.org/blender/blender/pulls/116278
2023-12-18 10:35:20 +01:00
Casey Bianco-Davis 1a92fbf31a GPv3: Drawing color conversion
Correctly convert brush color to stroke color when drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/116236
2023-12-18 10:33:37 +01:00
Campbell Barton 62e1059960 Cleanup: variable naming, reduce variable scope 2023-12-18 12:26:39 +11:00
Campbell Barton 8275232614 Cleanup: remove redundant path join for recursive operations on Haiku 2023-12-18 12:09:20 +11:00
Campbell Barton 27fdda2f85 Fix use after free error on abort()
When aborting, the Global shared pointer for memory usage tracking
would be freed before Blender's temporary directory was purged.

Removing the temporary directory would then use MEM_* functions which
accessed the freed memory usage class.

Resolve by using malloc/free for the internal recursive_operation(..)
utility function.

Remove strip_last_slash utility function as it's a specific operation
which can be written in 2 lines & was only used once after this change.
2023-12-18 12:09:19 +11:00
Brecht Van Lommel eaede06456 Fix: crash with sequencer scene strips after previous refactor 2023-12-17 21:07:33 +01:00
Richard Antalik 3d03dbfa4c Cleanup: VSE strips update callback
Split the code, use preconditions, use rather plain language for
function names and add comments where it is not totally obvious, what
the code is supposed to do.
2023-12-17 18:36:54 +01:00
Brecht Van Lommel 84591ac1a7 Cleanup: make format 2023-12-17 16:18:21 +01:00
Jacques Lucke e1d0d70911 Geometry Nodes: refactor storage for socket values
This refactors `SocketValueVariant` with the following goals in mind:
* Support type erasure so that not all users of `SocketValueVariant` have
  to know about all the types sockets can have.
* Move towards supporting "rainbow sockets" which are sockets whoose
  type is only known at run-time.
* Reduce complexity when dealing with socket values in general. Previously,
  one had to use `SocketValueVariantCPPType` a lot to manage uninitialized
  memory. This is better abstracted away now.

One related change that I had to do that I didn't see coming at first was that
I had to refactor `set_default_remaining_outputs` because now the default value
of a `SocketValueVariant` would not contain any value. Previously, it was
initialized the zero-value of the template parameter. Similarly, I had to change
how implicit conversions are created, because comparing the `CPPType` of linked
sockets was not enough anymore to determine if a conversion is necessary.

We could potentially use `SocketValueVariant` for the remaining socket types in the
future as well. Not entirely sure if that helps yet. `SocketValueVariant` can easily be
adapted to make that work though. That would also justify the name
"SocketValueVariant" better.

Pull Request: https://projects.blender.org/blender/blender/pulls/116231
2023-12-17 14:00:07 +01:00
Habib Gahbiche 80ab3338df Compositor: Unify relative translate behavior with realtime compositor
"Relative" in translation means relative to input size and not render size, as described in the user manual.

Pull Request: https://projects.blender.org/blender/blender/pulls/115947
2023-12-17 12:52:00 +01:00
Campbell Barton d2ba632b89 Cleanup: odd line wrapping for doc-string
Caused by C++ migration.
2023-12-17 20:26:33 +11:00
Campbell Barton 950334a02c Cleanup: remove duplicate null check in blf_search_by_mem_name 2023-12-17 16:43:18 +11:00
Campbell Barton 4d965615fc Cleanup: various C++ changes (use ELEM & string copy macros) 2023-12-17 16:25:10 +11:00
Campbell Barton 2b3c379850 Cleanup: use boolean & nullptr literals 2023-12-17 16:04:44 +11:00
Campbell Barton 240b159918 Cleanup: remove unused defines 2023-12-17 16:04:42 +11:00
Campbell Barton 53a51d2148 Cleanup: use color after doxygen parameters 2023-12-17 16:04:40 +11:00
Campbell Barton 225fc6fca7 Cleanup: spelling in comments, correct outdated comment 2023-12-17 16:04:38 +11:00
Campbell Barton 50f929c384 Cleanup: correct struct member comment name
Part of !115011, the underlying member wasn't renamed.
2023-12-17 16:04:36 +11:00
Campbell Barton 4fc553191b Cleanup: quite unused variable warning with CMake 2023-12-17 16:04:34 +11:00
Campbell Barton 6accd8503e Cleanup: format 2023-12-17 16:04:33 +11:00
Hans Goudey 7c423682bc Cleanup: Remove unnecessary namespace specification 2023-12-16 12:54:31 -05:00
Hans Goudey f5adfa6acd Fix: New generic attributes uninitialized after curves draw tool
Add a utility to set attribute values to their default, use it in a few
places that have already done this samething. Also:
- Don't create resolution or cyclic attributes unnecessarily
- Use API function to set new curve's type
- Always create the new selection on the curve domain
- Remove selection before resize to avoid unnecessary work
2023-12-16 12:52:22 -05:00
Hans Goudey 0e8c874166 Curves: Add edit mode tilt control
Adds support for the tilt transform operator and a "Clear Tilt"
operator to mirror the functionality from the legacy curve type.
2023-12-16 12:08:28 -05:00
Hans Goudey 3ddba82716 Cleanup: Remove unused PBVH node pointer
Removed in 47f46637be.
Also remove a lost comment and unused forward declarations.
2023-12-16 11:16:10 -05:00
Hans Goudey 488de130b3 Cleanup: Use FunctionRef for PBVH callbacks 2023-12-16 11:14:25 -05:00
Hans Goudey 3d82c9c239 Cleanup: Move more PBVH code to C++ namespaces
Also remove redundant parts of function names.
2023-12-15 22:51:10 -05:00
Hans Goudey 912c4c60d8 Mesh: Add viewport normals simplify option
Before #108014, toggling "Auto Smooth" was an easy way to disable
evaluation of custom normals and face corner normals for faster
viewport playback performance. Now that corner normals are calculated
automatically as necessary, it's helpful to still have a way to disable
expensive normal computation for faster playback.

This commit adds a "Normals" scene simplify setting. To avoid a bunch
of complexity, it just influences which normals are requested from the
object by viewport rendering. In my tests, skipping calculating at
least doubled viewport FPS in a few test files with a large mesh with
custom normals. This works well because normals are cached and lazily
calculated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113975
2023-12-16 00:18:41 +01:00
Brecht Van Lommel bf97dc14ba Cleanup: make format 2023-12-16 00:02:52 +01:00
Michael B Johnson 5edda6cbcc USD: optionally author subdivision schema on export
USD: optionally author subdivision schema on export

This PR adds support for exporting USD assets which have the subdivision
schema applied. Current behavior prior to this PR is that the effects of
Subdivision Surface modifiers are always applied to their mesh prior to
export, such that it is not possible to recover the original base mesh.

In this PR we provide three options for the subdiv schema type:

Ignore - Export base mesh without subdivision with USD Scheme = None
Tessellate - Export subdivided mesh with USD Scheme = None
Best Match (default) - Export base mesh with USD Scheme = Catmull-Clark

"Best Match" here means that Blender will set a subdiv scheme type in
the exported USD asset when it is possible to closely match the
subdivision surface type that was authored in Blender. At this time
Blender provides two subdivision types: Catmull-Clark and Simple.

Because Simple does not have a corresponding subdivision type in USD, we
do not attempt to convert or represent it, and instead the Simple subdiv
modifier will be evaluated and applied to the mesh during export.

Whenever a Catmull-Clark Subdivision Surface modifier is applied to an
object, and is the last modifier in the stack, it is possible to set the
subdiv scheme to Catmull-Clark for the respective prim in the exported
USD file.

Authored by Apple: Matt McLin

Co-authored-by: Matt McLin <mmclin@apple.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/113267
2023-12-15 21:11:41 +01:00
Richard Antalik 9f0b4344ac Fix #114630: Retiming fails if movie and scene FPS does not match
The main problem is, that retiming key frame index is defined in strip
content space (0 <> seq->len -1), but API functions must rescale this
index by applying `SEQ_time_media_playback_rate_factor_get()` and return
value in timeline space.

This wasn't done properly, in many places, some had challenges:
- `SEQ_retiming_key_timeline_frame_get()` returned floats, but UI
  expects integers. Otherwise keys may be drawn inbetween frames.
- Function `right_fake_key_frame_get()` must return  exact frame of
  keys, otherwise lookup by frame would fail. But `retime_key_draw()`
  can not compensate position of last fake key, so this has to be done
  in `fake_keys_draw()` and `try_to_realize_virtual_key()`.
- For transformation to work as expected, double precision value has
  to be used for frame index.
- For UI either API would had to be extended to provide helper functions
  to deal with FPS mismatch, or it needs to know the FPS difference.
  I have opted to put `SEQ_time_media_playback_rate_factor_get()` in
  "public" headers. Neither solution is great.
2023-12-15 21:01:44 +01:00
Aras Pranckevicius 5eb5712329 ffmpeg: restore compatibility with pre-5.0 versions
Only do threaded sws_scale_frame when using ffmpeg 5.0 or later.
On earlier versions continue using the single threaded path.

Pull Request: https://projects.blender.org/blender/blender/pulls/116226
2023-12-15 19:29:57 +01:00
Bastien Montagne 13148cdf39 Fix: (studio-reported) crash in Solidify Modifier code.
Regression from b52a071e7a, mistakenly replaced the destination by the
source mesh for some data (like face material indices attribute).
2023-12-15 18:15:39 +01:00
Hans Goudey 3fb6397b79 Cleanup: Remove extern "C" from mesh C header
We're in a strange half-transitioned state with this header.
In the meantime, removing this helps simplify some refactors.
2023-12-15 10:35:06 -05:00
Christoph Lendenfeld 3b1fd5d965 Cleanup: remove unused variable
The variable was missed in a previous
refactor commit.
2023-12-15 16:00:01 +01:00
Christoph Lendenfeld 6cb2ad7b39 Refactor: extract code from ANIM_apply_keyingset
No functional changes.

Extracting the section inside the `LISTBASE_FOREACH`
that inserts keyframes based on a `KS_Path`.
This moves variables closer to where they are used and
will allow to simplify the code later.

This also improves variable names by spelling out
the words instead of using abbreviations.
e.g. `ks` -> `keying_set`

Pull Request: https://projects.blender.org/blender/blender/pulls/116224
2023-12-15 15:53:35 +01:00
Philipp Oeser ff7b8f3412 Fix #116188: Symmetry breaks the Puff hair sculpting tool
Caused by 1b19f62917 .

Above commit didnt max the weight for each curve for each symmetry run
(so was just using the max it found for each run, overwriting the
previous run).

Pull Request: https://projects.blender.org/blender/blender/pulls/116221
2023-12-15 15:46:38 +01:00
Campbell Barton 9097f1c62d Cleanup: unhyphenate track-pad & thumb-stick
Both are typically written without hyphenation, add to local dictionary.
2023-12-15 22:57:34 +11:00
Aras Pranckevicius 422dd9404f ffmpeg: multithreaded conversion from RGBA into encoding format
Whenever movie frame encoding needs to be in non-RGBA format (pretty much
always, e.g. H.264 uses YUV etc.), the ffmpeg code has been using
sws_scale() since 2007. But that one is completely single threaded.

It can be multi-threaded by passing "threads" option to SwsContext
(in a cumbersome way), combined with sws_scale_frame API. Which however
requires frame data buffers to be allocated via AVBuffer machinery.

Rendering a 300-frame part of Sprite Fright Edit (target H.264 Medium):

- Windows Ryzen 5950X: 16.1 -> 12.0 seconds (generate_video_frame part
  4.7 -> 0.7 sec).
- Mac M1 Max: 13.1 -> 12.5 sec. Speedup is smaller, but comparatively,
  entirely other part of movie rendering (audio resampling inside audaspace)
  is way more expensive compared to the windows machine.
2023-12-15 12:35:59 +01:00
Antonio Vazquez 926854ddc4 GPv3: Material Render Preview
This adds support for material previews for GPv3.

Pull Request: https://projects.blender.org/blender/blender/pulls/115985
2023-12-15 11:50:48 +01:00
Bastien Montagne c23b51d614 Fix #116193: Assert on selecting object in outliner.
The asserts added in b840ba1f59 revealed the bug, which was passing the
wrong Scene pointer to `BKE_view_layer_synced_ensure` in affected code.

Issue likely introduced in 68589a31eb, was probably never actually a
crash-case because the viewlayer would always be in sync already when
this was called from the Outliner (besides perhaps some extremely rare
edge cases).

To be backported to potential bugfix release of 4.0 together with
b840ba1f59 commit.
2023-12-15 10:36:44 +01:00
Lukas Tönne 92cf9dd2f2 ID properties: Support enum values with items
Add support for enum values in ID properties.

This is needed for the "Menu Switch" node implementation (#113445) which
relies on ID properties for the top-level modifier UI.

Enums items can optionally be added to the UI data of integer
properties. Each property stores a full set of the enum items to keep
things simple.

Enum items can be added to properties using the `id_properties_ui`
function in the python API. A detailed example can be found in the
`bl_pyapi_idprop.py` test.

There is currently no support yet for editing enum items through the UI.
This is because the "Edit Property" feature is implemented entirely
through a single operator (`WM_OT_properties_edit`) and its properties.
Buttons to add/remove/move items would be operators changing another
operator's properties. A refactor of the custom properties UI is likely
required to make this work.

Pull Request: https://projects.blender.org/blender/blender/pulls/114362
2023-12-15 10:20:44 +01:00
Campbell Barton 7346727cfc Fix #116215: Sequencer crashes unlinking packed text
[0] caused a regression looking up fonts by filepath.

[0]: d770fd5ac4
2023-12-15 20:13:40 +11:00
Hans Goudey c8aecac001 Cleanup: Remove unused sculpt code
Remove abstract edge and face types. The design is to not abstract away
the code data structures like this and focus on sharing code more with the
rest of Blender rather than within sculpt mode.
2023-12-14 18:25:20 -05:00
Hans Goudey b3aca5b28f Cleanup: Simplify PBVH build process slightly
Before this happened as two steps: first allocating the PBVH with a type,
then calculating the BVH and filling it with data. This just confused things,
so change to allocating the struct when building it. Also move the functions
to the C++ namespace, and fix some cases of requiring the PBVH to be set
when it wasn't yet.
2023-12-14 18:20:46 -05:00
Harley Acheson 8c6898c04d Fix #116135: Ensure blf_font_width_to_rstrlen always works
If the string is shorter than the cut-off length, ensure we always
exit cleanly when we iterate to the very start of the string.

Pull Request: https://projects.blender.org/blender/blender/pulls/116208
2023-12-14 23:19:08 +01:00
Hans Goudey 87e8a282bc Fix: PBVH has face sets check ignored for BMesh 2023-12-14 15:41:02 -05:00
Hans Goudey 4c1f766d0d Cleanup: Remove unnecessary PBVH threading settings function
There were just two more places using the C threading API in sculpt code.
Switch them to the C++ API and remove the settings function.
2023-12-14 15:39:33 -05:00
Hans Goudey ce4ec6d42b Cleanup: Tweak PBVH node face indices functions, add comments 2023-12-14 15:31:12 -05:00
Hans Goudey 71b6f0ecbe Cleanup: Pass vertex update array as argument when building PBVH
To prepare for potentially not storing this array in the PBVH.
2023-12-14 15:13:52 -05:00
Hans Goudey 1d94003660 Cleanup: Remove unnecessary sculpt visibility update
Mainly for semantic reasoning-- these face set gestures don't change visibility.
2023-12-14 15:06:08 -05:00
Hans Goudey f15bca64f2 Cleanup: Remove useless PBVH update function
This `update_vertex_data` only found nodes with the color update
tag and also added redraw tags. But whenever nodes are marked
for a color update, those redraw tags are already set anyway.
It appears this was meant to solve problems switching active
color attributes during undo and redo, but it doesn't make a
difference when this function is removed.
2023-12-14 15:01:27 -05:00
Hans Goudey 262572a6a0 Cleanup: Move PBVH update functions to C++ namespace 2023-12-14 14:56:25 -05:00
Hans Goudey 5be9a1cce4 Cleanup: Slightly simplify some loops in delaunary triangulation
Use a local variable for the faces, use range based for loops.
2023-12-14 12:40:46 -05:00
Hans Goudey 34bf1f6c0c Cleanup: Slightly simplify delaunay triangulation input gathering
Separate allocation of input arrays and assignment to input class.
The main purpose is to simplify #111061.
2023-12-14 12:40:46 -05:00
Hans Goudey bb2a289a9a Cleanup: Use utility function to calculate face normal
Rather than inlining all the logic into OBJ export code
2023-12-14 12:40:46 -05:00
Miguel Pozo 9bf942dcc9 Cleanup: Conver macros into functions
Avoids macro redefinition warnings in unity builds.
2023-12-14 18:34:20 +01:00
Iliya Katueshenock 999c0f6878 Cleanup: Fix compiler warning in face group boundaries node
Fix error of wrong parameter for `compare_exchange_weak`. Second
one parameter is used for write new value, but a mistake occurred and
the wrong parameter (for read) was used. Default param is enough for
this, so just delete last one.

Pull Request: https://projects.blender.org/blender/blender/pulls/116010
2023-12-14 18:32:21 +01:00
Sybren A. Stüvel b5e7e6b214 Cleanup: Anim, add explanation to bone collection assign operator
Just a little explanation of the code, because I got confused by my own.

No functional changes, except for the addition of a `BLI_assert_msg()`.
2023-12-14 18:07:10 +01:00
Hans Goudey a494d6a641 Cleanup: Remove unnecessary C API for delaunay triangulation
The only user was the Python API. Convert that to use the C++ API.
That simplifies things a bit even, since the encoding of "arrays of arrays"
is a fair amount simpler with the C++ data structures. The motivation
is to simplify the changes from #111061.
2023-12-14 11:40:06 -05:00
Aras Pranckevicius 5cac8e2bb4 VSE: reduce effects code duplication, making gaussian blur faster in the process
Now that the code is in C++, quite some duplication between "byte" and
"float" effect code paths can be reduced (easier than it was in C times).
So I did that, removing about 400 lines of code.

In that process I accidentally made Gaussian Blur faster, since while
reducing the amount of code I noticed it was doing some things
sub-optimally (calculated kernel tables for each job, etc.). Applying
100x100 gaussian blur on 4K UHD resolution image strip on Ryzen 5950X
went 630ms -> 450ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/116089
2023-12-14 17:31:05 +01:00
Jeroen Bakker 4a34dcbb69 Studiolight: Free Resources for Unused Lights.
Studio lights based on image resources are kept in memory, even when only
displayed as an icon. When having many studio lights configured
leads to allocating a lot of memory that are not used.

This patch free image resources when only icons are requested.
For studio lights that are used in a viewport the image resources are kept.

Pull Request: https://projects.blender.org/blender/blender/pulls/116191
2023-12-14 16:17:55 +01:00
Hans Goudey 451aa56d9c Cleanup: Move BLI_delaunay_2d.hh to C++ 2023-12-14 10:05:35 -05:00
Hans Goudey 5b053204ed Fix #116017: Mesh edit mode vertex slide allocation ignores alignment
`float4x4` requires 16 byte alignment. The compiler can add padding
within the struct, but the allocation needs to know about the alignment
too. Fix by using an allocation function that handles this properly.
2023-12-14 09:30:19 -05:00
Aras Pranckevicius 1e0bf33b00 ImBuf: optimize IMB_transform
IMB_transform is used by Sequencer (and other places) to do image
translation/rotation/scale on the CPU. This PR speeds up parts of it,
particularly when bilinear filtering is used. No behavior changes are
expected.

- Don't use virtual function calls inside inner loop. The code was using
  class hierarchies with virtual calls just to do equivalent of "outside
  of image? ignore" and "wrap UV coordinates or not?" decisions. Make those
  use non-virtual function based code.
- Simplify pixel sampling functions to only do the work as needed by
  anything within Blender codebase. For example, bilinear sampling of uchar
  images always uses 4 RGBA channels and never does "UV wrap" logic.
- Bilinear interpolation uchar: completely branchless SIMD code now.
- Bilinear interpolation float: 2x floor() calls instead of 4x floor() +
  2x ceil(), and final sample blending is done with SIMD.

Sequencer at 4K UHD resolution, with two image strips that need a transform,
playback framerate:

- Windows Ryzen 5950X: 18.7fps -> 26.2fps (IMB_transform time per frame goes
  26.3ms -> 11.2ms)
- Mac M1 Max: 27.3fps -> 31.4fps

At that point the IMB_transform is not the slowest part of where playback
takes time (but rather sequencer effect application etc.).

Note: the amount of _actual code_ got a bit smaller. But I've added 100 lines
of unit tests in BLI_math_interp_test.cc, the bilinear interpolation
functions were only tested very indirectly by CPU compositor template
image tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/115653
2023-12-14 15:10:30 +01:00
Jeroen Bakker a52a362527 Studiolights: Remove Unused Options
Studio lights had gone over several iterations during 2.80. Some
unused options where still in the code, but not used.

This PR cleans up the studio lights to options that are still in use.
Removing:

- Spherical Harmonics: It was used by workbench, but was replaced
  by regular OpenGL lights
- Irradiance textures: Was used by an old eevee world light evaluation
- Cached data files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116186
2023-12-14 14:29:28 +01:00
Christoph Lendenfeld 915358f8b6 Cleanup: Remove unused EnumPropertyItem
The channel_bake_remove_options were forgotten
to be removed. They were no longer in use after
addressing review comments.
This fixes the compiler warning.
2023-12-14 14:21:16 +01:00
Christoph Lendenfeld 1e931f5bd7 Anim: Bake Channel operator
This is a replacement for the workflow that uses
"Bake Curve" and "Unbake Curve" to quickly generate
dense key data.

Compared to the existing workflow it has the advantage
of allowing the user more control over the key types,
and distance between keys, as well as the frame range affected.

Operator options

* Range: the range that will be baked.
Defaults to the scene range or preview range.

* Step: Distance between keyframes.
Can be used to bake on 2s or even bake to subframes.

* Remove Existing Keys: Boolean option that
if enabled also removes keys outside the specified baking range

* Interpolation Type: Choose a interpolation mode used
for new keys e.g. Constant or Bezier

* Bake Modifiers: If enabled bakes the effect of the
modifier stack to keys and deletes the modifier stack.
If false, the code disables the modifiers before baking,
so the resulting keys will behave as if the modifiers didn't exist

The operator can be found in the Graph Editor under `Channel->Bake Channels`

Part of: #111050

Pull Request: https://projects.blender.org/blender/blender/pulls/111263
2023-12-14 11:35:25 +01:00
Christoph Lendenfeld 9bfd7debcd Refactor: Move ED_id_action_ensure to animrig
No functional changes.

Move the function ED_id_action_ensure to animrig,
and rename it to `id_action_ensure`.
This is in order to reduce references from animrig
to the editor code.

Pull Request: https://projects.blender.org/blender/blender/pulls/116101
2023-12-14 10:17:18 +01:00
Christoph Lendenfeld 92ad16ab90 Anim: Don't use keying sets when inserting keyframes during autokeying
Prior to this PR, the autokeying system used keying sets
to insert keyframes where required.

With the functions introduced in #113504
the code can be simplified and made to not rely on keying sets,
allowing autokeying to also insert keys by rna path directly.

This also removes all the code related to "Insert Needed" from autokeying.
The insert key functions deal with that now, all that is needed is to pass
in the flag.

Part of #113278

Pull Request: https://projects.blender.org/blender/blender/pulls/115522
2023-12-14 09:04:09 +01:00
Omar Emara a8e13994b8 Realtime Compositor: Implement Cryptomatte node
This patch implements the Cryptomatte node for the Realtime Compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/115884
2023-12-14 08:49:41 +01:00
Jason Fielder 2db12cc049 Fix #116121: Resolve framebuffer resize issue in Metal
Changing size of framebuffer attachments would
throw an assertion as framebuffer size was not
correctly reset to zero. Zero allows any size
to override the current if there are no set attachments.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/116162
2023-12-14 08:09:03 +01:00
Campbell Barton 410e202e2d Cleanup: quiet parentheses warning 2023-12-14 13:52:31 +11:00
Hans Goudey e5cb2b2798 Fix #116141: Missing task isolation when storing sculpt undo node
We shouldn't use parallelism internally for each node, but it snuck in
with recent changes to use `array_utils::gather`. That's a nice change,
but we need a better way to turn off parallelism for that sort of
function. Until that's decided on, add a quick fix to fix the deadlock.
2023-12-13 21:46:32 -05:00
Campbell Barton 3241db35cd Docs: correct code comment for LaplacianSystem::tris
Also use doxygen doc-strings as they more easily allow comments to be
expanded on.
2023-12-14 12:51:21 +11:00
Campbell Barton bff5ffc09b Cleanup: use naming for the size of a looptris array 2023-12-14 12:51:20 +11:00
Campbell Barton 664b49c2ef Cleanup: replace C expressions with plain text in cloth errors
Also remove the print as BKE_modifier_set_error prints a warning.
2023-12-14 12:51:19 +11:00
Campbell Barton 0d9acf84c6 Cleanup: match argument naming for headers/source 2023-12-14 12:51:18 +11:00
Campbell Barton 944e0483a6 Cleanup: clarify naming for MLoopTri
The term `looptri` was used ambiguously for both single & arrays.
The term `tri` was also used, causing `tri->tri`.

Use terms:

- `looptris` for an array or when dealing with multiple items.
- `looptri` is used when dealing with a single item.
- `lt` for a single MLoopTri variables & arguments.

This was already a convention but not followed closely.
2023-12-14 12:32:11 +11:00
Campbell Barton 931b2554e2 Refactor: move BEZKEYTYPE define to DNA
Recently this was inlined [0] however the purpose of this define is to
allow for the method of setting the value to be changed.
It also means the hack doesn't have to be explained whenever it's used.

Move the BEZKEYTYPE to DNA, update it's doc-string and restore the
original comment.

[0]: fd3629b80a
2023-12-14 11:20:27 +11:00
Campbell Barton d8ffa648eb Cleanup: merge doc-strings, correct comments in WM_api.hh 2023-12-14 11:18:06 +11:00
Campbell Barton a4af406b81 Clenaup: spelling in comments 2023-12-14 11:14:50 +11:00
Campbell Barton adb74ad0f3 Cleanup: follow convention for naming array lengths
In the context of meshes `totface` reads as if its the number of faces
in the mesh. This was infact the number of looptris however as this
is converted into a "bodyface" array, use that as the prefix.
2023-12-14 11:10:33 +11:00
Campbell Barton 173a4dfbb6 Fix invalid size of allocated looptris array
Regression in [0], moving to C++ types.

[0]: 321c1af26e
2023-12-14 11:08:35 +11:00
Hans Goudey cdb2f1e1ba Fix #116140: GPU subdivision ignores completely smooth shading
Extraction of data is done in a different order for GPU subdivision
drawing. The necessary normals domain of the mesh has to be
retrieved before that.
2023-12-13 18:59:28 -05:00
Harley Acheson 463dc4dbec Fix #116137: Overflow causing event time false positive warnings
The intent of `ghost_event_proc_timestamp_warning` is to give a console
warning when an event time is outside of an expected 5 second window
around the last time. However if an event happens within the first 5
seconds we get an overflow in a calculation and we get warnings for
normal times within the range.

Pull Request: https://projects.blender.org/blender/blender/pulls/116164
2023-12-13 22:45:50 +01:00
Richard Antalik f372ac6f61 VSE: Keep exiting retiming when changing speed
Add "Preserve Current Retiming" option to set speed operator. This
option is enabled by default. When changing speed of retiming segment,
the strip changes length instead of changing next segment speed.

Ref: #112343
2023-12-13 20:45:49 +01:00
Richard Antalik 5092fe60e6 VSE: implement selection of "linked" retiming keys
This feature improves workflow, where it is necessary to select all
retiming keys after one that is selected in order to change speed of
only 1 segment.

The feature is reusing `sequencer.select` "linked time" feature and
mapped Ctrl key.

Ref: #112343
2023-12-13 20:45:16 +01:00
Miguel Pozo 8e9ce4d03d Fix: EEEVEE-Next: Volume lighting
Fix socket_not_white and socket_not_black logic.
(Volume lighting would be disabled if any scatter channel was 0)
Remove unnecesary clamps.
2023-12-13 19:49:31 +01:00
Miguel Pozo 937c4ed2c4 Fix: from_up_axis sign
Same as 6c40adcc36
Fixes the case where up.z == 0
2023-12-13 19:27:30 +01:00
Bastien Montagne 60a9c8ee25 Fix #115486: Linked scenes disappear after reopening file.
Caused by 133dde41bb, it is expected behavior now for linked ID in
general, see also #105786 and #106321.

However, Scenes are a special case here, since they are almost never
(and should not be) indirectly linked by other data, and have (almost)
never any real user, unless they are active in one of the open main
windows.

So this commit essentially reverts the new behavior implemented
in #106321, for linked scenes only.

Should be backported to a potential bugfix release of 4.0.
2023-12-13 18:50:07 +01:00
Bastien Montagne b840ba1f59 Fix (unreported) crash when trying to link/append while a linked scene is active.
Link/append code sets the scene pointer to `null` when the active
scene is a linked one, to avoid attempt to instantiate linked data
(objects or collections) into a linked scene, which is forbidden.

However, code was still calling some functions expecting a valid scene
pointer, leading to crash.

It is unclear when exactly this issue was introduced code wise. From a
user perspective, it seems to have been revealed between 3.6 and 4.0
release (bisect points at 00a36cbf24, which does not seem to be
directly related...).

In any case, the fix is trivial and safe, so should we do another 4.0
bugfix release, this commit should be backported.
2023-12-13 18:34:13 +01:00
Miguel Pozo 6c40adcc36 Fix: GPU: from_up_axis
glsl sign can return 0.
Fixes surfels display when normal.z == 0.
2023-12-13 17:47:48 +01:00
Jacques Lucke f7383cfe9b Geometry Nodes: use dynamic declaration for switch node
Follow up for 8149678d5e. Significantly reduce boilerplate
required for each type in the switch node.Forward compatibility in 4.0
provided by 0ea193bdb3.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/113413
2023-12-13 17:33:25 +01:00
Hans Goudey 65252564ee Fix #116025: Uninitialized value when versioning old node trees
Usually we expect new DNA values do be zeroed when we add them. But the
conversion to the interface format for 4.0 didn't clear the memory, so
behavior was different when updating old files. Fix that by using
`calloc` instead of `malloc`.
2023-12-13 11:24:39 -05:00
Miguel Pozo 7e4c2b2649 Fix: EEVEE-Next: DeferredProbelLayer emissive materials 2023-12-13 17:02:05 +01:00
Iliya Katueshenock 51bb3247b4 Fix #116144: Tag update relations for Active Camera node
Missed part of 75f160ee96

Pull Request: https://projects.blender.org/blender/blender/pulls/116152
2023-12-13 16:24:25 +01:00
Hans Goudey 96dff1d3ce Fix: Warnings and build error after previous forward declaration commit 2023-12-13 10:16:07 -05:00
Hans Goudey e657aa2360 Cleanup: Move two mesh functions to C++ header 2023-12-13 09:50:47 -05:00
Hans Goudey 6a1009c9f8 Cleanup: Remove const for Span and by-value types in headers 2023-12-13 09:39:03 -05:00
Hans Goudey 30d95966d5 Cleanup: Forward declare some classes in mesh headers
Aiming to reduce cases of including headers in headers,
when the final definition might be unnecessary.
2023-12-13 09:18:39 -05:00
Hans Goudey 766b0ce820 Fix #116122: Frame Selected/All operators incorrectly frame view
`BKE_object_minmax` is expected to update the min and max, not just set them.
2023-12-13 08:40:21 -05:00
Hans Goudey 4c1817e76f Cleanup: Un-inline mesh data access functions
These shouldn't be called in hot loops at all, and mostly aren't
anymore anyway. Definining them outside of a header allows removing
the `BKE_customdata.hh` include from `BKE_mesh.hh`.
2023-12-13 08:40:21 -05:00
Hans Goudey b52a071e7a Cleanup: Remove unnecessary Mesh C-API functions
Like mentioned in the docstrings, use the C++ API or access methods
in C++ code.
2023-12-13 08:40:21 -05:00
Philipp Oeser 65274dc096 Fix #116130: Mirrored custom normals broken again
Caused by c53e220aef

Above commit was working on the `mesh` (not the `result`) -- basically a
typo...

Pull Request: https://projects.blender.org/blender/blender/pulls/116134
2023-12-13 13:51:56 +01:00
Jacques Lucke 5519a48702 Cleanup: remove unnecessary alias 2023-12-13 13:46:21 +01:00
Jacques Lucke 3370228ae8 Geometry Nodes: rename ValueOrField to SocketValueVariant
Doing this in preparation for also supporting volume
grids in the same type (#115270).

At some point we could also actually use an `std::variant` in this
type, but that would change behavior without futher changes.
2023-12-13 13:40:40 +01:00
Jacques Lucke 1a4f4104d1 Cleanup: rename dynamic paint specific volume grid
Doing this to avoid name clashes with the more used `VolumeGrid` type.
2023-12-13 13:13:15 +01:00
Bastien Montagne f01bc93bcf Cleanup: Move `BKE_blendfile` headers to CPP. 2023-12-13 12:36:45 +01:00
Bastien Montagne fb8bf8b0c8 LibOverride: Modify automatic handling of which IDs to override in a hierarchy.
The previous behavior, fairly rough, was simply considering all
Collections and IDs found as part of the root's hierarchy as to be
overridden.

The new behavior is based on a specific tag added to some ID usages.
Currently, these are only the links from a Collection to its Objects
and children Collections, and the link from an Object to its parent.

The goal of this huge reduction of the 'automatically overridden' set of
data in a hierarchy is to avoid creating liboverrides for 'utils' data,
e.g. a collection used as source of data by a GeometryNode generating
some parametric geometry (Blender Studio use-case: some form of LOD
handling).

In general, it means that only Collections and objects part of the
collection hierarchy of the root collection are now overridden.

This should not change in the typical recommended use-case so far (where
there is a clear root collection to the whole overridden hierarchy, and
it contains all related collections and objects).

But this should allow much less overhead (and viewport pollution, due to
the current principle that local (and therefore liboverridden) objects
have to be instanciated in a Scene) for more complex setups.

Note that the initial idea/change is fairly simple and easy to
implement, but it creates some additional complexity in the partial
resync code, since now some linked data may not be detected as needing
a liboverride anymore when processing a sub-hierarchy, while it would
require it when processing the whole hierarchy.

This required adding some more processing to the util functions which
define which ID should be overridden. It essentially creates a
'reference set' of all reference IDs that should be overridden when
the whole hierarchy is considered, and use this as additional input to
decide which ID to override when processing a sub-hierarchy for the
partial resync.

Pull Request: https://projects.blender.org/blender/blender/pulls/115853
2023-12-13 11:58:54 +01:00
Omar Emara 048f70e7c2 GPU: Add function for setting float array uniforms 2023-12-13 12:52:49 +02:00
Omar Emara 123da3412b Cleanup: Move Cryptomatte node defines into enums 2023-12-13 12:40:34 +02:00
Omar Emara 931c188ce5 Compositor: Refactor File Output node
This patches refactors the compositor File Output mechanism and
implements the file output node for the Realtime Compositor. The
refactor was done for the following reasons:

1. The existing file output mechanism relied on a global EXR image
   resource where the result of each compositor execution for each
   view was accumulated and stored in the global resource, until the
   last view is executed, when the EXR is finally saved. Aside from
   relying on global resources, this can cause effective memory leaks
   since the compositor can be interrupted before the EXR is written and
   closed.
2. We need common code to share between all compositors since we now
   have multiple compositor implementations.
3. We needed to take the opportunity to fix some of the issues with the
   existing implementation, like lossy compression of data passes,
   and inability to save single values passes.

The refactor first introduced a new structure called the Compositor
Render Context. This context stores compositor information related to
the render pipeline and is persistent across all compositor executions
of all views. Its extended lifetime relative to a single compositor
execution lends itself well to store data that is accumulated across
views. The context currently has a map of File Output objects. Those
objects wrap a Render Result structure and can be used to construct
multi-view images which can then be saved after all views are executed
using the existing BKE_image_render_write function.

Minor adjustments were made to the BKE and RE modules to allow saving
using the BKE_image_render_write function. Namely, the function now
allows the use of a source image format for saving as well as the
ability to not save the render result as a render by introducing two new
default arguments. Further, for multi-layer EXR saving, the existent of
a single unnamed render layer will omit the layer name from the EXR
channel full name, and only the pass, view, and channel ID will remain.
Finally, the Render Result to Image Buffer conversion now take he number
of channels into account, instead of always assuming color channels.

The patch implements the File Output node in the Realtime Compositor
using the aforementioned mechanisms, replaces the implementation of the
CPU compositor using the same Realtime Compositor implementation, and
setup the necessary logic in the render pipeline code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113982
2023-12-13 11:08:03 +01:00
Philipp Oeser 105db1a06e Fix #115907: Select similar edge direction skips opposite direction
As I dont quite get the logic of "enforcing a positive quadrant" from
b38be90515 (which broke the previous behavior of 2.79 which was
capable of handling reversed edges as well -- there might be ways to
make that work though), now use the alternative approach of storing the
flipped direction in the kdtree as well.

This has a slight performance hit (only noticable at ~500k edges), but I
believe correctness beats performance here.

Pull Request: https://projects.blender.org/blender/blender/pulls/115951
2023-12-13 10:30:48 +01:00
Kenzie 3f485c8bf3 Geometry Nodes: add support for blackbody shader node
This adds the existing Blackbody shader node to geometry nodes, with the
same functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/114768
2023-12-13 10:10:06 +01:00
Omar Emara 23df139aaf IMB: Read single-layer XYZ channels as a combined image
Currently, the OpenEXR reader can't read single-layer XYZ images as a
combined image. Single-view images will only read the X channel, while
multi-view images will interpret the Z as a depth image and the Y and Z
channels will be treated as float passes.

This patch allows the reading of XYZ channels as combined images. For
single-view images, we just extend the RGB-like channel names we match
to contain XYZ. For multi-view images we only treat the Z channel as a
Depth one if no X and Y channels exists, since the Z in this case is
part of the XYZ image.

Pull Request: https://projects.blender.org/blender/blender/pulls/115290
2023-12-13 10:01:10 +01:00
Omar Emara 356480fabb Realtime Compositor: Add static cached images
The Realtime compositor currently relies on the GPU cache in image IDs.
That cache only supports single layer images, so multi-layer images will
be acquired without a cache, introducing significant IO bottlenecks for
the GPU compositor.

This patch ignores the image GPU cache and stores the images in the
static cache manager of the compositor. Draw data was introduced to the
image ID for proper cache invalidation, like other IDs such as masks.

The downside is that the cache will no longer be shared between EEVEE
and the compositor. But realistically, images are not typically shared
between materials and compositors.

This is just a temporary solution until we have proper GPU storage
support for image buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/115511
2023-12-13 09:50:42 +01:00
Campbell Barton c9a810db58 WM: correct error printing for suspicious time-stamps
Future/past were swapped & include the literal uint64 value as it's
useful to know the invalid value when debugging.
2023-12-13 14:58:58 +11:00
Clément Foucault 4aff321af5 Fix: EEVEE-Next: Broken surfel lighting
This was caused by #113257 which removed the
simple ltc evaluation usage. This in turn
caused a precision issue for the cases where
V == N and surfel lighting was one of them.

Adding a special case fixes the issue.
2023-12-13 04:06:37 +01:00
Jesse Yurkovich a7ed0e25ca USD: Apply MaterialBindingAPI to Curves with materials
For Curves having materials, make sure to apply the MaterialBindingAPI
to their prims during export.

Pull Request: https://projects.blender.org/blender/blender/pulls/116078
2023-12-13 03:07:29 +01:00
Clément Foucault 7f8763d823 Fix: EEVEE-Next: OpenGL errors in probe capture
Was caused by missing / incorrect bindings.
Reuse the same gbuffer setup for all deferred
layer to avoid this problem later on.
2023-12-13 02:47:40 +01:00
Clément Foucault ac11ccd2bd EEVEE-Next: Add Translucent BSDF support
This adds support for Translucent BSDF.

This also fixes a bug to allow correct
shadowing.

The input normal had to be set back to
non-inverted in the node function to allow
for correct interpretation of the Normal
by Screen Space Reflections.

This add the necessary optimization
and code deduplication to hybrid deferred
and forward pipeline.

Pull Request: https://projects.blender.org/blender/blender/pulls/116070
2023-12-13 02:19:19 +01:00
Campbell Barton 7ad2c71a0a Cleanup: remove redundant clamp with BLI_str_utf8_offset_from_index 2023-12-13 12:14:47 +11:00
Campbell Barton 2d171aa612 Tests: ensure BLI_str_utf8_offset_from_index index is logically clamped
Callers to this function were clamping the index which isn't necessary.

Update doc-string & tests to reflect this.
2023-12-13 12:14:29 +11:00
Hans Goudey 768cd9b763 Cleanup: Remove inline functions and extra includes from draw extraction 2023-12-12 20:08:30 -05:00
Hans Goudey 79ade784b8 Cleanup: Move draw_manager_text.h to C++ 2023-12-12 19:49:26 -05:00
Clément Foucault c1130ee782 Cleanup: EEVEE-Next: Avoid use of float math when needed 2023-12-13 01:17:00 +01:00
Clément Foucault c4d91ad328 Fix: EEVEE-Next: Numerical imprecision with emission only volumes
This was caused by the fix to #65771 which biased the extinction.
The fix uses an exact method by taking the limit of the ill defined
computation and replacing the result by the simplified formula.
2023-12-13 01:17:00 +01:00
Damien Picard 402cec5646 Fix #112293: wrong console line cursor position with multi-byte chars
The ConsoleLine's `cursor` stores the index of the char where the
cursor is currently at. This works for ASCII characters, which
are all one-byte long, but will be offset when the string contains
multi-byte UTF8 sequences.

This caused an issue during auto-complete where the matching results
would be offset to the right.

This commit reuses the same logic as the text editor's
`current_character` RNA property, so that on getting and setting, the
cursor index is converted from and to UTF-8.

Ref: !114121
2023-12-13 10:42:52 +11:00