Thomas Barlow 9956ef4622 PyAPI: Allow prop collection raw array read access for non-editable props
Non-editable prop collection items would always fall back to the slower
loop in `rna_raw_access`.

This patch changes `RNA_property_collection_raw_array` to only fail with
non-editable items when intending to set values, allowing for the faster
raw array access to occur when reading values in `rna_raw_access`.

This brings the Python API `bpy_prop_collection.foreach_get` performance
of `Mesh.vertex_normals`/`polygon_normals`/`corner_normals` up to the same
speed as generic `FLOAT_VECTOR` attributes with the same domains.

Given a mesh with 393216 corners:

Using `foreach_get` with the "vector" prop and a compatible buffer object:
- Corner vector attribute: ~0.9ms
- Corner normals (before): ~7.9ms
- Corner normals (after):  ~0.9ms

Using `foreach_get` with the "vector" prop and a Python list:
- Corner vector attribute: ~11.0ms
- Corner normals (before): ~18.0ms
- Corner normals (after):  ~11.0ms

Pull Request: https://projects.blender.org/blender/blender/pulls/114063
2023-11-06 15:51:07 +01:00
2023-11-01 10:33:27 +02:00
2023-11-06 15:45:00 +01:00
2023-11-06 15:45:00 +01:00
2023-11-04 16:41:18 +11:00
2023-11-02 16:10:37 +11:00
2023-11-02 16:09:11 +11:00
2023-08-16 19:29:47 +02:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%