The face normal was used in local space whereas it is needed as a global
direction (since other vectors here are in worldspace as well --
knife_input_ray_segment() returns worldspace).
Could go into 3.3 LTS.
Pull Request: https://projects.blender.org/blender/blender/pulls/108938
The problem here was that when direct light contibutions to baking were
disabled, the kernel just skipped all direct lighting evaluation.
However, at secondary bounces, "direct light" would actually end up
being indirect (since there's an extra bounce along the way), but
we're still skipping it.
Therefore, only apply direct lighting skipping at the first bounce.
e5ec04d73c changed the way crease vakyes are stored in 4.0.
Add versioning for reading the new files that replaces the new generic
attributes with the old non-generic custom data layers. The code is
paranoid with lots fo checks I expect will typically not be necessary.
Similar to f75af7cbf5
Interpolation from edge attributes is unsupported, and the data
of the new point attribute was uninitialized. As a fix, just avoid
interpolating edge attributes in the first place.
PyUnicode_AsUTF8AndSize is used when renaming a custom python property,
this method stores the size of the string without including the null
terminator in the size.
Renaming a custom python property now includes the null terminator when
copying the new string name.
Pull Request: https://projects.blender.org/blender/blender/pulls/107983
This fixes an issue where the light tree sampling algorithm would
discard light samples from groups of distance lights with an angle
greater than 0 when it shouldn't.
Pull Request: https://projects.blender.org/blender/blender/pulls/108832
The split edges code had a complex method of merging duplicate edges,
going backwards to avoid shifting elements in a vector. Sometimes it
could result in incorrect corner edge indices though, if it moved an
index that matched one of the local variables (I think! I've bee
trying to understand this all day and still struggling). Instead,
replace it with a `VectorSet` that handles the deduplication by
itself, and avoid creating the new edges until the end.
I think this code could still be simpler if we tried to reduce the
amount of things happening at the same time, making more code
deal with the input or final state rather than an in-between one.
But to avoid making the change too complicated I stopped here.
Pull Request: https://projects.blender.org/blender/blender/pulls/108826
So far, each closure in Cycles was either diffuse OR glossy OR
transmissive, and its color and contributions were assigned
to the corresponding direct/indirect/color passes.
However, since Glass is a single closure now, that is no longer enough,
since glass has both a glossy and a transmissive component.
Therefore, this commit adds support for splitting contributions from
the Glass closure between the two types.
For 4.0, we might want to also use this for Principled Hair since it
also technically has both types, but that would be a change from
the existing result so it's not part of 3.6 yet.
Before 4369627e71, the Mirror modifier merge did not interpolate
customdata.
Previously, the customdata was simply copied from the original vertex
during the merge, resulting in the retention of flags such as
`MVERT_SKIN_ROOT`.
This fix could just repeat that behavior for mirror. But these flags
can be useful in other cases, so this commit re-adds them to the
resulting merged vertex.
Although this can generate geometries with multiple roots on the same
island, there are different scenarios in which this can happen.
Therefore, multiple roots on the same island is not necessarily
considered a bug.
idiff sometimes locks up while shutting down when the CPU is
oversubscribed. While blender does not rely on the idiff tool
the tests that run on the CI environment do, which causes tests
to occasionally fail due to a timeout.
The root cause is a bit complex but can be found on the oiio tracker
at https://github.com/OpenImageIO/oiio/issues/3851
This change fixes idiff by :
1- Shutting down the thread pool before the main function exits
2- Have the shutdown wait for the pool threads to actually join, to
prevent the OS from forcefully terminating them while they could
potentially still be holding a lock.
Socket shapes are used in geometry nodes to indicate field types.
In other tree types (e.g. shaders) the socket shape is not touched at
all. Since nodes can be copied from geometry node trees, we need to
reset the socket shape when copying to a shader, compositor, or texture
tree.
Pull Request: https://projects.blender.org/blender/blender/pulls/108412
Resolves failing unit tests where missing texture read support for
1D/3D textures was required. Also resolves a number of missing
format support cases when determining texture component
count and byte size for reading/writing.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/108751
Math tests failing in Metal due to non-zero-initialized values
and shader compilation error caused by mutli-component
boolean being implicitly evaluated.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/108758
Bug in Metal when gl_FragDepth is used but not written to by a shader
causing depth-based navigation to fail. Patch ensures gl_FragDepth
is assigned a default value at the current depth from the vertex
shader to catch all edge-cases of this.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108453
With this change, instances of lamps and emissive meshes which do not
have their own light group assigned will use the light group of the
collection instance.
If an object does have a light group assigned, its instances will
continue to use it regardless of the collection instance's light group.
Caused by 5ca65001ea (which was already patched with ae7c71ef09 and
fa5cc84a0a)
Getting the right modifier would still fail / throw errors when not done
from the modifier extra ops dropdown.
Only there, a 'modifier' attribute is set for context (via
`uiLayoutSetContextPointer` in `modifier_ops_extra_draw`).
So now check if a 'modifier' attribute is set for context (and fallback
to using the active modifier instead).
This way, polling errors in F3 search are gone and you can actually
execute the operators which are also in modifier extra ops dropdown from
elsewhere (e.g. F3 search).
Pull Request: https://projects.blender.org/blender/blender/pulls/108795
When unlinking IDs like GN tree, materials, etc. undo step is not created.
To fix this, assign `undo_push_label` a string value for registering an
undo-step (with the help of `ED_undo_push`)
Pull Request: https://projects.blender.org/blender/blender/pulls/108452
The same Panel was named different in Image editor -> Paint
and in 3D view -> Texture Paint. 'Cursor' is the common name for
this panel in all paint modes.
Co-authored-by: Fynn Grotehans <68659993+Fynn-G@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108544
Pinning information was accidentally skipped inside of the
UV packing engine because of their ordering.
This was most noticeable when using the "Bounding Box" shape
method, causing some pinned islands to be moved when they
should have been locked in place.
Fixes#108730
The call to `CustomData_interp` also interpolated the face corner
topology attributes, which broke the mesh completely. To fix this,
avoid relying on the CustomData API and move the attribute
interpolation to use the attribute API instead. This change also
makes it trivial to support all attribute types in the future.
Also, only retrieve the closest vertex once, instead of doing it
again for every attribute. Combined with building the topology
maps in parallel this approximately doubled the performance
of color attribute propagation in a test with 2 million vertices
and 8 color attributes on both domains (63 to 34 ms).
Pull Request: https://projects.blender.org/blender/blender/pulls/108773
Ensure buffer read operations wait for pending GPU work to
complete. This is only required for unit tests, but required to
ensure correct results in all cases. Also adds support for staging
buffer if GPU memory type is private.
Buffer clearing routine added to support values above 1 byte.
The previous buffer clearing functionality using fillBuffer writes
values to each byte, rather than the full 32 bit uint used by the
GPU API.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/108757
The graph editor has the function to hide the display of FCurves and to only draw keyframes on selected curves.
Both options were not respected when executing the frame jump operator,
meaning it would jump to potentially hidden keyframes.
This patch adds a new operator that is specific to the Graph Editor and that respects those features.
The only possible issue that could arise from this is a slight confusion for the user
why they behave differently between editors.
Especially with only the Graph Editor and the 3D view open.
In general I think it's an improvement and follows the "you can only modify what you see" mantra in blender
Also
Resolves#97701
Pull Request: https://projects.blender.org/blender/blender/pulls/108549
Issue here was that Quick Favorites use a property's **identifier** when
adding [which is the bare name without brackets etc. from id properties]
but when spawning the actual menu, `RNA_struct_find_property` expects
the identifier to already include the brackets to know these are id
properties (later on in `screen_user_menu_draw`).
So to solve this, now include the needed syntax when storing the
`bUserMenuItem_Prop` identfier.
Seems the quickest way to append the needed characters is using
`RNA_path_property_py` (not sure if there are better ways to do this).
Also note that we (need to) ignore the actual array index constructing
the string [always pass -1 here] since the index is handled separately [I
tested boolean arrays and these work].
Pull Request: https://projects.blender.org/blender/blender/pulls/108713
288e7d0af0 added support for legacy curves, these dont have attributes
though, but code was checking for an active color atttribute.
Now, only do this check (and skip that object) if it has no attributes (or
doesnt have vertex or active color atttribute).
Pull Request: https://projects.blender.org/blender/blender/pulls/108647
In Embree, tfar modification is taken into account by rtcIntersect1
only when hits are accepted. In order to overcome this, we now check
manually for a max_t value in the filter function.
Pull Request: https://projects.blender.org/blender/blender/pulls/108706
We should be recording only the N closest hits in case the number of
hits is exceeding the maximum allowed or the size of the hits stack.
Previously, some cases made it record hits beyond the furthest recorded
one due to lack of hit distance check.
During uv unwrapping and uv packing, certain floating point algorithms
have extreme sensitivity to round-off errors. These can produce very
different layouts even when given inputs which are only slightly different.
The root cause is that the two main types of CPUs used to run Blender,
namely x86 and Apple Silicon, produce slightly different results on some
math functions, including `sinf()`, `cosf()` and `atan2f()`.
* sinf(0.8960554599761962890625) = 0.780868828296661376953125 (Intel i7)
* sinf(0.8960554599761962890625) = 0.78086888790130615234375 (Apple M1)
This fix, and others that came before it [0], improve accuracy by using
double-precision to hide the differences between the CPUs.
[0] e.g. 0eba9e41bf
[1] See also #107829