Commit Graph

129608 Commits

Author SHA1 Message Date
casey bianco-davis
e266b142f6 GPv3: Transform operators
This adds the keybindings, menu, and functionally for the edit mode transform operators to grease pencil v3.

The transform operation include:
 * translate, rotate, scale, change opacity, change radius

Pull Request: https://projects.blender.org/blender/blender/pulls/111836
2023-10-21 15:12:47 +02:00
Hans Goudey
b4e6ef4279 Fix: MeshPolygon.use_smooth set inversed
Mistake in 89e3ba4e25c9ff921b2584c294cbc38c3d344c34.
2023-10-21 14:56:06 +02:00
Hans Goudey
f64ed2e963 Cleanup: Simplifying freeing node editor space data 2023-10-21 14:56:06 +02:00
Campbell Barton
2864c20302 Cleanup: various C++ changes (use nullptr, function style casts) 2023-10-21 21:17:57 +11:00
Campbell Barton
a398de672a Merge branch 'blender-v4.0-release' 2023-10-21 20:40:20 +11:00
Campbell Barton
b592e5c69a Fix error in animation player arguments (font_id & frame_step swapped)
Regression in [0], even though this doesn't seem to cause problems,
the arguments were obviously wrong.

[0]: 4f3e2ee857b5b9d5625513c3e5258eb71a2314c8
2023-10-21 20:34:15 +11:00
Antonio Vazquez
5ad9521c7a GPv3: Change Toggle Cyclic menu text
The old text was not clear about the use of the operator and
now is more aligned with GPv2 menu.
2023-10-21 10:47:37 +02:00
Harley Acheson
0bde01eab5 UI: Configurable UI Font Weight
Allows selecting different font weights in Text Styles

Pull Request: https://projects.blender.org/blender/blender/pulls/112454
2023-10-21 00:28:28 +02:00
Jacques Lucke
b18810d2aa Merge branch 'blender-v4.0-release' 2023-10-20 21:22:11 +02:00
Jacques Lucke
0e9f472726 Fix #113773: repeat zone does not propagate anonymous attributes sometimes
The repeat zone needs some special treatment during anonymous attribute
inferencing, because it propagates those attributes directly  from the repeat
input to the repeat output node and vice versa.

Now the algorithm uses multiple passes if necessary to reach a stable
inferencing result.

Pull Request: https://projects.blender.org/blender/blender/pulls/113970
2023-10-20 21:21:40 +02:00
Hans Goudey
e52b269283 Cleanup: Use simpler copying with begin iterator and count 2023-10-20 20:07:02 +02:00
Hans Goudey
8ec6260ed5 Cleanup: Consistent use of curves::has_anything_selected
- Continue to reduce indentation
- Use more semantically correct processing for checking attribute
- Do cheap checks earlier
- Avoid redundant check when index mask is created anyway
2023-10-20 20:01:30 +02:00
Hans Goudey
8c0fc33739 Cleanup: Fix const correctness of node tree interface cache API
It shouldn't be possible to retrieve a mutable interface item from
a const node tree. Unfortunately that means we have to duplicate
the accessor methods. Fortunately they are very small.
2023-10-20 19:37:39 +02:00
Hans Goudey
7b09983423 Cleanup: Consistent const usage in headers, use std::move
Avoid const for variables stored by value in structs/classes,
since that is redundant with the constness of the owner itself.
std::move a few strings that were missed before.
2023-10-20 19:32:26 +02:00
Dalai Felinto
45fd780dff Cleanup: make format 2023-10-20 19:12:58 +02:00
Dalai Felinto
bd0ba8c75c Merge remote-tracking branch 'origin/blender-v4.0-release' 2023-10-20 19:11:57 +02:00
Dalai Felinto
b6108c5cef Cleanup: make format 2023-10-20 19:11:42 +02:00
Falk David
e433a8eaaf GPv3: Replace find API with find_node_by_name
Instead of having two APIs (`find_layer_by_name` +
`find_layer_group_by_name`) replace them with a single API
`find_node_by_name`.
This returns a `TreeNode` but the caller can easily check if it's a
layer or a group.
2023-10-20 19:05:31 +02:00
Falk David
f6c8ddda26 GPv3: Add is_child_of function
Adds a new API to check if a node is a child of a group.
2023-10-20 18:51:22 +02:00
Ray Molenkamp
fece71fa0a Fix: Build error on windows
winstuff.c got converted to .cc recently, and a merge was done of
#113674 from 4.0 which still was using C style code.

Small update in code style was required here.
2023-10-20 10:44:34 -06:00
Brecht Van Lommel
ac3ae7d452 Merge branch 'blender-v4.0-release' into main 2023-10-20 18:24:15 +02:00
Brecht Van Lommel
ed619559ce Fix #113942: Cycles discontinuities in bump mapping
Revert "Cycles: implement faster #make_orthonormals()"

This reverts commit 51923c09e2674ecfb3aee77fe67b44d97e22be11.

Ref #106053
2023-10-20 17:29:31 +02:00
Clément Foucault
b0e7a6db56 Merge branch 'blender-v4.0-release'
# Conflicts:
#	source/blender/gpu/opengl/gl_backend.cc
2023-10-20 17:23:53 +02:00
Anthony Roberts
4e69e49e7e Add check for Qualcomm devices on Windows
Some of these devices are not capable of running >=4.0, due to issues
with Mesa's Compute Shaders and their D3D drivers.

This PR marks those GPUs as unsupported, and prints info to stdout.

A driver update will be available for 8cx Gen3 on the 17th October
from here:
https://www.qualcomm.com/products/mobile/snapdragon/pcs-and-tablets/snapdragon-8-series-mobile-compute-platforms/snapdragon-8cx-gen-3-compute-platform#Software

It will take longer via the standard MS Windows Update channels,
as there is certification, testing, etc required, but it is possible
to get the drivers, at least.

This issue applies even when using emulated x64.

If this does not get merged, all WoA devices will break with 4.0,
where older ones will just launch a grey screen and crash, and newer
ones will open, but scenes will not render correctly in Workbench.

These devices work by using Mesa's D3D12 Gallium driver ("GLOn12"),
which is why we have to read the DirectX driver version - the version
reported by OpenGL is the mesa version, which is independent of the
driver (which is the part with the bug).

Pull Request: https://projects.blender.org/blender/blender/pulls/113674
2023-10-20 17:18:35 +02:00
Jason Fielder
1b0ddfa6cb GPU: Add explicit API to sync storage buffer back to host
PR Introduces GPU_storagebuf_sync_to_host as an explicit routine to
flush GPU-resident storage buffer memory back to the host within the
GPU command stream.

The previous implmentation relied on implicit synchronization of
resources using OpenGL barriers which does not match the
paradigm of explicit APIs, where indiviaul resources may need
to be tracked.

This patch ensures GPU_storagebuf_read can be called without
stalling the GPU pipeline while work finishes executing. There are
two possible use cases:

1) If GPU_storagebuf_read is called AFTER an explicit call to
GPU_storagebuf_sync_to_host, the read will be synchronized.
If the dependent work is still executing on the GPU, the host
will stall until GPU work has completed and results are available.

2) If GPU_storagebuf_read is called WITHOUT an explicit call to
GPU_storagebuf_sync_to_host, the read will be asynchronous
and whatever memory is visible to the host at that time will be used.
(This is the same as assuming a sync event has already been signalled.)

This patch also addresses a gap in the Metal implementation where
there was missing read support for GPU-only storage buffers.
This routine now uses a staging buffer to copy results if no
host-visible buffer was available.

Reading from a GPU-only storage buffer will always stall
the host, as it is not possible to pre-flush results, as no
host-resident buffer is available.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/113456
2023-10-20 17:04:36 +02:00
Clément Foucault
7b97bc48d8 EEVEE-Next: Rework the material panel
- Adds the missing new RNA definitions
- Split settings panel into surface and volume
- Expose displacement and volume nodetree panels
- Rename `Cull Backfaces` to `Backface Culling`
  for consistency
- Rename `use_backface_culling_probe` to
  `lightprobe_volume_single_sided` for accuracy
  and avoiding confusion as it is not a real
  backface culling.
- Rename `Screen Space Refraction` to
  `Raytrace Refraction` for accuracy.

Motivation is to make it closer to cycles now
that EEVEE is compatible with more features.

Pull Request: https://projects.blender.org/blender/blender/pulls/113971
2023-10-20 16:59:20 +02:00
Michael B Johnson
b262655d39 USD: export to a single root prim by default
This PR adds the following changes:

A single root is always set as default. After talking to Wave and
Spiff, we settled on root being the best default. Users who don't
want a single root prim inserted, can choose to clear the field
The root prim no longer requires the user to prefix the field with /.
It will implicitly insert that for them.

On export, the root_prim hierarchy is now defined all as Xform
instead of just the final prim in the path. Each prim also has
custom metadata added to show that it was generated by Blender.
This follows convention in other DCCs as well.

On import, the code now finds the hierarchy of generated prims
using that metadata. It then skips importing them. This means that
you can roundtrip hierarchies even with an inserted root.

Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113187
2023-10-20 10:58:40 -04:00
Hans Goudey
89e3ba4e25 Mesh: Replace auto smooth with node group
Design task: #93551

This PR replaces the auto smooth option with a geometry nodes modifier
that sets the sharp edge attribute. This solves a fair number of long-
standing problems related to auto smooth, simplifies the process of
normal computation, and allows Blender to automatically choose between
face, vertex, and face corner normals based on the sharp edge and face
attributes.

Versioning adds a geometry node group to objects with meshes that had
auto-smooth enabled. The modifier can be applied, which also improves
performance.

Auto smooth is now unnecessary to get a combination of sharp and smooth
edges. In general workflows are changed a bit. Separate procedural and
destructive workflows are available. Custom normals can be used
immediately without turning on the removed auto smooth option.

**Procedural**

The node group asset "Smooth by Angle" is the main way to set sharp
normals based on the edge angle. It can be accessed directly in the add
modifier menu. Of course the modifier can be reordered, muted, or
applied like any other, or changed internally like any geometry nodes
modifier.

**Destructive**
Often the sharp edges don't need to be dynamic. This can give better
performance since edge angles don't need to be recalculated. In edit
mode the two operators "Select Sharp Edges" and "Mark Sharp" can be
used. In other modes, the "Shade Smooth by Angle" controls the edge
sharpness directly.

### Breaking API Changes
- `use_auto_smooth` is removed. Face corner normals are now used
  automatically   if there are mixed smooth vs. not smooth tags. Meshes
  now always use custom normals if they exist.
- In Cycles, the lack of the separate auto smooth state makes normals look
  triangulated when all faces are shaded smooth.
- `auto_smooth_angle` is removed. Replaced by a modifier (or operator)
  controlling the sharp edge attribute. This means the mesh itself
  (without an object) doesn't know anything about automatically smoothing
  by angle anymore.
- `create_normals_split`, `calc_normals_split`, and `free_normals_split`
  are removed, and are replaced by the simpler `Mesh.corner_normals`
  collection property. Since it gives access to the normals cache, it
  is automatically updated when relevant data changes.

Addons are updated here: https://projects.blender.org/blender/blender-addons/pulls/104609

### Tests
- `geo_node_curves_test_deform_curves_on_surface` has slightly different
   results because face corner normals are used instead of interpolated
   vertex normals.
- `bf_wavefront_obj_tests` has different export results for one file
  which mixed sharp and smooth faces without turning on auto smooth.
- `cycles_mesh_cpu` has one object which is completely flat shaded.
  Previously every edge was split before rendering, now it looks triangulated.

Pull Request: https://projects.blender.org/blender/blender/pulls/108014
2023-10-20 16:54:08 +02:00
Jacques Lucke
65d4ae7445 Merge branch 'blender-v4.0-release' 2023-10-20 16:48:16 +02:00
Jacques Lucke
051b02ed11 Fix #113851: viscoelastic springs do not work
Caused by 425b871607.

The root issue was that these two states of the hash table were
mixed up in 425b871607: (1) the hash table exists and (2) the hash
table is empty.

The use of `std::optional` restores these two different states again.
2023-10-20 16:47:41 +02:00
Brecht Van Lommel
b1b0d7757a Merge branch 'blender-v4.0-release' into main 2023-10-20 16:29:05 +02:00
Brecht Van Lommel
4997c3aae5 Cycles: don't write surface AOVs when there is only a volume shader
These AOVs can get in the way for volume objects that have no real surface.

Ref #113871
2023-10-20 16:16:05 +02:00
Sergey Sharybin
15ab734faf Fix: Dyntopo sculpt on plane destroys the mesh
The issue is probably deeper and affects more cases. The plane with an
edge loop in the center added was the case which shown the error.

Caused by a mistake in the refactor in 062169698a7a which left an array
size uninitialized before filling it in.

Pull Request: https://projects.blender.org/blender/blender/pulls/113972
2023-10-20 16:09:36 +02:00
Clément Foucault
2a725001d1 EEVEE-Next: Material Pipeline Refactor
- Add mandatory forward opaque prepass for any opaque region
- Rename the "Show Backface" pass as `MAT_PIPE_PREPASS_OVERLAP`
- Replace Blend mode by Surface Render Method
- Add do versioning for `surface_render_method`
- Rename the Prepass pipe enum for consistency as they share
  the same depth shader
- Makes sure all object types subscribe to all passes

This does not change the UI yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/113968
2023-10-20 15:52:42 +02:00
Miguel Pozo
e24cd6b524 EEVEE-Next: Shadows backface culling
Add optional backface culling for shadows.

Pull Request: https://projects.blender.org/blender/blender/pulls/113969
2023-10-20 15:47:33 +02:00
Germano Cavalcante
fc66502e7a Cleanup: Deduplicate code
And prefer C++ vector types.
2023-10-20 10:13:58 -03:00
Germano Cavalcante
0343e0bd65 Merge branch 'blender-v4.0-release' into main 2023-10-20 09:56:13 -03:00
Germano Cavalcante
b657a35e8f Fix #113936: Extrude to cursor operations not snapping with Face Project
These are not `transform` operations, and use their own method to
detect snapping.

It is important to keep in sync when an enum varies.

In this case, `SCE_SNAP_INDIVIDUAL_PROJECT` was missing to check snap.
2023-10-20 09:55:37 -03:00
Germano Cavalcante
a4f7526847 Merge branch 'blender-v4.0-release' into main 2023-10-20 09:26:07 -03:00
Germano Cavalcante
6ce31d173d Fix #113505: Scale strips in nla with snap active seems broken
Caused by bd305c8d18

`snap_transform_data` adds an offset to each element being transformed.

However, this seems to only work for Move and Extend transformations.

Therefore, the solution is to make the NLA snapping system more generic.

Pull Request: https://projects.blender.org/blender/blender/pulls/113554
2023-10-20 14:24:50 +02:00
Philipp Oeser
9e7fd16c19 Merge branch 'blender-v4.0-release' 2023-10-20 14:23:42 +02:00
Philipp Oeser
bb8cb4e56f Fix #113810: Frame Range Metadata missing when burned into image
Probably an oversight in 6c3110a66122 ?

Now added the necessary bits to make it work in `BKE_image_stamp_buf` as
well.

Pull Request: https://projects.blender.org/blender/blender/pulls/113840
2023-10-20 14:22:57 +02:00
Philipp Oeser
83c64c1b60 Merge branch 'blender-v4.0-release' 2023-10-20 14:21:53 +02:00
Philipp Oeser
eed4f950d8 Fix #113798: Weight paint gradient tool paints over hidden vertices
Note 0a0a29887d70 / 4c99043a85bb were supposed to fix this.
This was mostly working, but verts could still obtain wrong weights
(most notably "outside" the gradient range).

Code from above commits would correctly skip hidden verts in
`gradientVertUpdate__mapFunc`.
However, `gradientVertInit__mapFunc` (called prior) already does
`gradientVert_update` once [not entirely sure why it does this, but
wouldnt want to remove the call there due to unforseen behavioral
changes] and we dont early out there.

So now move the check for hidden verts from
`gradientVertUpdate__mapFunc` to `gradientVertInit__mapFunc` and early
out (also saves us from doing other unneccessary stuff there).

Pull Request: https://projects.blender.org/blender/blender/pulls/113825
2023-10-20 14:21:23 +02:00
Philipp Oeser
17a950f570 Merge branch 'blender-v4.0-release' 2023-10-20 14:15:30 +02:00
Philipp Oeser
3cb659faa8 Fix #107920: Weight gradient tool auto normalizes over locked groups
Locking wasnt respected, now use `BKE_defvert_normalize_lock_map`
instead (and only use `BKE_defvert_normalize_lock_single` in case no
groups are locked).

Pull Request: https://projects.blender.org/blender/blender/pulls/113853
2023-10-20 14:14:49 +02:00
Clément Foucault
920005ddc0 Fix EEVEE-Next: Missing light specular contribution 2023-10-20 14:08:51 +02:00
Jacques Lucke
09e6ebb5f0 UI: support different main word heuristics in string search
Currently, we always prioritize the words in the last section of a search item
(the words that are highlighted). This generally works well, but the situation
is a bit different for link-drag-search, because there the last part is the socket
name, which is usually less descriptive than the node name.

This patch allows us to use different heuristics to select the prioritized section
per search.

Unfortunately, the link-drag-search is not fully consistent with itself. Sometimes
the last group is a socket name, but sometimes it's also the mode of a node
(`Math > Add`). Therefore, the patch currently simply prioritizes all words in the
same instead of prioritizing only the first part. This seems to work much better
than before even if not perfect in all cases yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/113648
2023-10-20 13:50:10 +02:00
Bastien Montagne
b684864561 Fix USD I/O crashing on reports by using new wmJob report system.
Calling `WM_report` & co API from wmJob worker thread is utterly unsafe,
and should never have been done. It 'worked' so far presumably because
worker threads were barely (if ever) reporting anything that way, but
now USD IO code is spamming reports in some cases, leading to fairly
common crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113883
2023-10-20 11:08:27 +02:00
Sergey Sharybin
21c8af467d Cleanup: Convert winfunc and utfconv to C++
Basically, the intern/utfconv directory, as well as users of
these headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113901
2023-10-20 10:27:31 +02:00