Jump to content

Importing/starting animations in KSP


Recommended Posts

Hello!

I'm having trouble starting (my first) animation in KSP.

The animation ("deploy") works fine in Blender, exported as FBX, looks okey in Unity asset preview. I don't know how to test the animation in Unity after adding the asset to the scene tho. 

I have created a cfg-file that contains the following code:

Spoiler

MODULE
{
name = ModuleAnimateGeneric
animationName = deploy
startEventGUIName = Deploy
endEventGUIName = Retract
animSwitch = false
isOneShot = false
actionGUIName = MyToggle
}

In the VAB, I get a button named "Toggle", but not the names I specified above.

I get the following output in ksp.log when clicking Toggle:

Spoiler

[EXC 09:18:09.965] NullReferenceException: Object reference not set to an instance of an object
    ModuleAnimateGeneric.UpdateAnimSwitch ()
    ModuleAnimateGeneric.Toggle ()
    BaseEvent.Invoke ()
    UIPartActionButton.OnClick ()
    UnityEngine.Events.InvokableCall.Invoke (System.Object[] args)
    UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters)
    UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters)
    UnityEngine.Events.UnityEvent.Invoke ()
    UnityEngine.UI.Button.Press ()
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData)
    UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData)
    UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor)
    UnityEngine.EventSystems.EventSystem:Update()

I see the following as part of the loading, which doesn't occur if I don't have the ModuleAnimateGeneric in there:

Spoiler

[LOG 09:40:33.636] PartLoader: Part 'SpaceCat/Goblins United/Parts/Engine/gu_mt1-0_beetle/gu_mt1_0_beetle' has no database record. Creating.
[LOG 09:40:33.671] DragCubeSystem: Creating drag cubes for part 'gu.mt1.0.beetle'
[EXC 09:40:33.723] IndexOutOfRangeException: Array index is out of range.
    ModuleAnimateGeneric.AssumeDragCubePosition (System.String name)
    DragCubeSystem+.MoveNext ()
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    :MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    :MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    :MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    :MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    PartLoader:StartLoad()
    :MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Any ideas? =S

EDIT:

In now changed Unity -> Import Preview -> Rig -> Animation Type from Generic to Legacy according to a tutorial. Is that still needed? The .mu file grew by some 20kb. Reloaded the game, but I seem to have the same issues showing up.

Adding the log snip when the ship is loading in VAB:

Spoiler

[ERR 10:00:34.221] Module ModuleAnimateGeneric threw during OnStart: System.IndexOutOfRangeException: Array index is out of range.
  at ModuleAnimateGeneric.OnStart (StartState state) [0x00000] in <filename unknown>:0 
  at Part.ModulesOnStart () [0x00000] in <filename unknown>:0 

[LOG 10:00:34.415] DragCubeSystem: Rendering procedural drag for fairingSize1
[EXC 10:00:34.624] NullReferenceException: Object reference not set to an instance of an object
    ModuleAnimateGeneric.FixedUpdate ()
[LOG 10:00:34.640] Autogen thumbnail for C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program/KSP_Data/../thumbs/Testing!_VAB_Auto-Saved Ship.png from C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\saves\Testing!\Ships\VAB\Auto-Saved Ship.craft

 

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