linuxgurugamer

[1.4.5, 1.5.1, 1.6.1, 1.7] ModuleSequentialAnimateGeneric

Recommended Posts

Posted (edited)

@SuicidalInsanity recently made a set of new parts for the Mk2.5 Spaceplane Parts mod.  A late addition is the Beluga nose, which lets the nose of the shuttle open up and down, and then a ramp comes out.  These are three different animations, and they needed to be spaced out;  ie:  the top needs to open first, then when it is 80% open, the bottom starts to open, and when it is >50%, the ramp can start to come out.  Closing does the same in reverse.

 

 

This mod is targeted at mod developers, more specifically, developers who make animated parts.  Advanced players using the UbioWelding mod may also find this useful

This mod provides the ability to control multiple animations in a single part. The animations are performed sequentially for each animation, there is a setting to specify at what point during the current animation's progress to start the next one.

The idea for this mod came from the necessity to control animations in a new part for the Mk2.5 Spaceplane Parts, the Beluga nose parts. One part has three animations, the other has two (second and third combined into one). The following discussions will be referring the the one with three animations:

Each animation in a part has a ModuleAnimateGeneric; this is the stock mod and is configured normally. However, the three events:

  • openEventGUIName
  • closeEventGUIName
  • actionGUIName

will not be used, there will be a set of events provided by this mod.

An interesting quirk is that the animations in some parts have the part initially open, and some initially closed. There is a setting to specify, called closed. For sanity's sake, the mod works on the assumption that the part when closed is the beginning of the animation; this option tells the mod to reverse that.

This mod is called (oddly enough): ModuleSequentialAnimateGeneric, and the config starts like this:

 
MODULE
{
	name = ModuleSequentialAnimateGeneric
	openEventGUIName = #autoLOC_502069 //#autoLOC_502069 = Open
	closeEventGUIName = #autoLOC_502051 //#autoLOC_502051 = Close
	actionGUIName = Toggle Doors

 

Each animation has a corresponding stanza called a SEQUENCE The following is one sequence from the complete module, with each line fully annotated:

SEQUENCE
	{
		seqNum = 1				// a sequence number, should start at 1 and count upwards
		animName = BelugaDoorsal		// Name of the animation

		// the mod thinks of 0 as closed, and 1 as open
		// Since many part seem to have that reversed, the
		// following tells the mod what the animation value is
		// when closed
		
		closed = 1					

		// The following specifies the progress value for the animation
		// to be for the child's animatinon to start, 
		// When the progress has reached this level or higher, 
		// start the child animation.  This value goes from 0 to 1,
		// any value outside that will be clamped to the nearest
		//
		allowChildAnimAt = 0.55

		// Since this is the beginning of the sequences, the following is unneeded
		// and commented out.
		// The following specifies the progress value for the animation
		// to go below, at which time the parent animation will be started.
		// Value range is the same as the "allowChildAnimAt"
		// 
		//allowParentAnimAt = 0.2

		// The minDeployLimit specifies the minimum percentage that the animation can be adjusted to.
		// If the player attempts to move it below that, a message will be displayed and the value reset.
		// Also, for this value, you can use either a whole number between 0 and 100, or a normalized
		// number of between 0 and 1.  The mod assumes that a value of 1 is == 100%
		// The following two lines are identical
		minDeployLimit = 50 
		minDeployLimit = 0.50 
	}

 

 

Availability

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites
On 5/14/2019 at 5:37 PM, cineboxandrew said:

so what does this do that a single large animation couldn't?

A single animation can't have the individual animations individually adjusted by the player

Share this post


Link to post
Share on other sites

GENIUS!!!

 

PURE.

UNADULTERATED.

G-E-N-I-U-S !!

 

 

On 5/14/2019 at 2:37 PM, cineboxandrew said:

so what does this do that a single large animation couldn't?

Like the man said in the post and the video ...

A single ani adds significant difficulty to the design and animation process in the graphical software suite of choice - i.e., Blender, AutoDesk, SketchUp, After Effects, et al.

This lets someone create a part with multiple animations and allows each to be created separately but operated sequentially all while affording the player's manageability.

Share this post


Link to post
Share on other sites
On 5/15/2019 at 7:41 PM, linuxgurugamer said:

A single animation can't have the individual animations individually adjusted by the player

ah, understood. that does sound useful, in fact you might see an optional patch for restock making use of this... 

 

58 minutes ago, TranceaddicT said:

A single ani adds significant difficulty to the design and animation process in the graphical software suite of choice - i.e., Blender, AutoDesk, SketchUp, After Effects, et al.

This is... not even remotely true

Share this post


Link to post
Share on other sites
 
 
 
9 minutes ago, cineboxandrew said:

This is... not even remotely true

I'm not saying adding one animation is difficult.

I'm saying multiple animations rendered all rendered as a single process, adds a level of difficulty.  This removes that.

Share this post


Link to post
Share on other sites
6 minutes ago, TranceaddicT said:

I'm not saying adding one animation is difficult.

I'm saying multiple animations rendered all rendered as a single process, adds a level of difficulty.  This removes that.

It’s actually the reverse - it’s relatively easy to do a bunch of animations as a single clip. Once you want to break that into multiple clips you have to start dealing with NLA strips, actions etc. 

Share this post


Link to post
Share on other sites
3 minutes ago, benjee10 said:

It’s actually the reverse - it’s relatively easy to do a bunch of animations as a single clip. Once you want to break that into multiple clips you have to start dealing with NLA strips, actions etc. 

Thank you.  That is what I was clumsily trying to get at.

Share this post


Link to post
Share on other sites

Glad we are all in agreement :-)

I'll be releasing the update to the Mk2.5 Spaceplane Parts over the weekend which will include the Beluga noses featured in the video.  I also think I know how to eliminate the flickering when trying to move an animation below the minimum, will test and release that over the weekend as well (assuming it works)

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