Commit Graph

120055 Commits

Author SHA1 Message Date
Germano Cavalcante
b0d37b4267 Fix #128074: Edit Mesh being occluded for snapping even in Xray
Caused by 1c77779160

That commit removed the part that created the skip_occlusion_plane
variable for edit meshes. Therefore, restore that part of the code.
2024-09-25 22:42:24 -03:00
Campbell Barton
36edfe04e0 Refactor: move blenlib tempfile to C++ 2024-09-26 09:39:35 +10:00
Habib Gahbiche
aac0c2cc5f Fix #127051: Compositing using multiple Levels nodes freezes Blender
Multiple levels nodes in a row causes blender to freeze when combined with other constant operations. Also, current results of standard deviation are wrong.

The problem was that constant folding optimized constant operations away, which caused a cyclic node graph, and therefore the freeze during node graph evaluation. Preventing such optimizations solves the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/127316
2024-09-26 01:37:23 +02:00
Sean Kim
d80011d11a Cleanup: Fix missing-declarations warning
Missed in 16550f78ea

Pull Request: https://projects.blender.org/blender/blender/pulls/128140
2024-09-25 23:13:33 +02:00
Hans Goudey
18c59d02a3 Fix: Lite build error after recent VSE commit
b4e5412a28
2024-09-25 16:04:38 -04:00
Sean Kim
16550f78ea Cleanup: Sculpt: Consolidate Flatten, Fill, and Scrape brushes
These brushes all share the same code except for a single line which
adds an optional extra filter on the factors when performing the brush
stroke and a single inversion of the offset for the scrape brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/128048
2024-09-25 21:54:16 +02:00
notrudyyy
76d4686987 Cleanup: Fix mesh face corner next/prev function descriptions
Swaps the descriptions of face_corner_prev and face_corner_next to be correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/128137
2024-09-25 21:52:11 +02:00
Pratik Borhade
f90e1b506f Fix: Hide id operator for menus in context menu
Continuation of !126927.  Do not show some items on the button context
menu when not appropriate. Handle the case of MenuType buttons.

Pull Request: https://projects.blender.org/blender/blender/pulls/128070
2024-09-25 21:43:41 +02:00
Hans Goudey
90ec79992f Fix: Potential crash in mesh comparison tests with mismatched attributes
Currently we allow the before/after meshes to have different
sets of attributes. But then we compare all attributes in each
mesh anyway, regardless of whether they exist or not.
2024-09-25 15:22:19 -04:00
Germano Cavalcante
504c1506b2 Fix: Snap to Grid with constraint limited to floor level
Caused by 1180a25c23

The `use_init_co` member can vary after a transformation.
It indicates whether to use the ground level or the 3D grid.
2024-09-25 16:06:21 -03:00
Miguel Pozo
2223d995fc Fix: Draw: Bounds usage
The first commit ensures IsectBoxes are not set up unless
they are valid.

The second commit renames
`drw_bounds_are_valid` to `drw_bounds_corners_are_valid`,
and `drw_bounds_culling_enabled` to `drw_bounds_are_valid`
so it's harder to set up an invalid `IsectBox` by mistake.

(Continuation of #127807)

Pull Request: https://projects.blender.org/blender/blender/pulls/128125
2024-09-25 19:58:38 +02:00
Sean Kim
df251784cd Fix: Avoid accessing face set with invalid index
When the PBVH is rebuilt, the `active_face_index` and
`active_grid_index` fields are initialized to -1. This results in a
possible segmentation fault if the `active_face_set_get` method is
called without these fields being populated.

This commit switches the raw `int` usage for `std::optional` to
better communicate the intent of these fields.

Pull Request: https://projects.blender.org/blender/blender/pulls/127959
2024-09-25 19:19:21 +02:00
Jonas Holzman
5cfe733f84 UI: Color Picker layout rework
Refactoring of the color picker popup. This simplifies code, removes
cruft, and adds new features. The Hex input is removed from its own
tab and placed at the bottom of the layout. The picker circle is made
just a bit smaller. "#" added to the hex values.

Pull Request: https://projects.blender.org/blender/blender/pulls/125675
2024-09-25 18:56:32 +02:00
Sebastian Parborg
b4e5412a28 VSE: Unwanted offset when adding a sound strip
When adding sound strips, it would in some cases be offset
from the desired start position.

This was because some sound files had a start time that was not 0
even if they didn't have any video file associated with them.
Only try to shift the sound strip around if it is added with a video
strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/127256
2024-09-25 18:53:55 +02:00
Bastien Montagne
22477956e2 Refactor: Move BPY main/public extern headers to proper C++ ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/128081
2024-09-25 18:04:33 +02:00
Bastien Montagne
6c0c53161e Refactor: Move BPY bmesh headers to proper C++ ones. 2024-09-25 18:04:27 +02:00
Bastien Montagne
c3247aa4f0 Refactor: Move BPY generic headers to proper C++ ones.
NOTE: `bgl.h` was left unchanged, as it is deprecated code anyway, and
its conversion to C++ does not seem immediately trivial.
2024-09-25 18:04:27 +02:00
Bastien Montagne
4fac7828e4 Refactor: Move BPY mathutils headers to proper C++ ones.
This module actually was confusing, since only a few headers were
effectively still C ones (using the `extern "C"` blocks)...
2024-09-25 18:04:27 +02:00
Bastien Montagne
4dd11465bc Refactor: Move BPY intern remaining headers to proper C++ ones. 2024-09-25 18:04:27 +02:00
Bastien Montagne
198a1ec7a9 Refactor: Move BPY intern bpy_app headers to proper C++ ones. 2024-09-25 18:04:27 +02:00
Bastien Montagne
91e4bcd204 Refactor: Move BPY intern bpy_rna headers to proper C++ ones. 2024-09-25 18:04:27 +02:00
Pratik Borhade
120d2b867b Fix #127365: Bisect operator modal keys missing in status bar
`workspace->runtime->status` is not empty, which gave perference to
existing text instead of the modal operator keys in `uiTemplateInputStatus()`.
To fix this for bisect operator, clear `status` vector in modal
function.

Pull Request: https://projects.blender.org/blender/blender/pulls/127449
2024-09-25 17:59:23 +02:00
Aleš Jelovčan
9ee00e3711 Fix #128119: GPv3: Modifier UI cleanups
The following changes were made:
* Update the icons of the "Smooth" and "Line Art" modifier to use the same icons as before
* Update the "Array", "Mirror", and "Subdivide" modifiers to not use "strokes" in the name.

Pull Request: https://projects.blender.org/blender/blender/pulls/128122
2024-09-25 16:47:58 +02:00
Jason Fielder
57f7d6380c Fix #126542 Fix UV Edge overlays in Metal
Takes into account any offset that must be added to the vertex index
(usually supplied as baseVertex or startVertex in the Metal draw call)
in the code that emulates the SSBO vertex fetch.

Authored by Apple: James McCarthy

Pull Request: https://projects.blender.org/blender/blender/pulls/127864
2024-09-25 15:22:30 +02:00
Laurynas Duburas
84dedfaf4b Curves: smooth handles
Adds antialiasing to curve's handles and thickness to active ones.
Also handles now react to
 `Preferences > Interface > Display > Resolution Scale` and
`Preferences > Themes > 3D Viewport > Edge Width` as they do in
legacy curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/122910
2024-09-25 15:21:31 +02:00
Lukas Tönne
12ef319a49 Support Menu sockets in the for-each-element zone
Adds support for the "Menu" socket type in for-each-element zones. This
only includes field inputs and their matching per-element values, but
not outputting attributes of type Menu (Menu attributes are not
generally supported at this point).

A dedicated enum propagation function is added for the zone input node.
This isn't technically necessary: the first 2 inputs and outputs should
be ignored but are not menus anyway. However, this is clearer and
provides a place for future changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/128106
2024-09-25 15:13:16 +02:00
Hans Goudey
f4de8c1a67 Fix: Incorrect viewport transform node tooltip
The View matrix isn't really the direction and location of the viewport,
it's the opposite, since it transforms object space into camera space.
Change both tooltips to state the change of transform space instead
of using nouns to try to describe what they "are".

Pull Request: https://projects.blender.org/blender/blender/pulls/124741
2024-09-25 15:10:39 +02:00
Philipp Oeser
e71c844354 Fix #127944: Normal rotates in wrong direction
Not verified by actually building, but pretty sure this was caused by
8bff3ec76b.

Since above commit, the Z axis of the View orientation was not negated
by default anymore.
This was then being accounted for in `applyRotation` (but not
`applyNormalRotation`).

So to resolve, do the same in `applyNormalRotation` as in
`applyRotation` (so negate there).

Pull Request: https://projects.blender.org/blender/blender/pulls/128115
2024-09-25 13:22:06 +02:00
Lukas Tönne
2459247f9f GPv3: Enable selection operators and overlays in vertex paint mode
Vertex paint mode also supports masking based on selection, so the
selection overlay and relevant operators should also be enabled in that
mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/128114
2024-09-25 12:40:46 +02:00
Campbell Barton
01825a85cb Cleanup: quiet compiler warnings 2024-09-25 20:14:06 +10:00
Campbell Barton
8dcd51ddc3 Fix crash in recent fix for #128104 2024-09-25 19:37:20 +10:00
Lukas Tönne
6c5b5a7683 Cleanup: formatting. 2024-09-25 11:32:12 +02:00
Campbell Barton
0e08e8bf2d Cleanup: add missing CMake headers, update "check_cmake" config 2024-09-25 19:24:21 +10:00
Campbell Barton
840c65f442 Cleanup: spelling in comments 2024-09-25 19:24:20 +10:00
Campbell Barton
c3b11fbfae Cleanup: correct outdated code comment 2024-09-25 19:24:18 +10:00
Lukas Tönne
59ac6074b7 Fix #128104: Selection operator poll function broken
The poll function was accidentally changed to return false when no
object is selected or the active object is not one of the special types
checked by the function. Reverted to return true in those cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/128110
2024-09-25 10:58:51 +02:00
Sybren A. Stüvel
407e18ed47 Anim: upgrade action group handling code to new API
Upgrade the handling of action groups in various areas to the new Layered
Actions API.

No functional changes for legacy Actions.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128088
2024-09-25 09:36:18 +02:00
Sybren A. Stüvel
02ebab57da Anim: add layered Action support to BKE_animdata_transfer_by_basepath
Add explicit handling of slots to `BKE_animdata_transfer_by_basepath()`,
and modernise the code to use the new API.

No functional changes for legacy Actions.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128088
2024-09-25 09:35:33 +02:00
Sybren A. Stüvel
4159f60e46 Anim: Layered Action support in group handling in action_mirror.cc
Use the `animrig::legacy::channel_groups_all()` function to get action
groups in a way that's compatible with both legacy and layered Actions.

No functional changes for legacy Actions.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128088
2024-09-25 09:35:30 +02:00
Sybren A. Stüvel
11f750bc7f Anim: update BKE_action Action Group functions
In `BKE_action.hh`, update the Action Group related functions, so that
either they are legacy-only or can handle layered Actions as well.

Legacy-only functions not only are documented as such, but also assert
that the given Action is a legacy one.

No functional changes for legacy Actions.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128088
2024-09-25 09:35:27 +02:00
Sybren A. Stüvel
5524a06038 Anim: support layered Actions in BKE get/set active actiongroup functions
Add slotted/layered Action support to `get_active_actiongroup()` and
`set_active_action_group()`.

Note that there is still a bunch of code around that directly manipulates
the action group flags, instead of using these functions. That's for
another commit to address.

This commit also introduces the functions `action_treat_as_legacy()` and
`channel_groups_all(action)` utility functions in the `animrig::legacy`
namespace.

Ref: #123424

Pull Request: https://projects.blender.org/blender/blender/pulls/128084
2024-09-25 09:33:04 +02:00
Jacques Lucke
b8b497dcac Geometry Nodes: add Iteration socket to repeat zone
For most cases where the iteration index is needed, a For Each zone is the
better than using a Repeat zone. It's easier to use and more optimizable.
However, in some cases a Repeat zone is actually the right solution and the
index often useful in such cases too.

Pull Request: https://projects.blender.org/blender/blender/pulls/127521
2024-09-24 23:35:35 +02:00
Harley Acheson
8450aa275f UI: Area Docking as Regular Feature, Not Experimental
This PR makes "Interactive Editor Docking" a regular feature, available
by default, and removes the option from Experimental Preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/127810
2024-09-24 23:23:48 +02:00
Jesse Yurkovich
9e11e95817 Cleanup: remove unused CacheReader_incref APIs
These were unused since 89826e0a0d.

Pull Request: https://projects.blender.org/blender/blender/pulls/128091
2024-09-24 22:40:06 +02:00
Hans Goudey
96c8ede062 Refactor: Sculpt: Deduplicate symmetry vertex search
Currently code to find symmetrical vertices is duplicated
a couple times-- in the expand operator and in the flood
fill API. This commit removes the symmetry processing from
the flood fill API, which arguably shouldn't need to know
about symmetry options in the first place.

Pull Request: https://projects.blender.org/blender/blender/pulls/127804
2024-09-24 22:26:22 +02:00
Jesse Yurkovich
e045471259 Cleanup: remove unused functions from usd_blend_shape_utils
These have been unused since the initial commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/128049
2024-09-24 19:07:03 +02:00
Jesse Yurkovich
2cdbe7b5f3 Fix: USD: Support color attributes on all relevant domains
Color primvars/attributes were historically treated as a special case
for both import and export. This was mostly done to align with how
painting and viewport display works in Blender. Export would generally
ignore color attributes except when they were found on a Mesh's Point or
FaceCorner domains. And import went out of its way to map incoming color
primvars to the FaceCorner domain in more situations than necessary.

To facilitate better roundtripping in Blender<=>USD workflows, and to
reduce code duplication, this PR teaches the common attribute utilities
how to handle color types. The color attributes will now work on all
relevant Mesh and Curve domains.

There were tests in place for this already but they were set to verify
the inverse state, i.e. the technically broken state, until this could
be fixed.

There remains one special case: "displayColor" primvars and attributes.
The "displayColor" is a special primvar in USD and is the de-facto way
to set a simple viewport color in that ecosystem. It must also be a
color3f type. In order to not regress import, if a "displayColor"
primvar is found on the Face domain we will map it to FaceCorner instead
so it can be displayed in the viewport; which has been the case for the
past several releases. We can drop this special-case if/when Blender can
display Face colors through the Viewport Shading "Attribute" color type.
Additionally, Blender will export this, and only this, color attribute
as a color3f.

Note: As was the case prior to this PR, the following 2 discrepancies
still prevent "perfect" round-trips:
- USD does not have an equivalent to Blender's byte colors; they are
  treated as float during IO
- Blender does not have an equivalent to USD's color3 types; they are
  treated as color4 during IO

Pull Request: https://projects.blender.org/blender/blender/pulls/127784
2024-09-24 19:05:55 +02:00
Jacques Lucke
a6d5652043 Geometry Nodes: use placeholder instead of label in some string sockets
This makes the input field much wider. I enabled this for most string sockets
except for a few where it is important to see the label even if the user has
inserted a string already (usually because there is more than one string input).

Pull Request: https://projects.blender.org/blender/blender/pulls/127992
2024-09-24 18:22:32 +02:00
Iliya Katueshenock
8027720e51 Refactor: Nodes: handle unavailable sockets in declaration instead of update function
This refactor changes many nodes to set socket availability in the node
declaration instead of using the more generic `bNodeType::updatefunc`.

This fixes issues where sockets that should be unavailable in evaluated data are
actually available. Also it moves us closer to a state where the generic update
function is not necessary anymore. The update function being so generic makes it
hard to integrate it well into the high level tree update code, because
"anything could happen" in that callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/127845
2024-09-24 18:05:19 +02:00
Sean Kim
591f4c0e59 Sculpt: Add Mask from Boundary Operator
This commit adds the Mask from Boundary operator, which creates or
otherwise modifies a mask based on the the mesh boundary or the face
set boundaries of the mesh.

Conceptually, it behaves similarly to the corresponding automasking
options and the existing Mask from Cavity operator. When applying this
setting, it either uses the global scene value, the brush specific
value, or the operator-defined values. As such, it is exposed in the
existing automasking menus and inside the main Mask menu in Sculpt mode.

Based on this [1] RCS request.

[1] https://blender.community/c/rightclickselect/DYKy/

Pull Request: https://projects.blender.org/blender/blender/pulls/127787
2024-09-24 18:02:30 +02:00