Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
90269dfe14 Fix #114357: Dyntopo face set brush does not create face sets layer
Create the face set layer in the BMesh when the face set brush is first
used. This requires iterating through all faces to set the default value
of 1 because the default of 0 (SCULPT_FACE_SET_NONE) has different
behavior defined elsewhere.

Pair-reviewed in person with Sergey
2023-11-01 18:33:22 +01:00
Hans Goudey
fbd49adfc4 Sculpt: Dyntopo: Consider all vertices in face set brush
4e87b3004b made the logic to require all vertices in the face
to be covered by the brush. However, the behavior is closer to the non-
BMesh version if only one of the face's vertices needs to be in "inside".

Pair-reviewed in person with Sergey
2023-11-01 18:33:17 +01:00
Hans Goudey
756dea7ca1 Cleanup: PBVH: Remove redundant storage of face set metadata
These two values are already stored in the mesh, and they have no
relation to the PBVH's goal as an acceleration structure. Similar to
a6a2af5fdd, remove the values from the PBVH and
just access them from the mesh as necessary.

Pair-reviewed in person with Sergey
2023-11-01 18:20:43 +01:00
Habib Gahbiche
f54ed1c639 Cleanup: Metal: Silence sometimes-uninitialized warning
Warning message:
`warning: variable 'pos' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]`

Pull Request: https://projects.blender.org/blender/blender/pulls/114360
2023-11-01 16:12:30 +01:00
Richard Antalik
6bb238c761 Merge branch 'blender-v4.0-release' 2023-11-01 13:19:06 +01:00
Richard Antalik
01b617a3c6 VSE: remove speed_factor RNA property from sound strips
Property `speed_factor` was used before retiming. It was kept for
potential versioning code for complex speed animation, that was
possible with even older `pitch` property.

Strips, where `speed_factor` is set to static value are already
correctly converted.

Such versioning code would be quite complex, possibly slow and maybe
could corrupt files. This is due to multiple factors:
- Sound seeking was broken, so conversion would have to ignore all
  keyframes before strip starts to map frames properly.
- Because some animation was effectively ignored, it may cause
  inconsistencies when doing conversion.
- It would have to integrate value of `speed_factor` to map keyframes
  to strip space, but the animation is not limited to strip length.
- For each keyframe where speed gradually changes, at least one smooth
  speed transition would be required, but there would be discrepancies
  that would have to be accounted for. With simpler strategy it is
  likely, that extent of ramps would be limited and thus animation would
  be quite different from original.

Because of these reasons, I think it is best to not convert
`speed_factor` animation.

Pull Request: https://projects.blender.org/blender/blender/pulls/114295
2023-11-01 13:17:06 +01:00
Hans Goudey
57fddca9f6 Merge branch 'blender-v4.0-release' 2023-11-01 11:12:04 +01:00
Hans Goudey
d503f2ac33 Fix #114177: Crash in extrude mesh vertex mode with unsupported data
Unsupported data can be removed, which reallocated the custom data layer
array. Since the temporary ID vectors referenced memory in that array
directly, this could lead to a use-after-free. Instead remove unsupported
data before collecting the referenced attribute IDs.
2023-11-01 11:08:35 +01:00
Hans Goudey
66c1ca7419 Fix #114102: Node tool data-block inputs broken
Also add data-blocks from the redo panel inputs to the temporary
dependency graph added by 2893dc8ab7. Then make a temporary
copy of the properties list to pass the updated "evaluated" pointers to
the geometry nodes evaluator.

Sharing code between the modifier and tools is starting to make things
more complicated than they should be. But for now it's still probably
worth it.

The remaining issue with data-block inputs is #113383. I'll look into
that next.

Pull Request: https://projects.blender.org/blender/blender/pulls/114347
2023-11-01 10:53:40 +01:00
Habib Gahbiche
021109e633 Speedup classic Kuwahara filter by summed area table
Implemented summed area table (SAT) for CPU.

- Filter runtime becomes independent of filter size
- Up to 30x faster for 4k images for full-frame compositor

Pull Request: https://projects.blender.org/blender/blender/pulls/111150
2023-11-01 10:49:09 +01:00
Antonio Vazquez
c412aa1a17 GPv3: Rename stroke_color_set to stroke_material_set
The old name was logic when the color of the stroke was using a palette and not materials, but now always a material is used so the name "color" is not logic.

As we are changing all the API, now is the moment to set the right name.

Also, the commit includes some cleanup of the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/114186
2023-11-01 10:39:17 +01:00
Omar Emara
37da2ac881 Merge branch 'blender-v4.0-release' 2023-11-01 10:33:27 +02:00
Omar Emara
cbcfca0a19 Fix #112716: Custom sockets ignore draw_color method
Customs sockets always ignore their draw_color method and are always
drawn using a magenta color.

This is a regression that was introduced in e071288ab2. The commit used
the simple variant even for drawing nodes where a context is available.
So this patch mostly reverts those changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/114148
2023-11-01 09:29:56 +01:00
Ray Molenkamp
9c0bffcc89 Merge remote-tracking branch 'origin/blender-v4.0-release' 2023-10-31 18:51:26 -06:00
Ray Molenkamp
f6c52849b5 Fix #112729: Update pinned blender shortcut
Windows allows people to pin an application to their taskbar, when a
user pins blender, the data we set in
`GHOST_WindowWin32::registerWindowAppUserModelProperties` is used
which includes the path to the `blender-launcher.exe`. Now once that
shortcut is created on the taskbar, this will never be updated, if
people remove blender and install it again to a different path
(happens often when using nightly builds) this leads to the
situation where the shortcut on the taskbar points to a no longer
existing blender installation. Now you may think, just un-pin and
re-pin that should clear that right up! It doesn't, it'll keep using
the outdated path till the end of time and there's no window API call
we can do to update this information. However this shortcut is stored
in the user profile in a sub-foder we can easily query, from there, we
can iterate over all files, look for the one that has our appid in it, and
when we find it, update the path to the blender launcher to the
current installation, bit of a hack, but Microsoft seemingly offers no
other way to deal with this problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/113859
2023-11-01 01:44:51 +01:00
Campbell Barton
374295799a Merge branch 'blender-v4.0-release' 2023-11-01 11:40:49 +11:00
Andrej730
977c62c708 Docs: remove dpi from blf.size doc as it's deprecated
DPI argument of blf.size is deprecated, remove it from docs.

Ref !114319.
2023-11-01 11:37:16 +11:00
Hoshinova
92c9a2d1bc Nodes: Add forward compatibility for merged Noise/Musgrave Texture
Add versioning to convert the new combined Noise Texture node from #111187.
Versioning is only done for the Musgrave exclusive noise modes, that is all modes
except for fBM.

Pull Request: https://projects.blender.org/blender/blender/pulls/114236
2023-10-31 19:57:57 +01:00
Hans Goudey
d6be6339f1 Fix: Incorrect PBVH mask drawing after recent change
The `COMPONENT_LEN_SCALAR` workaround isn't used for
masks which are drawn in a more hard-coded way.
2023-10-31 18:17:26 +01:00
Hans Goudey
acbab3550f Merge branch 'blender-v4.0-release' 2023-10-31 18:12:18 +01:00
Bastien Montagne
f84b0a4dd2 UI/Py API: Add active_panel_category to RNA Region struct.
This new member gives access to the current active panel category (i.e.
tab) if supported, and allows to set its value to another defined
category.

While typically add-ons should not force a tab to be the active one,
there are cases where this is a valid and necessary behavior, e.g. in
'Blender App' where an app can add some new tab to the UI and require
them to be active.

Note that there is a ctach here: typically at start time these panel
categories are unknown (enum is empty), since they are validated by
drawing code. So setting them usually needs to be done after initial
startup and drawing of the UI...

Pull Request: https://projects.blender.org/blender/blender/pulls/114070
2023-10-31 18:10:28 +01:00
Pablo Delgado Krämer
ae7719c312 MaterialX: implement HSV node Factor input
Ref #112864

Pull Request: https://projects.blender.org/blender/blender/pulls/114171
2023-10-31 18:07:28 +01:00
Hans Goudey
e05c36f56d Fix #113496: PBVH draw crashes and unsupported attribute types
Use more modern approaches for supporting all generic attribute types,
rather than hardcoding all of the types and mistakenly correlating types
and domains.

A "Converter" template class handles conversion to GPU data and
describing the GPU format. The class is based on recent work in Cycles
attribute upload and is meant to replace the `AttributeTypeConverter`
class in `extract_vbo_attributes.cc`. I will do that as a separate step.
This structure will give build errors if new attribute types are added
but not supported here, preventing the situation described in the
report.

All generic attribute types are supported now, consistently with non
sculpt mode drawing. The edge domain isn't supported though.
Typically edges are more costly and complex to access, and interpolation
is less well defined anyway.

Pull Request: https://projects.blender.org/blender/blender/pulls/114334
2023-10-31 17:33:15 +01:00
Sergey Sharybin
317ee3b6ea Merge branch 'blender-v4.0-release' 2023-10-31 17:29:41 +01:00
Hans Goudey
2893dc8ab7 Fix: Broken node tool group data-block references
Currently the node tool node group and data-blocks referenced by it
may not be part of the active dependency graph. This means we
cannot retrieve their evaluated geometry when executing the operator.
Since operators almost always use the evaluated geometry of other
objects, and since geometry nodes is mostly set up to deal with
evaluated data-blocks currently, this must be fixed.

Instead, set up a temporary dependency graph and add the selected
objects and the data-blocks used by the node group. That graph is
evaluated to give simple access to evaluated data-blocks.

Unfortunately this will cause more work than necessary in a few ways:
1. Selected objects are reevaluated an extra time before execution.
2. All data-blocks referenced by the group are completely evaluated again.
3. The node group itself is reevaluated, which recreates the function graph.

These may or may not become bottlenecks in the future, but it's best to
keep it simple late in the release process. And between a completely
broken feature and a potentially slow feature, the choice is clear!

Pull Request: https://projects.blender.org/blender/blender/pulls/114293
2023-10-31 17:16:48 +01:00
Falk David
9934381733 GPv3: Rename GP_Layer/GP_Group to Layer/Group
This changes the default names of layers and groups to "Layer" and "Group".

Pull Request: https://projects.blender.org/blender/blender/pulls/114332
2023-10-31 17:08:47 +01:00
Jason Fielder
a96aabc6f6 Metal: Resolve premature memory release
After previous changes to allow command buffers to not require
execution and completion in submission order,
guarantees for releasing freed buffers back to the memory pool
within the frame life time had changed.

This could mean a released buffer could be returned to the
memory pool prematurely, if a subsequent command buffer
completes before a previously submitted one, flagging a resource as no
longer in use by the GPU, while it still may be in use by the orignal
command buffer.

This PR defers final reference count release for buffers
being actively used until the following call to GPU_render_step,
to ensure that buffers freed will be available for the lifetime of
the frame, covering all command submissions, rather than just
within the lifetime of the command buffer submission within which a
buffer was freed.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114329
2023-10-31 16:45:12 +01:00
Nathan Vegdahl
729e29618b Merge branch 'blender-v4.0-release' 2023-10-31 16:07:56 +01:00
Nathan Vegdahl
5974a4482a Fix #109430: exit tweak mode before deleting an in-tweak-mode NLA strip
The issue was that when in tweak mode, there are other places than just
the strip list that keep pointers to the tweaked strip.  So deleting
that strip would leave dangling pointers, which caused things to blow up
elsewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/114331
2023-10-31 16:06:38 +01:00
Jason Fielder
dde346ca9f FIx #114286: Resolve ghosting artifact in workbench in Metal
Missing GPU flush added between workbench render frames
to ensure GPU command buffer does not submit all frames
in one go.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/114328
2023-10-31 15:53:32 +01:00
Jeroen Bakker
0d861a93a6 Merge branch 'blender-v4.0-release' 2023-10-31 15:46:16 +01:00
Jeroen Bakker
3da63377fc Fix #114224: Bone Disappear in Pose Mode
In certain cases bones can disappear in pose mode. The cause was
that the alpha channel was not set in all cases and might use uninitialized
memory as alpha value.

Pull Request: https://projects.blender.org/blender/blender/pulls/114324
2023-10-31 15:40:28 +01:00
Julian Eisel
6dcc394104 Merge branch 'blender-v4.0-release' 2023-10-31 15:38:21 +01:00
Sergey Sharybin
396ad5db83 Sculpt: Better boundary preservation with dyntopo
The user-level goal is to make it so boundaries are preserved in a
much better manner.

At this point of the project boundaries are considered edges which
are marked as seam or sharp. It is possible to expand this logic to
more cases like boundary between face sets. For now the main focus
in the algorithm itself.

The rough idea is the following:

- Splitting an edge is "lossless" for boundary, so there is no need in
  any special handling of edges there.

- When collapsing an edge prefer to collapse edges which are not
  boundary but adjacent to it. The vertex which is adjacent to boundary
  does is preserved and is not moved during the edge collapse algorithm.

- Then collapse boundary edges.

There are a bit of tricky parts, especially with the flaps. They are
explained in the code and ASCII diagrams are provided for better clarity.

Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/113836
2023-10-31 15:34:07 +01:00
Julian Eisel
4f0258f549 Fix #113687: Asset shelf header overlaps labels without region overlap
If "Region Overlap" was disabled, the region coordinate calculations
would end up placing the header on the bottom, taking space away from
the main asset shelf region. This is because the header was abusing the
`RGN_SPLIT_PREV` flag a bit, because it gave the desired behavior of
hiding the regions together. This worked well because the regions
wouldn't actually do the splitting when one used region overlap and the
other not. But disabling region overlap would bring the splitting
usually enabled with the `RGN_SPLIT_PREV` flag.

This PR removes the `RGN_SPLIT_PREV` flag from the asset shelf header.
Instead a new flag is introduced to only enable the behavior of
`RGN_SPLIT_PREV` of hiding a region together with the previous one. So
the header stays at the top of the region, and labels stay visible.

The new flag is added to the `ARegion.alignment` flags, even though it's
more related to behavior than alignment. However this is more
convenient, and keeps it together with related flags.
2023-10-31 15:26:09 +01:00
Sergey Sharybin
4e87b3004b Sculpt: Implement face set brush for dyntopo
The implementation follows the logic of the face set brush for the
faces and grids type of PBVH, with the similar weak part of iterating
over entire mesh at the start of a stroke.

The difference in the behavior is that face needs to be fully covered
by the brush in order to have face set assigned to it (while for the
other types of the PBVH face gets assigned its face set if any of its
vertices are covered). The main reason for this is that this seems to
avoid boundaries being too wiggly.

The auto-masking is not fully integrated into this brush yet. Doing so
is possible, but seems to require deeper re-considerations of the way
how automasking accesses original data and how it is fetched from an
undo node. It worth noting that auto-masking is something that needs
to be looked into for all brushes to make it supported in the dynamic
topology mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/113357
2023-10-31 15:14:31 +01:00
Julian Eisel
1ef36fffc2 Merge branch 'blender-v4.0-release' 2023-10-31 15:00:21 +01:00
Julian Eisel
af363a6ba2 Fix asset shelf can't resized by dragging header edge anymore
Regression from 7ec7dac860 (I assume). While the block active state is
relevant during drawing to avoid glitches, it should be ignored during
handling. Explained further in comment.
2023-10-31 14:59:45 +01:00
Christoph Lendenfeld
fef222efc3 Fix: NLA mapping not taken into account when framing FCurves
The functionality to frame channels in the Graph Editor
did not take into account any NLA mapping, causing the
viewport to frame the wrong part.

Fix it by mapping the `rctf` x-values

I had to remove the `const` on a parameter from the function
since `ANIM_nla_mapping_get` doesn't take a `const`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114325
2023-10-31 14:52:45 +01:00
Michael Kowalski
1e7f5b1e61 USD: fix cache reader open error handling.
This commit fixes error handling logic implemented in #113524.

- No longer calling WM_reportf, which is not thread safe.
- Freeing the reader before returning early.

Pull Request: https://projects.blender.org/blender/blender/pulls/114298
2023-10-31 14:50:47 +01:00
Aras Pranckevicius
0eb6aef3b0 PLY: import/export custom vertex attributes (#108948)
Implements #108948 - support for custom point domain attributes for PLY
import and export. Notes:

- Custom attributes are always represented as scalar floats. PLY itself
  has some data types that blender can't fully represent, e.g. double or
  uint32, or some that fit into a float just fine but blender does not have
  them as separate types (e.g. int16).
- When importing, any PLY vertex attribute that is not one of "standard"
  names (position, normal, etc.) gets turned into a custom attribute.
- For exporting, more complex custom attributes (e.g. 2D/3D floats,
  quaternions, colors) get turned into several PLY attributes, with "_x"
  like suffix.

Custom attribute import/export is on by default in the UI.

Pull Request: https://projects.blender.org/blender/blender/pulls/114320
Reviewed By: Hans Goudey
2023-10-31 14:07:51 +01:00
Jacques Lucke
874029fd5c Geometry Nodes: don't show Layer domain unless grease pencil 3 is enabled 2023-10-31 14:04:03 +01:00
Jacques Lucke
4ab960b5a4 Merge branch 'blender-v4.0-release' 2023-10-31 13:47:00 +01:00
Jacques Lucke
c29857fffa Fix #113532: geometry nodes is always reevaluated after undo
The issue was that the undo system detected that node trees have been changed
even though they have not. This is because the memory dump of the node tree
changed after unrelated changes. The root issue was that
`bNodeTreeInterface::write` also wrote the struct, and the pointer of the
`bNodeTreeInterface` itself. While this pointer is generally stable, it is not
during file-write, because when IDs are written, a shallow copy is created
first (see `BLO_write_init_id_buffer_from_id`). The temporary buffer for this
shallow copy is allocated on the heap, so its pointer may change over time.

The fix is to simply not write the `bNodeTreeInterface` separately, since it's
already embedded in `bNodeTree`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114322
2023-10-31 13:46:31 +01:00
Jacques Lucke
245da40f81 Fix #114251: Angle input of Compare node disconnected on reload
The issue was that `Angle` also starts with an `A`, just like the input
that is supposed to be handled by this compatibility code.
2023-10-31 13:44:09 +01:00
Jeroen Bakker
17bff13836 Vulkan: Replace Stencil Test Not Working
`GPU_STENCIL_OP_REPLACE` was different compared with OpenGL. This PR
sets the same operations that OpenGL uses.

Pull Request: https://projects.blender.org/blender/blender/pulls/114314
2023-10-31 13:41:15 +01:00
Pablo Vazquez
f9928a0f56 Merge branch 'blender-v4.0-release'
# Conflicts:
#	source/blender/blenkernel/BKE_blender_version.h
2023-10-31 13:09:51 +01:00
Pablo Vazquez
86ccbc4353 Fix #113683: Wrong colors in UIList items after importing 3.6 theme
Theme changes for active/hover elements in 4.0 were missing versioning.
2023-10-31 13:07:54 +01:00
Jeroen Bakker
0dbc13529b Cleanup: Remove Debug Statement
In vulkan texturing code.
2023-10-31 11:57:52 +01:00
Bastien Montagne
89bd460a7f Merge branch 'blender-v4.0-release' 2023-10-31 11:57:00 +01:00