Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
Use invert_m4_m4_safe_ortho for the knife tool to support
operating on objects with a single zero scaled axis.
|
|
|
|
|
|
|
|
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
|
|
The points were too small on hi-dpi displays.
|
|
In this case, the cage location was left zeroed which was then
projected back onto the screen to find the nearest screen space
edge/vertex.
This made snapping to the vertex/edge fail in some corner-cases
where it was intended to work.
|
|
Reduce the maximum number of queries to find the face under the
mouse cursor from 6x to 2x on cursor motion.
Calculating the screen-space detail could perform 2x look-ups
which have already been calculated.
|
|
Knife snapping logic assumed having a face under the cursor meant
the projected positions were set.
This is not always the case as failure to ray-cast uses the back-buffer
as a fallback.
|
|
- comment added in struct `KnifeTool_OpData`
- struct pointer name `lst` updated to `list` ( Guess its more readable )
- `KNF_MODEL_IGNORE_SNAP_ON` updated to `KNF_MODAL_IGNORE_SNAP_ON`
- `KNF_MODEL_IGNORE_SNAP_OFF` updated to `KNF_MODAL_IGNORE_SNAP_OFF`
Ref D10824
|
|
|
|
|
|
|
|
This function sets the `RegionView3D` matrices to the GPU.
But the OpenGL library is not actually being used by the operator.
|
|
Although the Knife Project operator converts 3D coordinates to screen
space, it doesn't really need opengl.
Differential Revision: https://developer.blender.org/D10178
|
|
Zeroed mouse coordinates were being used making projection fail.
|
|
Corrects incorrect usages of the word 'loose' when 'lose' was required.
Differential Revision: https://developer.blender.org/D9243
Reviewed by Campbell Barton
|
|
Corrects incorrect usages of the words 'then' and 'than'.
Differential Revision: https://developer.blender.org/D9246
Reviewed by Campbell Barton
|
|
|
|
No functional changes
|
|
|
|
|
|
We now use GPU_blend for enabling / disabling blending and explicitly
set the blend equation.
|
|
|
|
Also add new flags to communicate specific behavior to future backend.
|
|
This is in order to better encapsulate / isolate the drawing code.
|
|
This remove the use of batch->program and replace it with batch->shader.
This will allow GL abstraction latter.
|
|
|
|
|
|
Analyzing the cuts, the points shown in the viewport (indicating the
previous and current cuts) do not correspond to the final cuts.
Sometimes a point, even snapped to a vert, is a point that cuts an edge and
sometimes a point, even snapped to an edge, is a point that cuts only the face.
This is because the detection of snapping vertices from mouse is different
from the "snap" that detects vertices that are cut.
So small projection inaccuracies can result in detection failures.
The solution for this is simply to confirm the cuts whose vertices
indicate the `prev` ou and `cur` point.
The tolerance distance does not need to be calculated in these cases.
|
|
|
|
Should not use copy_v3_v3 on a 2 element vectors.
|
|
`Kfv-> sco` was being treated as a local variable, and can be
confusing since this value is not updated when navigating the viewport.
|
|
`v1` and `v2` are already set.
|
|
affected by the knife tool
The knife code currently calls the `BLI_bvhtree_overlap` function that
tests the overlap between the mesh tree and an AABB that encompasses the
points projected in the clip_start, clip_end and or clip_planes of the
view.
This resulted in many false positives since the AABB is very large.
Often all the triangles "overlapped".
The solution was to create a new function that actually tests the
intersection of AABB with a plane.
Even not considering the clip_planes of the view, this solution is more
appropriate than using overlap.
Differential Revision: https://developer.blender.org/D8229
|
|
Both `knife_find_closest_vert` and `knife_find_closest_edge` call
`knife_find_closest_face`. Thus, running the raycast twice and setting
values like `kcd->curr.bmface` and `kcd->curr.is_space` repeatedly.
So:
- separate `knife_find_closest_face` from `knife_find_closest_vert` and `knife_find_closest_edge`.
- rename `knife_find_closest_vert` to `knife_find_closest_vert_of_face`
- rename `knife_find_closest_edge `to `knife_find_closest_edge_of_face`.
- do not set parameters previously set.
Differential Revision: https://developer.blender.org/D8198
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/editors/mesh` module.
No functional changes.
|
|
|
|
Also allow NDOF with loop-cut.
|
|
This solution involves adding a uniform to each fragment shader that is
used by gizmo drawing and use the framebuffer state to set this uniform
accordingly.
This solution can also be carried to external shaders (addons).
A single line of code would then be enough to fix the issue.
The only trickery here is the dummy define:
`#define srgb_to_framebuffer_space(a)`
This is in order to avoid breaking other DRW shaders that use the same
fragment shader code but do not need the tranformation.
Related to T74139
Reviewed By: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D7261
|
|
|
|
Rename:
- WM_modalkeymap_add to WM_modalkeymap_ensure
- WM_modalkeymap_get to WM_modalkeymap_find
|
|
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
D6417 by @fbessou
|
|
This is a bug that the recent refactor exposed. Some widgets were drawing
with alpha set to 0.
|
|
This avoids a list lookup in Main (recently added), passing in a mesh
instead of an edit-mesh, since the mesh links to the edit-mesh.
|