Curves: Add box selection #104411

Merged
Falk David merged 5 commits from filedescriptor/blender:curves-mouse-selection into main 2023-02-09 15:53:44 +01:00
Member

This adds a select_box function for the Curves object. It is used in the view3d_box_select operator.

It also adds the basic selection tools in the tool bar of Curves Edit Mode.

This adds a `select_box` function for the `Curves` object. It is used in the `view3d_box_select` operator. It also adds the basic selection tools in the tool bar of Curves Edit Mode.
Falk David requested review from Hans Goudey 2023-02-07 18:02:07 +01:00
Falk David added this to the Nodes & Physics project 2023-02-07 18:14:49 +01:00
Hans Goudey requested changes 2023-02-07 18:28:58 +01:00
@ -421,0 +461,4 @@
ED_view3d_project_float_v2_m4(vc.region, pos, pos_proj, projection.ptr());
if (BLI_rctf_isect_pt_v(&rectf, pos_proj)) {
switch (sel_op) {
case SEL_OP_ADD:
Member

It would be nice to extract this switch and share it with the select pick operator too, is that possible?

It would be nice to extract this switch and share it with the select pick operator too, is that possible?
filedescriptor marked this conversation as resolved
@ -149,0 +155,4 @@
bool select_box(const ViewContext &vc,
bke::CurvesGeometry &curves,
const eAttrDomain selection_domain,
const struct rcti rect,
Member

const rcti &rect,

I guess it passes, the "small" test, but maybe better to just default to const reference here. Also struct is unnecessary in C++

` const rcti &rect, ` I guess it passes, the "small" test, but maybe better to just default to const reference here. Also `struct` is unnecessary in C++
filedescriptor marked this conversation as resolved
Philipp Oeser requested review from Philipp Oeser 2023-02-08 11:22:32 +01:00
Philipp Oeser refused to review 2023-02-08 12:41:36 +01:00
Philipp Oeser requested review from Philipp Oeser 2023-02-08 12:42:20 +01:00
Member

FYI, just adding/removing me as a reviewer because of infrastructure/blender-projects-platform#10

FYI, just adding/removing me as a reviewer because of infrastructure/blender-projects-platform#10
Falk David added 27 commits 2023-02-09 13:23:39 +01:00
buildbot/vdev-code-daily-coordinator Build done. Details
f5552d759c
Fix compiler error
buildbot/vdev-code-daily-coordinator Build done. Details
41ddd3d732
Fix: Experimental Panel links modified for Gitea
Modifies the links to point to the new developer site.

Pull Request #104425
buildbot/vdev-code-daily-coordinator Build done. Details
e817cff009
Release: support generating LTS release notes from Gitea
Now a single script to generate both links and release notes. It also includes
the issue ID for the LTS releases, so only the release version needs to be
specified.

Pull Request #104402
53b057aa09 Cleanup: Move 18 sculpt files to C++
To allow further mesh data structure refactoring. See #103343

Pull Request #104436
buildbot/vdev-code-daily-coordinator Build done. Details
5c994d7846
Fix #104297: Cycling geometry nodes viewer ignores sockets
Sockets after the geometry socket were ignored when cycling through
the node's output sockets. If there are multiple geometry sockets, the
behavior could still be refined probably, but this should at least make
basic non-geometry socket cycling work.
buildbot/vdev-code-daily-coordinator Build done. Details
6aa1b5d031
Cleanup: format
09eb4fe19a Fix #103913: Triangulate sometimes creates degenerate triangles
The ear clipping method used by polyfill_2d only excluded concave ears
which meant ears exactly co-linear edges created zero area triangles
even when convex ears are available.

While polyfill_2d prioritizes performance over *pretty* results,
there is no need to pick degenerate triangles with other candidates
are available. As noted in code-comments, callers that require higher
quality tessellation should use BLI_polyfill_beautify.
buildbot/vdev-code-daily-coordinator Build done. Details
4d3bfb3f41
Subdivision Surface: fix a serious performance hit when mixing CPU & GPU.
Subdivision surface efficiency relies on caching pre-computed topology
data for evaluation between frames. However, while eed45d2a23
introduced a second GPU subdiv evaluator type, it still only kept
one slot for caching this runtime data per mesh.

The result is that if the mesh is also needed on CPU, for instance
due to a modifier on a different object (e.g. shrinkwrap), the two
evaluators are used at the same time and fight over the single slot.
This causes the topology data to be discarded and recomputed twice
per frame.

Since avoiding duplicate evaluation is a complex task, this fix
simply adds a second separate cache slot for the GPU data, so that
the cost is simply running subdivision twice, not recomputing topology
twice.

To help diagnostics, I also add a message to show when GPU evaluation
is actually used to the modifier panel. Two frame counters are used
to suppress flicker in the UI panel.

Differential Revision: https://developer.blender.org/D17117

Pull Request #104441
buildbot/vdev-code-daily-coordinator Build done. Details
4ed8a360e9
Fix references to the main branch in the .gitmodules
buildbot/vdev-code-daily-coordinator Build done. Details
aab707ab70
Un-ignore modules in .gitmodules configuration
The meaning of the ignore option for submodules did change since our
initial Git setup was done: back then it was affecting both diff and
stage families of Git command. Unfortunately, the actual behavior did
violate what documentation was stating (the documentation was stating
that the option only affects diff family of commands). This got fixed
in Git some time after our initial setup and it was the behavior of the
commands changed, not the documentation. This lead to a situation when
we can no longer see that submodules are modified and staged, and it is
very easy to stage the submodules.

For the clarity: diff and status are both "status" family, show and
diff are "diff" family.

Hence this change: since there is no built-in zero-configuration way
of forbidding Git from staging submodules lets make it visible and
clear what the state of submodules is.

We still need to inform people to not stage submodules, for which
we can offer some configuration tips and scripts but doing so is
outside of the scope of this change at it requires some additional
research. Current goal is simple: make it visible and clear what is
going to be committed to Git.

This is a response to an increased frequency of incidents when the
submodules are getting modified and committed without authors even
noticing this (which is also a bit annoying to recover from).

Differential Revision: https://developer.blender.org/D13001
buildbot/vdev-code-daily-coordinator Build done. Details
43f308f216
Make update: Ignore submodules
The previous change in the .gitmodules made it so the `make update`
rejects to do its thing because it now sees changes in the submodules
and rejected to update, thinking there are unstaged changes.

Ignore the submodule changes, bringing the old behavior closer to
what it was.
buildbot/vdev-code-daily-coordinator Build done. Details
a1282ab015
Fix Cycles debug build error after host falback changes
Introduced in dcfb6df9ce6.

Co-authored-by: Lucas Tadeu Teixeira <lucas@lucastadeu.com>

Pull Request #104454
buildbot/vdev-code-daily-coordinator Build done. Details
0ab3ac7a41
BLI: Math: Fix vector operator * with `MutableMatView`
This was caused by operator priority trying to use
`friend VecBase operator*(const VecBase &a, FactorT b)`.

Adding tests as these were not covered.
buildbot/vdev-code-daily-coordinator Build done. Details
a0f5240089
EEVEE-Next: Virtual Shadow Map initial implementation
Implements virtual shadow mapping for EEVEE-Next primary shadow solution.
This technique aims to deliver really high precision shadowing for many
lights while keeping a relatively low cost.

The technique works by splitting each shadows in tiles that are only
allocated & updated on demand by visible surfaces and volumes.
Local lights use cubemap projection with mipmap level of detail to adapt
the resolution to the receiver distance.
Sun lights use clipmap distribution or cascade distribution (depending on
which is better) for selecting the level of detail with the distance to
the camera.

Current maximum shadow precision for local light is about 1 pixel per 0.01
degrees.
For sun light, the maximum resolution is based on the camera far clip
distance which sets the most coarse clipmap.

## Limitation:
Alpha Blended surfaces might not get correct shadowing in some corner
casses. This is to be fixed in another commit.
While resolution is greatly increase, it is still finite. It is virtually
equivalent to one 8K shadow per shadow cube face and per clipmap level.
There is no filtering present for now.

## Parameters:
Shadow Pool Size: In bytes, amount of GPU memory to dedicate to the
shadow pool (is allocated per viewport).
Shadow Scaling: Scale the shadow resolution. Base resolution should
target subpixel accuracy (within the limitation of the technique).

Related to #93220
Related to #104472
buildbot/vdev-code-daily-coordinator Build done. Details
9c03a1c92f
Fix Cycles link error with debug/asan builds after recent bugfix
Pull Request #104487
buildbot/vdev-code-daily-coordinator Build done. Details
9103978952
EEVEE-Next: Shadow: Fix issue with last merge
The merge with master updated the code to use the new matrix API. This
introduce some regressions.

For sunlights make sure there is enough tilemaps in orthographic mode
to cover the depth range and fix the level offset in perspective.
buildbot/vdev-code-daily-coordinator Build done. Details
94d280fc3f
EEVEE-Next: Shadows: Add global switch
This allow to bypass all cost associated with shadow mapping.

This can be useful in certain situation, such as opening a scene on a
lower end system or just to gain performance in some situation (lookdev).
9fd71d470e PyAPI: minor change to rna_manual_reference loading
- Use bpy.utils.execfile instead of importing then deleting from
  sys.modules.
- Add a note for why keeping this cached in memory isn't necessary.

This has the advantage of not interfering with any scripts that import
`rna_manual_reference` as a module.
buildbot/vdev-code-daily-coordinator Build done. Details
0381fe7bfe
Cleanup: update username in code-comments: campbellbarton -> ideasman42
Gitea migration changed my username, update code-comments.
buildbot/vdev-code-daily-coordinator Build done. Details
3c8f7b1a64
Cleanup: Remove unused/redundant includes from BKE_curves.hh
Avoid including headers that are obviously redundant, and don't
include BLI_task.hh in the header file, since it isn't really related.
buildbot/vdev-code-daily-coordinator Build done. Details
f3d7de709f
Cycles: update Intel Graphics Compiler to 1.0.13064.7 on Linux
Linux side of 8afcecdf1f.

Reviewed by: LazyDodo, sergey, campbellbarton
Ref !104458, 16984
buildbot/vdev-code-daily-coordinator Build done. Details
7effc6ffc4
Cleanup: solve compiler warnings.
Classes were predefined as structs.
buildbot/vdev-code-daily-coordinator Build done. Details
8b35db914e
GPU: Fix assert when using light gizmo.
Blender was reporting that the GPU_TEXTURE_USAGE_HOST_READ wasn't set.
This is used to indicate that the textures needs to be read back to
CPU. Textures that don't need to be read back can be optimized by the
GPU backend.

Found during investigation of #104282.
Falk David force-pushed curves-mouse-selection from ce18854caf to 8820793001 2023-02-09 13:25:21 +01:00 Compare
Falk David requested review from Hans Goudey 2023-02-09 13:27:18 +01:00
Hans Goudey reviewed 2023-02-09 14:34:47 +01:00
@ -286,2 +287,4 @@
}
template<typename T>
static void apply_selection_operation(MutableSpan<T> selection, int index, eSelectOp sel_op)
Member

const int index, const eSelectOp sel_op just for consistency.

`const int index, const eSelectOp sel_op` just for consistency.
filedescriptor marked this conversation as resolved
Hans Goudey requested changes 2023-02-09 14:46:49 +01:00
Hans Goudey left a comment
Member

Looks quite close, just a couple more comments.

Looks quite close, just a couple more comments.
@ -285,6 +286,27 @@ void select_random(bke::CurvesGeometry &curves,
selection.finish();
}
template<typename T>
Member

Theoretically this function could return whether the value was changed. Maybe a premature optimization though..

Theoretically this function could return whether the value was changed. Maybe a premature optimization though..
filedescriptor marked this conversation as resolved
@ -424,0 +452,4 @@
using T = typename decltype(type_tag)::type;
if constexpr (std::is_void_v<T>) {
BLI_assert_unreachable();
}
Member

Not sure if it would make a difference here, but it's usually preferred to move as much code as possible outside of the to_static_type lambda to avoid generating unnecessary code. That also makes the purpose of the to_static_type clearer and makes it easier to replace it with a generic utility with a runtime type in the future.

In this case, since this isn't really a performance bottleneck, it would probably be best for apply_selection_operation to take a GMutableSpan and do the type switch itself.

Not sure if it would make a difference here, but it's usually preferred to move as much code as possible outside of the `to_static_type` lambda to avoid generating unnecessary code. That also makes the purpose of the `to_static_type` clearer and makes it easier to replace it with a generic utility with a runtime type in the future. In this case, since this isn't really a performance bottleneck, it would probably be best for `apply_selection_operation` to take a `GMutableSpan` and do the type switch itself.
filedescriptor marked this conversation as resolved
Falk David requested review from Hans Goudey 2023-02-09 15:29:58 +01:00
Hans Goudey approved these changes 2023-02-09 15:33:01 +01:00
Hans Goudey left a comment
Member

Looks good!

Looks good!
Falk David force-pushed curves-mouse-selection from 23d7c6e70a to ea9b59b26a 2023-02-09 15:52:06 +01:00 Compare
Falk David merged commit 3bed78ff59 into main 2023-02-09 15:53:44 +01:00
Falk David deleted branch curves-mouse-selection 2023-02-09 15:53:44 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#104411
No description provided.