Refactor: change light linking object storage be dynamically allocated #108090

Closed
Brecht Van Lommel wants to merge 128 commits from light-linking-dna into cycles-light-linking

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

128 Commits

Author SHA1 Message Date
Brecht Van Lommel b5b64cb4cb Merge branch 'cycles-light-linking' into light-linking-dna 2023-05-22 17:29:22 +02:00
Brecht Van Lommel e2fbf0193f Merge branch 'main' into cycles-light-linking 2023-05-22 17:09:26 +02:00
Brecht Van Lommel 7d416ece82 Cleanup: fix compiler warnings
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 17:08:50 +02:00
Nate Rupsis f9ec539a51 Merge branch 'blender-v3.6-release' 2023-05-22 10:55:21 -04:00
Nate Rupsis 24ca886ac0 Revert "Animation: Update NLA "TAB" tweak mode to be full stack evaluation"
buildbot/v360-code-daily-coordinator Build done. Details
This reverts commit 0f67ac4547.
2023-05-22 10:54:57 -04:00
Sebastian Herholz 8d17458569 Cycles: Path Guiding: Adding guiding on glossy surfaces via RIS
Pull Request: #107782
2023-05-22 16:47:05 +02:00
Brecht Van Lommel f11c51cc5b Skip light linking allocation in depsgraph when not needed 2023-05-22 16:45:53 +02:00
Brecht Van Lommel c994a4ece4 Merge branch 'cycles-light-linking' into light-linking-dna 2023-05-22 16:26:07 +02:00
Xavier Hallade 6cce149144 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 15:27:55 +02:00
Xavier Hallade 23de320878 Cycles: fix multi-device rendering with oneAPI and Hardware Raytracing
buildbot/v360-code-daily-coordinator Build done. Details
Only Embree CPU BVH was built in the multi-device case. However, one
Embree GPU BVH is needed per GPU, so we now reuse the same logic as in
the other backends.

Pull Request: #107992
2023-05-22 15:26:58 +02:00
Philipp Oeser 7b818e7bcb Merge branch 'blender-v3.6-release' 2023-05-22 15:25:35 +02:00
Philipp Oeser adb36b89c7 Fix #107988: Spreadsheet not updating when playing animation
Similar to other screen options, add one for Spreadsheet editors that
makes them update when playing animation.

NOTE: there are some editors that always update when playback was
invoked from an animation editor while others only do this when their
respective option is specifically set (think the later behavior fits the
spreadsheet better).

Pull Request: #108002
2023-05-22 15:15:22 +02:00
Jacques Lucke e70051ae3d Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 14:02:28 +02:00
Jacques Lucke 9692262b9d Fix #108122: onion skin disappears after scrubbing timeline
buildbot/v360-code-daily-coordinator Build done. Details
This was broken in 037b3f87bd.
2023-05-22 14:01:14 +02:00
Jeroen Bakker 2164515fab DrawManager: Fix Incorrect Resource Binding Hair/Curves
buildbot/vdev-code-daily-coordinator Build done. Details
In the DrawManager a dummy texture was attached to the a, au, c, ac
binding points. In the shader those binding points are actual texture
buffers.

The reason for the dummy texture was to work around some OpenGL driver
bugs. In Vulkan (and expected also in Metal) it is not allowed to attach
a texture as a texel buffer. Fixing this would require copying buffers into a
buffer during binding.

This patch will remove the binding of the textures and use the vbos
instead. Also it fixes an issue where a platform does support compute
shaders, but don't support transform feedback. This is currently the
case for the Vulkan backend.

Pull Request: #108139
2023-05-22 12:59:09 +02:00
Damien Picard b9049411a8 I18n: disambiguate more "A" and "B" messages
buildbot/v360-code-daily-coordinator Build done. Details
In dd32dac60f, the "A" and "B" input socket from the Mix node were
disambiguated, so as not to confuse them with Alpha and Blue.

These messages are used in other nodes and elsewhere in the same
sense, so this commit adds translation contexts to these occurrences
as well.

Pull Request: #108051
2023-05-22 12:54:39 +02:00
Bastien Montagne 1ab265f535 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 12:07:08 +02:00
Damien Picard 94fd2efc96 Cleanup: remove translation headers from node files
buildbot/v360-code-daily-coordinator Build done. Details
After 22f641e7f8, translation macros were removed and thus in many
files inclusion of the translation header is no longer needed.

Pull Request: #107986
2023-05-22 12:06:46 +02:00
Damien Picard 0af41365e6 Cleanup: remove translation headers from node files
After 22f641e7f8, translation macros were removed and thus in many
files inclusion of the translation header is no longer needed.

Pull Request: #107986
2023-05-22 12:05:39 +02:00
Damien Picard 60ac9ab7a1 Fix: I18n: Vector Math node label translation function
The Vector Math node's label has a special function used to compute
its label based on the currently selected operation. This operation,
like that of the Math node, is extracted using the "NodeTree"
translation context.

Therefore, in this function it must also use the same context to
translate the label.

In addition, a few node types can have an "Unknown" label if there is
a problem with their internal state (operation, filter type, blending
type). This message can also be translated.

Pull Request: #108029
2023-05-22 12:04:29 +02:00
Bastien Montagne 1277f7a476 Merge branch 'blender-v3.6-release' 2023-05-22 12:01:45 +02:00
Damien Picard 94934301e9 I18n: Add translation contexts to properties declared from Python
buildbot/v360-code-daily-coordinator Build done. Details
Some property labels need a context to disambiguate them from others
which have the same name.

The only way to show the proper text currently for such properties is
to override it in the UI code with a translation context, like:

```python
    layout.prop(obj, "area", text="Area",
                context=i18n_contexts.amount)
```

Python properties already store a translation context though, but this
context cannot be chosen from a Python script.

For instance, typing:

```python
bpy.types.Scene.test_area = bpy.props.BoolProperty(name="Area")
print(bpy.context.scene.bl_rna.properties['test_area'].translation_context)
```

will print `*`, the default context for Python props.

This commit allows specifying a context in this manner:

```python
from bpy.app.translations import contexts as i18n_contexts
bpy.types.Scene.test_number_area = bpy.props.BoolProperty(
    name="Area", translation_context=i18n_contexts.amount
)
print(bpy.context.scene.bl_rna.properties['test_number_area'].translation_context)
```

will now print `Amount` and can be translated differently from other
labels. In this instance, the word for a surface area measurement,
instead of a UI area.

-----

This is what translated properties look like using the existing ("Area", "") and ("Area", "Amount") messages:
![python_prop_contexts_test.png](/attachments/b0d9737e-4b31-4c91-a08e-b347db31225f)

The panel can be generated with this script:
[python_prop_contexts_test.py](/attachments/ab613cdc-8eba-46bc-8f3c-ad0a97e7a6e5)

Pull Request: #107150
2023-05-22 11:41:48 +02:00
Damien Picard 2decfe4f00 I18n: Add translation contexts to properties declared from Python
buildbot/vdev-code-daily-coordinator Build done. Details
Some property labels need a context to disambiguate them from others
which have the same name.

The only way to show the proper text currently for such properties is
to override it in the UI code with a translation context, like:

```python
    layout.prop(obj, "area", text="Area",
                context=i18n_contexts.amount)
```

Python properties already store a translation context though, but this
context cannot be chosen from a Python script.

For instance, typing:

```python
bpy.types.Scene.test_area = bpy.props.BoolProperty(name="Area")
print(bpy.context.scene.bl_rna.properties['test_area'].translation_context)
```

will print `*`, the default context for Python props.

This commit allows specifying a context in this manner:

```python
from bpy.app.translations import contexts as i18n_contexts
bpy.types.Scene.test_number_area = bpy.props.BoolProperty(
    name="Area", translation_context=i18n_contexts.amount
)
print(bpy.context.scene.bl_rna.properties['test_number_area'].translation_context)
```

will now print `Amount` and can be translated differently from other
labels. In this instance, the word for a surface area measurement,
instead of a UI area.

-----

This is what translated properties look like using the existing ("Area", "") and ("Area", "Amount") messages:
![python_prop_contexts_test.png](/attachments/b0d9737e-4b31-4c91-a08e-b347db31225f)

The panel can be generated with this script:
[python_prop_contexts_test.py](/attachments/ab613cdc-8eba-46bc-8f3c-ad0a97e7a6e5)

Pull Request: #107150
2023-05-22 11:38:51 +02:00
Damien Picard e718f29ec3 I18n: fix node socket extraction regexes
The node socket extraction regexes introduced in 6d39ba7b41 suffered
from two issues:

1. the contextless name extraction would also extract socket names
   which did have a context. To solve, this, use a negative lookahead
   at the end of the regex, containing ".translation_context(".
2. the number of characters in a message was limited to 1, because the
   _str_base component would match one or more chars after the first
   one, while it should have matched zero or more.

This last issues existed before, and the fix allows the extraction of
three new messages.

Pull Request: #108052
2023-05-22 11:36:59 +02:00
Bastien Montagne a440386654 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 11:18:37 +02:00
PaulKristoffersson b7a71d65f8 Fix Estonian language name from #105461
buildbot/v360-code-daily-coordinator Build done. Details
Pull Request: #108042
2023-05-22 11:13:55 +02:00
PaulKristoffersson 963c4a8baa Fix Estonian language name from #105461
Pull Request: #108042
2023-05-22 11:10:14 +02:00
Sergey Sharybin eb3e32b653 Fix #108136: Regression : Texture paint is broken
buildbot/vdev-code-daily-coordinator Build done. Details
Mistake in the 406cfd214a which was calculating the offset wrongly.

Pull Request: #108138
2023-05-22 10:45:15 +02:00
Sybren A. Stüvel 7a06588f05 Fix #102662: NLA-Strip Corrupted after reopening file w/ lib override
buildbot/v360-code-daily-coordinator Build done. Details
Mark `NlaStrip.frame_{start,end}` and `NlaStrip.frame_{start,end}_ui` as
to-be-ignored for the library override system, and add a new set of RNA
properties `frame_{start,end}_raw` that the library override system can
use.

Versioning code ensures that overrides on `frame_{start,end}` are
altered to be applied to the `..._raw` counterpart instead.

The override system uses RNA to update properties one-by-one, and the
RNA code trying its best to keep things consistent / valid. This is very
much desired behaviour while a human is editing the data.

However, when the library override system is doing this, it is not
replaying the individual steps (that each end in a valid configuration),
but just setting each property one by one. As a result, the intermediate
state can be invalid (for example moving one strip into another) even
when the end result is perfectly fine.

This is what the `..._raw` properties do -- they set the values without
doing any validation, so they allow the library overrides system to move
strips around.

This assumes that the result of the override is still valid. Logic to
detect invalid situations, and reshuffle the NLA strips if necessary, is
left for a future commit as it is related to #107990 (NLA Vertical
Reorder).

Additionally, this commit adds functions
`BKE_lib_override_library_property_rna_path_change()` and
`BKE_lib_override_library_property_search_and_delete()` to the library
override API. The former is used to change RNA paths of property
overrides, and the latter is used to remove a property override
identified by its RNA path.
2023-05-22 10:36:50 +02:00
Xavier Hallade 7f4aa0b553 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 10:17:40 +02:00
Xavier Hallade 3695f0dffc Cycles: fix device settings update for Multi-device
buildbot/v360-code-daily-coordinator Build done. Details
Hardware Raytracing wasn't properly disabled or enabled in the
subdevices of the multi-device.

This construct:
foreach ( DeviceInfo &info,
  (device.multi_devices.size() != 0 ?
    device.multi_devices : vector<DeviceInfo>({device}))
)
was a nice trap - it was giving a copy to iterate on.

Pull Request: #107989
2023-05-22 10:14:35 +02:00
Jacques Lucke 64c33871bd Cleanup: add missing inline
buildbot/vdev-code-daily-coordinator Build done. Details
This is necessary for correctness of the code to avoid duplicate symbols.
In practice, this wasn't necessary yet, because usually we pass lambdas
into these functions which cause every instantiation to have a different
signature.
2023-05-22 09:32:35 +02:00
Jacques Lucke 7725bacd6a BLI: support aligned parallel reduce
Alignment here means that the size of the range passed into callback
is a multiple of the alignment value (which has to be a power of two).
This can help with performance when loops in the callback are are
unrolled and/or vectorized. Otherwise, it can potentially reduce
performance by splitting work into more unequally sized chunks.
For example, chunk sizes might be 4 and 8 instead of 6 and 6 when
alignment is 4.
2023-05-22 09:30:51 +02:00
Jacques Lucke 3895261454 BLI: add size_in_bytes method to MutableSpan 2023-05-22 09:25:25 +02:00
Jacques Lucke 2b49d4eeea BLI: support transferring ownership of buffers between linear allocators
This can be useful when e.g. each thread has its own `LinearAllocator`,
but in the end they are combined into one.
2023-05-22 09:25:09 +02:00
Jacques Lucke 92512f224d BLI: support keeping track of how much memory a linear allocator uses
This is useful when debugging how much memory a particular function
allocates from this allocator. The change also reduces the size of
`LinearAllocator`.
2023-05-22 09:15:43 +02:00
Jacques Lucke 153e1c0492 BLI: fix overload resolution with FunctionRef parameters
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 09:03:21 +02:00
Guillermo Venegas e83a2386b5 Fix #107411: Non-visible objects in the viewport affect selection collusion
buildbot/v360-code-daily-coordinator Build done. Details
When using edit mode with a mesh, if you have the retopology overlay active,
the selection of vertices, edges, or faces is occluded by the other objects.
However, if local view is on or collections with objects are hidden,
these non-visible objects can occlude the selection.

This patch discards objects that are not visible in the viewport so they
do not occlude selection.
2023-05-22 08:27:05 +02:00
Chris Blackbourn fd887bcb15 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 15:58:47 +12:00
Chris Blackbourn 96101a66fc UV: Use correct uv packing method when all/none islands are pinned.
buildbot/v360-code-daily-coordinator Build done. Details
During packing, some combinations of `Fraction` margin method, and
various locking options, interact with situations where all or none
of the islands are pinned.

Previously, the settings were queried to choose the best packing method.

Now, the islands themselves are queried if they can translate or scale,
and the packing method is chosen based on the input, rather than the
parameters.

Fixes unreported crash with "Locked Position" when all islands are pinned.

Reported as #108037 "3. In some case locked position is not respected"
2023-05-22 15:54:38 +12:00
Chris Blackbourn 47cbeabb11 UV: Fix uv packing problem with rotate and scale line-search
When rotation is enabled and doing a scale line-search (locked islands
or "fraction" margin method), if the `rotate_inside_square` would
result in a a tighter packing, the wrong scale value was being used,
resulting in UVs outside of the unit square.

Reported as #108037 "1. Use locked scale on after scaling UV..."
2023-05-22 15:44:01 +12:00
Chris Blackbourn de4f456ea2 UV: Fix overlap problem during uv packing with scale locked islands
If an island overlaps a pinned island, and that pinned island has
locked scale, then the pinning information must be copied to the
first island so it can be scaled correctly.

Reported in #108037 as "2. Use with Merge Overlapped"
2023-05-22 15:36:03 +12:00
Richard Antalik 737f582329 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-22 03:58:29 +02:00
Richard Antalik a928d6d6b7 Fix #107588: Sound strip has negative length
buildbot/v360-code-daily-coordinator Build done. Details
Make sure pitch property has positive value in versioning.
Cause of 0 value pitch is unknown.
2023-05-22 03:55:52 +02:00
Harley Acheson 52f991b1a9 Fix #106484: Show all rotations with same precision
buildbot/v360-code-daily-coordinator Build done. Details
Increase precision of some rotational inputs so that they all show the
same precision. And have the arrows change in full degrees.

Pull Request: #106515
2023-05-21 10:38:07 -07:00
Harley Acheson d81646cbce Fix #102574: Don't Show "Rename" for Volume and & System lists
For File Browser "System" and "Volumes" lists, the item names cannot be
changed by users yet the tooltip says "Double click to rename". This PR
just removes that text for these non-editable lists.

Pull Request: #106873
2023-05-21 10:29:22 -07:00
Pratik Borhade 8c6908eba5 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-21 19:30:43 +05:30
Pratik Borhade 6c4da68ad2 Fix #107718: Extend channel selection not working due to key conflicts
buildbot/v360-code-daily-coordinator Build done. Details
In 80feb13665, preference for extend channel selection is changed to
ctrl-click. But some channel type invokes rename operation due to key
conflicts. Since double-click is also used for renaming, remove
ctrl-click keys for renaming.

Pull Request: #107719
2023-05-21 15:56:01 +02:00
Jacques Lucke b58cfde48a BLI: improve IndexRange
buildbot/vdev-code-daily-coordinator Build done. Details
Defining `operator-` for the iterator allows it to be used in more generic
iterator code. The `index_range` method is the same that exists on many
other containers like `Vector`.
2023-05-21 15:13:57 +02:00
Jacques Lucke f6d824bca6 BLI: move tbb part of parallel_for to implementation file
buildbot/vdev-code-daily-coordinator Build done. Details
Previously, `tbb::parallel_for` was instantiated every time `threading::parallel_for`
is used. However, when actual parallelism is used, the overhead of a function
call is negilible. Therefor it is possible to move that part out of the header
without causing noticable performance regressions.

This reduces the size of the Blender binary from 308.2 to 303.5 MB, which is
a reduction of about 1.5%.
2023-05-21 13:31:32 +02:00
Campbell Barton 57f593b7ca Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-21 13:50:45 +10:00
Campbell Barton 047ff43ee4 Fix GHOST/Wayland configuring an XDG surface before it was handled
buildbot/v360-code-daily-coordinator Build done. Details
xdg_surface_ack_configure must run once the events have been handled
which is not the case configure runs from the event handling thread.

In practice this could lead to glitches resizing windows, although some
flickering on startup remains on KDE which would be good to resolve.
2023-05-21 13:47:56 +10:00
Iliya Katushenock 43d66f6760 Cleanup: Fix copyright date in new bke header
buildbot/vdev-code-daily-coordinator Build done. Details
Pull Request: #108112
2023-05-21 03:43:06 +02:00
Daniel Salazar f637b8c095 UI: Rename Copy Vertex Group to Duplicate Vertex Group
buildbot/vdev-code-daily-coordinator Build done. Details
Change display name of OBJECT_OT_vertex_group_copy to "Duplicate Vertex
Group" from "Copy Vertex Group". The word "duplicate" is a better
unambiguous descriptor of this operation.

Pull Request: #107691
2023-05-21 02:02:10 +02:00
Campbell Barton ab294b4ebb Cleanup: spelling in comments, colon after doxy parameters
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-20 21:24:42 +10:00
Campbell Barton 8925ea1890 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-20 21:18:02 +10:00
Campbell Barton bf36a61e62 Cleanup: spelling in comments & some corrections
buildbot/v360-code-daily-coordinator Build done. Details
2023-05-20 21:17:09 +10:00
Campbell Barton 8783a51583 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-20 20:31:36 +10:00
Campbell Barton 7c169ddd67 Cleanup: format 2023-05-20 20:31:31 +10:00
Campbell Barton 1d6eb9bc93 Fix UV vertex snap while transforming snapping to itself
buildbot/v360-code-daily-coordinator Build done. Details
When the mouse cursor was close to the selection being transformed,
the UV's could snap to themselves.
2023-05-20 20:28:11 +10:00
Brecht Van Lommel 8e38e45be5 Cycles: skip non-emissive and non-linked meshes when finding mesh lights with ray
Ref #104972

Pull Request: #108091
2023-05-19 23:53:51 +02:00
Germano Cavalcante 33c13ae6e3 Transform: support navigation while transforming in 3D view
buildbot/vdev-code-daily-coordinator Build done. Details
Implements a new option in keymap settings:
- "Navigate during Transform"

Note that with the option enabled, the keymap changes as follows:

|Modal Map (Blender):| Conflict: | Current: | New:
|---|---|---|---
| Increase Proportional Influence | VIEW3D_OT_zoom | Wheel Down | Alt Wheel Down
| Decrease Proportional Influence | VIEW3D_OT_zoom | Wheel Up | Alt Wheel Up
| Adjust Proportional Influence | VIEW3D_OT_rotate | Mouse/Trackpad Pan | Alt Mouse/Trackpad Pan
| Increase Max AutoIK Chain Length | VIEW3D_OT_zoom | Wheel Down | Alt Wheel Down
| Decrease Max AutoIK Chain Length | VIEW3D_OT_zoom | Wheel Up | Alt Wheel Up
| Automatic Constraint | VIEW3D_OT_rotate | Middle Mouse | Alt Middle Mouse
| Automatic Constraint Plane | VIEW3D_OT_move | Shift Middle Mouse | Shift Alt Middle Mouse

Design Task: #106008
Pull Request: #105764
2023-05-19 23:45:27 +02:00
Germano Cavalcante 2ce365efc7 View 3D: new utility to provide navigation in operators
buildbot/vdev-code-daily-coordinator Build done. Details
Implements a new API consisting of:
- `ED_view3d_navigation_init`,
- `ED_view3d_navigation_do` and
- `ED_view3d_navigation_free`,

With these functions, any operator can create their own navigation
context and navigate in the 3D View without having to use
`PASS_THROUGH`.
2023-05-19 18:20:13 -03:00
Bastien Montagne 552c262cee Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 23:00:34 +02:00
Bastien Montagne 575772d70d install_linux_packages: update library versions for 3.6 release.
buildbot/v360-code-daily-coordinator Build done. Details
Following #104895 specs for versions.
2023-05-19 22:47:53 +02:00
Hans Goudey f17ea1f2a7 Geometry Nodes: Remove realize instances legacy behavior
buildbot/vdev-code-daily-coordinator Build done. Details
The option was added f5ce243a56 when the node was
rewritten to add support for propagating instance attributes.
2023-05-19 14:02:53 -04:00
Hans Goudey ea64b2ce08 Cleanup: Remove deprecated unused fields in raycast node 2023-05-19 14:02:53 -04:00
Brecht Van Lommel e1d9e127c2 Refactor: change light linking object storage be dynamically allocated
To reduce memory usage of Object a bit when no light linking is in use.
2023-05-19 20:01:03 +02:00
Clément Foucault c435d2f856 Metal: Always add GPU_TEXTURE_USAGE_ATTACHMENT flag
buildbot/vdev-code-daily-coordinator Build done. Details
Texture clearing is done using framebuffer clear.
To avoid adding the flag everywhere we add it as part
of the texture creation process.

This should have no performance impact.
2023-05-19 18:48:07 +02:00
Sergey Sharybin 8bca0e1075 Cleanup: Format python after recent changes
buildbot/vdev-code-daily-coordinator Build done. Details
Pull Request: #108086
2023-05-19 18:20:27 +02:00
Clément Foucault b40b59935d Metal: Force Compute shaders workgroup max thread count
This forces the max thread count to be inlined with what
blender expects. While this will make some shaders less
eficient it avoid crashes / assert on shaders that
could not compile. The performance impacts can be fixed
by tackling the individual cases.
2023-05-19 18:08:49 +02:00
Germano Cavalcante 560e9c654b UI: Edit Mode Options panel cleanup
buildbot/vdev-code-daily-coordinator Build done. Details
AutoMerge is a property of transform operations, so it seems more
convenient to have this option bundled with transform settings.

Another thing is that the 'Live Unwrap' option has no real relation to
Transform.

Therefore, remove the 'AutoMerge' sub-panel and create two sub-panels
for the Options Panel:
- Transform
- UVs

Merge the 'AutoMerge' settings into the 'Transform' sub-panel.

Move 'Live Unwrap' to the 'UVs' sub-panel.

Pull Request: #108056
2023-05-19 17:32:46 +02:00
Sergey Sharybin 8cc22d2809 Workaround Cycles regression test failures
buildbot/vdev-code-daily-coordinator Build done. Details
The failure happens since the recent changes in the make_orthonormals.

The only difference is the underwater caustics test file, and the
difference seems to be a noise floor.

There seems to be nothing wrong with the math in the function itself:
the return values are all without quite small epsilon when comparing
Linux with M2 macOS. The thing is: the very first input is already a
bit different on different platforms. So the difference is already
somewhere else.

For now increase the threshold to avoid confusion of the rest of the
team, and to allow builds to be deployed.

Pull Request: #108080
2023-05-19 16:42:08 +02:00
Germano Cavalcante e0e182d5e9 Cleanup: deduplicate code to obtain the object for the transform space
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 11:09:50 -03:00
Philipp Oeser b060beae17 Merge branch 'blender-v3.6-release' 2023-05-19 15:53:44 +02:00
Philipp Oeser 370b7ae917 Fix #107889: Scale Cage gizmo wrong in editmode with rotated objects
buildbot/v360-code-daily-coordinator Build done. Details
Object transforms were already respected, issue was just pre vs. post
matrix multiplication when local axis were used.

Should go into LTS as well I guess.

Pull Request: #108076
2023-05-19 15:51:28 +02:00
Hans Goudey 2a56403cb0 Mesh: Move bevel weight to generic attribute
buildbot/vdev-code-daily-coordinator Build done. Details
Store bevel weights in two new named float attributes:
- `bevel_weight_vert`
- `bevel_weight_edge`

These attributes are naming conventions. Blender doesn't enforce
their data type or domain at all, but some editing features and
modifiers use the hard-coded name. Eventually those tools should
become more generic, but this is a simple change to allow more
flexibility in the meantime.

The largest user-visible changes are that the attributes populate the
attribute list, and are propagated by geometry nodes. The method of
removing this data is now the attribute list as well.

This is a breaking change. Forward compatibility is not preserved, and
the vertex and edge `bevel_weight` properties are removed. Python API
users are expected to use the attribute API to get and set the values.

Fixes #106949

Pull Request: #108023
2023-05-19 14:31:31 +02:00
Weizhen Huang 51923c09e2 Cycles: implement faster #make_orthonormals()
buildbot/vdev-code-daily-coordinator Build done. Details
Pull Request: #106053
2023-05-19 12:13:39 +02:00
Campbell Barton 3a286a735f Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 19:56:20 +10:00
Campbell Barton c007e6a346 Fix occasional crash on exit under Wayland
buildbot/v360-code-daily-coordinator Build done. Details
pthread_cancel was sometimes called once the thread had exited,
resolve this by having the function wait to be canceled.
2023-05-19 19:51:42 +10:00
Campbell Barton e620ae054f Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 19:26:01 +10:00
Campbell Barton 8a4ab1b3fe Fix assertion in BLI_path_normalize & add test
buildbot/v360-code-daily-coordinator Build done. Details
2023-05-19 19:25:08 +10:00
Sergey Sharybin 9e5e06136a Fix motion tracking not tracking at all
buildbot/vdev-code-daily-coordinator Build done. Details
A mistake in the recent ImBuf API refactor: the Libmv image accessor
was copying destination to destination (possibly using the wrong
number of channels as well).

Pull Request: #108070
2023-05-19 10:48:49 +02:00
Jason Fielder c267256f01 Fix #105830: Add depth bias for overlay faces in Metal
buildbot/v360-code-daily-coordinator Build done. Details
Resolves z-fighting blocking artifacts on faces due to limited
depth precision at certain camera positions. Depth bias
offsets the calculation enough without affecting display.

Authored by Apple: Michael Parkin-White

Pull Request: #108048
2023-05-19 09:23:17 +02:00
Campbell Barton 9af19822f0 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 16:27:42 +10:00
Campbell Barton 2ce7f3ec71 Fix crash on exit under Wayland with multiple windows open
buildbot/v360-code-daily-coordinator Build done. Details
Exiting with multiple overlapping windows (a file selector for e.g.)
reliably crashes.

Closing the windows on exit caused the the keyboard enter handler to be
called with a NULL window surface (wl_surface).

While this doesn't look to be documented anywhere, SDL's code-comments
note this happens when windows have just been closed.
GTK also check surfaces for NULL.
2023-05-19 16:25:56 +10:00
Campbell Barton 3db0bde21d Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 15:14:27 +10:00
Campbell Barton 2eaacbaa3f Fix memory leak on exit under GHOST/Wayland
buildbot/v360-code-daily-coordinator Build done. Details
2023-05-19 15:10:51 +10:00
Campbell Barton 712d177aa3 Cleanup: avoid strcpy for initializing ID names
While strcpy is safe in this case, it's use requires extra scrutiny
and can cause problems if the strings are later translated.

Also move the ID code assignment into material_init_data
as the ID-code is more of an internal detail.
2023-05-19 15:01:03 +10:00
Campbell Barton ec8a4cfcb7 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 14:34:42 +10:00
Campbell Barton 2c6e88da96 Fix memory leak in copy_to_selected_button
buildbot/v360-code-daily-coordinator Build done. Details
Memory leak introduced in [0] early return cleanup.

[0]: a25a1f39aa
2023-05-19 14:29:46 +10:00
Hans Goudey 71d22331b1 Cleanup: Rename mesh loose edges tag function
buildbot/vdev-code-daily-coordinator Build done. Details
To match the more recently added `tag_loose_verts_none`.
2023-05-18 23:06:15 -04:00
Hans Goudey 381fae91b1 Geometry Nodes: Keep loose vert/edge tags for extrude and split edges
If there are no loose vertices or edges, it's basically free to
propagate that information to the result and save calculating
it later in case it's necessary. I observed a peformance increase
from 3.6 to 4.1 FPS when extruding a 1 million face grid.
2023-05-18 23:06:15 -04:00
Campbell Barton c7a508be50 Cleanup: pass boolean to text_drawcache_tag_update
Also remove redundant CTX_wm_space_text(C) calls.
2023-05-19 13:02:15 +10:00
Campbell Barton 6fbad2ce7e Merge branch 'blender-v3.6-release' 2023-05-19 12:53:53 +10:00
Campbell Barton bb543620ae Fix invalid UTF8 strings being copied into the Python console
buildbot/v360-code-daily-coordinator Build done. Details
Add a ensure_utf8 argument to WM_clipboard_text_get so callers don't
have to handle validation themselves.

Copying non-utf8 text into the Python console and buttons was possible,
causing invalid cursor position and a UnicodeDecodeError accessing
ConsoleLine.body from Python.
2023-05-19 12:49:27 +10:00
Campbell Barton 8ad2ee7f12 Cleanup: function style C++ casts, use printing & ELEM macros
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 11:35:59 +10:00
Campbell Barton 2aa01c3807 Cleanup: quiet discard const warning 2023-05-19 11:34:45 +10:00
Harley Acheson dad9e8e621 Fix #102574: Don't Show "Rename" for Volume and & System lists
buildbot/vdev-code-daily-coordinator Build done. Details
For File Browser "System" and "Volumes" lists, the item names cannot be
changed by users yet the tooltip says "Double click to rename". This PR
just removes that text for these non-editable lists.

Pull Request: #106873
2023-05-19 01:17:28 +02:00
Richard Antalik 40ccc37fc6 VSE: Add go to current frame operator to view menu
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-19 00:46:53 +02:00
Harley Acheson b34ece48f8 Fix #106484: Show all rotations with same precision
buildbot/vdev-code-daily-coordinator Build done. Details
Increase precision of some rotational inputs so that they all show the
same precision.  And have the arrows change in full degrees.

Pull Request: #106515
2023-05-19 00:25:05 +02:00
Lukas Stockner 8cde7d8f8a Cycles: Merge Anisotropic BSDF node into Glossy BSDF node
buildbot/vdev-code-daily-coordinator Build done. Details
Used to be https://archive.blender.org/developer/D17123.

Internally these are already using the same code path anyways, there's no point in maintaining two distinct nodes.

The obvious approach would be to add Anisotropy controls to the Glossy BSDF node and remove the Anisotropic BSDF node. However, that would break forward compability, since older Blender versions don't know how to handle the Anisotropy input on the Glossy BSDF node.

Therefore, this commit technically removes the Glossy BSDF node, uses versioning to replace them with an Anisotropic BSDF node, and renames that node to "Glossy BSDF".

That way, when you open a new file in an older version, all the nodes show up as Anisotropic BSDF nodes and render correctly.

This is a bit ugly internally since we need to preserve the old `idname` which now no longer matches the UI name, but that's not too bad.

Also removes the "Sharp" distribution option and replaces it with GGX, sets Roughness to zero and disconnects any input to the Roughness socket.

Pull Request: #104445
2023-05-18 23:12:20 +02:00
Nate Rupsis 3a839cc52b Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-18 16:07:41 -04:00
Nate Rupsis 0f67ac4547 Animation: Update NLA "TAB" tweak mode to be full stack evaluation
buildbot/v360-code-daily-coordinator Build done. Details
This PR updates the key mapping (TAB) for Tweak mode (Lower stack) to Full stack for the NLA editor

[Issue](#108026)

Pull Request: #108050
2023-05-18 22:06:19 +02:00
Hans Goudey fc06a471f1 Geometry Nodes: Only use realized geometry in mesh boolean node
buildbot/vdev-code-daily-coordinator Build done. Details
Since 44e4f077a9 and related commits, geometry nodes doesn't
try to hide the difference between real geometry data and instances from
the user. Other nodes were updated to only support real geometry, but
the "Mesh Boolean" node was never updated and still implicitly gathered
all the instances. This commit removes the special instance behavior in the
boolean node and adds realize instances nodes to keep existing behavior
in most cases. Typically this doesn't make a difference in the result,
though it could in the union mode for instance inputs. Shifting more of
the work to realizing instances should generally be better for
performance, since it's much faster.
2023-05-18 15:08:53 -04:00
Hans Goudey 30a20b4def Nodes: Remove deprecated useless width_hidden property
buildbot/vdev-code-daily-coordinator Build done. Details
See 7b82d8f029
2023-05-18 13:37:55 -04:00
Hans Goudey 0eba8ac85a Fix #108034: Multires simple subdivide crash
Before 9f78530d80, the -1 coarse_edge_index values in the
foreach_edge calls would return false in BLI_BITMAP_TEST_BOOL,
which made them look like loose edges. BitSpan doesn't have this
problem, so the return for negative indices must be explicit.
2023-05-18 13:28:37 -04:00
Sergey Sharybin 406cfd214a Refactor ImBuf buffer access
buildbot/vdev-code-daily-coordinator Build done. Details
The goal is to make it more explicit and centralized operation to
assign and steal buffer data, with proper ownership tracking.

The buffers and ownership flags are wrapped into their dedicated
structures now.

There should be no functional changes currently, it is a preparation
for allowing implicit sharing of the ImBuf buffers. Additionally, in
the future it is possible to more buffer-specific information (such
as color space) next to the buffer data itself. It is also possible
to clean up the allocation flags (IB_rect, ...) to give them more
clear naming and not have stored in the ImBuf->flags as they are only
needed for allocation.

The most dangerous part of this change is the change of byte buffer
data from `int*` to `uint8_t*`. In a lot of cases the byte buffer was
cast to `uchar*`, so those casts are now gone. But some code is
operating on `int*` so now there are casts in there. In practice this
should be fine, since we only support 64bit platforms, so allocations
are aligned. The real things to watch out for here is the fact that
allocation and offsetting from the byte buffer now need an explicit 4
channel multiplier.

Once everything is C++ it will be possible to simplify public
functions even further.

Pull Request: #107609
2023-05-18 10:19:01 +02:00
Campbell Barton 07058765b9 Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-18 13:32:23 +10:00
Campbell Barton 6dcebc68d6 Fix "~" expanding to the default document directory instead of HOME
buildbot/v360-code-daily-coordinator Build done. Details
Originally this function expanded to the home however on WIN32
functionality changed to return the default Documents directory & the
function was renamed. Always expand "~" to the users home directory
since that's what it represents when used at the beginning of a path.
2023-05-18 13:30:40 +10:00
Campbell Barton 9fbadc98cd Merge branch 'blender-v3.6-release'
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-18 09:34:42 +10:00
Campbell Barton a9358f5274 Fix Blender failing to start in Gnome when X11 isn't available
buildbot/v360-code-daily-coordinator Build done. Details
Only make libdecor a hard-requirement for using Wayland in gnome-shell
when X11 is available, as it's possible to disable Xwayland.

This also fixes window-borders not being used in gnome-shell when
WITH_GHOST_X11 is off.

Now it's possible to test Blender under gnome without libdecor by
uninstalling libdecor & running with DISPLAY environment variable
set to an empty string - useful for troubleshooting issues which
could be caused by libdecor.
2023-05-18 09:33:46 +10:00
Ray molenkamp 4368b0e296 Merge branch 'blender-v3.6-release' into main
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-17 16:41:37 -06:00
Ray molenkamp 96867a713b CMake/Windows: Blacklist MSVC 17.6.x
buildbot/v360-code-daily-coordinator Build done. Details
Code gen bugs can happen, ad usually they can be worked around
MSVC 17.6 is not one of those cases:

59% tests passed, 120 tests failed out of 296

There really is no other choice than to refuse to build with this
compiler. Alternates that CAN be used are both 17.5 and the current
17.7 preview builds.

Upstream tracking ticket kindly submitted by @deadpin :
https://developercommunity.visualstudio.com/t/vs176/10293729

If a compiler is released in the 17.6.x series that has the bug
fixed, we can contract the range of blacklisted compiler versions
to cover just the affected range, for now however all of 17.6 marked
bad
2023-05-17 16:40:51 -06:00
Hans Goudey 180c72a708 Cleanup: Add version after linking function for 4.0 series
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-17 17:02:07 -04:00
Hans Goudey 468295cb7c Cleanup: Add a function to sample mesh point normals
This simplifies #108014 and is consistent with the existing function
for face corners, `sample_corner_normals`.
2023-05-17 16:54:22 -04:00
Hans Goudey f106579a9a Cleanup: Add function to check if named custom data layer exists
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-17 16:16:54 -04:00
Hans Goudey 9bdfb15e98 Cleanup: Remove redundant writing of old face set type
buildbot/vdev-code-daily-coordinator Build done. Details
Face sets are now always saved with the generic float type
2023-05-17 14:34:52 -04:00
Hans Goudey d41021a7d4 Mesh: Remove deprecated face/vert custom data API
buildbot/vdev-code-daily-coordinator Build done. Details
Remove six collection properties from Mesh that are redundant
with the attribute API which has a nicer API and more features.
- `vertex_layers_float`
- `vertex_layers_int`
- `vertex_layers_string`
- `polygon_layers_float`
- `polygon_layers_int`
- `polygon_layers_string`
2023-05-17 14:10:00 -04:00
Hans Goudey 6805657a39 Mesh: Remove sculpt vertex colors from RNA API
buildbot/vdev-code-daily-coordinator Build done. Details
Added in f7bbc7cdbb, these were never exposed in an
official release, and were eventually replaced by the attribute system.

Ref #100153
2023-05-17 13:41:16 -04:00
Hans Goudey 1b63a290c6 Core: Write mesh and movieclip with new format
buildbot/vdev-code-daily-coordinator Build done. Details
Finish the transition from #95966 and fe38715600 by
writing files with the new format for meshes and some movie clip fields.
This removes overhead when saving files, and makes meshes saved in
files smaller (a file with a 1 million face grid changed from 32 to 28 MB).

3.6 can still read files saved with this format, but older versions will
crash. Older files are automatically converted by versioning code when
opened.

This also allows removing all the code that converts from the new
format to the legacy format, previously used when saving files.

Pull Request: #108015
2023-05-17 19:03:16 +02:00
Julian Eisel 39a5025032 UI: Use fixed width for grid view items, don't stretch to full width
buildbot/vdev-code-daily-coordinator Build done. Details
No user visible changes expected (since grid-views are only used in
branches right now).

This just makes grid view UIs feel more "stable" while scaling areas,
since things don't move around as much anymore. The tradeoff is that
there may be some empty space on the right, if there's not enough space
for a full column. This is how the file browser already behaves, and can
be mitigated by a smaller preview size.
2023-05-17 18:20:34 +02:00
Julian Eisel c89354da80 UI: Properly center text under previews
The text under previews would be quite close to the preview, so that
there was more space below it than above. Center it vertically in the
available space now. Also, the horizontal padding was only applied to
the right side of the text rectangle, meaning horizontally centered text
would be too far left. Apply the padding equally, this doesn't affect
available space for the text too much.

See #108018 for before/after pictures.

Pull Request: #108018
2023-05-17 18:10:54 +02:00
Hans Goudey 479aa64326 Merge branch 'blender-v3.6-release' 2023-05-17 12:00:39 -04:00
Hans Goudey 112a5196f6 Fix: Missing loose vertices converting BMesh to Mesh
buildbot/v360-code-daily-coordinator Build done. Details
Mistake in 6323d56eb5
2023-05-17 11:58:49 -04:00
Julian Eisel 76112f1439 Fix double highlighting of preview tiles in asset view template
The highlighting of preview tiles would be too strong in asset view
templates and grid views (only used in branches so far). This is because
two buttons are overlayed on top of each other, and both would
highlight. Ensure the overlayed preview tile button doesn't use any
highlighting.
2023-05-17 17:54:35 +02:00
Julian Eisel d4217c278e Fix excessive vertical margin between items in asset view template
The UI list and asset view preview size calculations were out of sync,
so the UI list made more space than the preview actually used. Making
them match made the previews quite large though, so compensate that by
scaling the layout down.
Remove the related TODO comment, since this uses a common function for
getting the preview size now.

Before/after:
![Screenshot from 2023-05-17 17-33-19.png](/attachments/0ac713a3-12d9-41b6-ab50-85790da765a9) ![Screenshot from 2023-05-17 17-42-15.png](/attachments/0def65b5-6b16-4431-9a9e-592ed3d9675f)

Pull Request: #108017
2023-05-17 17:49:16 +02:00
Miguel Pozo 430b2716c8 Workbench Next: Volumes: Don't draw on top of "in front" objects
buildbot/vdev-code-daily-coordinator Build done. Details
2023-05-17 17:34:16 +02:00