diff options
author | Hans Goudey <h.goudey@me.com> | 2021-11-02 23:16:52 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-02 23:16:52 +0300 |
commit | 18392cef17ddb40857fdb2462d8bad50f389029b (patch) | |
tree | f0fad510f46ce175ab9dd63529b4f06a726205f2 /source/blender/blenkernel/BKE_attribute_access.hh | |
parent | 7aa311e5396bca5d65ba9cd00060d61bafbf28e9 (diff) |
Fix T92652: Joining curves breaks point attribute order
Currently the curve to mesh node relies on the order of attributes being
the same on every spline. This is a worthwhile assumption, because it
will allow removing the attribute name storage duplication on every
spline in the future.
However, the join geometry node broke this order, since it just created
new attributes without any regard to the order. To fix this, I added a
"reorder" step after all the merged attributes have been created, the
types have been joined, etc. It should be possible to change this code
so that the attributes are added with the right order in the first
place, but I would like to do that after refactoring spline attribute
storage, and not for 3.0.
Differential Revision: https://developer.blender.org/D13074
Diffstat (limited to 'source/blender/blenkernel/BKE_attribute_access.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_attribute_access.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh index cf19eb29a0e..6a87375e5e2 100644 --- a/source/blender/blenkernel/BKE_attribute_access.hh +++ b/source/blender/blenkernel/BKE_attribute_access.hh @@ -372,6 +372,11 @@ class CustomDataAttributes { void *buffer); bool remove(const AttributeIDRef &attribute_id); + /** + * Change the order of the attributes to match the order of IDs in the argument. + */ + void reorder(Span<AttributeIDRef> new_order); + bool foreach_attribute(const AttributeForeachCallback callback, const AttributeDomain domain) const; }; |