Commit Graph

117289 Commits

Author SHA1 Message Date
Sean Kim
e01713be7c Fix #129135: Automasking topology doesn't work with certain brushes
Introduced in 915be63b01

Also fixes an unreported similar issue with BMesh

Pull Request: https://projects.blender.org/blender/blender/pulls/129139
2024-10-17 23:12:20 +02:00
Jesse Yurkovich
5c65ad4b1b Cleanup: use non-void return types for BKE_*_add functions
Many of the functions were already using proper types. This changes the
others still using `void *` to return their proper types directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/128980
2024-10-17 21:05:18 +02:00
Sybren A. Stüvel
56e6eb6d6d Fix merge issue
Remove an `#endif` that was accidentally merged from
`blender-v4.3-release` to `main`.
2024-10-17 19:12:20 +02:00
Falk David
72aca040e3 Merge branch 'blender-v4.3-release' 2024-10-17 18:35:19 +02:00
Falk David
0a560582b5 Fix: GPv3: Python: Missing parent_group property on layer groups
This property was available for `layers` but was missed for layer groups.
Adds a `parent_group` property for layer groups that returns the
parent group if the group is inside another group.
For groups that are inside the root, returns `None`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129168
2024-10-17 18:34:19 +02:00
Clément Foucault
a4ef779abe Fix: Overlay-Next: Assert caused by unreleased texture 2024-10-17 18:23:45 +02:00
Bastien Montagne
1e55d034a1 Fix massive amount of memleaks on exit in BPY.
Essentially, our current code would not properly remove (dereference)
its python objects matching various RNA data created during execution.

Some cases are fairly trivial to understand (like the lack of handling
of unregstering for our 'startup' operators and UI), other were more
subtle (like unregistered PropertyGroups who would remove/free their RNA
struct definition, without releasing first the potential matching python
object).

Co-authored-by: Campbell Barton <campbell@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/128899
2024-10-17 18:05:31 +02:00
Falk David
649dfb8abc Refactor: GPv3: Use int3 for triangle data type
These were `uint3` before, but they should just be `int3`s.
Also uses `array_utils::copy_group_to_group` with new cpptype `int3`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129166
2024-10-17 17:21:15 +02:00
Jacques Lucke
ca2058ab04 Fix #129128: broken data-block search for short names
If ifdef for `WITH_ANIM_BAKLAVA` accidentally removed the `else { ... }` branch
around `name = RNA_struct_name_get_alloc(...)`. For data-block names,
`BKE_id_full_name_ui_prefix_get` is used above which adds 3 extra letters before
the data-block name. This are removed again by the bug. Later code removes them
again leaving potentially an empty string.

Pull Request: https://projects.blender.org/blender/blender/pulls/129153
2024-10-17 16:59:35 +02:00
Falk David
d68a79e084 Merge branch 'blender-v4.3-release' 2024-10-17 16:43:11 +02:00
Falk David
c539ea792c Fix: GPv3: Reduce draw tool performance regression
During the painting operation, the `GreasePencilDrawing` is updated in-place.
Previously, we simply tagged the whole drawing for a topology update.
This meant that the triangulation and curve normals were recomputed
for (pretty much) every new input sample.

Since the draw tool only creates one new stroke, we can copy the
triangulation of all the other strokes and only recompute the triangulation
of the newly drawn stroke(s).

First, a new `triangle_offsets_cache` is added that is lazily computed.
The computation for this should be pretty cheap.
Then, a new function `Drawing::tag_topology_changed(const IndexMask &curves_to_update)`
is added. This function takes an index mask of curves and only updates
their triangle cache. The cache for the other curves is copied.

In a test file with around 400k points, recomputing the triangle cache
(every input sample) took around 45ms. This meant that there was a noticable
drop in frame rate. With this patch, the time for each sample goes down to
less than 0.1ms. The frame rate feels much better.

But, drawing a longer and longer stroke still makes this time go up,
because the triangulation for the single stroke becomes more and
more expensive. This will have to be improved further.

Part of #124149.

Pull Request: https://projects.blender.org/blender/blender/pulls/129115
2024-10-17 15:28:44 +02:00
Omar Emara
8a33962357 Compositor: Support passes in new CPU compositor
This patch adds support for passes in the new CPU compositor. This
involves rewriting the get_input_texture method into a get_pass methods
that returns a result as opposed to a texture. The result wraps the
cached GPU texture or image buffer depending on the execution device.

The Render Layers node was implemented for CPU execution and a new
utility constructor for the result class was added to determine type and
precision based on GPU texture format. The fallback depth pass that was
retrieved from the viewport frame buffer was removed, as it was a hack
that can no longer be supported due to the use of stencil format.

Pull Request: https://projects.blender.org/blender/blender/pulls/129154
2024-10-17 15:04:25 +02:00
Philipp Oeser
b5abb8a2e3 Merge branch 'blender-v4.3-release' 2024-10-17 14:55:50 +02:00
Philipp Oeser
3c5103d9c9 Fix #129148: Weight/Vertex paint not switching to Blur with Shift
In both `essentials_brushes-mesh_vertex.blend` and `essentials_brushes-
mesh_weight.blend`, the brush is actually only called "Blur".

Pull Request: https://projects.blender.org/blender/blender/pulls/129158
2024-10-17 14:55:15 +02:00
Philipp Oeser
58248c34cb Fix: Linked/liboverride objects can get their materials assignments modified by drag and drop
Changes would be lost (or worse things can happen, see below), so this
is now prevented by polishing the polls for these operations.

Behavior of Materials in override objects was considered shaky as well (lost
on reload, no undo or crash on undo, see  #127605, #127606, #101552 in
general) , so conclusion was to prevent this on linked as well as liboverride
objects.

Pull Request: https://projects.blender.org/blender/blender/pulls/129064
2024-10-17 14:54:45 +02:00
Julian Eisel
ea8be30386 Merge branch 'blender-v4.3-release' 2024-10-17 14:45:05 +02:00
Julian Eisel
5e5c387159 Fix: Another typo in brush asset deletion confirmation message 2024-10-17 14:44:17 +02:00
Julian Eisel
41b8ee1c48 Sculpt/Paint: Change label of asset update operator in menu for clarity
From feedback: "Update Asset" sounds more like receiving a new version
of the brush, while this actually saves the changed brush to the asset
library. "Save Changes to Asset" is more clear and fits well with the
labels of other menu items in the menu.
2024-10-17 14:36:05 +02:00
Julian Eisel
7decebe2c3 Fix: Typo in brush asset deletion confirmation message
Also use "cannot" instead of "can't", since that's less likely to be
misread. This is also noted in the human interface guidelines:
https://developer.blender.org/docs/features/interface/human_interface_guidelines/writing_style/
2024-10-17 14:20:07 +02:00
Lukas Tönne
d2210df6af Fix: GPv3: Interpolate tool uses selection in paint mode
Follow-up fix for #128769.

Selection is now taken into account for interpolation tool, but should
be ignored in paint mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/129150
2024-10-17 14:09:48 +02:00
Jacques Lucke
a80bb83bff Fix: memory leak with muted group nodes in localized shader node trees
The leak happens when there is a muted group node in a shader node tree which is
rendered. For rendering, the drawing code "localizes" the node tree which also
means duplicating the node groups used by each group node (might even duplicate
the same group more than once if it's used by multiple nodes). Generally, this
works fine, because all of these duplicates are freed when the tree is
flattened.

However, there is a preprocessing step which deletes all muted nodes from the
tree. This code path did not free the groups recursively.

Pull Request: https://projects.blender.org/blender/blender/pulls/129124
2024-10-17 13:48:28 +02:00
Jacques Lucke
8c13316f30 Merge branch 'blender-v4.3-release' 2024-10-17 13:17:31 +02:00
Jacques Lucke
1564e02a8f Fix #128994: crash when extracting point meshes
The domain interpolation can fail when e.g. converting from an
empty to a non-empty domain.
2024-10-17 13:15:54 +02:00
Julian Eisel
36877ce6d9 Fix: Essentials asset library loaded from wrong location if present
Design of the essentials asset library is to treat it as part of
Blender (as if it were compiled into the binary), so the location and
state of these assets is clear and can be assumed in code. User edits
are not expected.

Because of that we should only look for this asset library in the
installation ("system") location, not in the user configuration which
would take priority if present. On some devs machines this location
would actually be present, making the essentials unavailable and causing
confusing/misleading warning prints, see #128420.
2024-10-17 12:16:56 +02:00
Christoph Lendenfeld
328ec2b172 Fix #123963: Unable to select through unselectable bones
When trying to select bones that are inside other bones which are not selectable,
the selection would fail. This is inconsistent with object mode, where unselectable
things are just ignored.
This patch fixes it for pose mode and edit mode.
Note that there are two areas for edit mode that were modified.
The one in `ed_armature_pick_bone_from_selectbuffer/202` is never actually reached,
but I added the code there for completeness.

The code in `get_nearest_editbonepoint` had to be modified some more to
implement a similar logic as `armature_select.cc/220`

Pull Request: https://projects.blender.org/blender/blender/pulls/129120
2024-10-17 12:13:35 +02:00
Falk David
0bc595bbab Merge branch 'blender-v4.3-release' 2024-10-17 11:36:22 +02:00
Falk David
40e1bf214a Fix: GPv3: Don't create handle types attribute for all curve types
The "Set Handle Type" operator didn't check the curve types
(not if the curves are editable for that matter).

This fix retrieves the edtiable bézier curves and only changes
the handle types of those.
2024-10-17 11:35:13 +02:00
Campbell Barton
0625756644 Cleanup: remove unused includes 2024-10-17 16:45:39 +11:00
Jason C. Wenger
da689835e8 Fix #129110: Join triangles can assert when topology influence is used
Also add test.

Ref: !129121
2024-10-17 16:21:49 +11:00
Campbell Barton
b317296772 Merge branch 'blender-v4.3-release' 2024-10-17 11:59:29 +11:00
Campbell Barton
3290e33d34 Cleanup: spelling in comments 2024-10-17 11:53:47 +11:00
Campbell Barton
8752413171 Fix null pointer de-reference in rna_Particle_Material_itemf
Correct error in [0], also break out of the loop once the
object is found.

[0]: 140c0f1db9
2024-10-17 11:53:46 +11:00
Campbell Barton
2d832240a3 Merge branch 'blender-v4.3-release' 2024-10-17 09:51:18 +11:00
Campbell Barton
21aa149568 Cleanup: spelling in comments 2024-10-17 09:48:37 +11:00
Jonas Holzman
0b2f65c665 Merge branch 'blender-v4.3-release' 2024-10-16 23:40:14 +02:00
Damien Picard
9b78b8d1ed UI: Fix and improve a few messages
- "Export additional animationsThis feature..." -> Add period and
  newline to separate sentences.
- "name from laoded image" -> "Name from loaded image": typo.
- "Duplicate Active Keyframe (All Layer)" -> "All Layers": grammar.
- "%s is no directory" -> "%s is not a directory": grammar.
- "Can't ensure directory: %s" -> "Cannot", see HIG.
- "Duplicate active Frame(s)": title case.
- "Delete active keyframes of all layer" -> "... layers": grammar.
- "Grease Pencil group color tag": title case.
- "color tag": title case.
- "Bake all line art modifiers" -> "... Line Art...": title case for
  product name
- "... imported USD files.Export remaining..." -> "... imported USD
  files.\nExport remaining...": missing newline.
- "Premanently delete brush. This can't be undo." -> "Permanently
  delete brush. This cannot be undone.": typos.
- "Samplerate" -> "Sample Rate": use more correct two-word form.
- Decimate Keyframe operator: rename and rephrase a property to better
  reflect what it does.
  - "Remove" -> "Factor"
  - "The ratio of remaining keyframes after the operation" ->
    "The ratio of keyframes to remove"
- "Add a repository referencing an remote repository" -> "an": typo.
- "... unique within the Action.This is used..." -> "... unique within
  the Action.\nThis is used...": missing newline.
- "Threashold in screen space ... within this threashold " ->
  "Threshold in screen space ... within this threshold ": typo
- "... occluded by other faces (Slower performance)" -> ... (slower
  performance): no need for the capital here.
- "Indices must be sorted in acending order" -> "ascending": typo.
- "Enable the new Overlay code-base" -> "codebase": typo.
- "dectected by plane tracks" -> "detected": typo.
- "the same index can occure" -> "occur": typo.
- "Single element geometry..." -> "Single-element": spelling.
- "it can be quite inefficient to splitup large geometries" -> "split
  up": spelling.
- "If true, true gizmo is displayed..." -> "the gizmo": typo.

Some issues reported by Tamuna Mebonia.

Pull Request: https://projects.blender.org/blender/blender/pulls/129001
2024-10-16 19:05:48 +02:00
notrudyyy
450aad7489 Cleanup: Fix Erase Displacement typos
Fixes multiple typos in the Erase Displacement option of the Mesh Filter tool.

Pull Request: https://projects.blender.org/blender/blender/pulls/128745
2024-10-16 19:01:24 +02:00
Philipp Oeser
44bfaf68cf Merge branch 'blender-v4.3-release' 2024-10-16 18:30:05 +02:00
Philipp Oeser
140c0f1db9 Fix #129066: ParticleSettings.material_slot wrong from python
`rna_Particle_Material_itemf` was using the context object for getting
the materials.
This is OK when doing it through the UI (the context object is correct
in the Properties Editor, also when pinned), but might not be correct
when doing this from python.

So now do similar as in `rna_Particle_change_type`, iterate all objects
to find the one matching the `ParticleSettings` (but only do this if the
context object does not have a matching `ParticleSettings` already).

NOTE: `rna_Particle_change_type` could be sped up as well with this
method (checking context object first), might be for a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/129101
2024-10-16 18:29:08 +02:00
Philipp Oeser
7e720a8dd6 Fix #127195: Changing curve mean weight/radius/tilt changes handle type
In the case of weight, tilt or radius (these dont don't change [handle]
positions), dont change the handle types.

See the doc for `BKE_nurb_handles_test` ("Use when something has changed
handle positions")

NOTE: a siilar check is done in `createTransCurveVerts`

Pull Request: https://projects.blender.org/blender/blender/pulls/129056
2024-10-16 18:28:07 +02:00
Clément Foucault
6bfa0921c2 Fix: Overlay-Next: Wireframes on top of meshes are aliased
This ports the nasty copy workaround. We don't have time
to investigate a better solution for the moment.
2024-10-16 18:22:10 +02:00
Clément Foucault
1dd1853298 Cleanup: Overlay: Avoid non-uniform control flow for texture sampling
Fix missing part of e6f8924870
2024-10-16 18:22:10 +02:00
Falk David
783f69343a Cleanup: Remove unused variable 2024-10-16 18:09:33 +02:00
Bastien Montagne
0c6f0aa07b Merge branch 'blender-v4.3-release' 2024-10-16 17:32:32 +02:00
Bastien Montagne
a153809829 Fix #128704: Make liboverride keeps linked object in 'main' Scene collection.
Scene itself (and therefore its main collection) was not remapped from
linked objects to the newly created liboverrid ones.
2024-10-16 17:32:04 +02:00
Sergey Sharybin
9916a0130e Merge branch 'blender-v4.3-release' 2024-10-16 17:14:23 +02:00
Clément Foucault
e6f8924870 Cleanup: Overlay: Avoid non-uniform control flow for texture sampling 2024-10-16 17:01:17 +02:00
Clément Foucault
f38827802a Fix: GPU: Broken shader printf support
Was using wrong type of data offset and not removing
the quote when outputing the strings.
2024-10-16 17:01:17 +02:00
Clément Foucault
0d7bfb0711 Fix: Overlay-Next: Missing wireframe in wireframe mode 2024-10-16 17:01:17 +02:00
Clément Foucault
88b5a42d2d Fix: Overlay-Next: Light and lightprobe object appearing in UV view
A more consistent fix would be to split the 2D view and 3D view
overlay. Unfortunately, this is more difficult than it should
with the current legacy codebase expecting a base class
in various places with reinterpret cast.
2024-10-16 17:01:16 +02:00