Error Log Feature Request: Divide By Zero Animation Problem.
In either simple log or verbose log mode, after an export fails when a "Divide By Zero" error crops up, It doesn't seem to tell me what object(s) or animations are having an issue in the log.
I'm trying to troubleshoot what animation is giving me problems but I can't really figure out which animation is causing this error. It would be nice if it could tell me what the problem item/animation is at this stage of the export failure.
TikiBear helped me find the issue and fixed it. Adam requested I post here what the problem was to aid in debugging. The problem causing "Divide By Zero" was that my "Z Axis Motion" Was "Too Fast"
I started with this basic loop to get the animation back to its starting point for a different length variable of the animation's run time.
Frame1: End of X axis Movement.
Frame2: ZMovement Upwards.
Frame3: X Axis Reversal.
Frame4: ZMovement Downwards
This is incorrect and will cause the "divide by zero" error. The Graph Editor shows the Zmovement as a single sharp movement up and down.
Instead it should look something more like this in theory:
Frame1: End of X axis Movement.
Frame2,
Frame3: ZmoveUp,
Frame4,
Frame5: Xaxis Reversal,
Frame6,
Frame7: ZmoveDown
Frame8
However, in execution, Please Note that even when trying this, this seemed to be TOO tight of a buffer for my animations still, so I ended up giving a 3 or 5 frame buffer between the start of Z Movements. And also, be wary when scaling the X axis for such animations, because I had a set of frames that had buffers, but intermediary frames inbetween those buffers, and when I shrunk the graph editor's portion of it down, the buffer frames between the buffers and the intermediaries became erased as the frames were scrunched up next to eachother causing the same divide by zero issue.
So, in practice you want something like this:
F1.KeyFrame1: End of X axis Movement.
3-5 non keyed frame spaces.
F7.KeyFrame2: ZmoveUp,
3-5 non keyed frame spaces.
F12.KeyFrame3: Xaxis Reversal,
3-5 non keyed frame spaces.
F17.KeyFrame4: ZmoveDown
3-5 non keyed frame spaces.
F22.Keyframe5: The loop continues.
I'm not sure how to best have an error report inform a player of how to fix this, but atleast you can figure out how to probably tell the exporter how to notify what objects w/ animation are the problem from this?
@Traveler263 This was happening when it was trying to generate bezier curves for smoothly animating those keyframes. That animation might be okay if it's set to use linear jumps rather than beziers.
From a math perspective: If you have things going frame 1, frame 2, frame 3, it's pretty well impossible to create bezier transition curves between those points because there do not exist any frames over which to ramp the change.
From a Python error perspective: This error isn't related to an object, it's caused by math, so there's no reason for Python to include information about the object because the object is irrelevant to the operation that caused the error.
What would be nice is if korman could hold some sort of context that has the current object name and relevant details (material name, animation name, etc.) and use that in a global error handler that displays the message alongside information about the object that was being processed at the time. This feels like it should be doable, but Hoikas would know better how to actually hook that up in a way that makes sense and doesn't break Python rules.
@dpogue Yeah, I get WHY it doesnt show an error since it's Math, but... it would be nice to tell the user what object is giving problems with that math. Otherwise, you're left doing what I was doing and poking at every single object I'd messed with animations on, and trying to figure out what the problem was. ><;
Can you provide a minimum viable reproduction of this?
Attempting to create a test build with the same circumstances i had during the crash
Can you provide a minimum viable reproduction of this?
https://drive.google.com/file/d/1WgCj7tlQAZCqSFjjsbmgrAHBtF-W8gPK/view?usp=drive_link
I have attempted to recreate the exact animation setup steps I had when I created the issue, but was unable to get the crash to repeat itself on my end. I'm not sure what I did different this time. :/