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.
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.
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.
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.
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
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 |
| -------- | -------- | -------- |
|  |  |  |
The behavior stays the same when `radius = 0`.
| This patch | Previous behavior |
| -------- | -------- |
|  |  |
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|
|||||
Pull Request: https://projects.blender.org/blender/blender/pulls/108506
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
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
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.
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.
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.
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
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
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.
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.
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.
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.
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