Commit Graph

150077 Commits

Author SHA1 Message Date
Campbell Barton
7ee6451a51 Extensions: support adding system repositories via the command line 2024-07-10 17:39:06 +10:00
Campbell Barton
1fc2530179 mypy: remove non-existing file from config 2024-07-10 17:03:20 +10:00
Campbell Barton
b3fbc439fe readfile: add missing define check 2024-07-10 17:02:57 +10:00
Hans Goudey
28c3332e32 Cleanup: Sculpt: Remove now-unused proxy system
Part of #118145.

The proxy system was used to store the accumulated translation from
the deformation of multiple symmetry passes. After a brush/tool update
step, all PBVH nodes with proxies were gathered, the proxies from
each symmetry passes were accumulated, and the deformation was applied
to the evaluated mesh, then the base mesh and shape keys.

In the recently refactored brushes, the translations are immediately
applied to the base mesh and shape keys instead. That avoids the need
for storing a float vector for every affected vertex during the
deformation. Reducing memory usage and affecting the memory that is
already hot in the cache has significant performance benefits too.
Also, brushes are now more conceptually independent-- they don't
rely on a separate pass to actually apply deformations.

Finally removing the proxy system reduces the size of PBVH nodes from
728 to 416 bytes. That's helpful as part of the effort to reduce per-
node overhead in order to make nodes smaller, and helps to reduce the
responsibilities of the PBVH, to focus it on being a BVH tree instead
of "bag for storing arbitrary user-interaction data."
2024-07-09 23:56:07 -04:00
Hans Goudey
d0a5599da3 Cleanup: Sculpt: Remove no-op addition of proxy
Adding the proxy doesn't do anything because the translations
are zeroed by default.
2024-07-09 23:56:07 -04:00
Hans Goudey
830f9cb95b Sculpt: Data oriented refactor for elastic transform
Part of #118145.
2024-07-09 23:56:07 -04:00
Hans Goudey
9a44887b23 Cleanup: Sculpt: Use C++ math types for elastic transform 2024-07-09 23:56:07 -04:00
Hans Goudey
11a4510e9a Sculpt: Avoid normals calculating when starting filter/transform
Move the node update tagging and normal recalculation outside of the
generic filter initialization to the callers. This avoids unnecessarily
recalculating all normals when the filter/transform starts. That's
especially unnecessary for the color filter which doesn't affect positions.
2024-07-09 23:56:01 -04:00
Hans Goudey
9eac6b6786 Sculpt: Use faster undo push function before transform tools
Use the function introduced in fd205d9bb9. In a test this made
the initialization of the transform operator 1.5x faster for a large mesh.
2024-07-09 22:31:49 -04:00
Hans Goudey
d65f6a9d62 Cleanup: Sculpt: Remove redundant undo pushing in transform code 2024-07-09 22:26:36 -04:00
Hans Goudey
c3c68cfc88 Cleanup: Sculpt: Remove unused variables
The original position wasn't actually used in the elastic transform mode.
2024-07-09 22:21:26 -04:00
Hans Goudey
fc385ca746 Cleanup: Sculpt: Remove unnecessary deformation flushing
Unnecessary after a9e29bea94.
2024-07-09 21:45:15 -04:00
Hans Goudey
bf05ac13c8 Sculpt: Data oriented refactor for snake hook brush
Part of #118145.
There is more cleanup possible here, particularly doing some loop
fission and making the brush use our common utilities will help
remove some code and make better use of auto-vectorization.
But with this commit the code we want to remove is no longer
used, so we can stop here for now.
2024-07-09 21:45:15 -04:00
Harley Acheson
e3036cc3d5 Fix #124390: Slightly Improved Icon Rendering at Non-Integral Interface Sizes
Size icons to subpixel precision to give slightly better results when used
with fractional resolution scales.

---

This change is very subtle. So you might have to trust me or get your reading glasses on...

Our icons are designed for small sizes.  When the Blender resolution scale is set to exactly 1.0 then the icons are aligned perfectly to a 14x14 grid and features like lines are exactly one pixel wide.  So these one-pixel wide lines are perfectly aligned to the pixel grid.  Change the scale to 2.0x and they also align perfectly, just with lines that are two pixels wide.

But what happens at 1.25x scale?  Now the icon is 17.5 pixels and lines in it are a pixel and a quarter wide .  The best that can be is a solid pixel and one next to it that is quarter-opacity. But it can get worse than that as it could potentially touch three adjacent pixels.

Our old icon code took an icon bitmap that was rendered larger and scaled it into the desired size.  Because this was done by the opengl shader, this scaling was done to subpixel size. So at 1.25 scale you got an icon that was 17.5 pixels.

The new icon code is truncating the sizes to integer before rendering. I thought this was best, but I was wrong.

The following image has three rows.  The top is the old icon code, with UI scale from 1.0, 1.25, 1.5, 1.75, and 2.0. The second row is current code. The third is with this PR:

![image](/attachments/f809b30f-df6f-48b1-8745-40d9e897ebc7)

The first and last columns are identical, obviously because the design perfectly fits the pixel grid.

The left green area, at 1.25 scale, current code is forcing the design into an integer size, while (bottom) gives a more pleasing result as it is properly spread over 17.5 pixels.

The right green area is more interesting.  With both the old code and new code, the 1.75 pixel wide line is spread over three pixels. The PR nicely spreads it over two pixels.

Hard to tell;  Just squint.  This is just very slightly more pleasing rendering of icons.

Pull Request: https://projects.blender.org/blender/blender/pulls/124436
2024-07-10 03:08:58 +02:00
Richard Antalik
20eb70ee18 Merge branch 'blender-v4.2-release' 2024-07-10 02:22:22 +02:00
il4n
e13b2f3774 Fix: VSE: Overlap after moving a retiming key was not handled
Moving a strip retiming key at the end of a strip, so that a strip
overlaps another one would leave them overlapped. The expected
behavior is that it acts according to the Overlap Mode, like it does
when moving a strip.

Co-authored-by: Richard Antalik <richardantalik@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/124424
2024-07-10 02:21:14 +02:00
il4n
b2e3b6c393 Fix: VSE: Selected strips don't get tinted while transforming
If the "Overwrite" Overlap Mode was used, the non-active strips would
not get tinted while moving them.

Pull Request: https://projects.blender.org/blender/blender/pulls/124411
2024-07-10 01:21:13 +02:00
il4n
a23cb6b1d6 Fix: VSE Set Speed operator not handling overlap
Lowering the speed of a strip that doesn't have user-created retiming
keys using the "Set Speed" operator would cause the strip to overlap
neighboring strips. The fix shuffles the retimed strip to avoid
overlap. This now matches the behavior of the same operator, when
using it on a user created retiming key.

Pull Request: https://projects.blender.org/blender/blender/pulls/124414
2024-07-10 01:19:50 +02:00
Jonas Holzman
3b23dc4b4d Fix: Window title not properly updating on editor change
Update the window title on change of area even if the spacetype remains
the same. This way it catches subtype changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/124304
2024-07-10 01:04:20 +02:00
Hans Goudey
0ccb126a14 Fix: Build error in Windows after allocator change, part 2
Similar to 248910be1f
2024-07-09 17:21:01 -04:00
Hans Goudey
879eca663a Fix #124419: Smooth brush broken for larger meshes
Simple mistake in 68d6bf56e5.
2024-07-09 17:19:00 -04:00
Hans Goudey
248910be1f Fix: Build error on Windows after recent fix
`PreviewImage` is a non-trivial type on MSVC and can't
be allocated with `MEM_cnew`.
2024-07-09 16:16:56 -04:00
Jesse Yurkovich
30407af01c Hydra: Update Storm reference images after color space fix 2024-07-09 12:38:11 -07:00
Hans Goudey
1d5bf4ca56 Refactor: Sculpt: Change parts of snake hook brush to new structure
- Access positions from a thread-local array
- Replace use of the proxy system with immediately applied translations
- Access data from stroke cache directly
2024-07-09 15:26:30 -04:00
Hans Goudey
426ffa6000 Refactor: Sculpt: Specialize snake hook brush per PBVH type
Part of #118145.
2024-07-09 15:26:30 -04:00
Jesse Yurkovich
3c65b154eb Merge branch 'blender-v4.2-release' 2024-07-09 12:07:15 -07:00
Pablo Delgado Krämer
7cc0e48882 Fix #124016: Translate Image Texture node color spaces to MaterialX
This addresses #124016. The report provides a scene to test the changes.

Currently, the Blender and MaterialX color spaces are not fully aligned,
but the linear/srgb heuristic should cover most cases however.

Pull Request: https://projects.blender.org/blender/blender/pulls/124315
2024-07-09 21:06:08 +02:00
Hans Goudey
5665243bef Cleanup: Use C++ types for snake hook brush 2024-07-09 14:10:05 -04:00
Hans Goudey
3009d4f28c Cleanup: Sculpt: Move snake hook brush to separate file 2024-07-09 13:31:45 -04:00
Julian Eisel
46c0d3e644 Fix: Broken active highlighting of assets in the asset shelf
Suspecting a mismatch when asset weak references stored using Unix style
paths with ones generated at runtime with Windows sytle paths.

Pull Request: https://projects.blender.org/blender/blender/pulls/124415
2024-07-09 19:07:18 +02:00
Jacques Lucke
57f1d959d4 Cleanup: use StringRefNull instead of std::string for instance reference name 2024-07-09 18:56:09 +02:00
Jacques Lucke
39d509f91f Fix: incorrect preview image shallow copy 2024-07-09 18:53:50 +02:00
Jacques Lucke
d0c6bce884 Fix: new/free mismatch
Also see 06be295946.
2024-07-09 18:31:13 +02:00
Jacques Lucke
a57d1ae35e Cleanup: fix compilation
For some reason, `MTex` is trivial on some platforms and not on others.
2024-07-09 18:20:11 +02:00
Sybren A. Stüvel
c26dc45bd9 Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-07-09 18:11:21 +02:00
Pratik Borhade
63cb33139f Fix #124288: Channels overlap the Dope Sheet search
Channels are drawn after/on top of the search box. To fix this, move
`ED_time_scrub_channel_search_draw` below the channel drawing function.

Pull Request: https://projects.blender.org/blender/blender/pulls/124331
2024-07-09 17:57:07 +02:00
Falk David
509cb361bb GPv3: Remove tint tool from tool bar
This is now accessible from the draw tool as a brush asset.

Pull Request: https://projects.blender.org/blender/blender/pulls/124421
2024-07-09 17:17:25 +02:00
Jacques Lucke
dc8e9678e1 Geometry Nodes: allow naming geometry sets
This adds a new `name` member to the `GeometrySet` class. This name can be set
with the new `Set Geometry Name` node. Currently, the name is only used in the
spreadsheet when displaying instances.

The main purpose of this name is to help debugging in instance trees. However, in the
future it may also be used when exporting instance trees or when creating separate
objects from them.

Note, the name is not expected to be unique, it is fully in user control.

Naming geometries is necessary to make the spreadsheet more useful for instances,
because currently the user has no information for which geometry is used by each instance.

We also want to use this name to improve the integration with grease pencil where
sometimes layers become instances with the same name.

Pull Request: https://projects.blender.org/blender/blender/pulls/114910
2024-07-09 17:03:54 +02:00
Aras Pranckevicius
6f0620161d Fix #123949: OBJ importer should not set face sharpness when vertex normals are present
Having both custom vertex normals and the "is the face sharp?"
attribute on a mesh leads to some non-intuitive behaviours. Instead,
make the behaviour more aligned with OBJ format description wording,
which says "When vertex normals are present, they supersede
smoothing groups" (https://paulbourke.net/dataformats/obj/).

Pull Request: https://projects.blender.org/blender/blender/pulls/124366
2024-07-09 16:59:17 +02:00
Clément Foucault
e0474c4bd3 Merge branch 'blender-v4.2-release' 2024-07-09 16:47:16 +02:00
Clément Foucault
983e4a7543 Fix: EEVEE: Shadow mode versioning node affecting Cycles
Even if Cycles is not the active render engine, this
versioning code could affect Cycles if a material was
used with Cylces in another file (using linking).

Fix this by spliting the output node into another one
that only affects EEVEE.
2024-07-09 16:46:06 +02:00
Clément Foucault
ee94e84ab2 EEVEE: Make tests pass on all platforms
Increase fail threshold for tests with platform
dependent noise.
Blacklist `principled_thinfilm_transmission` as
the IOR is very small and isn't packed to the GBuffer
with the same precision on every platform.
2024-07-09 16:46:06 +02:00
Jacques Lucke
056ac7f407 Fix: new/free mismatch in a few cases
Also see 06be295946.
These aren't all cases, but a few that I found by addding a static
assert in `MEM_new` so that it fails for trivially constructible types.
2024-07-09 16:22:04 +02:00
Omar Emara
cad488e820 Merge branch 'blender-v4.2-release' 2024-07-09 17:12:39 +03:00
Omar Emara
0251db1447 Fix #124335: Viewport compositor crash upon scene change
The viewport compositor crashes when the scene is changed in some
situations. That's because the viewport compositor tries to use node
tree data that was freed in the last depsgraph update, while it should
have invalidate those references based on the same depsgraph update.

The source of this issue is in the depsgraph itself. In particular, when
the depsgraph evaluation happens in two passes, the ID recalculate flags
are backed up for every pass then restored at the end of all passes,
however, this doesn't happen for the ID Type Update table. So whenever
evaluations happen in two passes, changes will not be propagated to
engines that require those information, like the viewport compositor
engine in that particular case.

To fix this, we backup and restore the ID Type Update table in a similar
manner to the ID recalculate flags.

Fixes #107235, #124335, #116142.

Pull Request: https://projects.blender.org/blender/blender/pulls/124409
2024-07-09 16:10:58 +02:00
Falk David
55162916ca Fix: GPv3: Draw Tool: Prevent trim_end_points from removing entire stroke
The `trim_end_points` in the draw tool was only supposed to be able to remove
end points of the stroke.
Make sure to clamp the value so that at least one point remains in the curve.
2024-07-09 16:08:04 +02:00
Sybren A. Stüvel
1b09466e13 Refactor: Anim, move some Slot methods next to their siblings
Move some methods on `Slot` in the source file so that they sit next to
their siblings. Some unrelated functions squeezed in between them.

No functional changes.
2024-07-09 15:57:48 +02:00
Jacques Lucke
edd40007ab Fix: new/free mismatch
Also see 06be295946.
2024-07-09 15:39:09 +02:00
Bastien Montagne
57e9abb564 Cleanup: Remove left-over call to BKE_blendfile_write_partial_end.
BPY `library.write` has been moved to new PartialWriteContext code a few
weeks ago, removing this call to `BKE_blendfile_write_partial_end` was
somehow missed then.
2024-07-09 15:27:12 +02:00
Bastien Montagne
17af2bb83c Cleanup: BKE Workspace: Remove unused BKE_blendfile_workspace_config_write. 2024-07-09 15:23:44 +02:00