Commit Graph

120055 Commits

Author SHA1 Message Date
Philipp Oeser
475865ddb7 Merge branch 'blender-v4.1-release' 2024-03-21 11:13:23 +01:00
Omar Emara
20f930c8d8 Cleanup: Clarify comment in MemoryBuffer class 2024-03-21 12:01:39 +02:00
Pratik Borhade
bc74bbef0b Fix: GPv3: Empty grease pencil object crash
The `bounds` is `nullopt` when the number of points is 0 at current frame.
The fix uses `value_or()` to make sure we get some bounds.
Also uses `Bounds<float3>` instead of `std::optional<Bounds<float3>>`
in `gpencil_object_cache_add`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119690
2024-03-21 11:00:39 +01:00
Omar Emara
12d34fed91 BLI: Add step function to math library
This patch adds a step function that is equivalent to the GLSL step
function to the BLI math library.

Needed by #119414.

Pull Request: https://projects.blender.org/blender/blender/pulls/119731
2024-03-21 10:54:17 +01:00
Guillermo Venegas
aa03646a74 UI: support layout panels in popups
Enables operators that uses `WM_operator_props_dialog_popup`
or `redo` popup to use layout panels.

Other popups would likely also support layout panels, only
they need to set its dummy panel with `UI_popup_dummy_panel_set`.
Popups don't normally use `Panel`, but that's the type that stores the
layout panel states. Therefore, to use layout panels in a popup, one
currently needs to create a dummy panel whose purpose is to store the
layout panel states for as long as the popup is open.

Alternatively, we could potentially also store the layout panel states
somewhere else in the future for popups, but that might be a more involved
change for now.

See #119519 for an example script that uses layout panels in a popup.

Pull Request: https://projects.blender.org/blender/blender/pulls/119519
2024-03-21 10:31:05 +01:00
YimingWu
e22eaf8783 Fix #119714: GPv3: Remove cyclic stroke point count limit
It's not necessary to check for `points.size() >= 3` since the extra
point space is always added thus the point should always be filled with
valid attribute to avoid erroneous "closing stroke".

Pull Request: https://projects.blender.org/blender/blender/pulls/119727
2024-03-21 09:04:20 +01:00
Germano Cavalcante
24be7bd99e Fix #119716: snap in curve editing when mesh is generated by Geometry Nodes
In these cases, the Mesh is defined as an instance of the object.
These instances need to be ignored when in edit mode.
2024-03-20 23:46:55 -03:00
Germano Cavalcante
43e1e88223 Cleanup: use const pointers where possible in ED_view3d API 2024-03-20 22:42:14 -03:00
Campbell Barton
03ebef0fad Cleanup: typos in recent code-comments 2024-03-21 11:57:41 +11:00
Campbell Barton
98a8ed2002 Cleanup: forward event to WM_operator_name_call_ptr
In general it's best practice to forward events when available.
2024-03-21 11:46:56 +11:00
Campbell Barton
f64f3e8524 Extensions: recursively remove custom-directories on repo removal
Even though there is a dialog users must accept when removing a
repository & directory being removed is shown, it's possible users
assume this only removes files which are part of the repository after
pointing the custom-directory to their home directory or similar.

Removing repositories which point to a custom-directory now only
remove packages and server meta-data to prevent accidents.

Resolves #119481.
2024-03-21 11:43:00 +11:00
Pratik Borhade
2df06a05ae GPv3: Show stats in edit mode
GPv3 uses `OB_MODE_EDIT` so it falsely shows empty mesh data in stats.
This worked in legacy gp because it had special edit_mode type.
To show correct grease pencil data in edit mode, rearrange if conditions and
add special check for `OB_GREASE_PENCIL`

Pull Request: https://projects.blender.org/blender/blender/pulls/119689
2024-03-21 01:15:18 +01:00
Campbell Barton
57dd9c21d3 Cleanup: spelling in comments 2024-03-21 10:02:53 +11:00
Campbell Barton
116264c310 Cleanup: use full scentences for code-comments & minor corrections 2024-03-21 09:49:19 +11:00
Campbell Barton
fbe16bc1eb BLI_delete: assert that dir is true when recursive is true
While this isn't an error avoid ambiguity for recursive deletion
as it's not meaningful to delete a file.
2024-03-21 09:43:40 +11:00
Campbell Barton
4e3771124d Docs: BLI_delete parameters & behavior with symbolic-links 2024-03-21 09:35:40 +11:00
Hans Goudey
ddcfc46ee6 Fix #119544: Cage modifier deformation ignored in next modifier
When the edit mesh modifier stack first deforms the original edit mesh,
it creates deformed positions in a separate array. That array is copied
to the mesh's vertex positions if a subsequent modifier requires an
actual mesh rather than a mesh wrapper.

However, if that last deform modifier is the last "on cage" modifier
and the next modifier requires a real Mesh, we hit a code path that
didn't copy the temporary position array, since it was contained in the
separate `EditMeshData` struct that must be handled manually.

This was a regression in 91b27ab637. In the future I hope to
make this simpler by expanding the use of implicit sharing and making
the conversion from original BMesh to a Mesh more lazy / const correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/119718
2024-03-20 23:16:02 +01:00
Miguel Pozo
9b1ba4fced Fix: EEVEE-Next: Metal compilation
Compilation errors after #119436

Pull Request: https://projects.blender.org/blender/blender/pulls/119709
2024-03-20 19:09:31 +01:00
Miguel Pozo
81ceff8e73 Fix: Missing subversion update
Missing from #119436
2024-03-20 18:39:46 +01:00
Harley Acheson
d0eacbd6ba Merge branch 'blender-v4.1-release' 2024-03-20 09:07:40 -07:00
Harley Acheson
afbd733047 Fix #119635: File Browser Horizontal Display Never Compact
File Browser listings can clip content, remove columns, etc as the
available space narrows. This PR just makes this never happen for
the horizontal display mode, where files are shown in multiple columns,
as this is not applicable.

Pull Request: https://projects.blender.org/blender/blender/pulls/119673
2024-03-20 17:06:38 +01:00
Sergey Sharybin
e0b413f818 Merge branch 'blender-v4.1-release' 2024-03-20 16:06:36 +01:00
Sergey Sharybin
4eab8fae5a Fix #119697: Incorrect update after disabling light linking
The issue was caused by 29aaa2922d.

With the change from the offended commit there was nothing that
would have informed objects previously linked to a light that they
need to re-calculate their light linking collections.

This change makes it so scene's hierarchy is tagged for update,
which propagates to all dependencies which do depend on hierarchy
of objects and collections in the scene.

This brings behavior closer to what it used to be, without causing
slowdown with full re-evaluation (which was fixed by the offending
commit).

Pull Request: https://projects.blender.org/blender/blender/pulls/119698
2024-03-20 16:06:06 +01:00
Miguel Pozo
3888bdf8b2 EEVEE-Next: Fix transparent shadows convergence
Replace the hashed alpha function in shadows for a fully random one.
Add pcg functions to `gpu_shader_common_hash.glsl`
(Split from #119480)

Pull Request: https://projects.blender.org/blender/blender/pulls/119526
2024-03-20 16:05:07 +01:00
Hans Goudey
3f10ba244a Cleanup: Use C++ types in view3d_navigate.cc, restore fix from merge
Also restore a fix that was lost in the merge commit from 4.1.
2024-03-20 11:00:25 -04:00
Miguel Pozo
881fd2dbd5 EEVEE-Next: Jittered Shadow Transparency
Smooth transparent shadows by jittering their opacity threshold every
sample.
Always enabled on final renders, optionally enabled in the viewport with
`scene.eevee.shadow_jittered_transparency`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119480
2024-03-20 15:55:58 +01:00
Miguel Pozo
0c8b96d1e0 EEVEE-Next: Shadow resolution scale and adaptive filtering
Allow the user to scale shadow-map resolution per-light.
Adapt the PCF scale based on shadow-map to pixel footprint ratio,
since we can no longer assume that higher LODs don't need filtering.
This allows using much lower shadow resolutions, which can yield
quite significant performance improvements, with relatively little
perceptual quality loss (at the cost of softening shadow edges).
The per-light resolution scale is a literal scale, so for example 0.5
means half the resolution. The Scene Simplify Shadows setting has
been updated to match this behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/119436
2024-03-20 15:54:41 +01:00
Brecht Van Lommel
dc34e96dc4 Merge branch 'blender-v4.1-release' 2024-03-20 15:49:15 +01:00
Jason Fielder
c584597165 Fix #109363: Resolve GPencil fill in Metal
Resolves an issue with stroke rendering in
Metal using the geometry shader fallback
path. Stroke rendering now matches OpenGL
which should enable the GPencil fill tool to
function correctly at all zoom levels.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119660
2024-03-20 15:38:44 +01:00
Hans Goudey
6d3ac72a29 Merge branch 'blender-v4.1-release' 2024-03-20 10:19:49 -04:00
Hans Goudey
87de8109b7 Fix: Build error from misplaced const in recent commit 2024-03-20 10:09:06 -04:00
Hans Goudey
cb3975c045 Fix #119642: Orbit around selection ignores geometry bounds
The code tried to retrieve the bounds from the data
synced back to the original object at the end of depsgraph
evaluation. That data is only set on original objects.

Instead just retrieve the bounds directly from the evaluated
object. Also make two variables const now that it's possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/119674
2024-03-20 14:47:27 +01:00
Sergey Sharybin
6dc1cffe33 Merge branch 'blender-v4.1-release' 2024-03-20 14:38:52 +01:00
Sergey Sharybin
03c7191286 Fix #119560: Wanderer Demo Crash in 4.1 and 4.2
Add a null pointer check around CPU processor, matching the rest of the
processor access.

This solves crash in cases when the OCIO configuration exists but is
invalid: i.e. by removing a lookup table. It could lead to an invalid
render result, but is better than a crash.

The original issue with running Blender from within .zip archive might
still need investigation, as there might be a way to make it work.

Pull Request: https://projects.blender.org/blender/blender/pulls/119693
2024-03-20 14:38:23 +01:00
Michael Kowalski
99b845b1fb Fix: USD import: point instancer invalid modifier uid
Initializing the uid of the geom nodes modifier created
by the point instancer reader to prevent an assertion failure
(in a call to to BKE_modifiers_persistent_uids_are_valid())
when reading any USD point instancers in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/119683
2024-03-20 13:59:00 +01:00
YimingWu
3689dfca4f GPv3: Build Modifer migration
Reimplemented build modifier using the new `CurvesGeometry` logic.

Pull Request: https://projects.blender.org/blender/blender/pulls/118739
2024-03-20 13:28:28 +01:00
Pratik Borhade
c250b4bd51 Merge branch 'blender-v4.1-release' 2024-03-20 17:27:43 +05:30
Jacques Lucke
1fadf2251f Nodes: align functions to check if socket type supports fields or grids 2024-03-20 12:55:49 +01:00
Pratik Borhade
f99939e2ff Cleanup: Remove redo panel drawing code of graph select handle
Since there is no special case for drawing redo panel, this callback is
not required. Panel will be generated automatically because `undo` and `register`
flags are added to operator.
This improves alignment in redo panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/119494
2024-03-20 12:55:13 +01:00
Jacques Lucke
25a10c211f Nodes: support accessing socket type directly from declaration
Previously, we haven't added this because there were plans to use these
declarations at a higher abstraction level where one declaration potentially
contains more than one socket. This hasn't happened yet, and we are also using
other ways to achieve dynamic socket amounts (using dynamic declarations).
Therefore, it is reasonable to simplify the code by storing the integer socket
type in the declaration directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/119691
2024-03-20 12:37:37 +01:00
Jacques Lucke
7447666c85 Merge branch 'blender-v4.1-release' 2024-03-20 11:48:42 +01:00
Jacques Lucke
067daec270 Nodes: don't use combined input/output sockets in node tree interface
Those shouldn't really exist at all currently, since we forbid them in 354915cf3c.
Unfortunately, not all cases were removed, and many node trees with such sockets
have been created during the development of 4.1 due to the auto-smooth changes.

I'm not entirely sure if it's still possible to properly remove them now. The commit
above mentions that we might lose links due to changed identifiers. Maybe we're
better off just supporting these inlined sockets while also allowing the "align with
previous socket" functionality.

Either way, not creating more of such node trees for now is reasonable, since we
explicitly disabled that functionality for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/119654
2024-03-20 11:26:07 +01:00
Thomas Dinges
31eaa2f5ba Merge branch 'blender-v4.1-release' 2024-03-20 08:38:41 +01:00
Jason Fielder
3c25b079ce Fix #109739: Resolve greyed out UI on MacOS
UI would sometimes disappear with the Metal backend.
This occured in situations where there was only a single
GPUContext within a single GHOST window, meaning
the activation routine for the context was never run.

Context activation is required to ensure the backbuffer
was up to date upon resize. Otherwise, re-sizing the
window would cause the screen to turn grey as the
new drawables would not be rendered to.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/119299
2024-03-20 08:33:29 +01:00
Campbell Barton
3135e766ec Cleanup: replace UI_MAX_NAME_STR with BKE_ST_MAXNAME
Since [0] some comments referencing UI_MAX_NAME_STR were incorrect.
Also correct buffer size for preview_id in uiTemplatePreview so newly
created names are guarantee to be the correct size.

[0]: a180314ac5
2024-03-20 15:14:08 +11:00
Campbell Barton
ee64778cac Cleanup: code-comments for struct ID's and use backtick quotes
- Prefix comments before members is used practically everywhere,
  remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
2024-03-20 14:43:35 +11:00
Campbell Barton
729949669e Fix #114667: UI List search broken when class names >32 chars
The list identifier includes the class name and an list_id,
see: WM_uilisttype_to_full_list_id

This requires using UI_MAX_NAME_STR (as noted in doc-string).
2024-03-20 14:41:56 +11:00
Sean Kim
130ce5f53d Cleanup: Remove redundant function prefixes in sculpt_trim.cc
This PR strips the `sculpt_gesture_trim` prefix and other similar
prefixes from the `sculpt_trim.cc` code, as it is already contained
within the `blender::ed::sculpt_paint::trim` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119680
2024-03-20 03:41:21 +01:00
Campbell Barton
9edb2784da Fix #117320: UV Sync-select selects faces instead of just edges 2024-03-20 13:39:43 +11:00
Sean Kim
e53d4e423e Cleanup: Convert sculpt_trim.cc to enum class
This PR converts the three `enum` definitions to `enum class` in sculpt_trim.cc

Pull Request: https://projects.blender.org/blender/blender/pulls/119679
2024-03-19 22:38:25 +01:00