Curves: Sculpt mode frame selected operator support #109924
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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 project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109924
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mod_moder/blender:tmp_frame_on_selection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implementation of Frame to Selected operator for curves sculp.
Do the other modes use the evaluated geometry rather than the original geometry?
Also, it might be better to use the deformed positions in
GeometryComponentEditData
combined with the selection on the original geometry. That's probably more reliable. But maybe I'm missing something.@ -45,0 +73,4 @@
return GVArray::ForSingle(*default_value.type(), domain_size, default_value.get());
}
static std::optional<Bounds<float3>> selection_bounds_for_curves(const bke::CurvesGeometry &curves)
I'd suggest a couple changes:
retrieve_selected_points
andIndexMask::from_bools
for other geometry typesThe main reason for splitting logic for different domain is that we can do simpler selection transformations:
IndexMask::ForOffsetInfides(curves.points_by_curve(), curves_mask);
IndexMask::from_bools(boolean_selection);
IndexMask::from_bools(boolean_selection);
mesh.bounds_cache
;IndexMask::from_bools(boolean_selection);
IndexMask::from_bools(boolean_selection);
points.runtime.bounds_cache;
For this feature, I think I'd rather avoid the complexity and use the attribute API for the domain and type conversions when necessary. If the performance is a problem, it can be improved later.
@ -45,0 +107,4 @@
bounds_list.append(*bounds);
}
}
if (geometry.has_mesh()) {
if (const Mesh *mesh = geometry.get_mesh_for_read()) {
@ -45,0 +116,4 @@
}
if (geometry.has_pointcloud()) {
const PointCloud &points = *geometry.get_pointcloud_for_read();
const std::optional<Bounds<float3>> bounds = selection_bounds_for_points(points);
The variable declaration and if statement can be combined into one line here too
Here I observe some unsequence (maybe just a bug, lagacy or undefined, for now I'll just consider this how it works):
Not sure why (for what):
WIP: Frame Selected operator for curves sculptingto Frame Selected operator for curves sculptingThanks, it's getting there! Can be simpler still though.
curves::retrieve_selected_points
to retrieve the selection index maskselection_bounds
function toED_curves.h
, since it's specific to curves now@ -65,0 +80,4 @@
init,
[&](const IndexRange range, const Bounds<T> &init) {
Bounds<T> result = init;
mask.slice(range).foreach_index_optimized<int>(
Can't assume the number of elements is less than 2 billion here in this generic header-- so
int64_t
here@ -25,0 +28,4 @@
std::optional<Bounds<float3>> selection_bounds(
const Curves *curves_id, const bke::crazyspace::GeometryDeformation deformation)
{
if (curves_id == nullptr) {
Such a function shouldn't really have a null check.
@ -1378,0 +1386,4 @@
using namespace blender::bke::crazyspace;
const Object &ob_orig = *DEG_get_original_object(ob_eval);
const GeometryDeformation deformation = get_evaluated_curves_deformation(ob_eval, ob_orig);
const Curves *curves = static_cast<const Curves *>(ob_eval->data);
I thought we decided to retrieve the selection from the original curves. Since they have the same number of points, that should amount to the same thing, but rely on interpolation of selection to the evaluated curves.
Frame Selected operator for curves sculptingto Curves: Sculpt mode frame selected operator supportSorry for the delay. If you merge main into this branch, I'll take a look again-- I think I was close to accepting this before.
@ -23,6 +26,15 @@
namespace blender::ed::curves {
std::optional<Bounds<float3>> selection_bounds(
Since this is only really tangentially related to selection, and it's probably not used elsewhere, it might be better if this function was inlined into the view selected function. It's only 4 lines anyway.
One reason would be to be able to reuse this for new grease pencil.
Other one is just size of already exist view selected function...
I think these operations (
retrieve_selected_points
,bounds::min_max
) are high level enough that combining them won't be that helpful for that case. For GP the arguments would be different anyway.I'll test this before committing, but the code looks good to me now, thanks.