Blender Git Loki

Git Commits -> Revision ac25786

November 26, 2020, 17:11 (GMT)
Geometry Nodes: support accessing attributes with spans

Before, attributes could only be accessed via setter and getter functions.
While this works well, it can be cumbersome and slow.
It would be better if most code could just operate on the underlying
attribute array directly. The issue is that some attributes are currently
not stored in plain arrays (e.g. vertex positions, vertex groups, ...).

This patch implements a solution where these "special" attributes are
converted into a temporary array for easy access and then copied
back into their correct form after all modifications are done.

Attribute accessors now have a `get_span` and `apply_span` method,
which can be used exactly for that purpose. In the case of attributes
that are plain arrays internally, only small constant overhead is added.

Commit Details:

Full Hash: ac257864a67450da29694ba7fbdc8461aea26a97
Parent Commit: 6d0e92c
Lines Changed: +165, -2

2 Modified Paths:

/source/blender/blenkernel/BKE_attribute_access.hh (+52, -0) (Diff)
/source/blender/blenkernel/intern/attribute_access.cc (+113, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021