1
$\begingroup$

I am baking a lot of keyframes in the strip time parameter of NLA strips. As it's 1 keyframe per blender frame, the keyframe counts end up in the sheer thousands with multiple strips.

Is there any possible way to manipulate the display of F-Curves specifically in the dopesheet? I would like to essentially hide all strip time F-curves from appearing there.

$\endgroup$
3
  • $\begingroup$ which property have you animated exactly? $\endgroup$
    – Lauloque
    Commented May 15, 2023 at 19:34
  • $\begingroup$ As I mentioned, it is the strip time parameter of NLA strips. It is literally called "strip_time", corresponding to the UI for "Animated Strip Time". $\endgroup$
    – Ryth Azhur
    Commented Aug 11, 2023 at 19:40
  • $\begingroup$ my bad, guess I read too fast x) answer posted though $\endgroup$
    – Lauloque
    Commented Aug 11, 2023 at 20:47

2 Answers 2

1
$\begingroup$

I found a dubious but reliable workaround to completely hide the channels and restore the performance.

It turns out the Dope Sheet's name search functionality can be inverted. The invert button does NOT appear in the menu full of filter settings for the channels you want to see, but it does appear at the very top left of the dope sheet when using the search there.

Both the search and the invert button are fortunately exposed to Python.

Here is the solution, solving my original problem of wanting to hide the Strip Time channels from the Dope Sheet, so I use "Strip" as the simple term.

for s in bpy.data.screens:
    for a in s.areas:
        for space in a.spaces:
            if hasattr(space, 'dopesheet'):
                space.dopesheet.filter_text = 'Strip'
                space.dopesheet.use_filter_invert = True

I refer to this as dubious because it removes the ability for the user (me) to use the search feature for any other purpose. Nevertheless, it works.

$\endgroup$
0
$\begingroup$

If you have performance issues when running this script over a large amount of objects, I would advise removing the print statements as well as limiting the effect of such script to the selection. I left the lines to do so at the top, just comment/uncomment what you want.

import bpy

# for extending effect to all objects:
objs = bpy.data.objects

# for limitting effect to selection only:
# objs = bpy.context.selected_objects

for obj in objs:
    try:
        nla_tracks = obj.animation_data.nla_tracks
    except:
        nla_tracks = None
        
    if not nla_tracks:
        print(f"No tracks in object '{obj.name}'")
    else:
        
        for track in nla_tracks:
            
            nla_strips = track.strips
            
            for strip in nla_strips:
                
                for fcurve in strip.fcurves:
                    
                    data_path = fcurve.data_path
                    if "strip_time" in data_path:
                        print(f"Found {data_path} in '{strip.name}'")
                        fcurve.hide = True  # Hide the F-curve in the Graph Editor
```
$\endgroup$
1
  • $\begingroup$ This hides them in the graph editor, not the dope sheet. My add-on already does this. $\endgroup$
    – Ryth Azhur
    Commented Aug 13, 2023 at 3:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .