Jump to content

[1.8.x, 1.9.x, 1.10.x, BETA for 1.12.x] Kerbal Animation Suite Continued


linuxgurugamer

Recommended Posts

This wonderful mod was originally written by @MrHappyFace, who hasn't been around since September.  Original thread is here: http://forum.kerbalspaceprogram.com/index.php?/topic/117663-113-kerbal-animation-suite/&page=1Rebuilt for KSP 1.2.2 and your animation pleasure:

The new version for KSP 1.4.1 has new dependencies

New Dependencies

CKAN has been updated to install the dependencies, if needed.

So here it is, Kerbal Animation Suite v1.2.1. It runs with KSP 1.2.2, and allows the creation of animations for kerbals on EVA.

Download:  https://spacedock.info/mod/1199/Kerbal Animation Suite Continued?ga=%3CGame+3102+%27Kerbal+Space+Program%27%3E

Source code: https://github.com/linuxgurugamer/KerbalAnimationSuite

License:  GPLv3

Patreon.png

https://www.patreon.com/linuxgurugamer

 

WB451PQ.jpg

These gifs demonstrates this mod:

http://gfycat.com/DifficultDeterminedGalapagospenguin

http://gfycat.com/HilariousNarrowFlies

http://gfycat.com/PettyMintyIrishdraughthorse

I posted these gifs on reddit a while back, if you recongnized them. The animation files for them are all included in the download.

This mod has 2 components: the animator, and the API.

Animator:

The animator is the main tool, which allows you to create, edit, play, and export .anim files, which can be used by your own plugins.

Getting started with the animator

  1. Install this mod
  2. Launch a ship, or go to one you've already landed somewhere.
  3. Go on EVA. The animation tool will only work if the kerbal is standing on dry ground.
  4. Click the kerbal face looking button in the App Launcher

You will see 4 windows pop up.

  1. The Bone Hierarchy window, which is where you select the bones to manipulate.
  2. The Manipulation window, which is where you manipulate the selected bone.
  3. The Animation window. This is the most important window, it's where you Load animation files, create them, and manage the timeline of the loaded animation.
  4. A little window in the top right corner which allows you to hide any of the other 3 windows

You will also see, if you right click on the kerbal while you're NOT in the animation screen, there are some new right click actions. You can play any animation anywhere in the GameData folder, and you can reload the animations (Reload Animations) if you want to test animations you've just made. You can also use the 1-9 keys to play animations without the rightclick menu. There are 4 animations included with the download in the Presets folder.

Source Code: https://github.com/HappyFaceIndustries/KerbalAnimationSuite

Download: https://github.com/HappyFaceIndustries/KerbalAnimationSuite/releases/latest

Latest Version: v1.2.0.0

License: GPL v3.0 [full text]. Code in the API subdirectory is not restricted by this licence, and is in the public domain.

 

API:

The API is a file that mod developers can include in their plugins that handles the loading and playing of animation files.

Because it is not a seperate dll, there's no need to include the animator with your download when releasing a mod that uses these animations.

You do, however, need to include a copy of animation_hierarchy.dat with your mod, which can be found in GameData/KerbalAnimationSuite/Config

You can see the API here: https://github.com/HappyFaceIndustries/KerbalAnimationSuite/tree/master/KerbalAnimationSuite/API

The API has 2 classes.

KerbalEVAUtility class

public static void AddPartModule(string moduleName)

public static List<KFSMState> GetEVAStates(KerbalEVA eva)

public static List<KFSMState> GetEVAStates(KerbalEVA eva, List<KFSMState> states)

public static void RunEvent(this KerbalEVA eva, string name)

public static void RunEvent(this KerbalFSM fsm, string name)

The first method, AddPartModule, is the most important. You can use it to add your own part module to the kerbalEVA and kerbalEVAfemale parts, which aren't supported by ModuleManager, so using a plugin is the only way. This is the reccommended way to handle animations, but if you're feeling adventurous (or stupid) then you can use some other method.

The other methods are methods to manipulate the Kerbal's Finite State Machine (KerbalFSM). The KerbalFSM is the engine kerbal's use to handle animations, like walking, swimming, etc. I highly reccomend you research the concept of Finite State Machines if you haven't already, and want to use this.

KerbalAnimationClip class

public KerbalAnimationClip(string url, bool fullPath = false)

public void Initialize(Transform transform, Animation animation)

public string Name
{ get; }

public int Layer
{ get; }

public float Duration
{ get; }

public UnityEngine.AnimationClip Clip
{ get; }

Basically, you use the constructor to create the clip object, then load the animation by putting in a path relative to the GameData folder (example: Squad/Animations/bleh.anim), a ConfigNode object, or a full path if you so choose.

You can optionally set more values in the Clip property, such as the frame rate, wrap mode, etc.

All of the properties are set in the .anim when you create the animation using the animator, but you can edit those values in the Unity animation system later, after you call Initialize.

Then, you use Initialize to add the animation to the kerbal's transform/animation components. If you're use a part module added to the kerbalEVA and kerbalEVAfemale parts using KerbalEVAUtility.AddPartModule, then just use transform and GetComponent<Animation>() as arguments.

The rest of the code will be done with Unity's AnimationClip, Animation and AnimationState classes. You can see the documentation for those here:

http://docs.unity3d.com/ScriptReference/Animation.html

http://docs.unity3d.com/ScriptReference/AnimationClip.html

http://docs.unity3d.com/ScriptReference/AnimationState.html

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 3 weeks later...
On 2/28/2017 at 8:39 PM, ThiccRocketScientist said:

YES! This is amazing... however, one thing. My Kerbal Animation box (The one where you right click the Kerbal) to select the animation, is minimized. I can't make it bigger, it is just a thin grey strip. I tried restarting my game buuut.. maybe I can reinstall the mod.

But great!

~John

I see this also, but I'm still on v1.1.3 of KSP so I haven't filed an issue, nor really looked into it because I found if I load an animation it'll assign itself to a number key so I haven't had to use the animation selection menu, I just press the number keys till I find which one it is. If this is still a problem in the KSP v1.2.2 version then post up your log after you trigger the event

Link to comment
Share on other sites

  • 2 months later...

anyone happen to figure out why the animation menu doesn't show? I keep meaning to hunt it down but haven't had the time and haven't been using this much lately. Just did a quick rigging today and saw it was still an issue

Edited by Drew Kerman
Link to comment
Share on other sites

On 2/28/2017 at 8:39 PM, ThiccRocketScientist said:

YES! This is amazing... however, one thing. My Kerbal Animation box (The one where you right click the Kerbal) to select the animation, is minimized. I can't make it bigger, it is just a thin grey strip. I tried restarting my game buuut.. maybe I can reinstall the mod.

But great!

~John

I wish you had pinged me, I wasn't aware of this.

And now it's going to have to wait for all the 1.3 updates

 

On 2/28/2017 at 8:39 PM, ThiccRocketScientist said:

YES! This is amazing... however, one thing. My Kerbal Animation box (The one where you right click the Kerbal) to select the animation, is minimized. I can't make it bigger, it is just a thin grey strip. I tried restarting my game buuut.. maybe I can reinstall the mod.

But great!

~John

You really should have posted a log file

42 minutes ago, Drew Kerman said:

anyone happen to figure out why the animation menu doesn't show? I keep meaning to hunt it down but haven't had the time and haven't been using this much lately. Just did a quick rigging today and saw it was still an issue

Log file please

Link to comment
Share on other sites

5 hours ago, linuxgurugamer said:

So can you tell me what's not working, and how to reproduce it

Good to know its def a mod conflict somewhere. Next time I have a chance I will pare things down and see what I can find

Link to comment
Share on other sites

23 minutes ago, linuxgurugamer said:

Are you sure?  I just installed it via CKAN, and it's there.

how did you install it?

The installation was done as usual and with all mods manually. Is a sub-mod needed? Had this mod really gladly tried, but no matter where and what I put the Kerbal, the button does not appear.

Link to comment
Share on other sites

35 minutes ago, hraban said:

The installation was done as usual and with all mods manually. Is a sub-mod needed? Had this mod really gladly tried, but no matter where and what I put the Kerbal, the button does not appear.

Log file please

Please check the following:

in the GameData directory, you should see KerbalAnimationSuite

Open the VERSION file and verify that it is version 1.2.2 

Verify the following directories exist:

  • Config
  • Icons
  • Plugins
  • Presets

and what is in the Icons directory?

Link to comment
Share on other sites

7 minutes ago, linuxgurugamer said:

Log file please

Please check the following:

in the GameData directory, you should see KerbalAnimationSuite

Open the VERSION file and verify that it is version 1.2.2 

Verify the following directories exist:

  • Config
  • Icons
  • Plugins
  • Presets

and what is in the Icons directory?

Load the master from GitHub and in the .zip the Plugin directory is missing. *lol*

Link to comment
Share on other sites

2 minutes ago, linuxgurugamer said:

Sounds like you are loading the wrong file.  I'll check It later, but get the file from soacedick, that is what I tested with CKAN

Now i take the File from Spacedock and here is all fine. Nice work and realy funny to play with the kerbals! :D

Thank you for support and the great plugin!

Link to comment
Share on other sites

40 minutes ago, hraban said:

Load the master from GitHub and in the .zip the Plugin directory is missing. *lol*

I've confirmed that the release file is correct on Github.  Sounds like you downloaded the master zip for the entire git repo, you didn't download the file from the Releases directory.

Anyway, glad to hear it's working for you

Link to comment
Share on other sites

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...