Age | Commit message (Collapse) | Author |
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
Generally the evaluated mesh should not be changed, since that is the
job of the modifier stack. Current code is far from const correct in
that regard. This commit uses a const variable for the reult of
`BKE_object_get_evaluated_mesh` in some cases. The most common
remaining case is retrieving a BVH tree from the mesh.
|
|
|
|
|
|
Fix regression in 9c202281287743494fd7d81a13970053bc8a33b5
that wasn't using the random seed correctly.
|
|
|
|
Avoid computationally expensive copying operations
when only some settings have been modified.
This is done by adding support for updating parameters
without tagging for copy-on-write.
Currently only mesh data blocks are supported,
other data-blocks can be added individually.
This prepares for changing values such as edit-mesh auto-smooth angle
in edit-mode without duplicating all mesh-data.
The benefit will only be seen when the user interface no longer tags
all ID's for copy on write updates.
ID_RECALC_GEOMETRY_ALL_MODES has been added to support situations
where non edit-mode geometry is modified in edit-mode.
While this isn't something user are likely to do,
Python scripts may change the underlying mesh.
Reviewed By: sergey
Ref D11377
|
|
|
|
|
|
|
|
|
|
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.
Differential Revision: https://developer.blender.org/D11663
Reviewed by Harley Acheson
|
|
Invalid face normals were used for tessellation.
|
|
Invalid face normals were used for tessellation.
|
|
This resolves a long standing bug in edge selection
(picking, circle, box & lasso).
Now when one of the edges vertices fails to project into screen space,
the edge is clipped by the viewport to calculate an on-screen location
that can be used instead.
This isn't default as it may be important for the on the screen location
not to be clipped by the viewport.
|
|
X & Z were ordered min/max, where as Y was max/min.
|
|
This patch ensures that selection mode flushing updates total selection
counts internally. This reduces recounting when we are sure that the
input total selection counts were up to date.
For example for circle selection the total selection counts were
correct. But during flushing the selection could have been changed and
therefore the selection was always recounted.
This increased the performance on selected system from 6.90 FPS to 8.25
FPS during circle selection operations.
Before: {F10179981}
After: {F10179982}
Reviewed By: mano-wii
Differential Revision: https://developer.blender.org/D11647
|
|
- BKE_mesh_copy_parameters_for_eval to be used for evaluated meshes only
as it doesn't handle ID user-counts.
- BKE_mesh_copy_parameters is a general function for copying parameters
between meshes.
|
|
After looking into task isolation issues with Sergey, we couldn't find the
reason behind the deadlocks that we are getting in T87938 and a Sprite Fright
file involving motion blur renders.
There is no apparent place where we adding or waiting on tasks in a task group
from different isolation regions, which is what is known to cause problems. Yet
it still hangs. Either we do not understand some limitation of TBB isolation,
or there is a bug in TBB, but we could not figure it out.
Instead the idea is to use isolation only where we know we need it: when
holding a mutex lock and then doing some multithreaded operation within that
locked region. Three places where we do this now:
* Generated images
* Cached BVH tree building
* OpenVDB lazy grid loading
Compared to the more automatic approach previously used, there is the downside
that it is easy to miss places where we need isolation. Yet doing it more
automatically is also causing unexpected issue and bugs that we found no
solution for, so this seems better.
Patch implemented by Sergey and me.
Differential Revision: https://developer.blender.org/D11603
|
|
|
|
Support calculating face normals when tessellating. When this is done
before updating vertex normals it gives ~20% performance improvement.
Now vertex normal calculation only needs to perform a single pass on the
mesh vertices when called after tessellation.
Extended versions of normal & looptri update functions have been added:
- BM_mesh_calc_tessellation_ex
- BM_mesh_normals_update_ex
Most callers don't need to be aware of this detail by using:
- BKE_editmesh_looptri_and_normals_calc
- BKE_editmesh_looptri_and_normals_calc_with_partial
- EDBM_update also takes advantage of this,
where calling EDBM_update with calc_looptri & calc_normals
enabled uses the faster normal updating logic.
|
|
Rename function EDBM_update_generic to EDBM_update, use a parameters
argument for better readability.
Also add calc_normals argument, which will have benefits when
calculating normals and tessellation together is optimized.
|
|
These were limited to obvious cases. Some less obvious cases
were kept as refactoring might make them necessary in future.
|
|
Note that these changes are limited simple cases as these kinds of
changes could allow for errors when refactoring code when the known
state is not so obvious.
|
|
Under some circumstances using task isolation can cause deadlocks.
Previously, our task pool implementation would run all tasks in an
isolated region. Now using task isolation is optional and can be
turned on/off for individual task pools.
Task pools that spawn new tasks recursively should never enable
task isolation. There is a new check that finds these cases at runtime.
Right now this check is disabled, so that this commit is a pure refactor.
It will be enabled in an upcoming commit.
This fixes T88598.
Differential Revision: https://developer.blender.org/D11415
|
|
When projecting into screen space Z value isn't always needed.
Add 2D projection functions, renaming them to avoid accidents
happening again.
- Add GPU_matrix_project_2fv
- Add ED_view3d_project_v2
- Rename ED_view3d_project to ED_view3d_project_v3
- Use the 2D versions of these functions when the Z value isn't used.
|
|
While the advantage isn't large,
it's simpler to skip the intermediate link.
Also remove unused next and previous struct members
from MeshUndoStep_Elem.
|
|
When editing more than 1 object at a time, complete copies of each mesh
were being stored. Now the most recent undo-data for each mesh is used
(when available).
|
|
|
|
|
|
|
|
Use invert_m4_m4_safe_ortho for the knife tool to support
operating on objects with a single zero scaled axis.
|
|
|
|
|
|
FLT_EPSILON was added to the threshold when comparing values,
this caused problems selecting similar small faces since the areas
can be very small in this case.
Also increase the displayed precision so it's easier to use
smaller numbers.
|
|
The default value of `0.0001` was displaying as `0.000`,
increase the display precision to 5 since this value often needs
to be small.
|
|
Draw functions used RNA_pointer_create to create the pointer,
however this already exists in the operator.
|
|
|
|
Any dynamic enum access would not use the callback.
Always set the owner_id to avoid this causing problems.
Oversight in 919558854d624f5db40acfa9f5674ac8c94873b6
|
|
|
|
|
|
This allows the addition of the `SNAP_GEOM_CAGE` option.
Currently unused.
|
|
Selecting random percentage would not reliably guarantee the precise
percentage of selected elements now randomize an index array instead
and use the precise number of elements from this array.
Note that this change has only been made to edit-mesh
and should be applied to all random selection operators.
|
|
|
|
Seem on linux.
Caused by rB6ec463a4b754bf69baf94ba6b3683655f6834ccd
|
|
- Don't use `r_` prefix for an argument that's also read from
(this is meant for return only arguments).
- Rename variables to make it clear the distance is pixels,
using manhattan length measurement.
|
|
Regression in 80cbbd2843c2358879b1a710d81a3b41e1468327.
Unfortunately keeping selection picking behavior as well as
supporting finding the nearest face within a radius requires an
inconsistency between x-ray and back-buffer selection that
doesn't work well using the current arguments.
Resolve by adding an argument that causes the input distance
to be ignored for back-buffer selection.
This is used by selection picking but not the knife tool.
This changes behavior for path-selection in face mode,
which now uses a margin for back-buffer selection.
From my own testing this doesn't seem to be a problem like it could be
for regular selection picking.
|
|
|
|
|
|
Minor changes preparing for snap gizmo inclusion.
- Extract `knife_snap_edge_in_angle` into a utility function.
- Check the snap vertex on closest edge instead of the face.
- Add MODE_INVOKING state.
- Remove unnecessary NULL checks.
- Control 'ignore_edge_snapping' while dragging instead of checking
dragging in `knife_snap_update_from_mval`.
Ref D8220
|