Katten

[1.4.5] AnimatedAttachment 2.1.0 - now with animated surface attachments! (2018-07-20)

Recommended Posts

Posted (edited)

This mod adds a PartModule that enable generic animations to move sub parts! Thus, it is a light-weight option for modders and players to use instead of the more advanced robotics mods out there. Even works for stock parts!

When a part contains components that move (due to animations, gimballing or moving control surfaces), this part module can move any connected part in response. Thus, a part modder may add a moving boom, rotators, hinges etc without learning anything more than they already know from before. 

Parts are moved by using physical forces in the joints. This means that they will obey the laws of physics.

Limitations & known issues

#3 There is a caveat for physics-less parts - while they and any other physics-less sub-parts to them will move with the animation, any physics-enabled sub-parts will not. For example, a cubic strut connected to a hinge will move with it, but a tank connected to the cubic strut will not.

Basic usage

AnimatedAttachment will be automatically added to all parts containing a ModuleAnimateGeneric, ModuleGimbal or ModuleControlSurface. So there is no need to do anything else to your config.

Players simply use the "Deploy" button or similar to run the animation and any connected sub-part will move with it.

Advanced usage

A player can adjust this in the VAB by enabling the stock feature "Advanced tweakables" in the settings and then right clicking the animated part, to set maximum force and spring strength.

Part modders may potentially override the default settings in the part module, but this has not been tested much yet.

Mods using AnimatedAttachments

Rocket Emporium contains several parts that uses this part module 

Spoiler

Samples.png?raw=true

Compatibility

This mod has been tested for compatibility with

* KJR

* KIS/KAS

License

Released under CCA-NC-SA 4.0

Credit

Thanks to @Rudolf Meier@blowfish and others for answering many questions about quaternions and whatnot, and @HebaruSan for the awesome work with CKAN.

Change log

Spoiler

v1.2.2:
* Stock wheels create auto-struts that inhibits robotic mods to move them. All auto-struts are now removed while any animation is running. They are recreated after the animation has stopped. 

v1.2.1:
* Solved #1: Now applies scaling from models to attach nodes
* Briefly tested in 1.4.4

v1.2.0
* Can now disable the updating of the positions temporarily in order to move attached parts in the editor for tuning by clicking "Animated attachments = disable" (remember to enable it again afterwards!)
* Now survives time warp
* Now survives launch revert
* Now survives saving and loading
* Increased default springs and dampers
* Fixed the download path in the version file

v2.0.0:
* Now supports animated surface attachments! 
* Now makes it possible to surface attach stuff on cargo doors and engine bells
* Now adds support to all moving stock parts (generic animations, engines and control surfaces)

v2.0.1
* Improves compatibility with KJR by implementing IJointLockState
* Cleanup, since the above fix also works for stock wheel auto-struts

v2.0.2
* Cleaned out some dlls that were mistakenly included in the release

v2.0.3
* Implemented a work-around for an issue in stock wheel auto-struts

v2.1.0
* Now compatible with KIS/KAS.
* Fine-tuning now works without having to disable the mod
* Increased default spring&force

Download

Download from CKAN or from github.

Edited by Katten
  • Like 27

Share this post


Link to post
Share on other sites

OMG I FLIPPING LOVE YOU!

  • Like 1

Share this post


Link to post
Share on other sites

THIS is what i need!!! Man, I LOVE you!!! 

  • Like 1

Share this post


Link to post
Share on other sites

Wait, so RCS quads on a cargo bay door will follow the opening arc, and still function? :O

Share this post


Link to post
Share on other sites
Posted (edited)
On 6/14/2018 at 6:23 AM, Daishi said:

Wait, so RCS quads on a cargo bay door will follow the opening arc, and still function? :O

It doesnt work with surface attached parts.. yet at least =) I think it is possible to solve it 

Edit: now supports surface attached parts too

Edited by Katten
  • Like 2

Share this post


Link to post
Share on other sites

My attention has been piqued :D

Share this post


Link to post
Share on other sites
Posted (edited)

Oops, noticed now that transform scales in the models are not properly applied. Will be fixed, but for now make sure that your meshes/armatures/empties are in 1,1,1 scale in Blender.

Also, when animating an object in the VAB, the attach node isn't properly updated (used to work but broke it in a cleanup before the release). So it is updated directly when you attach something to it instead.

Edit: solved

Edited by Katten

Share this post


Link to post
Share on other sites

Awesome. I think this will be great for implementing customizable all moving horizontal stabilizers for my airliner mod. As a workaround to the surface attach not working, is it possible to have a "dummy-part" in-between, that attaches to a node, then surface attach parts to that?

Share this post


Link to post
Share on other sites
2 minutes ago, neistridlar said:

Awesome. I think this will be great for implementing customizable all moving horizontal stabilizers for my airliner mod. As a workaround to the surface attach not working, is it possible to have a "dummy-part" in-between, that attaches to a node, then surface attach parts to that?

It is!

MountingPlate.png?raw=true
 

  • Like 1

Share this post


Link to post
Share on other sites

v1.2.0
* Can now disable the updating of the positions temporarily in order to move attached parts in the editor for tuning by clicking "Animated attachments = disable" (remember to enable it again afterwards!)
* Now survives time warp
* Now survives launch revert
* Now survives saving and loading
* Increased default springs and dampers
* Fixed the download path in the version file

Known issues: 
* Forgetting to re-enable animations after fine-tuning the position of a part before launch will cause problems
* Still doesn't handle scaling of transforms in the model

Overall, this mod is now quite stable and useful! Modders, please give it a spin =)

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Excellent work @Katten will check when I got home. Is it known if this conflicts if Konstruction? It seems unlikely though. If it's unkown, I can check for it tomorrow (I think)

EDIT:

EDIT2: spelling

Edited by VaPaL

Share this post


Link to post
Share on other sites
1 minute ago, VaPaL said:

Excellent work @Katten will check when I gat home. Is it known if this conflicts if Konstruction? It seems unlikely though. If it's unkown, I can check for it tomorrow (I think)

Thanks!

I don't know, but I don't think so. 

  • Like 1

Share this post


Link to post
Share on other sites

v1.2.1:
Solved #1: Now applies scaling from models to attach nodes

Share this post


Link to post
Share on other sites
Posted (edited)

v1.2.2:
In stock KSP, wheels create auto-struts that inhibits robotic mods to move them. All auto-struts are now removed by AnimatedAttachment while any animation is running. They are recreated after the animation has stopped. Please tell me if this is causing issues in any situation!

Edited by Katten

Share this post


Link to post
Share on other sites

v2.0.0:
* Now supports animated surface attachments! 
* Now makes it possible to surface attach stuff on cargo doors and engine bells
* Now adds support to all moving stock parts (generic animations, engines and control surfaces)

 

 

  • Like 6

Share this post


Link to post
Share on other sites
Posted (edited)

@Katten Hello, this looks interesting! the download on github is missing the release  zip file.

Edited by TheKurgan

Share this post


Link to post
Share on other sites
Just now, TheKurgan said:

@Katten Hello, this looks interesting! the download on github is missing the release  zip file.

I forget every time, lol. Coming

  • Like 1

Share this post


Link to post
Share on other sites
Just now, TheKurgan said:

LOL I have done it myself a few times ;)

Now it's up =)

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, The Minmus Derp said:

I LOVE THIS

Happy to hear =)

Here is a test from @TheKurgan with BD Armory =)

 

 

  • Like 3

Share this post


Link to post
Share on other sites
Posted (edited)

Edit: no longer needed =)

I've tested AA with KJR.

The CKAN version seems to be incompatible with KSPv1.4.4, and is not active when installed, so it doesn't cause any issues with AA.

There is a fork of KJR, that works for KSPv1.4.4, available here: 
https://github.com/meirumeiru/Kerbal-Joint-Reinforcement/releases

With this version installed, AA will not work. There is however a mechanism in KJR to enable compatibility with robotics mods, made just for this kind of situations. I will ask them to add the fix.

Meanwhile, you can add the fix yourself by editing the config.xml file in the Gamedata/KerbalJointReinforcment folder.
Add the following line in the xml file:

<string name="exemptModuleType6">AnimatedAttachment</string>

Thanks to TheKurgan who figured out this solution.

Edited by Katten
  • Like 2

Share this post


Link to post
Share on other sites

v2.0.1
* Improves compatibility with KJR. The above fix is no longer required and will not make any change.

Some issues still remains when using wheels, when KJR is installed.
 

Share this post


Link to post
Share on other sites

@Katten is all this really supposed to be in the release? Just curious...

GameData\AnimatedAttachment\Plugins\AnimatedAttachment.pdb
GameData\AnimatedAttachment\Plugins\Assembly-CSharp.dll
GameData\AnimatedAttachment\Plugins\Assembly-CSharp-firstpass.dll
GameData\AnimatedAttachment\Plugins\TDx.TDxInput.dll
GameData\AnimatedAttachment\Plugins\UnityEngine.dll
GameData\AnimatedAttachment\Plugins\UnityEngine.UI.dll

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now