Commit Graph

139791 Commits

Author SHA1 Message Date
Hans Goudey
77be435eee Fix #121107: Box Hide occasionally causes artifacts
There is more of a proper fix to do here still (#121152).
But for now, just use the recently added single-threaded
gather/scatter methods.
2024-08-05 11:11:21 -04:00
Philipp Oeser
f53b6b89f8 Fix: Editor related RNA paths incomplete/wrong
The RNA path that is generated for Editor properties were mostly
incomplete (e.g. the viewport overlay settings).
- in python tooltips
- from the `Copy (Full) Data Path` operator
- python methods `path_from_id`, `path_resolve` returned incomplete paths

Since a space (editor) is ultimately owned by the screen, we now add the
missing "areas[x].spaces[x]" subpath to any editor.
Nested structs (like the viewport overlay) also need to include this
subpath.

Some editor related structs are not tied to a single space though (and
these cases are therefor not resolved yet):
- Dopesheet is referenced from SpaceGraph, SpaceAction and SpaceNla
- View3DShading is referenced from SpaceView3D but render engines as
well
- FileSelectParams / FileAssetSelectParams / FileAssetSelectIDFilter
need more investigation

NOTE: in case of the VSE, to make this work this also changes the
overlays to be tied to SpaceSeq (the only editor using them)
NOTE: since the above is now in place, adding VSE overlay props to Quick
favourites is now made possible as well (was a leftover from !116604)

Fixes #124527, #113489

Pull Request: https://projects.blender.org/blender/blender/pulls/125365
2024-08-05 16:54:34 +02:00
Clément Foucault
f819e5eeb4 Fix: Overlay-Next: Crash in 2D view when dereferencing v3d
These cases should be safeguarded.
2024-08-05 16:44:01 +02:00
Falk David
656bbd4c7c Refactor: GPv3: Remove DrawingPlacement from GreasePencilStrokeParams
Instead of requiring `GreasePencilStrokeParams` to have a
`DrawingPlacement`, pass it to the `foreach_editable_drawing`
callback.

This makes it possible to have a variant of `foreach_editable_drawing`
that doesn't use a `DrawingPlacement`.
The `Smooth`, `Thickness`, and `Strength` sculpt
brushes don't need this for example.

Also in preparation of using `GreasePencilStrokeOperationCommon`
in more places like vertex painting and weight painting.

Pull Request: https://projects.blender.org/blender/blender/pulls/125903
2024-08-05 16:24:56 +02:00
Bastien Montagne
65e0bc0f7e I18N: Updated UI translations from gti/weblate repository (793d8f93fc67353). 2024-08-05 15:58:35 +02:00
Devashish Lal
f6e6f2b2d2 Geometry Nodes: PLY import node
This commit adds a PLY format import node, part of the current Google
Summer of Code Project [0]. The importer is refactored to output a mesh,
and a node is added to wrap around the importer. The node supports error
messages from the importer. The node is hidden behind an experimental
option for now, like the others.

0: https://devtalk.blender.org/t/gsoc-2024-geometry-nodes-file-import-nodes/34482)

Pull Request: https://projects.blender.org/blender/blender/pulls/125587
2024-08-05 14:54:54 +02:00
Falk David
310c4cdc3c Fix: GPv3: DrawingPlacement copying and moving
The `DrawingPlacement` class did not define the copy
and move constructors/assignment operators even
though they were used in a couple of places.

Pull Request: https://projects.blender.org/blender/blender/pulls/125898
2024-08-05 14:44:23 +02:00
Clément Foucault
60d80c6bd5 Fix: DRW: Broken compilation on MacOS 2024-08-05 14:08:48 +02:00
nutti
1c3a2d1f5f Fix: temp_override doc not to take the positional arguments
Add positional argument to `temp_override` pyapi docs

Pull Request: https://projects.blender.org/blender/blender/pulls/125132
2024-08-05 13:28:25 +02:00
Falk David
5ae70519b2 GPv3: Python API: Add function to get current frame on a layer
This adds the `layer.current_frame()` function which will get the frame
at the current scene time on this layer.

In the lagacy API this was the property `layer.active_frame`. Since we don't cache the visible
frame anymore, we use the current context to get the current scene time.

Pull Request: https://projects.blender.org/blender/blender/pulls/125892
2024-08-05 13:28:06 +02:00
Clément Foucault
0e6d9c355c Fix: DRW: Vertex count explosion on pass resubmission
This was caused by the primitive expansion code path
modifying the `DrawGroup` source input. Upon resubmission
it would take the initial vertex count and expand it again.

The fix is to isalate the description of the draw
from the resolved vertex range.

Fix #125879
2024-08-05 13:00:46 +02:00
Lukas Tönne
43b68132c0 Fix #125866: Crash when converting empty grease pencil to instances
The specialized code for converting grease pencil layer attributes to
instance attributes was accessing the instance component without check.
This _should_ work because the component is explicitly created, but
still fails for empty grease pencil data, because the
`get_component_ptr` function checks if the component is "empty" as well
(zero instances).

Pull Request: https://projects.blender.org/blender/blender/pulls/125887
2024-08-05 12:14:56 +02:00
Weizhen Huang
e981389bdd Refactor: Cycles: use reservoir sampling to pick phase function in volume
so that we loop through the volumes only once.

Pull Request: https://projects.blender.org/blender/blender/pulls/125676
2024-08-05 10:55:47 +02:00
Weizhen Huang
7e40d567d4 Fix #125595: Cycles artifacts in overlapping volumes with different phase functions
A phase function is normalized over the sphere, it is therefore
incorrect to sum two phase functions together when evaluating for NEE.
It should be a weighted sum with normalized weights, which, according to
`volume_shader_phase_pick()`, is `sample_weight / sum_sample_weight`.

Also corrects an error in `volume_shader_phase_pick()`.
2024-08-05 10:55:44 +02:00
Clément Foucault
1e83d2f3ea Cleanup: GPU: Silence implicit narrowing warning 2024-08-05 10:36:36 +02:00
Omar Emara
aecea2e4bb Cleanup: Mixed type comparison warning 2024-08-05 10:45:14 +03:00
Harley Acheson
5fb140a36e UI: Status Bar Using SVG Icons
Refactor of how "event icons" are created, using custom SVG icons for
key outlines and some complex keys. Allows multiple key widths so that
"Ctrl", "Insert", etc can be readable. Strings are automatically sized
rather than hardcoded. Also allows these strings to be translated.
Supports the UI icon alpha preference.  Also supports local aspect in
case we ever want to allow 2D zooming there.

Pull Request: https://projects.blender.org/blender/blender/pulls/125591
2024-08-05 02:42:26 +02:00
Campbell Barton
fc6a99e0d2 Fix #77837: Error removing addons/extension/wheels on WIN32
When deleting files on WIN32, open files cannot be removed.
This is especially a problem for compiled Python modules which
remain open once imported.

Previously it was not as common for add-ons to include compiled Python
modules however with extensions supporting Python-wheels,
it's increasingly likely users run into this.

Workaround the problem by:
- Scheduling the files for removal next time Blender starts.
- Rename paths that cannot be removed to avoid collisions when
  the paths is reused (re-installing for example).

This is supported for:
- Extensions.
- Python wheels.
- Legacy user add-ons.
- App-templates.

Details:
- On startup, a file exists that indicates cleanup is needed.
  In the common case the file doesn't exist.
  Otherwise module paths are scanned for files to remove.
- Since errors resolving paths to remove could result in user data loss,
  ensure the paths are always within the (extension/addon/app-template)
  directory.
- File locking isn't used, if multiple Blender instances start at the
  same time and try to remove the same files, this won't cause errors.
  Even so, remove the checking file immediately avoid unnecessary
  file-system access overhead for other Blender instances.

Also resolves #125049.
2024-08-05 09:49:14 +10:00
Jesse Yurkovich
fe672bd479 Cleanup: USD: const correctness fixes
Apply `const` to variables, arguments, and methods. Also includes a few
variable shadowing changes that were noticed along the way.

All changes should have no user visible effects.

Pull Request: https://projects.blender.org/blender/blender/pulls/125873
2024-08-04 22:42:08 +02:00
Hans Goudey
c0d37d97de Cleanup: Sculpt: Move topology islands API to C++ namespace 2024-08-04 14:05:21 -04:00
Harley Acheson
a57c3be05e UI: Add SVG Icons for Status Bar Event Use
This adds 26 SVG icons (13 unfilled/filled pairs) for use on the Status
Bar for keymap indication. No other functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/125868
2024-08-04 19:19:54 +02:00
Sean Kim
dd905de795 Fix #125838: Elastic deform brush does not respect mask values
Factor calculation was not being used to scale the final translation.

Also removes a seemingly mistakenly added texture calculation for the
grids PBVH type.

Pull Request: https://projects.blender.org/blender/blender/pulls/125849
2024-08-04 18:28:30 +02:00
Campbell Barton
be4c7cae7c Cleanup: format 2024-08-04 23:33:55 +10:00
Campbell Barton
afa44b16a6 Fix error installing app-templates & legacy add-ons overwriting symlinks
Resolve error when overwriting existing Python modules would attempt
to recursively remove a symlink which raised an error.

Related to #123827, same error but for extensions.
2024-08-04 20:58:48 +10:00
Campbell Barton
805f66c5c4 Extensions: restore fix for removing extensions with symlinks
Regression from [0], removed the fix for #123827.

[0]: 08b75549e3
2024-08-04 20:52:00 +10:00
Campbell Barton
c071030ac3 Cleanup: spelling in comments 2024-08-04 13:45:06 +10:00
Hans Goudey
cdd72e689f Sculpt: Refactor displacement eraser filter initialization
Part of #118145.
Parallelize the creation of the initial limit positions for the filter,
also using the API function to evaluate more than one vertex at a time,
and removing the old sculpt API function as well.
2024-08-03 22:44:22 -04:00
Hans Goudey
f06d6185fc Cleanup: Sculpt: Use C++ vector type for symmetry flip function 2024-08-03 22:44:22 -04:00
Hans Goudey
08cd53b1d1 Cleanup: Sculpt: Remove unnecessary geodesic fallback code
It is the responsibility of the caller to make sure this is only called
for base mesh sculpting. The expand tool (the only caller of the
geodesic functions) already does this.
2024-08-03 22:44:22 -04:00
Hans Goudey
009366410f Cleanup: Sculpt: Avoid PBVHVertRef abstraction for trim tool
The tool is only supported for base mesh sculpting anyway.
2024-08-03 22:44:22 -04:00
Jesse Yurkovich
892bdf3134 USD: support color4f types in addition to color3f
Support the USD `color4f` (and related) types during import and use this
type when writing out Blender's color attributes.

This roundtrips Blender data correctly and will properly load data from
many more USD files as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/125839
2024-08-04 04:34:15 +02:00
Harley Acheson
21f2d91359 UI: Improve Icon Centering
Slightly improved sub-pixel centering of icons within their bounds. This
also adds a minimum (negative) for the offsets for the future case of
icons that require a design that overflows the design grid. Not just
that that have non-square proportions but that also need to be maximum
height or width of the design grid. These should not center themselves
but be anchored at the specified location.

Pull Request: https://projects.blender.org/blender/blender/pulls/125844
2024-08-04 03:52:06 +02:00
Hans Goudey
8e150c06bd Fix: Crash from ODR violation in sculpt color painting
I'm not sure how another definition of `LocalData` becomes visible in
this translation unit, but de60594cfc which added another
Vector to this struct exposed a crash with sculpt color painting
because the wrong struct definition was used somewhere.
2024-08-03 21:13:57 -04:00
Jesse Yurkovich
b627b68a76 Cleanup: Formatting 2024-08-04 00:35:18 +02:00
Jörg Müller
e6178be3b8 Fix #125011: Scrubbing not producing audio output
Together with changes from upstream audaspace, this should fix the
issue. The change slightly increases the duration of the scrubbing
sound to ensure that the audio buffer size gets played back at least
before it stops playback.
2024-08-03 11:19:34 +02:00
Jörg Müller
a235a18aca Audaspace: port changes from upstream. 2024-08-03 11:19:34 +02:00
Clément FOUCAULT
d712f91881 DRW: Primitive Expansion
This PR introduces the concept of primitive expansion draws.
This allows to create a drawcall that will generate N amount of new
primitive for an original primitive in a `gpu::Batch`. The intent is to
phase out the use of geometry shader for this purpose.

This adds a new `Frequency::GEOMETRY` only available for SSBOs.
The resources using this will be fed the current `gpu::Batch` VBOs
using name matching.

A dedicated slot is reserved for the index buffer, which has its own
internal  lib to decode the index buffer content.

A new attribute lib is added to ease the loading of unaligned attribute.
This should be revisited and made obsolete once more refactor
lands.

It is similar to the Metal backend SSBO vertex fetch path but it is
defined on a different level. The main difference is that this PR is
backend independant and modify the draw module instead of the GPU
module. However, it doesn't cover all possible attribute conversion
cases. This will only be added if needed.

This system is less automatic than the Metal backend one and needs
more care to make sure the data matches what the shader expects.
The Metal system will be removed once all its usage have been
converted.

This PR only shows example usage for workbench shadows. Cleanup PRs
will follow this one.

Rel #105221

Pull Request: https://projects.blender.org/blender/blender/pulls/125782
2024-08-03 11:06:17 +02:00
Jesse Yurkovich
11e7b7d0bd Collection Export: Allow renaming of exporters in the UI list
Allow the user to rename their collection exporters.

Pull Request: https://projects.blender.org/blender/blender/pulls/125553
2024-08-02 22:36:43 +02:00
Sean Kim
e758e947c4 Cleanup: Sculpt: Extract boundary strength calculation
Pull Request: https://projects.blender.org/blender/blender/pulls/125799
2024-08-02 22:10:26 +02:00
Alaska
5b61a01c19 Fix #125750: NaN on Glossy materials with low roughness
Fix a NaN when rendering glossy materials that can appear due to a
division by zero in bsdf_D when rendering materials with low roughness.

Thank you to Weizhen for the fix after my incorrect
first attempt.

Pull Request: https://projects.blender.org/blender/blender/pulls/125756
2024-08-02 16:28:42 +02:00
Miguel Pozo
09390858ab Fix #122454: EEVEE : Volumes don't render on Nvidia sometimes
The issue happens due to `out_phase_img` returning wrong values in `eevee_surf_volume_frag.glsl`.
The only workaround I've been able to find is using the same format as the other property textures.

Pull Request: https://projects.blender.org/blender/blender/pulls/125715
2024-08-02 15:58:30 +02:00
Sergey Sharybin
89ededeec4 Cleanup: Code style 2024-08-02 14:41:33 +02:00
Omar Emara
9c44349204 Fix #124023: File output always saves PNG in sRGB
The File Output node doesn't provide an option to save byte formats like
PNG in a space that is not sRGB. This is problematic for data images
like normal maps, which need to be saved as non-color.

This patch adds a Color Space option to the File Output node to allows
users to override the assumed color space. This also adds a new global
Save As Render option that is used if Use Node Format is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/124238
2024-08-02 13:52:22 +02:00
Pratik Borhade
574fe037a1 GPv3: Draw lines between frames
Draws lines between keyframes indicating that they are held.
This is similar to legacy grease pencil.

Pull Request: https://projects.blender.org/blender/blender/pulls/125813
2024-08-02 13:39:11 +02:00
Bill-Spitzak
2042669e23 Refactor: Reformulate math in domain realization
Directly calculate the transformation matrix by multiplying and
inverting the Domain matrices. This removes a double-invert and
decomposition of the matrices so it should be more accurate, and I think
makes the math a lot easier to figure out.

This also moves the "bias" for Nearest to be done in the input space
rather than output. This should make it select the same pixels from the
input even if the image is rotated 180 degrees.

Co-authored-by: Bill Spitzak <bills@sidefx.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/125543
2024-08-02 13:26:46 +02:00
Sergey Sharybin
813c18e39c Fix: Unable to duplicate mask keyframes
Pull Request: https://projects.blender.org/blender/blender/pulls/125809
2024-08-02 12:58:28 +02:00
Laurynas Duburas
6f76ac236b Overlay-Next: refactoring and fixes
Classes Speaker, Lattice, Metaball, Prepass refactored to contain one pass.
Stereo camera's connecting line fixed to always be dashed.
Metaball selection fixed in object and edit modes.

Pull Request: https://projects.blender.org/blender/blender/pulls/125684
2024-08-02 12:55:33 +02:00
Alaska
5ce29bedf6 Fix: Cycles Shadow linking with HIP-RT
Fix shadow linking not working on HIP-RT by adding code to correctly
ignore certain shadow ray hits.

Ref #125086

Pull Request: https://projects.blender.org/blender/blender/pulls/125803
2024-08-02 12:17:09 +02:00
Jacques Lucke
51f7d37716 Fix: missing update tag when remapping IDs on embedded node trees
Previously, the tag would be missing when remapping an ID on e.g. the
embedded node tree of a material.

Pull Request: https://projects.blender.org/blender/blender/pulls/125806
2024-08-02 11:43:31 +02:00
Alaska
ba5d76e7e2 Fix: Shader: Align vector math node reflect mode with OSL
Align Cycles SVM and EEVEE's rendering of the vector math node
in reflect mode with OSL when the normal vector is 0,0,0.

This is done by using safe_normalize rather than normalize on the
normal vector. Which also fixes a NaN in the reflect mode in this
specific configuration.

Pull Request: https://projects.blender.org/blender/blender/pulls/125688
2024-08-02 11:20:57 +02:00