Commit Graph

104290 Commits

Author SHA1 Message Date
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
Bastien Montagne
46c180015a Fix #114134: Make Local (All) operator is crashing Blender with Library Override.
Dummy mistake in own a238ab737b, forgot to do a NULL check...
2023-10-31 11:56:18 +01:00
Campbell Barton
5e19245dee Merge branch 'blender-v4.0-release' 2023-10-31 21:49:38 +11:00
Campbell Barton
17d372750b Merge branch 'blender-v4.0-release' 2023-10-31 21:49:33 +11:00
Campbell Barton
ab41558186 Fix #113881: Sculpt Curves: R shortcut conflict
The "Curves" key-map poll function now only works in edit-mode.

Ref !114297.
2023-10-31 21:48:30 +11:00
Jeroen Bakker
f665680024 Vulkan: Mipmap Generation Pipeline Barriers
This PR replaces submissions with pipeline barriers when generating
mipmaps. This would reduce the amount of submissions and improve
performance during mipmap generation as dependencies will be tracked
between commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/114306
2023-10-31 11:46:07 +01:00
Julian Eisel
7c739ad560 Fix #114287: Drawing in post-view draw handlers broken
Mistake in 4d668e6825. `draw_seq_strips()` would use
`UI_view2d_view_orthoSpecial()` to only scale drawing horizontally, but didn't
reset the matrix state for normal view-space drawing. Result is that the
preview range drawing would be broken, and so were add-ons using the
`POST_VIEW` draw callback.

Pull Request: https://projects.blender.org/blender/blender/pulls/114285
2023-10-31 11:41:47 +01:00
Campbell Barton
f60d1b3537 Merge branch 'blender-v4.0-release' 2023-10-31 21:36:37 +11:00
Campbell Barton
ea86a77bc5 Docs: add notes on populating bpy.app.driver_namespace
Address issues raised by #114155.

Also fix sphinx documentation generation using incorrect identifiers
when looking up references from PyStruct types
(was looking for `bpy.app.bpy.app.driver_namespace.py`).
2023-10-31 21:34:32 +11:00
casey bianco-davis
c57fe9a6e0 Curves: Add radius transform mode to edit mode
This adds the radius control operator and active tool
to curves edit mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/114017
2023-10-31 11:33:32 +01:00
Sietse Brouwer
faeb9e7775 Fix: missing attribute finish() in curves selection code
Fixes a missing attribute `finish()` in the curves selection code.

Pull Request: https://projects.blender.org/blender/blender/pulls/114147
2023-10-31 10:31:50 +01:00
Lukas Stockner
d15013b583 Merge branch 'blender-v4.0-release' 2023-10-31 05:48:58 +01:00
Campbell Barton
4bec9d0d71 Fix #114282: Extrude to Cursor tool no longer tweaks on drag
Regression in [0] which only ran drag events if the press event passed
through.

Resolve using the same logic as select picking
(see: WM_operator_flag_only_pass_through_on_press).

[0]: 4d0f846b93
2023-10-31 14:55:12 +11:00
Alaska
a15f9e49ec Shader: Only clamp undefined or unsupported inputs of Principled BSDF
Adjust clamping of inputs in the Principled BSDF to avoid errors and
inconsistencies between render engines, while trying to leave as many
inputs as possible unclamped for artisitc purposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112895
2023-10-31 03:14:04 +01:00
Iliya Katueshenock
dca2490689 Fix #114240: Initialize output alpha for RGB color
Pull Request: https://projects.blender.org/blender/blender/pulls/114270
2023-10-30 22:19:58 +01:00
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00