Page MenuHome

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

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

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) added inline comments.
release/scripts/startup/bl_operators/sequencer.py
152–153

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
release/scripts/startup/bl_operators/sequencer.py
152–153

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.

release/scripts/startup/bl_operators/sequencer.py
152–153

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.