Jump to content

[SOLVED] Part with animation not loading


Recommended Posts

Hi

I've got a part that I just can't get to load. It's absolutely fine when I strip the animation component off, but I get the following in output_log when adding it back on:


File error:
(null)
at (wrapper managed-to-native) UnityEngine.AnimationClip:SetCurve (string,System.Type,string,UnityEngine.AnimationCurve)


at A..ReadAnimation (System.IO.BinaryReader br, UnityEngine.GameObject o) [0x00000] in <filename unknown>:0


at A..ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0


at A..ReadChild (System.IO.BinaryReader br, UnityEngine.Transform parent) [0x00000] in <filename unknown>:0


at A.. (.UrlFile ) [0x00000] in <filename unknown>:0

I've stripped it right back, made a fresh scene, completely reconstructed the Unity rigging, made a fresh animation called something different, made sure the rig is set to legacy, unticked Play Automatically, checked there is nothing funny in the PartTools console log. Running out of ideas now. The part just won't load when any animation is applied. It's not even a clip I've imported, I animated this one straight in Unity. All it does it rotate one GameObject 90 degrees! PartTools appears to spits the .mu out fine, along with textures.

It used to work fine, then I changed the animation slightly and this started happening, then I ran through all the steps above trying to figure out what the hell went wrong. Several hours screaming, ranting and raving at KSP have left me none the wiser!

Cheers, really stumped on this one.

Edited by lo-fi
Link to comment
Share on other sites

Hi, had issues like this a couple of times usually during a mass burning of midnight oil, in my case it was simply caused by me accidentally selecting the individual part to be animated from the hierarchy rather than the root object. It sort of happens like this:

click on model, select animation window, create new animation, select transforms or whatever to be animated, create curves , then because i couldn't get a decent view on the animating part i rotated the scene so I could, and this is where it went bad, instead of the root object i just selected the animating object, Nothing changed to tell me it was off in the animation window, and it all worked and looked fine in Unity, but very bad things happened once loaded in game, like engines and effects running in vab or worse an insta crash, producing the same error as you have highlighted. As you've remade it once i doubt this is the case , but you never know.

Link to comment
Share on other sites

you get an error like you had in the OP. I usually run into it if I accidentally key framed a collider or some other channels that shouldn't have curves, but I can't remember specific ones other than a collider. Could be Active/Inactive tick box on a component or a GameObject. alot of things can get key framed in Unity and it's easy to accidentally key something that KSP can't read.

Edited by nli2work
Link to comment
Share on other sites

Fixed. Thanks guys, gave me a push to look at a few more things.

The problem was to do with the exported .DAE having animation, which I ignored and wrote again in Unity. Previously, I'd broken the prefab, so this had not been a problem. In the new version where I didn't break the prefab by renaming an object (because I'd named it correctly before export), it clearly causes a problem with the Part Tools export. A nice little Gotcha! Interestingly, adding my new animation to the fresh root game object I put the dae inside did not help, I'd imagine something to do with it still hanging around in the prefab.

Edit: Thanks nli2work, that's useful info I'll try to remember!

Link to comment
Share on other sites

No, it's during KSP load time that message comes up. Whether it's part tools or KSP that's actually causing the issue we may never know!

Yeah, basically. Or a clip that didn't actually get properly clipped.

EDIT: To be clear, the model had an animation exported, which I did not use. I left it un-rigged and added anothe animation which I created directly in Unity. This is what caused the problem. I did this because you animation that are part of a prefab (.DAE or FBX) are read-only and I wanted to animate some of the objects I added in in Unity. The solution was fairly simple: Rig as normal, open the prefab in Unity and find the animation. highlight it and hit CTRL+D, which will clone the animation. change the animator component to point to the copied animation (not the one stored in the prefab), and it will then be editable.

Edited by lo-fi
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...