Transform: support properly transforming implicitly shared curve's positions #120824
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120824
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "laurynas/blender:transform-data-copy"
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?
The alternative implementation of #120631
@ -65,0 +88,4 @@
const int64_t points_num = selection.size();
const Vector<IndexRange> ranges{selection.to_ranges()};
void *data = MEM_callocN(sizeof(int64_t) * 2 + sizeof(float3) * points_num +
Could you make the customdata point to a struct like
TransformArrays
that contains aArray
for each dhunk it needs to hold?I was trying to avoid new struct, it will change a lot.
@ -65,0 +101,4 @@
Span<float3> positions = curves.positions();
int64_t offset_dst = 0;
for (const IndexRange &range : ranges) {
Might it be simpler to use
array_utils::gather
instead of using an intermediate step of building index ranges?If to go with
array_utils::gather
selection asIndexMask
needs to be stored intc.custom.type.data
for latter use byarray_utils::scatter
. I didn't find how to make deep copy ofIndexMask
and that forces in functioncreateTransCurvesVerts
to useIndexMaskMemory
instance fromtc.custom.type.data
instead of local variable.And it is doable, but
curve_populate_trans_data_structs
is also called from grease pencil code. Selections there also has to be attached totc.custom.type.data
and it's data type (currentlyTransformArrays
) exposed outside fromtransform_convert_curves.cc
. Here things get messier.Also with ranges I like fact that copying is done in chunks, though this advantage is selection dependent.
Can you check current version? It would transfer to grease pencil a lot easier.
You need to do that:
And after this:
No need for
to_ranges
andArray<int> offsets
.Storing the selection for later would really just be an optimization anyway, it can always be recomputed from the current attributes. Anyway, I'm not convinced that storing
Array<IndexRange>
is faster thanIndexMask
general. Especially since there's a lot of single threaded work going on computing the offsets, etc, it doesn't seem worth the complexity.I would suggest moving
IndexMaskMemory
andIndexMask
intoTransformArrays
. SinceTransformArrays
is becoming more general that way, maybe it should be renamedCurvesTransformData
or something.You're right about that being more different for grease pencil, but to me it seems better to find the optimal solution separately for each case. GP is doing a different thing by combining the data from multiple
CurvesGeometry
into one container.I don't see to separate GP without two separate
curve_populate_trans_data_structs
functions.Current version works for both, also I think it'll be handy for Bezier handles also.
Thanks for suggestion.
I wanted ranges to copy in chunks. I was frightened by fact that many curves with all vertices selected will be copied point by point.
Anyway I think I solved it with
IndexMask
s.@ -170,3 +236,2 @@
pseudoinverse_m3_m3(smtx, mtx, PSEUDOINVERSE_EPSILON);
MutableSpan<float3> positions = curves.positions_for_write();
int64_t position_num = *blender::ed::transform::curves::custom_data_to_point_num(
I think you can remove the
blender::
from hereTransform: support properly transforming implicitly shared curve's positionsto WIP: Transform: support properly transforming implicitly shared curve's positionsWIP: Transform: support properly transforming implicitly shared curve's positionsto Transform: support properly transforming implicitly shared curve's positions@ -83,0 +87,4 @@
struct CurvesTransformData {
blender::IndexMaskMemory memory;
blender::Vector<blender::IndexMask> selection_by_layer;
blender::Vector<int> layer_offsets;
Add comments for what
layer_offsets
andpositions
contain.@ -161,6 +172,12 @@ void curve_populate_trans_data_structs(TransDataContainer &tc,
bool use_connected_only,
int trans_data_offset);
CurvesTransformData *create_curves_custom_data(TransCustomData &custom_data);
These functions are in the global namespace, so they should have a bit more specific names.
@ -65,0 +73,4 @@
transform_data.layer_offsets.append(data_offset + selection.size());
array_utils::gather(
positions,
transform_data.selection_by_layer.last(),
selection
@ -82,2 +101,3 @@
else {
selection_per_object[i] = ed::curves::retrieve_selected_points(curves, memory);
selection_per_object[i] = ed::curves::retrieve_selected_points(
curves, curves_transform_data->memory);
IndexMaskMemory memory;
is unused aboveLGTM, can you update the patch description a bit?