Transform: support properly transforming implicitly shared positions #120631
No reviewers
Labels
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 project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120631
Loading…
Reference in New Issue
No description provided.
Delete Branch "JacquesLucke/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?
There seems to be a fairly fundamental problem with transforming points in curves edit mode right now. The transform code keeps non-const pointers into potentially shared (and therefore immutable) position arrays. This is not possible allowed with implicitly-shared data. Instead, the transform code should work on a local copy of the data that it actually owns and then copy the changes back into the geometry.
I don't know the transform code all that well, so it's possible that this has been fixed in a different way elsewhere already. Some feedback would be welcome.
I'm not a big fan of the idea of increasing the size of
TransData
(with thefloat loc_copy[3]
member). It would be better if we could shorten this struct. To give you an idea, when we transform a mesh with Proportional Editing enabled, the number ofTransData
is equal to the number of vertices which causes memory usage to be greater than that of the mesh itself.If we really need a copy with the curve locations. We could allocate an array and reference it in
tc->custom.type.data
. This member is customizable for each type of "transform_convert". It can be created and set within thetransform_convert_curves.cc
file.(More information that might be useful:)
recalcData_curves
function.special_aftertrans_update
member ofTransConvertTypeInfo
.I agree that keeping pointers to mutable shared data is problematic. I've removed them from a fair amount of sculpt code for the same reasons.
I think a better long term solution would be to completely replace the
TransData::iloc
pointer. The only thing the transform system should need to store per element is an index (or aBMVert
pointer for BMesh). Instead the transform system should retrieve the data on-demand and write it back to the geometry as a separate step.I like array in
tc->custom.type.data
solution more too.Maybe I could implement it in #120222, because in any case I'll have to add Bezier handles to the solution?
@laurynas it would be very helpful if you could look into fixing this issue properly. I'd recommend doing it separate from your existing patch though, as the problem exists in
main
already.#120824
Pull request closed