Hi, Mario. @munderfire is working on graphics and animations and I am a developer. I am using spine-threejs to perform spine animations in our project (sure it is built on top of THREEjs).
spine-threejs seems to be set up correctly as we tested it with default Raptor
animation and some random old animtion provided by @mundfire. Both works perfectly
Recently we added a new animation just created by @mundfire and we faced problems. Most of parts were not shown and nothing moves. Actually the only static thing on scene was shown.
Ive done some research inside. spine-threejs (installed from @esotericsoftware/spine-threejs, I use bundled "spine-threejs.js") and realized that after a while an InterleavedBufferAttribute of geometry used on actual spine mesh, begins to contain an NaN values in its "array". I causes errors on BoundingThings calculation and so-on.
I
ve tried to find a source of a problem. In our case it is in SkeletonJSON class and its readTimeline2 and readCurve methods.
In our fresh animation we got { curve, c2, c3, c4 } values in our keyMap (all are numbers). in "readTimeline2" method "keyMap.curve" value is passed to "getCurve" method as a first argument. But it seems like "getCurve" methods supposes "curve" parameter to be String (actually "stepped" value) or Array (as method tries to get value by indexes (curve, curve[i+1])).
Finally that is what method does. It checks that "curve" is not stepped and behaves with it as it is Array. But it is number. So theres a place where NaN values in Track
s "curve" array begins. And it causes NaN elsewhere if animating.
PS: So looking at my animatios jsons I realized that 'curve' as Number and c2, c3, c4 props are things that exists only in our new problem animation.
PS: If not animation. Scene is look good.
PSS: if force stepped. Scene became visually correct. Some tracks play correct. Some tracks does not.
PSSS: if ignore "curve" in "readTimeline2" at all (as it is omitted), another tracks start playing correctly. But ones that played correct before stopped. (actually inverted situation to forcing stepped xd)
Thank you,