Jump to content

[1.12.x] ModuleSequentialAnimateGeneric


Recommended Posts

@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
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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. 

Link to comment
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.

Link to comment
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)

Link to comment
Share on other sites

  • 5 months later...

@linuxgurugamer Can this be used on a *single* animation? Currently trying to address the "reversed" deployment limit on an OPT cargo tail ramp. I already have a single animation for it and wondering if it will work as-is with MSAG, before I go and redo/split the animation up in Blender, and have to re-run it thru Unity.

I apologize in advance, since I will most likely have moar questions incoming, as well. :/

If i can get this to work, we will probably try to integrate it into several OPT parts, and add it as a dependancy.

EDIT: Also throwing out a "HELP! me pleeze" call, to any other mod devs who have poked or integrated this as a dependency into a mod... I know LGG is pretty busy rn, just trying to get his million and one mods updated for 1.8.+ :P

Edited by Stone Blue
Link to comment
Share on other sites

43 minutes ago, Stone Blue said:

@linuxgurugamer Can this be used on a *single* animation? Currently trying to address the "reversed" deployment limit on an OPT cargo tail ramp. I already have a single animation for it and wondering if it will work as-is with MSAG, before I go and redo/split the animation up in Blender, and have to re-run it thru Unity.

I apologize in advance, since I will most likely have moar questions incoming, as well. :/

If i can get this to work, we will probably try to integrate it into several OPT parts, and add it as a dependancy.

EDIT: Also throwing out a "HELP! me pleeze" call, to any other mod devs who have poked or integrated this as a dependency into a mod... I know LGG is pretty busy rn, just trying to get his million and one mods updated for 1.8.+ :P

I don't see why not, but not sure how it will help.  If there is only one animation,then it will stop when it is done

Link to comment
Share on other sites

1 minute ago, linuxgurugamer said:

If there is only one animation,then it will stop when it is done

Well, trying to have it launch in closed position... But then the deploy limiter is limiting the wrong end of the animation. Been struggling with the stock module, and cant get it to reverse. Seems the part has had this issue since KYeon first made it? vOv
 

 

Link to comment
Share on other sites

  • 4 months later...

@linuxgurugamer OK... I'm about to delve into this mod...
Another use case i am interested in seeing if this mod can do:

Can it combine a PartTools created Color Animation, with a "standard" unity created one?
Example:
trying to get an emissive Color Animation for a lamp part (lens), to animate with, and use the *SAME* PAW toggle, as a Unity created animation for a Unity point light (actual light source).
Surprisingly, this is turning out to be IMMENSELY difficult using stock modules...

Currently, as far as I can tell, the lens emissive can be easily done with a ModuleColorChanger, and the point light can be done with a ModuleLight...
but it makes NO sense to have to toggle them seperately with TWO buttons in the PAW.
I know of at least one other mod dev who is having this *same* exact issue right now.

Edited by Stone Blue
Link to comment
Share on other sites

7 hours ago, Stone Blue said:

@linuxgurugamer OK... I'm about to delve into this mod...
Another use case i am interested in seeing if this mod can do:

Can it combine a PartTools created Color Animation, with a "standard" unity created one?
Example:
trying to get an emissive Color Animation for a lamp part (lens), to animate with, and use the *SAME* PAW toggle, as a Unity created animation for a Unity point light (actual light source).
Surprisingly, this is turning out to be IMMENSELY difficult using stock modules...

Currently, as far as I can tell, the lens emissive can be easily done with a ModuleColorChanger, and the point light can be done with a ModuleLight...
but it makes NO sense to have to toggle them seperately with TWO buttons in the PAW.
I know of at least one other mod dev who is having this *same* exact issue right now.

Not as is, it only deals with the ModuleAnimateGeneric.

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...
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...