* `BKE_sculpt_vertex_attr_get` (and it's alias `SCULPT_vertex_attr_get`)
is now `blender::bke::paint::vertex_attr_ptr`. Same for the face
versions of those functions. The SCULPT_XXX aliases are removed.
* Removed code duplication; `[vertex/face]_attr_ptr` now just calls
a generic template (`elem_attr_ptr`).
* Added `[vertex/face]_attr_get` and `[vertex/face]_attr_set` functions
to get/set attribute data without pointer wrangling.
* Given the unwieldly length of `blender::bke::paint::` it's recommended
to do a `using blender::bke::paint;` at the top of sculpt files.
Example: `float w = vertex_attr_get<float>(vertex,
ss->attrs.automasking_factor);`
Apply the changes suggested at #103782
It includes:
- Draw dot at the origin the active gizmo
- Hide other gizmos while dragging (except the move arrows)
Other changes:
- Draw shadow for the move and scale circle gizmos (while transforming)
Pull Request: blender/blender#104624
Some properties may have the pointer stored in the gizmo structure
itself.
Reading from the struct directly is useful for cases where the value is
accessed frequently but not often required by the caller.
A disadvantage is that the property may not be saved in the file.
If there is not enough space for the Color Picker either above or below
the launching button, adjust the position to fit instead of clipping.
Pull Request: blender/blender#106122
Similar to e35f971da1. We aren't meant to rely on the
zero-initiatialization on creation anyway. I observed a small (a few
percent) decrease in minimum runtime in the geometry nodes points node.
The position attribute has special meaning for point clouds, and
meshes and curves have access methods for the attribute as well.
This saves boilerplate and gives more consistency between types.
The OSL GPU services implementation of noise intrinsics was missing the
overloads for derivatives and therefore OptiX pipeline creation would fail if
those were referenced.
This integrates the new implicit-sharing system (from fbcddfcd68)
with `CustomData`. Now the potentially long arrays referenced by custom
data layers can be shared between different systems but most importantly
between different geometries. This makes e.g. copying a mesh much cheaper
because none of the attributes has to be copied. Only when an attribute
is modified does it have to be copied.
Also see the original design task: #95845.
This reduces memory and improves performance by avoiding unnecessary
data copies. For example, the used memory after loading a highly
subdivided mesh is reduced from 2.4GB to 1.79GB. This is about 25%
less which is the expected amount because in `main` there are 4 copies
of the data:
1. The original data which is allocated when the file is loaded.
2. The copy for the depsgraph allocated during depsgraph evaluation.
3. The copy for the undo system allocated when the first undo step is
created right after loading the file.
4. GPU buffers allocated for drawing.
This patch only gets rid of copy number 2 for the depsgraph. In theory
the other copies can be removed as part of follow up PRs as well though.
-----
The patch has three main components:
* Slightly modified `CustomData` API to make it work better with implicit
sharing:
* `CD_REFERENCE` and `CD_DUPLICATE` have been removed because they are
meaningless when implicit-sharing is used.
* `CD_ASSIGN` has been removed as well because it's not an allocation
type anyway. The functionality of using existing arrays as custom
data layers has not been removed though.
* This can still be done with `CustomData_add_layer_with_data` which
also has a new argument that allows passing in information about
whether the array is shared.
* `CD_FLAG_NOFREE` has been removed because it's no longer necessary. It
only existed because of `CD_REFERENCE`.
* `CustomData_copy` and `CustomData_merge` have been split up into a
functions that do copy the actual attribute values and those that do
not. The latter functions now have the `_layout` suffix
(e.g. `CustomData_copy_layout`).
* Changes in `customdata.cc` to make it actually use implicit-sharing.
* Changes in various other files to adapt to the changes in `BKE_customdata.h`.
Pull Request: blender/blender#106228
This function was not exposed outside of internal GPU module.
Renaming `draw::Texture::depth()` to `is_depth` for consistency
and removing the ambiguity.
Some functions changed slightly for this non beta release.
No functional changes though as we didn't use what was removed.
Pull Request: blender/blender#106861
The fast_float is an external library, so move it to the
system includes which has less strict compiler flags applied.
This matches how other IO module use this library as well.
Pull Request: blender/blender#106892
When WITH_CYCLES_DEBUG is set to ON the following errors are
printed to the console:
E0412 15:51:22.588564 7996345 sync.cpp:737] Unknown pass Guiding Color
E0412 15:51:22.588605 7996345 sync.cpp:737] Unknown pass Guiding Probability
E0412 15:51:22.588613 7996345 sync.cpp:737] Unknown pass Guiding Average Roughness
This change fixes this by treating the guiding passes the same
way as all other passes, solving the errors and making it possible
to visualize guiding passes in the viewport later on.
Pull Request: blender/blender#106863
This PR reverts the breaking part of the #106535. This part doesn't seem
to be required to fix the HD4400-HD5500 issue.
Might also fix#106844.
Pull Request: blender/blender#106887
Changes to viewport state to resolve texture paint color
selection introduced a side effect wherein the correct
attachment size of a framebuffer was reset. This size is
needed when scissor regions are disabled to return the
state to its correct default. When this default was wrong,
certain operators would have incorrect offsets.
To maintain consistency with the OpenGL backend, the
Metal backend independently tracks the raw attachment
size using default_width/height. This will also reset to zero
when attachments are all removed, unlike other state which
may be retained.
Authored by Apple: Michael Parkin-White
Pull Request: blender/blender#106857
After double clicking a file, user can click on a different app and
Blender will lose focus. Then it stays on splash screen. So fetch any
window instead of relying on active one to open the file.
pull request #106769
This reverts commit 4fe2685615.
Always use the preferred_scale requested by the compositor as this
did not work so well in the intended use case (where the low resolution
monitor text was scaled down and difficult to see).
After discussion with @ZedDB, revert this change since there are cases
where either functionality might be preferred - to ensure Blender's UI
is visible on a low resolution mirrored projector for e.g.
Changing the behavior of the preferred scale makes most sense in the
compositor, instead of controlling it on a per-application basis.
GCC did not support mold when support was initially added,
since then GCC has been updated to add support, removing the need
to point to a binary directory containing an alternative `ld` command.
Support for MOLD_BIN CMake option has been kept as mold may be installed
to standard location.
Use names:
- `tool_settings` instead of `ts`.
- `props` instead of `op` / `prop` / `op_props`
As Python may reference operators, don't confuse the operator
properties with an instance of the operator.
In both cases these names were already used for most scripts.
I cleaned up the cube brush tip code quite a bit; more remains
to be done. There is a new function to initialize cube
tip matrices, SCULPT_cube_tip_init. It's currently only
used by the paint brush, I'll need to do a bit of testing
before using it for clay strips and multiplane scrape.
Note: SCULPT_cube_tip_init uses the brush local matrix code
to avoid code duplication (and to take advantage of the debouncing
that is done there).
Nodes with names separated by a slash / can
not be searched by their initials.
This commit adds the slash character to
the list of separators for this type of
fuzzy search.
Pull Request: blender/blender#106838
This data should be initialized when building the mesh. If the arrays
aren't already initialized, there is already a bug. Theoretically this
could improve performance, since we can use `malloc` instead of
`calloc`. In practice I observed less than a 1% difference though.
These aren't used much in current code, but currently they created
offsets on the result curves, then just freed them again when copying
from the source data. In the future it might be better to completely
avoid using the base constructor in the first place.
Swap is commonly used to implement move assignment since it's short
and the logic is relatively simple. Use is here to avoid the need to
spell out the copying and freeing manually. The `BKE_id_free` call
at the end of the function will free whatever data was swapped.
The curve types and the runtime always have to be created when reading
the file from disk, so we might as well do that in `blend_read`, which
will help in the future when the offsets use implicit sharing.
Return null instead of an empty curves data-block, which amounts to
the same thing in geometry nodes, with less potential for error in
the rest of the function.
Change Text Object character `kern` member to float from int, and allow
fractional changes to kerning with Shift-Alt-arrows.
Pull Request: blender/blender#105181