Commit Graph

100590 Commits

Author SHA1 Message Date
Campbell Barton
5a8d9b893c Cleanup: quiet shadow warning 2023-06-21 11:28:55 +10:00
Hans Goudey
e38195109c Merge branch 'blender-v3.6-release' 2023-06-20 16:33:08 -04:00
Hans Goudey
2ef27684c5 Fix #108930: Mirror modifier handles custom normals incorrectly
Before 17d161f565, the "vec_lnor" stored the automatically
computed normal without any influence from custom normals. But after,
the normals were used from the final output corner normals array, which
did have the custom normal data factored in at the end. This fix is to
revert part of that commit, storing the automatically computed normal
per space like before.
2023-06-20 16:32:15 -04:00
Jesse Yurkovich
88cc6aa11e Merge branch 'blender-v3.6-release' 2023-06-20 12:34:02 -07:00
Jesse Yurkovich
66a6ef0163 Fix #109045: Allow images with more than 4 channels to load
Align behavior to what Cycles does in such cases which is to drop the
additional channels that are not supported.

This was a regression from aa3bdfd76a

Pull Request: https://projects.blender.org/blender/blender/pulls/109063
2023-06-20 21:32:54 +02:00
Iliya Katueshenock
ee98b24d15 Cleanup: Undo revertions from last cleanup
Changes from 8bcad285de were reverted when merging
#108995 with main. This was missed and committed to main.
This is a revert of those changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109167
2023-06-20 18:56:37 +02:00
Iliya Katueshenock
5b086fdc74 Cleanup: Preparation to move versioning file 2.6 to C++
Changes is a using `LISTBASE_FOREACH` instead of manual for-loops.
Also decrease variable scope in some places.

See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/108995
2023-06-20 18:38:28 +02:00
Julian Eisel
167c5c6b53 Fix UI views not refreshing properly in popovers
No UI views are used inside popups in the main branch yet, #104831 does
this so this issue became apparent. For example tree-view items would
not change their collapsed state.

UI views require the block to be attached to a region when drawing, so
that the matching to previous versions of the tree works. Before this
commit the block was attached just after.

The `BLI_findindex()` check before attaching the block was already done
for other kinds of popups, so this is more in sync now.
2023-06-20 17:23:25 +02:00
Jacques Lucke
a6d2bb92ed Cleanup: deduplicate code to create dummy nodes in simulation graph
The same new utility functions can also be used for serial loop zones later on.
2023-06-20 17:10:39 +02:00
Nate Rupsis
4268ac0ed9 Animation: NLA Vertical Reorder
Allow NLA strips to be vertically re-ordered. NLA strips can now be dragged through other strips, and locked tracks.

Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/107990
2023-06-20 17:10:09 +02:00
Sybren A. Stüvel
2014084d29 Animation: Convert armature RNA from C to C++
Transform `rna_armature.c` and `rna_armature.cc` to C++.

- `UNUSED(x)` -> `/*x*/`
- Explicit casts for ID and void pointers
- Explicit casts for 0 enum values

No functional changes.
2023-06-20 17:02:47 +02:00
Julian Eisel
c8395e3bbc Cleanup: Remove unused header includes in outliner_tree.cc 2023-06-20 16:55:15 +02:00
Martijn Versteegh
c78ea4cefc Merge branch 'blender-v3.6-release' 2023-06-20 16:27:07 +02:00
Martijn Versteegh
77c37fb01d Fix #108053: Make the Collada UV sets enumerated from zero
The UV sets incorrectly used the CustomData layer index instead of the
count within the FLOAT2 layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/109056
2023-06-20 16:24:33 +02:00
Campbell Barton
1765640558 Merge branch 'blender-v3.6-release' 2023-06-20 21:10:30 +10:00
Campbell Barton
e2dbc4779e UI: change the UV packing pin option into a toggle & drop-down
Exposing both the option not to use pinned islands and to skip pinned
islands in the same drop-down was confusing.

Now there is a checkbox "Pin", when disabled, pinned UV's don't
have any impact on the packed result.

When enabled, the pin-method selects how pinned islands are handled.

Also remove the "ignore" option from the UI as this didn't fit well with
other methods of handling pinned islands. Instead, islands to be ignored
can be de-selected by the user.

Ref !108733.
2023-06-20 21:08:59 +10:00
Bastien Montagne
27965a64a9 Merge branch 'blender-v3.6-release' 2023-06-20 12:42:14 +02:00
Michael Kowalski
a6f3afe995 Fix: USD export: wrong emissive color in viewport material
When a Blender material has no nodes, its viewport color,
roughness and metallic values are saved as inputs to a simple
USD Preview Surface.  This pull request fixes a bug where
the Blender material's viewport color is also saved as
the USD Preview Surface emissiveColor attribute.

This bug was accidentally introduced in #107947.

To reproduce the issue, open the default Blender scene,
turn off nodes on the material and set the material's viewport
color.  Export to USDA and notice that the color is incorrectly
set as the emissiveColor input in the USD shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/109138
2023-06-20 12:35:39 +02:00
Weizhen Huang
a4d792a3ad Cycles/EEVEE: change point light to double-sided sphere light
for energy preservation and better compatibility with other renderes. Ref: #108505

Point light now behaves the same as a spherical mesh light with the same overall energy (scaling from emission strength to power is \(4\pi^2R^2\)).
# Cycles
## Comparison
| Mesh Light | This patch | Previous behavior |
| -------- | -------- | -------- |
| ![mesh_1024](attachments/2900954c-57f8-49c2-b6f3-8fb559b820ac)     | ![sphere_1024](attachments/148241ca-9350-48b6-be04-3933e015424c)     | ![point_1024](attachments/d9b19d54-2b00-4986-ba8c-c4b28f687f09)  |

The behavior stays the same when `radius = 0`.

| This patch | Previous behavior |
| -------- | -------- |
| ![sphere_64](attachments/aa05d59a-146a-4f69-b257-5d09a7f41d4e)     | ![point_64](attachments/69a743be-bc15-454b-92d8-af02f4e8ab07)    |

No obvious performance change observed.

## Sampling
When shading point lies outside the sphere, sample the spanned solid angle uniformly.
When shading point lies inside the sphere, sample spherical direction uniformly when inside volume or the surface is transmissive, otherwise sample cosine-weighted upper hemisphere.
## Light Tree
When shading point lies outside the sphere, treat as a disk light spanning the same solid angle.
When shading point lies inside the sphere, it behaves like a background light, with estimated outgoing radiance
\[L_o=\int f_aL_i\cos\theta_i\mathrm{d}\omega_i=\int f_a\frac{E}{\pi r^2}\cos\theta_i\mathrm{d}\omega_i\approx f_a \frac{E}{r^2}\],
with \(f_a\) being the BSDF and \(E\) `measure.energy` in `light_tree.cpp`.
The importance calculation for `LIGHT_POINT` is
\[L_o=f_a E\cos\theta_i\frac{\cos\theta}{d^2}\].
Consider `min_importance = 0` because maximal incidence angle is \(\pi\), we could substitute \(d^2\) with \(\frac{r^2}{2}\) so the averaged outgoing radiance is \(f_a \frac{E}{r^2}\).
This only holds for non-transmissive surface, but should be fine to use in volume.
# EEVEE
When shading point lies outside the sphere, the sphere light is equivalent to a disk light spanning the same solid angle. The sine of the new half-angle is the tangent of the previous half-angle.
When shading point lies inside the sphere, integrating over the cosine-weighted hemisphere gives 1.0.
## Comparison with Cycles
The plane is diffuse, the blue sphere has specular component.
| Before | |After ||
|---|--|--|--|
|Cycles|EEVEE|Cycles|EEVEE|
|![](attachments/5824c494-0645-461a-b193-d74e02f353b8)|![](attachments/d2e85b53-3c2a-4a9f-a3b2-6e11c6083ce0)|![](attachments/a8dcdd8b-c13c-4fdc-808c-2563624549be)|![](attachments/8c3618ef-1ab4-4210-9535-c85e873f1e45)|

Pull Request: https://projects.blender.org/blender/blender/pulls/108506
2023-06-20 12:23:05 +02:00
Kévin Dietrich
c49af381c0 Alembic: set output error string for subdivision meshes
This will ensure that errors will be propagated to the modifier when
reading subdivision meshes.
2023-06-20 11:49:49 +02:00
Kévin Dietrich
79cd8d6682 Alembic: add missing topology check for subd meshes
No functional changes.
2023-06-20 11:49:49 +02:00
Jacques Lucke
8af5b59d5f Merge branch 'blender-v3.6-release' 2023-06-20 11:43:51 +02:00
Sergey Sharybin
954c262a96 Fix #108778: Crash when rendering multiple view layers
The rendering pipeline will re-use dependency graph and request
for re-building its relations for every new view layer, and try
to re-use as much evaluation as possible.

This could potentially run into situation when a content of
collection is changed: due to the difference in the per-view
layer visibility. If the evaluated collection has an object cache
this will make the cache to get out-of-sync with the actual
content. The cache on the evaluated collection might be created
when instancing system iterates over the collection.

This change makes it so the cache is freed when the dependency
graph relations are updated. This might be a bit too intrusive.
There might be ways to somehow ensure the content of the collection
is still the same as it was before the relations update, but this
is much more complicated task. Perhaps the performance is already
good enough.

This is a collaboration with Jacques Lucke, who was looking into
the same report, bouncing some ideas back and forth, and helped
testing the patch.

Pull Request: https://projects.blender.org/blender/blender/pulls/108816
2023-06-20 11:39:38 +02:00
Julian Eisel
fa59084025 RNA: Fix compile error when assigning to a typed enum in C++
When a RNA file was compiled in C++, building would fail when defining a
RNA enum property that assigns to a enum value with a defined (i.e.
non-integer) type.

Pull Request: https://projects.blender.org/blender/blender/pulls/109136
2023-06-20 11:30:26 +02:00
Jacques Lucke
e40f993a70 Fix #108704: scrubbing timeline does not to proper sampling like normal frame change
This was broken in 037b3f87bd.
This fix brings the original problem back a bit in that there will be an additional
frame update now, but really only a redraw should be necessary without a
depsgraph update.

The depsgraph update is caused by the `NC_SCENE | ND_FRAME` notifier,
which is checked for in `wm_event_do_notifiers`. Changing that in more depth
is a bit risky for 3.6 now unfortunately.
2023-06-20 10:51:11 +02:00
Jacques Lucke
887faf83e5 Cleanup: improve node tree zones naming 2023-06-20 10:25:41 +02:00
Jacques Lucke
98d675ac6c Geometry Nodes: make evaluation and logging system aware of zones
This refactors how a geometry nodes node tree is converted to a lazy-function
graph. Previously, all nodes were inserted into a single graph. This was fine
because every node was evaluated at most once per node group evaluation.
However, loops (#108896) break this assumption since now nodes may be
evaluated multiple times and thus a single flat graph does not work anymore.

Now, a separate lazy-function is build for every zone which gives us much
more flexibility for what can happen in a zone. Right now, the change only
applies to simulation zones since that's the only kind of zone we have.
Technically, those zones could be inlined, but turning them into a separate
lazy-function also does not hurt and makes it possible to test this refactor
without implementing loops first. Also, having them as separate functions
might help in the future if we integrate a substep loop directly into the
simulation zone.

The most tricky part here is to just link everything up correctly, especially
with respect to deterministic anonymous attribute lifetimes. Fortunately,
correctness can be checked visually by looking at the generated graphs.

The logging/viewer system also had to be refactored a bit, because now there
can be multiple different `ComputeContext` in a single node tree. Each zone
is in a separate `ComputeContext`. To make it work, the `ViewerPath` system
now explicitly supports zones and drawing code will look up the right logger
for showing inspection data.

No functional changes are expected, except that the spreadsheet now shows
"Simulation Zone" in the context path if the viewer is in a simulation.
2023-06-20 10:08:57 +02:00
Iliya Katueshenock
7b93431c2d BLI: add assert for negative indices in MutableSpan
Pull Request: https://projects.blender.org/blender/blender/pulls/109143
2023-06-20 09:54:32 +02:00
Jeroen Bakker
58b5d38824 Metal: Fix operator precedence bug
Backporting commit 31c986998b to 3.6 release branch

Pull Request: https://projects.blender.org/blender/blender/pulls/109147
2023-06-20 08:09:35 +02:00
Campbell Barton
4f3c09c5ee Cleanup: replace memcmp with BLI_rctf_compare
While in this case it's likely not an issue, in general using memcmp
for floating point values should be avoided.
2023-06-20 14:21:44 +10:00
Campbell Barton
2e087374d9 BLI_rect: support a zero limit for BLI_rctf_compare
Use <= comparison for BLI_rctf_compare so two rectangles which
are exactly the same return true with a limit of zero.

Matches compare_ff, compare_v3v3 etc.

In practice, this shouldn't result in user visible functional changes.
2023-06-20 14:14:16 +10:00
Campbell Barton
69d92bd3de Cleanup: remove strcpy usage
Remove strcpy use in:

- bone_autoside_name
- BLI_string_flip_side_name
- datatoc_icon utility.
- RNA define error messages.
- RNA UI registration.
- extern/xdnd.
2023-06-20 13:26:38 +10:00
Campbell Barton
2100ebca7a Cleanup: use the term "value" for RNA get/set functions
This is already used in most functions.
2023-06-20 13:23:30 +10:00
Hans Goudey
b0caddc32b Merge branch 'blender-v3.6-release' 2023-06-19 22:29:18 -04:00
Hans Goudey
e516f25e8f Fix #109060: Crash with mask modifier smooth option
A mistake similar to the one fixed in 17aaff69c6.
Also remove the DNA deprecated define added in the last fix.
2023-06-19 22:27:47 -04:00
Hans Goudey
4bd0676cf1 Merge branch 'blender-v3.6-release' 2023-06-19 21:45:36 -04:00
Jason Fielder
53cb09357e Fix #108792: Ensure Metal buffers correctly freed on exit
Replaces vector of allocations with dynamic linked list.
Bug caused by previously freed buffers still having been in the
list. Linked list enables fast removal of already-released buffers.

Also ensured that the memory manager classes are included in
memory tracking.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/108940
2023-06-19 20:28:51 +02:00
Germano Cavalcante
cedec09d05 Fix #109130: Crash with Snap Project Individual
Caused by 3df2110abd

`dist_px` can be `nullptr`.
2023-06-19 14:26:58 -03:00
Germano Cavalcante
7764c87528 Cleanup: Transform Snap Object Code
Transform: remove unused members from 'SnapObjectHitDepth'

Also move the `short face_nearest_steps` member before the bit field.

And move 'void SnapData_EditMesh::clear()' definition to the source.

Pull Request: https://projects.blender.org/blender/blender/pulls/109132
2023-06-19 19:03:08 +02:00
Almaz Shinbay
93e2e749da Outliner: Port armature elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new tree-element class for armature IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108964
2023-06-19 19:01:21 +02:00
Julian Eisel
378843c69c Cleanup: Comments & naming to File Browser file-listing logic more clear
Always found this function a bit hard to follow, hopefully these small
tweaks improve that slightly.
2023-06-19 18:22:35 +02:00
Julian Eisel
6fd1f565d2 Cleanup: Replace unnecessary function in file indexer with lambda
The function was named like a public API call but wasn't one. Rather
than renaming, replace it with a lambda that keeps the callback and
void-pointer casting local to the function it is necessary for. This
also avoids obfuscating code with function calls for trivial logic.
2023-06-19 18:22:34 +02:00
Falk David
8c0b81da5b Cleanup: Separate GP operators and functions
Moved selection operators and related functions to their own file
`grease_pencil_select.cc`.
Moved editing related functions to `grease_pencil_edit.cc`.
Added a `ED_operatortypes_grease_pencil` function that calls all the
`ED_operatortypes_grease_pencil_*` functions.
2023-06-19 17:45:21 +02:00
Falk David
171de8b5a7 Cleanup: Remove ED_grease_pencil_draw.h
This is no longer needed. The function can be moved to
`ED_grease_pencil.h`
2023-06-19 17:38:58 +02:00
Julian Eisel
9b246fc438 Merge branch 'blender-v3.6-release' 2023-06-19 16:40:10 +02:00
Julian Eisel
232e065a17 Fix #109053: File Append with recursions leads to crash
In this specific code path (recursive reading inside .blend files
containing assets), reading datablocks marked as asset would move
ownership over the asset metadata without indicating that in the source
that owned it previously. This would cause a double free attempt.
2023-06-19 16:39:37 +02:00
Brecht Van Lommel
4b4c95c402 Fix compositor node previews flickering when dragging sliders
Compositing jobs would get cancelled as you drag number sliders, and
would write back empty previews. Only sync previews for completed jobs.
2023-06-19 16:27:08 +02:00
Falk David
a6503f1dc9 Cleanup: Moving selection domain getter for GP
It was a bit odd having `ED_view3d_grease_pencil_selection_domain_get`
in the `ED_view3d.h` header.
Moving it to `ED_grease_pencil.h` makes more sense.
2023-06-19 16:22:48 +02:00
Sietse Brouwer
3432fc0b87 GPv3: Domain support for selection operators
This patch adds support for two of the three selection domains in the Edit Mode tool settings: point and stroke.

Affected selection operators: select all, lasso select, select pick, box select.

Pull Request: https://projects.blender.org/blender/blender/pulls/108970
2023-06-19 16:12:11 +02:00
Hans Goudey
c2db655d5e Merge branch 'blender-v3.6-release' 2023-06-19 09:55:12 -04:00