As part of a more general Objective-C GHOST refactor and in an effort to
modernize the macOS backend for further works, this commit cleans up the
codestyle of Objective-C files. Based off the Blender C/C++ style guide,
in addition to some Objective-C specific style changes.
Changes:
- `const` correctness, use nullptr, initializer list for simple struct
- Reduced variable scope for simple functions, removed unused variables
- Use braces for conditional statements, no else after return
- Annotate inheritted function of GHOST Cocoa classes with override and
use `= default` to define trivial constructors
- Use #import instead of #include for Objective-C headers
This is only for correctness. As the Objective-C #import directive
is really just an #include with an implicit #pragma once.
- Use proper C-style comments instead of #pragma mark
#pragma mark is an XCode feature to mark code chapters, to follow
the Blender codestyle, and make the Objective-C code more editor
agnostic, these were replaced with multi-line C-style comments.
Ref #126772
Pull Request: https://projects.blender.org/blender/blender/pulls/126770
This requires writing selection attributes to a different domain than
the Point domain.
Note that for assigning/removing from vgroups the `adapt_domain`
function is used implicitly by always looking up attributes from the
Point domain: ".selection" may be stored on Curves and will
automatically be adapted to points. For select-by-vgroup `adapt_domain`
cannot be used because the selection has to be "greedy" (one point
selects the whole curve).
Pull Request: https://projects.blender.org/blender/blender/pulls/127799
Remove the three problematic entries:
- `aligned_free` is not a 'real' function and does not need to be
handled here. There is no symetry with the `aligned_malloc` symbol
here.
- `__end` and `_bss_start` seem to have been mis-typed from the
beginning (actual symbols seem to be `_end` and `__bss_start`).
Regardless, neither `gold` nor `mold` seem to take these directives
from the LD version script into account (result is the same for them
when removed for the `.map` file), so removing them.
Pull Request: https://projects.blender.org/blender/blender/pulls/127761
Saving for the first time or using save-as printed a summary, e.g.
`Total files 0 | Changed 0 | Failed 0`
When path operations were added it was only accessed from the UI,
where reporting a summary makes sense. Having the summary reported when
path manipulation is done as part of another action isn't useful.
It's also not clear what the summary relates to.
Now the summary is only shown in operator reports.
When we create a new window at run time, we request that it be placed
at a specific size and location, but afterward we ask the OS for
details about where it was actually made and then update the window's
size and position with the correct information. Unfortunately when we
open a window when loading a blend file we do most of this, but only
update the size from the OS, not the position. There are times a window
will need to be placed somewhere different than we request and so the
window posx and posy will be incorrect until we move or resize it. This
is more likely to happen on Macs, but is possible on any platform.
Pull Request: https://projects.blender.org/blender/blender/pulls/127819
Docking can close windows during its operation. If the current window
does not match before and after an operator has run our event handling
code can assume that a new blend file has been loaded and will rerun
the operator. This PR avoid this problem by just not starting if the
event initiating it is of type WINDEACTIVATE. There might be a later
fix that addresses the underlying issue, but this is simple, small, and
harmless.
Pull Request: https://projects.blender.org/blender/blender/pulls/126379
Since their introduction, generated UDIM images/tiles would not be
loaded in Cycles. In relative recent history 72ab6faf5d added the
ability to track which tiles were still marked as being "generated" and
unsaved. However, that check was never implemented into the Cycles code.
With this PR, these two additional scenarios should now work:
- Properly load pixels if all tiles are generated
- Properly load pixels if a UDIM image has been loaded from a file and
new generated tiles have been added but not saved yet etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/127673
98c92b9033 disabled refreshing for the redo popup, since that requires
passing an operator pointer to the UI to holding on to it while the popup is
visible. Usually operators are short lived and shouldn't be held by the UI, to
avoid dangling pointer accesses. In this case it's fine though, because the
operator will be kept alive in the window manager.
Partially reverts 98c92b9033, and adds a comment to note this special case.
Fixes: #126521, #127561
Pull Request: https://projects.blender.org/blender/blender/pulls/127795
This change adds `--prune-destructive` command line argument to the
`make_update.py` script which ensures directories which used to be
an in-worktree checkout do not exist. Currently it is addons and
addons_contrib folders.
This gives buildbot an ability to ensure checkout used for build is
correct, regardless of which branch or patch was built there.
The option is needed because sometimes it is still required to be
able to build patches against v330 or v360 which still use the old
style of addons.
Alternative solution could be to ignore the folders in the INSTALL
command, but this could have impact on users who wants to package
custom addons.
The downside of this solution is that buildbot potentially will be
downloading addons and addons_contrib repositories every time it
builds a patch against v330 or v360. It should not be a problem in
practice since the repositories are rather small, and patches for
these tracks are not built very often.
Ref #126557
Pull Request: https://projects.blender.org/blender/blender/pulls/127798
std::sort() requires a strict weak ordering, i.e. `x < x` must be false. Therefore `id_order_compare(ID *a, ID *b)` must return false for `a.name == b.name`
Pull Request: https://projects.blender.org/blender/blender/pulls/127794
This is due to memory allocation mismatch. `MEM_dupallocN` is used on
cpp style `ButsTextureUser` pointer. Now fixed by using `MEM_new`. Also
pass `uiButArgNFree/Copy` callback fn arguments to avoid the use of
default arguments which are C style.
Pull Request: https://projects.blender.org/blender/blender/pulls/127690
Blender codebase had two ways to convert half (FP16) to float (FP32):
- BLI_math_bits.h half_to_float. Out of 64k possible half values, it converts
4096 of them incorrectly. Mostly denormals and NaNs, which is perhaps not too
relevant. But more importantly, it converts half zero to float 0.000030517578
which does not sound ideal.
- Functions in Vulkan vk_data_conversion.hh. This one converts 2046 possible
half values incorrectly.
Function to convert float (FP32) to half (FP16) was in Vulkan
vk_data_conversion.hh, and it got a bunch of possible inputs wrong. I guess it
did not do proper "round to nearest even" that CPU/GPU hardware does.
This PR:
- Adds BLI_math_half.hh with float_to_half and half_to_float functions.
- Documentation and test coverage.
- When compiling on ARM NEON, use hardware VCVT instructions.
- Removes the incorrect half_to_float from BLI_math_bits.h and replaces single
usage of it in View3D color picking to use the new function.
- Changes Vulkan FP32<->FP16 conversion code to use the new functions, to fix
correctness issues (makes eevee_next_bsdf_vulkan test pass). This makes it
faster too.
Pull Request: https://projects.blender.org/blender/blender/pulls/127708
When the opaque layer was populated with only emissive
material, no raytracing was used for it and no feedback
buffer was needed. Thus, the refraction layer had nothing
to raytrace against.
This fixes it by forcing the use of feedback buffer in this
corner case.
Pull Request: https://projects.blender.org/blender/blender/pulls/127771
Part of #118145.
Doing so removes the last usages of some dependent code as well, namely
the `SCULPT_VERTEX_NEIGHBORS_ITER` macro and the `PBVHVertRef` version
of the `flood_fill` algorithms. The now dead & unused code, as well as
their related helper functions, structs, and defines have been removed.
Additionally, a helper `vert_face_set_get` method for multires has been
added to be consistent with the other provided APIs
Pull Request: https://projects.blender.org/blender/blender/pulls/127781
`U.runtime.is_dirty` is not tagged dirty when some animation preferences
are changed. To fix this, pass `rna_userdef_update` updated function
which will tag preference dirty with the help of `USERDEF_TAG_DIRTY`
macro.
Pull Request: https://projects.blender.org/blender/blender/pulls/127754
This is a variation of the modal "Interpolate" operator, where a series
of keyframes is generated according in stead of a single keyframe.
The behavior should be the same as the GPv2 operator.
Much of the code is shared between the "Interpolate" and "Interpolate
Sequence" operators now (utility functions section at the top).
Pull Request: https://projects.blender.org/blender/blender/pulls/127709
In an effort to improve code documentation, reduce the number of
commonly needed arguments, and avoid repeating work for each
BVH node, combine position data and shape key data arrays to a
temporary struct used during brush deformation.
I'm generally wary of adding such object-oriented abstractions to
the code, but I think this one will hold up, and I find things easier to
understand after the change. It reduces overhead too, since the
evaluated position attribute and shape key data aren't retrieved
potentially thousands of times.
Pull Request: https://projects.blender.org/blender/blender/pulls/127725
* Move grab brush preview method to `grab.cc`
* Use `enum class` where possible
* Use `const` where possible
* Use C++ math libraries where possible
* float3 instead of float *
* numeric limits & constexpr instead of macros
* Clarify naming of some variables
* Add doxygen sections
Pull Request: https://projects.blender.org/blender/blender/pulls/127743
Also return a pointer from `Layer::duplicate_with_shallow_strip_copies()`
rather than a reference, since it doesn't maintain ownership of the
returned item.
Temporarily disable point cloud rendering in HIPRT to fix a performance
regression triggered by increased register preasure until
a better solution can be developed.
Pull Request: https://projects.blender.org/blender/blender/pulls/127738
Transforming the layers instead of points is way more efficient and usually has
the same effect visually. Therefore, it is the better standard behavior.
The main problem with this right now is that layer transforms are stored
as separate location/rotation/scale, so shearing is not supported. This will have
to be solved separately.
Pull Request: https://projects.blender.org/blender/blender/pulls/127757
The Vulkan backend has come a long way and it is time to spread his
wings a bit more. This change will make the vulkan backend available
in a regular release starting from 4.3.
Vulkan is still experimental and performance isn't there yet. But it
gives add-on developers already time to check if their add-ons work.
Main goal for the vulkan project is to get a better understanding which
platforms are supported.
- NVIDIA GTX900 and up should be supported using the official NVIDIA
drivers. This means that support for GTX700/800 is currently not
available. This is related to dynamic rendering.
- AMD Polaris and up are supported using the AMD drivers. When using
the open source drivers I believe the support level is around GCN2.
- Intel CPUs are supported from UHD (6th gen) on Linux. On windows
it requires features that are not available on all latest drivers and
a workaround should be added on our side.
- Intel GPUs are supported preferrable using the latest drivers on
Windows and Linux
Some render artifacts are showing when using EEVEE but the cause is
clear and would assume to solve them before the actual release.
Pull Request: https://projects.blender.org/blender/blender/pulls/127096