Commit Graph

125310 Commits

Author SHA1 Message Date
Campbell Barton
4ed4fa8106 Linux: quiet error message on startup when GVFS dir isn't found 2023-06-21 17:23:15 +10:00
Pratik Borhade
57e4eea7b9 Merge branch 'blender-v3.6-release' 2023-06-21 11:47:08 +05:30
Pratik Borhade
3d3569852f Animation: Change channel selection key preferences in IC keymap
Missed in 80feb13665. Include changes in key
preferences of `extend` and `extend_range` in Industry Compatible keymap.

Pull Request: https://projects.blender.org/blender/blender/pulls/108790
2023-06-21 08:14:56 +02:00
Germano Cavalcante
c83e37d354 Cleanup: Organize snap functions into methods
The definition of `test_projected_vert_dist` has been moved to
`Nearest2dUserData::snap_point`, and the parameters accessed within the
object have been removed from the function.

Additionally, the definition of `test_projected_edge_dist` has been
moved to `Nearest2dUserData::snap_edge`, and the parameters accessed
within the object have been removed from the function.
2023-06-21 02:12:21 -03:00
Germano Cavalcante
b12ced210a Cleanup: Deduplicate transform snap code
This commit deduplicates the code for:
- Creating local projection matrix;
- Creating local clip planes;
- Testing BoundBox snap distance.

These common codes are repeated for each type of object
(Empty, Camera, Armature, Curve, Mesh, Editmesh...).

Now they have been unified in the creation of `Nearest2dUserData`.
2023-06-21 02:11:31 -03:00
Germano Cavalcante
3cfd9d8bb5 Cleanup: Reduce number of parameters in snapping functions 2023-06-21 02:09:23 -03:00
Germano Cavalcante
af63f05d17 Transform: Add utility for debug snapping time 2023-06-21 02:08:52 -03:00
Omar Emara
b450101000 Realtime Compositor: Add support for node previews
This patch adds support for node previews in the realtime compositor.
Only node operations have previews for now. Shader nodes likes the
MixRGB node does not have previews implemented yet due to required
sizable changes in the node compiler.

Depends on: #108900.

Pull Request: https://projects.blender.org/blender/blender/pulls/108904
2023-06-21 05:41:49 +02:00
Omar Emara
740baefb16 Nodes: Add bNodeInstanceKey to DerivedNodeTree
This patch adds support for bNodeInstanceKey to DerivedNodeTree. The
keys are computed and cached in the DContext at construction time, and
various utilities are added to return the instance keys of contexts,
nodes, as well as find the active context in the tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/108900
2023-06-21 05:03:56 +02:00
Campbell Barton
b46b1c02a0 Cleanup: use enum for texture types
- move POINT_DATA_* to texture_pointdensity.c.
- remove MTEX_NSPACE_*.
- replace magic numbers with defines for Tex::vn_coltype comparisons.
- use doxy sections.
2023-06-21 11:29:00 +10:00
Campbell Barton
472c461816 Cleanup: spelling in comments 2023-06-21 11:28:58 +10:00
Campbell Barton
25b46a5041 Cleanup: comment blocks 2023-06-21 11:28:56 +10:00
Campbell Barton
5a8d9b893c Cleanup: quiet shadow warning 2023-06-21 11:28:55 +10:00
Iliya Katueshenock
fa505d7c18 Fix #109171: Delete curve instead of creating empty result
If accumulated amount of points is zero, next offsets
will be empty too. Instead to expand offsets to create
empty curve, just delete source curve and skip any next steps.

Pull Request: https://projects.blender.org/blender/blender/pulls/109172
2023-06-21 02:27:58 +02: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
Brecht Van Lommel
c7319e6c79 Merge branch 'blender-v3.6-release' into main 2023-06-20 20:49:44 +02:00
salipourto
b84d4dd16d Fix various HIP RT issues
* Motion blur issues due to missing ray time
* Wrong bitcode path for runtime compilation
* Quiet logging

Pull Request: https://projects.blender.org/blender/blender/pulls/109170
2023-06-20 20:47:10 +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
Thomas Dinges
897bd3f431 Merge branch 'blender-v3.6-release' 2023-06-20 17:00:54 +02:00
Thomas Dinges
4b0dc9eb29 License: Update THIRD-PARTY-LICENSES doc for 3.6. 2023-06-20 17:00:11 +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
casey bianco-davis
fff98eb59f Fix: Grease pencil conversion to new type not in menu
When legacy grease pencil objects were selected the conversion operator was not visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/109094
2023-06-20 11:02:17 +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