Regression: Attributes shared between meshes after modification #109670
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#109670
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Linux-6.1.31-2-MANJARO-x86_64-with-glibc2.37 64 Bits, X11 UI
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 530.41.03
Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash:
c7fc78b81ecb
Worked: 3.5.1
behavior changed with
7eee378ecc
Short description of error
Lets say we have cube object, with 2d vector attribute (on Points, not sure if domain matters).
When creating cube copy, (with mesh copy - not instance), 2d Vector attribute (named 'test' in blend file ), stays linked to the original attribute.
Exact steps for others to reproduce the error
-it will write 1, to 'test' attribute on cube,
When we print 'test' attrib value, you will see both attributes (on both object) was set to (0,0), but original attribute on cube should not have been affected (it should print (1,1) and not (0,0) ) .
Above script works ok on blender 3.5.1 ( print 1 for original cube, 0 - for copy). There is also no issue for Int attributes. I did not test other domains / data types.
[REGRESSION] 2d vector attribute, not unlinked correctly on mesh copy.to Regression: 2d vector attribute, not unlinked correctly on mesh copyCan we please label recent regressions with High priority?
Will check which commit broke this...
@lichtwerk I didn't know if it was a regression...
So it would be better to check if it's a bug first
First : triaging (this does not include classification as Bug or something else, this ultimately is up to the module to decide).
This seems to be a bug though, copying (non-linked) should not share data like that.
Also: the title says "Regression", and a previous working version is mentioned (3.5.1), this should all be verified if you triage a report.
Please refer to https://wiki.blender.org/wiki/Process/A_Bugs_Life, https://wiki.blender.org/wiki/Process/Bug_Reports
Anyways, in this case the behavior changed with
7eee378ecc
From the commit message:
In this case, the attribute is clearly modified, so sharing should not happen anymore.
CC @JacquesLucke
I don't think this issue is limited to 2D integer attributes. All attribute types are now shared, and
rna_Attribute_data_begin
doesn't ensure that the attribute data is mutable (un-share it if it has more than 1 user).However, this exposes a larger issue with the RNA API. Because we have no idea if users of the API intend to modify the attribute data, we will have to always un-share the data, even for something like an exporter that just wants to read the data. This is "correct" but it's very inefficient!
@brecht, did you ever think about this issue regarding attributes and RNA before? Currently I'd propose something like adding a
data_read_only
RNA method that returns a different type that isn't settable. Or breaking the API and using our internalfor_write
naming convention in RNA. Maybe it would be possible to provide an array more directly accessible with Python too, so.value
or.vector
isn't necessary (not sure if that's related though).I didn't really consider it. For Python scripts I guess it's simplest if we can hide this, and automatically make the attribute mutable whenever RNA set is called. But then you need to store indices into the array since the pointer to an element gets invalidated.
Yes, it would be nice to handle it automatically. The changing pointers makes that tricky though, I haven't thought of a way to make that work yet. We'd need to store the
CustomDataLayer
pointer inPointerRNA
as well as the index, and there isn't space for that. I'll think a bit more.Which is the same underlying problem we have in #107500 , where the pointer also gets invalidated. If we change attribute RNA to not directly point to the data, but always store a (name based?) reference to the attribute and an index we could catch both these issues at the same time. But that's a quite lowlevel change to RNA and we'd need to be smart about it because doing name based attribute lookups per element would be very inefficient.
Thinking about this: storing CustomDataLayer pointers is dangerous as long as thge layers still get moved around. same #107500 problem.
Regression: 2d vector attribute, not unlinked correctly on mesh copyto Regression: Attributes shared between meshes after modification