Fix #109670: attribute shared between geometries even when edited #111514
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111514
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "JacquesLucke/blender:unshare-attribute-on-rna-access"
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 RNA attribute API did not make sure that attributes are unshared when the data is accessed. This is necessary to avoid accidentally changing data on other geometries.
Unfortunately, we currently can't detect if the access is read-only or if the attribute data is modified. Therefore, the data is always copied when it was shared. This makes it a little bit less efficient in some cases, but that should still be ok. The old behavior could by brought back by implementing #112150.
@blender-bot build
It's too bad this will affect Cycles, but maybe we can move Cycles to use the C++ attribute API (not RNA) for 4.0.
@blender-bot build
I know this is a fix, but I'm a little hesitant to accept this before we have at least some idea of how const correctness and implicit sharing should work properly with the RNA API. Do you have any thoughts about that? I thought making the Python API look more like the
AttributeReader
andAttributeWriter
classes would make sense. But I'm not sure if that sort of const correctness is typical in Python or if things are just expected to be more explicit.We'll probably have to add a way to get read-only access to attributes at some point (e.g.
attribute.data_readonly
). I don't think it's worth breaking the api over this. It's also less common for things to be readonly that could also be mutable in Python, so making read-only the special case probably makes sense from a Python API perspectice.I'd like to consider Brecht's review blocking here, but this is okay with me. Can you create a followup task for
.data_readonly
just so we have that written down somewhere and we can point to it?I'll change Cycles to use the C++ API directly for attributes in after this lands, since I don't want that to get slower.
I created #112150 as a follow up task.
Not ideal but I don't have a better solution without significant API changes.
I had been using a mode]al operator to using mouse / keyboard / joysticks to interact with a running simulation
I can't interact with the sim in py at all now without using a second mesh / passing in data that way - breaking any sort of ability to duplicate a setup.