Commit Graph

117289 Commits

Author SHA1 Message Date
Iliya Katueshenock
4839a86984 Cleanup: BLI: Merge files
Deduplicate IndexRange implementation files.

Pull Request: https://projects.blender.org/blender/blender/pulls/126169
2024-08-13 20:26:55 +02:00
Iliya Katueshenock
593e70dc53 Fix: Geometry Nodes: typo in node description
Pull Request: https://projects.blender.org/blender/blender/pulls/126165
2024-08-13 19:56:20 +02:00
Jacques Lucke
4f491aca80 Fix #126286: crash when opening blend file with point cache 2024-08-13 19:53:46 +02:00
bartus
7207015a58 Fix #125070: Handle "Unit Scale" correctly in the STL and PLY importers
When importing an STL file with the "Scene Unit" option enabled, we
should divide by the Unit Scale instead of multiply (which was already
done when Exporting with "Unit Scale" enabled)

The PLY importer had the same issue.

The prior "legacy" implementation did this correctly:
b42d686277/io_mesh_stl/__init__.py (L110)

Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/124718
2024-08-13 19:22:58 +02:00
Hans Goudey
5b75c5b89d Refactor: Sculpt: Specialize expand operator boundary calculation
Part of #118145.
2024-08-13 13:07:28 -04:00
Hans Goudey
90460878b3 Cleanup: Sculpt: Remove unused hide_poly argument
Even if/when we take visibility into account for multires calculations,
the per-grid-face visibility is stored in SubdivCCG::grid_hidden, not
the base mesh's face visibility.
2024-08-13 12:49:20 -04:00
Hans Goudey
6229f10e93 Cleanup: Sculpt: Pass position argument instead of PBVHVertRef 2024-08-13 12:35:30 -04:00
Hans Goudey
e12c568a69 Cleanup: Sculpt: Remove unused function 2024-08-13 12:35:11 -04:00
Hans Goudey
2449b12e67 Fix #125929: Add curves creates 1-segment too short curves
Caused by 5e96934ef6.
2024-08-13 12:11:58 -04:00
Hans Goudey
a716685f2f Fix #126149: Flat face wireframe edges hidden on some platforms
d1049f6082 translated the logic from the `int8` to `float`
conversion incorrectly. Previously the data was extracted to an integer
array (multiplied by 254) first then translated to a float VBO (and
divided by 255). I think conceptually the special `1.0/255` value isn't
necessary because the "optimal display edges" area already taken into
account for the creation of the index buffer. But as a quick fix, just
fix the factor to be the same as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/126290
2024-08-13 18:09:23 +02:00
Jacques Lucke
e1422530d6 Fix: crash when attempting to unload volume tree twice 2024-08-13 17:47:52 +02:00
Hans Goudey
9eb7e8bfd1 Refactor: Sculpt: Reduce reliance on BVH tree geometry back pointers
Retrieve the relevant data directly from the original object's mesh
(or the evaluated SubdivCCG in that case) rather than using the
BVH tree's geometry points which we'd like to remove.

Pull Request: https://projects.blender.org/blender/blender/pulls/126284
2024-08-13 17:38:09 +02:00
Christoph Lendenfeld
9741750497 Refactor: move BKE_action_get_item_transform_flags out of the kernel
No functional changes expected.

The function `BKE_action_get_item_transform_flags` was only ever used in a single place.
As such it could be a static function within the given file.
This reduction in scope will help with future refactors.

This is in service of fixing #126125 since the function in its current form
does not support layered actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/126287
2024-08-13 17:04:01 +02:00
Anthony Roberts
9df75725be Switch to using blender::BitVector in tile changesets
This avoids an issue in clang-cl on Windows ARM64 where an invalid pointer would be (re)used.

See #124182 for more details, but basically without this, when the vector of tiles inside changeset is resized, a reference to an invalid pointer (ie, the location in the old vector) is kept somewhere, which makes the test fail.

Pull Request: https://projects.blender.org/blender/blender/pulls/126083
2024-08-13 16:52:52 +02:00
Jacques Lucke
d81ba55ce4 Fix #124467: lazy-connect does not work with Capture Attribute node
The lazy-connect feature of node wrangler uses the built-in `connect_sockets`
function which automatically handles virtual sockets in group input and output
nodes already. However, it does not handle virtual sockets in other nodes.

The fix is to generalize this behavior. For that, a new `handle_dynamic_sockets`
boolean input is added to `tree.links.new`. When enabled, virtual sockets are
handled properly by internally calling the `bNodeType.insert_link` methods.

The new behavior is turned of by default for compatibility reasons.

Pull Request: https://projects.blender.org/blender/blender/pulls/126282
2024-08-13 16:25:20 +02:00
Omar Emara
59a4fdfc81 Cleanup: Fix warning about non void function 2024-08-13 16:36:05 +03:00
Omar Emara
edc4d0d84a Compositor: Support CPU storage in result class
This patch adds support for CPU side buffers for the result class. A new
storage type member was added to identify the type of buffer storage,
and allocation will either allocate a GPU texture or a CPU buffer based
on the context's GPU usage.
2024-08-13 16:13:22 +03:00
Falk David
81d78e3416 GPv3: Apply Modifier
This implements the `Apply Modifier` operator for GPv3.

Applies the modifier to the current frame. Drawings at the current frame will be updated.
If the result of the modifier creates new layers, the layers will be added and a drawing
at the current frame will be inserted.

Applying a modifier will run the following steps:
* Create a localized copy of the original Grease Pencil data and insert it into a geometry
   set that owns it.
* Execute the `modifiy_geometry_set` function of the modifier with this geometry set.
* In the resulting Grease Pencil data loop over all layers:
   * If the original data has a layer with the same name, overwrite its drawing data in the
      current frame.
   * Otherwise create a new layer in the original data and insert a resulting drawing at
      the current frame.
* Remove all original layers that are not mapped to from a result layer.
* Remap the material indices for all drawings that have not been updated (e.g. the ones
    that are not on the current frame).
* Copy all the layer attributes to the original Grease Pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/124543
2024-08-13 15:02:25 +02:00
casey bianco-davis
738c2a5e1c Fix #126241: Some attributes set to default.
The problem was that the attributes where hard coded, rather then using the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/126251
2024-08-13 15:01:48 +02:00
Jacques Lucke
05925b404d Fix #125419: crash when loading baked data with empty instances
The problem was the automatic instance deduplication. There were two
instance references before baking, both of which were referenced by instances.
When loading the bake, they were deduplicated, so there was only one geometry,
but the instances still referenced two.

The fix is to not do deduplication when loading instances from a bake.
2024-08-13 14:10:25 +02:00
Jeroen Bakker
7fc55c0ad8 OpenGL: Remove conservative depth extension check
No need to enable the GL_ARB_conservative_depth extension as it is
core in GLSL 4.20. Some drivers still complain that the
extension was explicitly enabled.

Detected on AMD 21.Q2.1 (27.20.21026.2006) legacy driver.

Pull Request: https://projects.blender.org/blender/blender/pulls/126223
2024-08-13 12:10:00 +02:00
Jeroen Bakker
c4e90eddcb Fix #125618: EEVEE: Cryptomatte Material Layer Incorrect
The encoded material names used by cryptomatte were incorrect. Reason
was that it used the name including the object type.

NOTE: reference images needs to be updated

Pull Request: https://projects.blender.org/blender/blender/pulls/126267
2024-08-13 11:28:45 +02:00
Christoph Lendenfeld
2641216344 Fix #124125: Ensure evaluated depsgraph when inserting keyframes
When quickly running the "frame step" and "insert key"
operators it was possible to run the key insertion when the
depsgraph hasn't yet been updated.
Because the key insertion code took the frame from the scene,
but the channel values
from the depsgraph, the inserted keys were appearing to be
duplicated from a different frame.

Compared to the previous solution #124583 this moves
the code to ensure an evaluated depsgraph
into a new invoke function for the operator.
This avoids the performance issues when calling the
operator from python (#125888)

Pull Request: https://projects.blender.org/blender/blender/pulls/126123
2024-08-13 11:19:23 +02:00
Omar Emara
58c10d191e Cleanup: Default initialize Result class members 2024-08-13 11:56:12 +03:00
Omar Emara
10f64edb3a Compositor: Allow non-pooled result allocation
This patch allows the result to be allocated using new textures as
opposed to using pooled texture. This is useful to allow the result
class to be used for persistent data like cached resources which can't
be pooled since it spans multiple evaluations.
2024-08-13 11:33:37 +03:00
Casey Bianco-Davis
588e016d4e Fix: GPv3: Drawing plane does not consider layer transform
This fixes the issue by transforming the plane normal using the layer transform.

Pull Request: https://projects.blender.org/blender/blender/pulls/126262
2024-08-13 10:15:52 +02:00
Hans Goudey
5c2b9218c4 Cleanup: Sculpt: Use shared utility to blur float data array 2024-08-12 22:55:26 -04:00
Hans Goudey
dd1454a648 Sculpt: Various refactors in expand tool
Part of #118145.
- Specialize initialization of enabled states, parallelize for mesh.
- Pass integer index and position instead of `PBVHVertRef`.
- Rename some variables to more standard names.
- Precalculate vertex enabled state instead of calculating in loop.
2024-08-12 22:55:14 -04:00
Hans Goudey
60390f8ac4 Cleanup: Sculpt: Pass expand cache by reference, use C++ Array 2024-08-12 22:43:47 -04:00
Hans Goudey
7e11ccc78c Cleanup: Sculpt: Use clearer variable name than "f" 2024-08-12 22:43:47 -04:00
Hans Goudey
f602492f18 Cleanup: Sculpt: Use IndexMask for expand boundary vertices 2024-08-12 22:43:47 -04:00
Harley Acheson
99a4bc325e UI: Allow Theme Coloring for Color SVG Extraction
For the times we need to obtain the bitmap of an SVG icon, send these
through the new theme coloring callback if they are multi-color. This
removes some code duplication by adding a new function that gets an
imBuf from SVG Icon. This allows, for "About" logo, Dialog icons, and
file system icons the optional ability to use a single SVG source file
that works as both monochrome (themed by text color) or multicolor with
internal parts themed.

Pull Request: https://projects.blender.org/blender/blender/pulls/126215
2024-08-13 03:31:43 +02:00
Blazer
ddc9f92777 Define fallback tooltip string for UI_UL_list items
Having the description blank for template list items when not editable
creates undo items that show as "Unknown Action." This PR ensure it has
a description whether editable or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/126184
2024-08-13 00:42:39 +02:00
Harley Acheson
e8786c7be7 UI: Icon Overlay Text Should Not Shadow if Dark
If the text color is dark then don't add shadow to the icon overlay
text - the small text showing things like user counts.

Pull Request: https://projects.blender.org/blender/blender/pulls/126247
2024-08-12 21:23:12 +02:00
Hans Goudey
4c2e5b57de Sculpt: Use new relax implementation for mesh filter
Use the relax/relax face sets implementation from
4f73bf2871 for the mesh filter.
2024-08-12 13:51:48 -04:00
Hans Goudey
00ca0e8eee Refactor: Sculpt: Share face set boundary filtering functions 2024-08-12 13:51:48 -04:00
Hans Goudey
11076b691c Cleanup: Sculpt: Small simplification in relax brush
Check the boundary corner condition outside of the
function that calculates it, and only check zero normals
when calculating them here.
2024-08-12 13:51:48 -04:00
Sean Kim
45d9bfa734 Refactor: Sculpt: Add active_vert_index() and active_vert_position()
* Adds two helper methods, the first replacing direct access to the
  PBVHVertRef i value, the second replacing the previously removed
  SCULPT_active_vertex_co_get
* Removes most trivial usage of active_vert_ref(), the remaining cases
  are a bit more complex and need separate PRs

Pull Request: https://projects.blender.org/blender/blender/pulls/126186
2024-08-12 18:57:24 +02:00
Sean Kim
cab4d6f724 Refactor: Restructure sculpt shape key updates
Pull Request: https://projects.blender.org/blender/blender/pulls/126161
2024-08-12 18:25:45 +02:00
Clément Foucault
fd7c884aef Fix: Overlay-Next: Crash on scene without active object 2024-08-12 17:24:00 +02:00
Clément Foucault
461bd0a477 Fix: Overlay-Next: Incorrect overlay_fb_draw lambda 2024-08-12 17:20:31 +02:00
Michael Kowalski
f30689e12c Fix: USD instancing export errors
Fixed two errors when exporting to USD with Instancing enabled:

Ensuring the mesh prototype prim exists before referencing it to
avoid the "Unresolved reference prim path" error messages in the
console.

Adding the Root Prim path prefix to the prototype reference path.

Pull Request: https://projects.blender.org/blender/blender/pulls/126210
2024-08-12 16:35:51 +02:00
Dalai Felinto
4b726b41b9 Outliner: Expand Geometry Nodes Modifier to show the data-block
This allow users to create a Geometry Nodes Asset directly from the Outliner.

---

Pull Request: https://projects.blender.org/blender/blender/pulls/126103
2024-08-12 15:59:09 +02:00
Hans Goudey
3d7c9a7a0b Cleanup: Sculpt: Remove unnecessary BMesh function call
This code path doesn't support BMesh which is the only
case this does anything anyway.
2024-08-12 09:45:47 -04:00
Hans Goudey
005cc72bda Cleanup: Sculpt: Remove outdated comment
The "vertex iterators" have been removed.
2024-08-12 09:45:47 -04:00
Clément Foucault
c42380c633 Overlay-Next: Outline
Straightforward port.

Only the dupli object optimization and the resource handle
deduplication are left as todos.

Marked areas that are against design to be fixed.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126152
2024-08-12 15:29:20 +02:00
Laurynas Duburas
1c70e07af5 Overlay-Next: Facing
Overlay-Next version of facing.

Rel #102179

Pull Request: https://projects.blender.org/blender/blender/pulls/126153
2024-08-12 15:17:54 +02:00
Lukas Stockner
d8f550875b Fix #124038: Performance issue with color sampling in 3D Viewport
The issue here is that copying the GPU viewport back to the CPU is an expensive
operation, so doing it for every frame when dragging the eyedropper is not ideal.

Instead, copy it once at the start and keep reading from it until the user
releases the eyedropper.

Pull Request: https://projects.blender.org/blender/blender/pulls/126072
2024-08-12 14:52:28 +02:00
Sergey Sharybin
49d2184fca Cleanup: Unused variable 2024-08-12 14:14:01 +02:00
Andrej730
74c796e057 UI: Add property description for show hidden objects operator
Clarify `selection` property with description.

Pull Request: https://projects.blender.org/blender/blender/pulls/126221
2024-08-12 13:32:01 +02:00