abrasic/abratools

"bake" tool returns errors and "crashes" the plugin

Closed this issue · 4 comments

Hello,
first off, I'm not a coder, just an animator, so please forgive me if I use the wrong terms or names for things, if I can clarify in any way, please let me know.

in Abratools beta v1, there's a tool I use a lot: "bake", which in the v1 is much better than blender's native bake tool which deletes all unseelcted keys, errors often, doesn't obey your settings, etc etc. With the Abratools version of "bake", there's no fuss: you click it and it works! Ideally I'd love it to only bake within the preview range as opposed to the entire range but changing it manually is worth it. I use this more than any other tool! :)

however in version 2, I'm not sure what changed but now whatever number I put in for steps (I usually use 3 or 4), usually it bakes a key on every single frame, but if it works, leaves odd stray frames behind that I need to delete. As well, the little 'bar' vanishes as the add-on seems to close itself and becomes the regular blender settings tab. I have to click the "aT" button to load it in again.

I've tried this several times, and I'm not sure what's changed, but if possible an optional "bake, legacy ver." option to use instead of the new one would be awesome, if you wanted to keep this new one too.

(in addition,I have it as a hotkey, but alongside the tangent options a "flatten handles" (from the key>snap menu) would be super useful as well, but that's just a suggestion, it's not a big deal, just something I use a lot.)

Thank you so much!

Hello, and thank you for your bug report.

I did encounter a lot of the Bake Keys bugs that you've mentioned while making changes to the newer system a couple days ago. Thing is, I completely forgot to upload my most recent build which included those Bake Keys fixes onto the releases page, which I assume is where you downloaded it from? A newer build has finally been uploaded there which should hopefully fix majority of those issues. You can redownload the newest build from the link above. Apologies for the mess-up on my part!

With the newest build, I have yet to reproduce any of the errors that you've mentioned so far, but please let me know of any additional problems that this build may cause you.

"flatten handles" (from the key>snap menu) would be super useful as well

I can consider adding this natively at a later time. For a temporary solution you can also do this with custom scripting:

In the "Scripts" tab of abraTools you can click "Open Scripts Folder" and create a flatten_handles.py file, where the contents of the file are:

class script_info:
    name = 'Flatten Handles'
    icon = 'ARROW_LEFTRIGHT'
    context = 'GRAPH_EDITOR'

def execute():
    import bpy
    bpy.ops.graph.snap(type='HORIZONTAL')

You can now use this operator on the toolshelf (and assign a hotkey if you'd like!)

cs

thank you so much!

I installed it, and did a "test" to bake out a few frames, and while it did work beautifully.... the bar closed itself yet again, requiring me to restart it. I got this error:

Python: Traceback (most recent call last):
File "C:\Users\jametc\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\abratools\core\key.py", line 493, in invoke
curve.keyframe_points.remove(curve.keyframe_points[api.get_key_index_at_frame(curve, frame)])
IndexError: bpy_prop_collection[-1]: out of range.

is it because I'm using an old version of blender? Not all my favourite plug-ins are up to date yet so I've been holding out. But either way I thought I might let you know what happened.

Thank you again! :)

Thank you, I've been able to reproduce your error and your issue should be fixed in the latest build (you can redownload the new one at the same page).

This error seems to have been caused because there was an "F-Curve" that didn't actually contain any keyframes -- most code assumes that at least one keyframe makes up a single F-Curve. This could happen, for example, when you use the NLA Editor and have ever toggled either "Animated Influence" or "Animated Strip Time" on an action strip. When you toggle it back off, even if that keyframe data is "all gone", the F-Curve itself remains visible on the graph editor until you manually delete it, for some reason.

I also discovered a new issue where custom property F-Curves were not affected by the bake. This seems to have been fixed as well.

Please let me know if the newest build worked for you, or if any new problems arise for you.

Closing for inactivity. If issues persist with the newer baking options in the latest build, please feel free to re-open this issue.