Commit Graph

105452 Commits

Author SHA1 Message Date
Jacques Lucke
e0aa05996f Fix: normalize option not shown in noise texture node
Caused by f7e8021b2a.
2023-12-19 12:56:37 +01:00
Philipp Oeser
820a0f7240 Fix #116239: Propagate to Shapes overwrites all vertices with mirroring
Since 4d0dbab5b1, `EDBM_verts_mirror_cache` is used to find mirror
verts (but this was initialized with `use_select` being `true`, so the
cache was only set up for selected verts). `EDBM_verts_mirror_get`
behaves in a way that if you then query a vert that does not have a true
mirror, it would always return the vert with index zero in this case (so
basically would look like the index zero vert is the mirror for verts
not covered in the cache). Now if that zero index vert happened to be
selected, verts would not be skipped and the whole mesh would be
overwritten.

To solve this, we need to initialize the `EDBM_verts_mirror_cache` with
`use_select` being `false` -- this way all verts are covered and we
always get back the true mirror (checking selection on that one is fine
then and everything behaves as expected).

Pull Request: https://projects.blender.org/blender/blender/pulls/116329
2023-12-19 12:34:56 +01:00
Clément Foucault
5e5345cd2c Fix: EEVEE-Next: Subsurface artifact on M1
This is caused by the local cache optimization.
Disabling it for now on this platform.
2023-12-19 23:42:35 +13:00
Clément Foucault
07be933218 Fix: EEVEE-Next: Undefined behavior on gbuffer load
This caused issue in the SSS setup and could
have caused other issues.
2023-12-19 23:42:35 +13:00
Clément Foucault
6f50e71029 Fix: EEVEE-Next: Workaround Load/Store broken on M1
Load/store action is broken on Metal.
2023-12-19 23:42:35 +13:00
Clément Foucault
d73050114b EEVEE-Next: Volume: Combine the volume closure nodes
instead of randomly choosing one.
This avoid noise when mixing them.
2023-12-19 23:42:35 +13:00
Sybren A. Stüvel
a3160393ee Anim: clarify description of armature.bone_collection_unassign_named
The 'named' is about the name of the bone that's being unassigned. This
was already clear from the parameters, and it's now mentioned in its
description too.

No functional changes.
2023-12-19 10:41:57 +01:00
Sybren A. Stüvel
a04bbc8a1f Anim: better check for overrides when (un)assigning bone collections
When (un)assigning bone collections, don't just check that the armature is
linked, but also check for the existence of a library override.
2023-12-19 10:41:57 +01:00
Sybren A. Stüvel
b70ebf96e7 Anim: bone collections, split ARMATURE_OT_collection_assign in two
Split the `armature.collection_assign` operator in two. Before, the
operator could do two things: assign selected bones to the active/named
bone collection, or create a new bone collection with the given name.

This is now split up, where `armature.collection_assign` only assigns to
existing bone collections, and `armature.collection_create_and_assign`
always creates a new bone collection.

This makes the purpose of each operator clearer & more predictable.
2023-12-19 10:41:57 +01:00
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