Blender Git Loki

Git Commits -> Revision 89e5c75

Revision 89e5c75 by Sybren A. Stüvel (master)
July 21, 2015, 14:01 (GMT)
Added Action.fcurves.find(data_path, array_index=0)

Finding a specific F-Curve is often needed in Python, and usually
consists of a construct like:

```
[fcurve
for fcurve in ob.animation_data.action.fcurves
if fcurve.data_path == "location"][1]
```

This can now be written as
`ob.animation_data.action.fcurves.find('location', 1)`

This new function `Action.fcurves.find()` is still O(N) in the number
of FCurves in the Action, but at least it allows us to remove
boiler-plate code. It is also faster than the Python equivalent, as
only the found F-Curve is converted to Python.

Reviewers: campbellbarton, aligorith

Reviewed By: aligorith

Differential Revision: https://developer.blender.org/D1427

Commit Details:

Full Hash: 89e5c756665c1e7e622ddbd5deece0dda4ce7724
Parent Commit: e7fc8d9
Lines Changed: +24, -0

1 Modified Path:

/source/blender/makesrna/intern/rna_action.c (+24, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021