Jump to content

[SOLVED] Error during KSP Tools export


Recommended Posts

Just finished a part I've been working on and PartTools won't export it properly, I get this error in Unity:

at (wrapper managed-to-native) UnityEngine.Mesh:get_vertexCount ()

at KSPPartTools.PartWriter.WriteMesh (System.IO.BinaryWriter bw, UnityEngine.Mesh mesh) [0x00000] in <filename unknown>:0

at KSPPartTools.PartWriter.WriteCollider (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0

at KSPPartTools.PartWriter.WriteChild (System.IO.BinaryWriter bw, UnityEngine.Transform t) [0x00000] in <filename unknown>:0

The thing has more than one animation, and is more that one separate blender file mashed together into one part to allow for multiple animations happening at separate times, does anyone know if this is a nono? I have been told it's fine to do in the past but have never actually attempted it myself, and this error is a bit upsetting, any clues?

Edited by Squiggsy
Link to comment
Share on other sites

What's the hierarchy of the part in Unity?

Where did you put your Animation component(s)?

Yeah I was just about to post an update saying I solved it, this was exactly the problem! I had placed two of the animated components under the 3rd animated component in the heirachy, I just had to create an empty game object and then have it be the parent for all 3 objects and then it exported no problem, have yet to see if it actually works in game though but at least it exported.

thanks for your reply though :)

Edit: well I guess it technically works... but I'm getting spam errors causing it to lag while animating:

Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually!

(Filename: ..\..\Physics\src\NpActor.cpp Line: 134)

ok this is very weird, it causes incredible amounts of lag and the attach nodes don't seem to work properly, things just became detached from it at random but still counted as being part of the same ship...

Ok I fixed it, this was caused by mesh colliders on objects that were too small, seems it causes an error in unity's physics engine, simply replaced them with box colliders and it no longer gives errors.

now the only problem is finding out why Dmagic animate modules won't work if there's also a stock animate generic....

Edited by Squiggsy
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...