Page MenuHome

Remove the use of eval in Fades operators, re-enable fades

Authored by Nathan Lovato (gdquest) on Sep 16 2019, 10:12 AM.

Diff Detail

rB Blender

Event Timeline

Campbell Barton (campbellbarton) added inline comments.

A dict lookup here is be more efficient with many f-curves & strips.

This revision is now accepted and ready to land.Sep 16 2019, 5:37 PM

Sorry but I don't get what that'd be in this case. Using fcurves.find()? I don't know what would be fast in this kind of situation.


Current loop looks at every f-curve for every sequence strip. if you have 100 strips and 100 f-curves, that's 10,000 comparisons.

fcurves.find() would be an improvement but that just moves the comparisons to C.

In this case you could do:

fcurve_map = {
    curve.data_path: curve
    for curve in fcurves 
    if curve.data_path.startswith("sequence_editor.sequences_all")

Then curve = fcurve_map.get(data_path) will give an efficient hash lookup.

  • Optimize fcurve lookup

Makes sense! Just made and tested the change, everything should be working now.