Commit Graph

112027 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Bastien Montagne
5ce7937101 Fix (unreported) wrong alignement handling for mat4x4f DNA struct.
Code was using the `struct_index` instead of the `type_index` to set the
alignement value for this struct, effectively setting that alignement
value for another struct/type than `mat4fx4f`.

Found while working on naming cleanups of maksdna code.

Pull Request: https://projects.blender.org/blender/blender/pulls/125777
2024-08-02 11:11:51 +02:00
Jacques Lucke
c90f13f2b3 Fix #124702: crash when pasting material 2024-08-02 11:07:22 +02:00
Sergey Sharybin
1a266f6894 Cleanup: unused variable 2024-08-02 10:13:05 +02:00
Pratik Borhade
e60422c5a7 GPv3: Delete active keyframe operator
Port missing keyframe operator to new structure.
Found this missing operator during #125261

Pull Request: https://projects.blender.org/blender/blender/pulls/125770
2024-08-02 08:18:32 +02:00
Sean Kim
a88327411d Fix: Debug assert for boundary brush
Pull Request: https://projects.blender.org/blender/blender/pulls/125797
2024-08-02 04:41:38 +02:00
Sean Kim
e4b56c3765 Fix #125785: Mesh Filter sharpen mode has no effect
`add_v3_v3v3(disp, disp_avg, disp_sharpen);` was accidentially changed
to `disp = disp_avg * disp_sharpen;`

Pull Request: https://projects.blender.org/blender/blender/pulls/125794
2024-08-02 01:38:40 +02:00
Harley Acheson
97fc0d2716 Refactor: Change Name of ed_workspace_status_mouse_item
Rename ed_workspace_status_mouse_item to ed_workspace_status_icon_item
as this is not specific to mouse icons. Just a brain-fart because this
function has specific handling of mouse icons because of spacing
issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/125790
2024-08-01 22:42:25 +02:00
Harley Acheson
48d55fb420 UI: Always Show Version Patch Level
PR #125332 made changes to the format of the version string displayed
on the title bar and in status bar. These changes included not showing
the patch level if zero.  Unfortunately this also changes the version
as displayed on the command-line with "--version".  This particular
change was approved quite hastily so this PR just reverses that, always
shows zero patch level and therefore shows the command-line version as
before.  If we want to hide patch zero we can debate this specifically
later.

Pull Request: https://projects.blender.org/blender/blender/pulls/125788
2024-08-01 21:57:31 +02:00
Harley Acheson
885824540a UI: Increase Size of Curve Control Points
Curve control points are shown quite small regardless of UI scale and
local zooming. This PR increases the minimum, regular, and maximum
sizes so that they are easier to see in all circumstances.

Pull Request: https://projects.blender.org/blender/blender/pulls/125786
2024-08-01 20:51:42 +02:00
Hans Goudey
d282b1735e Sculpt: Remove color buffer from sculpt BVH tree
Part of #118145.
Instead of storing a separately allocated array for each BVH node
for the temporary "color buffer" colors meant for mixing during a
stroke, just store an array the size of the whole mesh. Though this
is wasteful in terms of memory usage, plenty of other brushes store
mesh-sized arrays already, and it should make more sense as BVH
nodes get smaller too. After this commit, the BVH tree has no
specific code for color attributes anymore.
2024-08-01 13:58:50 -04:00
Harley Acheson
90e7331d10 Fix #125558: Show UI_BTYPE_CURVE Control Points
The curve control points are almost invisible because it is missing a
call to GPU_program_point_size, which allows the setting of dot size
in the shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/125744
2024-08-01 19:56:32 +02:00
Hans Goudey
a0a70bf46d Refactor: Sculpt: Simplify cloth brush persistent base retrieval
Pass a single span for both cloth brush init positions and the persistent
base array instead of switching between the two every time. Also only
retrieve the persistent base for base mesh sculpting since AFAIK that's
the only situation where it works properly anyway.
2024-08-01 13:09:12 -04:00
Hans Goudey
606e880d29 Refactor: Sculpt: Specialize cloth constraints creation per PBVH type
Use the same method for sharing code as elsewhere in the cloth brush:
translate the SubdivCCG and BMesh data structures to the equivalent
vertex indices used by meshes. This commit has to add some more code
for that because we only want to process visible vertices and there are
no factors being used for the typical filtering method used by brushes.
2024-08-01 13:09:12 -04:00
Hans Goudey
0fdd251826 Cleanup: Sculpt: Remove unused fields from cloth sim struct 2024-08-01 13:09:11 -04:00
Hans Goudey
b62fe77604 Cleanup: Sculpt: Reorder cloth constraints function 2024-08-01 13:09:11 -04:00
Miguel Pozo
644e7bf309 Fix #125185: Weight Paint Overlay doesn't work with EEVEE-Next
Use less or equal depth comparison for EEVEE and Overlay, since their
depths no longer match.
The main disadvantage of this approach is that material masked
transparency won't work anymore with overlays, so there's still another
(arguably not as bad) regression.

Pull Request: https://projects.blender.org/blender/blender/pulls/125722
2024-08-01 17:40:53 +02:00
Hans Goudey
387cc06c12 Sculpt: Use new API for weight/vertex paint factors
Part of #118145.
For computation of factors, use the new API functions that handle
more than one vertex at a time.
2024-08-01 10:53:35 -04:00