Previously the joining code put the final data into temporary mesh
data, which meant more complexity because it couldn't use the slightly
higher level APIs more commonly used for transferring data.
The process can be simplified by just merging into the active mesh
directly (though some care must be taken when that is used by
multiple selected objects).
This process avoids iterating over attribute data twice, by processing
values at the same time as copying them. Also some of the inner hot
loops are parallelized. There is more opportunity for trivial multi-
threading in the future.
Mismatched attribute types and domains will now choose the higher
complexity type and domain, which should help avoid information loss.
There was a bug with the existing face set processing which would
modify the source meshes. That is now fixed.
- Use spans instead of raw pointers
- Construct OffsetIndices instead of accumulating offsets while iterating
- Use newly added `math::transform_points` utilities.
- Simplify topology index offsetting
- Make sure active mesh is at the start of the vector
The point is mostly to simplify a rewrite of this code that will be
the next commit. The overall motivation is to ease the switch to
AttributeStorage, solve a few issues in this code, and make it easier
to understand.
The naming was confusing as only some selection flushing functions
were intended to be used when elements had been selected or de-selected.
Replace these with a single function that takes a "select" argument.
These are causing quite a big difference in existing files, which is not
easy to address in versioning. Since the goal of removing this was to
simplify things for us and that's not the case, just revert this change.
This reverts commit ab21755aaf.
Ref #139923
Pull Request: https://projects.blender.org/blender/blender/pulls/146336
This actually matches the OpenColorIO terminology more closely, and
makes a bit more sense as the display is more of an abstract thing than
a specific device.
Pull Request: https://projects.blender.org/blender/blender/pulls/146483
The merge by distance operator now has an optional merge centroid
option, when it is enabled, groups of merged vertices are averaged
and moved to their centroid position.
This allows for more predictable results in cases where vertices that
form loops would have otherwise collapsed unevenly and ended up with
jagged lines.
Ref !146478
Previously the method of picking the "target" duplicate wasn't
deterministic from a user perspective.
The behavior has been changed so:
- For a cluster of 3 or more vertices,
use the vertex closest to the centroid.
- For a cluster of 2 use the lowest index.
This mitigates #78916, solving some cases where clusters have a
central vertex although can't be considered fixed as the 2 vertex
case doesn't work so well.
Added a BLI_kdtree_{N}d_calc_duplicates_cb function that lets the
caller choose the index to keep from a cluster of duplicates.
Refactored from !145851.
Ref !146492
Co-authored-by: tariqsulley <tariqsulley3c@gmail.com>
Adds comprehensive logging system for temp_override context manager to
help developers debug "context is incorrect" operator poll failures.
The logging tracks all context member access during temp_override
sessions and provides detailed summaries to identify context
availability issues.
Features:
- Command-line logging: `./blender --log-level trace --log "context" `
- Python programmatic control: `temp_override_handle.logging_set(True)`
- C-level API: CTX_temp_override_logging_set/get() functions
- Tracks individual member access
- Uses CLOG logging infrastructure
The logging helps identify which context members are accessed during
temp_override sessions and whether they return valid data, making it
easier to debug operator poll functions that fail with context errors.
Ref !144810
The previous implementation used KDTree duplicate search with
BLI_kdtree_3d_calc_duplicates_fast(). The survivor was always
one of the input vertices, not the centroid of the cluster.
This caused cases where merging a line of vertices did not
collapse to their average position, resulting in jagged loops.
Now vertices within the threshold are clustered, their centroid
is computed, and the chosen survivor is snapped to this centroid.
This ensures predictable and consistent merge results.
Ref !145851
Support adding lattices to selected objects,
deforming them with with the lattice modifier.
By default the lattice fits to the object bounds and is oriented
to the active object (if it's set).
Resolves#144076
Ref !144888
There was an incorrect assumption that the display colorspace of a
view + display transform uniquely identifies it. But with modern OCIO
configs there is no longer a unique display colorspace per view.
The same wrong assumption was made in the code that refreshes the image
editor after save, and that was fixed as well.
Ref #145519
Pull Request: https://projects.blender.org/blender/blender/pulls/146449
error: ‘INT_MAX’ was not declared in this scope
compiler hints to include missing header `#include <climits>`
but replaced with `std::numeric_limits<int>::max()` / min
**ONLY** in cases where the errors were thrown
Pull Request: https://projects.blender.org/blender/blender/pulls/146212
This removes unused closure branches in the principled BSDF
code using the Material flags.
On top of this, use constants for weights to use compiler
dead code eliminitation for unused branches when there
is different variants of the principled BSDF node used.
Finally, remove Gbuffer packing cases that are not present
inside the nodetree.
Testing with the same setup as #145347:
| | main (ms) | PR (ms) | Delta (ms) |
| -------- | ----------- | ------------ |------------ |
| Nvidia | 174 | 132 (1.31x) | 42 |
| Mesa AMD | 191 | 170 (1.12x) | 21 |
Barbershop compilation time is almost equal because it is not using
the principled BSDF.
Rel #145347
Pull Request: https://projects.blender.org/blender/blender/pulls/146324
Can happen if you set cursor location by snapping or manually.
In order to really skip drawing in `draw_output`, we have to set
`enabled_` to false in `begin_sync`.
This is already done for the "simple" cases covered by
`is_cursor_visible_XXX` but not for the "special" case where the cursor
is clipped in the view.
This is what this PR does.
Pull Request: https://projects.blender.org/blender/blender/pulls/146354
Currently, when a python error is encountered when rendering the UI, the
corresponding message is printed to stdout / stderr via `PyErr_Print`,
this patch modifies behavior so that a cursory message is also printed
with CLOG
This has the benefit of allowing for testing via
`--debug-exit-on-error`, which aborts Blender when an error message is
printed.
Pull Request: https://projects.blender.org/blender/blender/pulls/146296
Unlike some other UI types, specifying the space type with this property
doesn't guarantee the asset shelf will only be shown in this space type. This
is an important behavioral detail that's easily missed.