Jump to content

[WIP Plugin] BDAnimationModules - v0.6.1


BahamutoD

Recommended Posts

I see, I see. I'll start off with a simple one first; just a generic module that can play a deploy and a loop animation. We'll take it from there and start giving it modularity later. What would help in designing how modular it is would be if you guys gave me some examples of different parts that might use a loop.

Link to comment
Share on other sites

I see, I see. I'll start off with a simple one first; just a generic module that can play a deploy and a loop animation. We'll take it from there and start giving it modularity later. What would help in designing how modular it is would be if you guys gave me some examples of different parts that might use a loop.

fair enough :).

Look at this parts pack there is one rotating dish antenna I've made.

Link to comment
Share on other sites

can you make the engine animation have separate start, stop, and running animations? because i have a couple engines that have a rotor that i want to animate, i want to do a spin up animation when the engine starts, then a looping animation while its running, and a spindown animation when its shut off. you can also link particle emmitters to those animations for some cool effects.*

another cool animation would be a tweakable animation. you have a part with an animation. the animation is controlled by one of those tweakable bars. if you change the value of the bar then the animation will play from its current position to the new position. i can think of a million and one uses for this one. adjustable ladders, jacks, robotic arms, flaps, trim tabs, camera turrets, etc. have a bool that if set let it loop around the start/end if the distance is shorter, otherwise it would be forced to animate without looping around.

*already discussed, my bad

I'd appreciate it.

i think thats doable with a stock animation. ive seen a mod that has done that before. it had parts for nautilus-x and it came with a really awesome command pod, designed for docking/tug application. it had extendable rcs units. id love to see that mod brought up to date. i presume they did it by just sticking their thruster xforms and geometry in a game object and animate it with a translate.

Edited by Nuke
Link to comment
Share on other sites

can you make the engine animation have separate start, stop, and running animations? because i have a couple engines that have a rotor that i want to animate, i want to do a spin up animation when the engine starts, then a looping animation while its running, and a spindown animation when its shut off. you can also link particle emmitters to those animations for some cool effects.*

another cool animation would be a tweakable animation. you have a part with an animation. the animation is controlled by one of those tweakable bars. if you change the value of the bar then the animation will play from its current position to the new position. i can think of a million and one uses for this one. adjustable ladders, jacks, robotic arms, flaps, trim tabs, camera turrets, etc. have a bool that if set let it loop around the start/end if the distance is shorter, otherwise it would be forced to animate without looping around.

*already discussed, my bad

i think thats doable with a stock animation. ive seen a mod that has done that before. it had parts for nautilus-x and it came with a really awesome command pod, designed for docking/tug application. it had extendable rcs units. id love to see that mod brought up to date. i presume they did it by just sticking their thruster xforms and geometry in a game object and animate it with a translate.

Firespitter already has a perfect module for spinning rotors, you should look into that.

Tweakable animation is a good idea, I'll add that to the list.

The RCS animation thing, while possible with stock animation, won't happen automatically when you activate/deactivate RCS. I've made a module that does that. It's ready for the 0.2 update, which I'm just holding until I can make a short video with all the new functions. For now, a video of AnimatedThrust (ModuleEngines.finalThrust scaled animation):

The gimballing is stock, but to get it to look like that, I had to make 24 thrust transforms and 24 ModuleGimbal nodes... So I stuck a bool into the AnimatedThrust to let you disable the Lock Gimbal button (there was one for each of the 24 flaps).

Edited by BahamutoD
Link to comment
Share on other sites

Put up a DL of v0.2.

New features are:

Deployable RCS animation,

Generic loop animation (as of now, only has deploy and loop function)

Engine Case (just something I needed for a part I was making. It activates any attached engine when the animation is in the open state)

Animated Thrust (like FXAnimateThrottle except it scales based on the engines current thrust)

Added "WaitForAnimation" value for animated engine so you can tell it to not activate the engine until a certain time in the animation (like waiting until the doors open for example)

Video of some of these in action:

Keep in mind that this is an ongoing work in progress so things will change. If you want to use some of these modules in your parts, expect future updates to possibly break functionality. (At least until 1.0, after which I won't make any part-breaking changes).

Edited by BahamutoD
Link to comment
Share on other sites

Put up a DL of v0.2.

New features are:

Deployable RCS animation,

Generic loop animation (as of now, only has deploy and loop function)

Engine Case (just something I needed for a part I was making. It activates any attached engine when the animation is in the open state)

Animated Thrust (like FXAnimateThrottle except it scales based on the engines current thrust)

Added "WaitForAnimation" value for animated engine so you can tell it to not activate the engine until a certain time in the animation (like waiting until the doors open for example)

Video of some of these in action:

Keep in mind that this is an ongoing work in progress so things will change. If you want to use some of these modules in your parts, expect future updates to possibly break functionality. (At least until 1.0, after which I won't make any part-breaking changes).

Excellent. Those rcs and engine animation plugins are Exactly what i needed. The plugin is really starting to become the like a new and better firespitter animation plugin. This gives me soo many ideas for engines and rcs blocks.

Link to comment
Share on other sites

Been playing around with your plugin and the genericLoopAnimation module seems to be exactly what I've been looking for for my centrifuge part for some time.

It has a deploy and a looped rotation animation, previously I've used two ModuleAnimateGenerics with lots of bugginess as you can imagine.

Unfortunetely with your module I run into similar bugs. It looks like the plugin is kinda confusing the two animations or something.

Is there a special way I have to set this up in unity or what's going on?

Keep up the great work, would be too cool if it could finally make my centrifuge properly working.

Link to comment
Share on other sites

Been playing around with your plugin and the genericLoopAnimation module seems to be exactly what I've been looking for for my centrifuge part for some time.

It has a deploy and a looped rotation animation, previously I've used two ModuleAnimateGenerics with lots of bugginess as you can imagine.

Unfortunetely with your module I run into similar bugs. It looks like the plugin is kinda confusing the two animations or something.

It looks like there is a bug (or maybe just a missing condition) in the last few lines of the genericLoopAnimation module.

Where it says:


if(loop.normalizedTime<=0 && loop.speed == -1)
{
loop.speed = 0;
loop.enabled = false;
deploy.enabled = true;
deploy.normalizedTime = 1;
deploy.speed = -1;
}

Should it instead say:


if(loop.normalizedTime>=1 && loop.speed == -1)
{
loop.speed = 0;
loop.enabled = false;
deploy.enabled = true;
deploy.normalizedTime = 1;
deploy.speed = -1;
}

The loop.normalized time will be greater than 1 after it finishes one rotation. So after pushing deactivate it will wait until the loop finishes at least one complete rotation, stop the loop, then play the reverse animation. The only problem is that I think the loop animation will just stop in place, you might need something to make sure it finishes the next loop before playing the reverse deploy animation.

Edit: I think I might see why it was set to time<=0. But looped animations, unfortunately, don't reset their normalized time after each loop, it just keeps going up. Maybe you want:


if(loop.normalizedTime % 1 == 1 && loop.speed == -1)

That would put the normalized time back to a value between 0 and 1 regardless of how many times it has looped.

Edit the second: Ok, I think eventually I will edit my way to an understanding of how this works.

If the intended behavior is for the deactivate button to turn the loop around, play back to its starting state, then play the reverse deploy animation then just switching to loop.normalizedTime % 1 <= 0 should work.

But in my opinion it's smoother to let the loop finish out one last rotation in the forward direction, then stop it and play the reverse deploy animation. Maybe using the deactivate button the set loop.enabled to false, instead of changing the speed, and check that in the update method would work, or something along those lines.

Edited by DMagic
Link to comment
Share on other sites

I plan to make the deactivation behavior an option you can set in the config. (choose whether to play the loop in reverse, let it finish, or jump to the reverse deploy).

Porkjet, do you mind sending me that centrifuge part so I can use it to test the plugin?

Link to comment
Share on other sites

Ok here's the whole pack https://www.dropbox.com/s/7rfuu6ott8j5bl7/Habitat%20Pack.zip

EDIT:

I took a closer look at the Firespitter plugin and FSanimateGeneric module.

In the module documentation theres information about a layer parameter for multiple animations

// Animation Layer. If you have more than one animation on a part, this must be unique for each one in order for them to not interrupt each other. If the stock engine heat animation module is used, that’s probably on layer 0, so make this 1 or higher.

layer = 1

from https://docs.google.com/document/d/1iD52DfHft04Hb48TEhF5a4n5JOc8efUevdg5Y_QPICQ/edit

I don't even know what animation layers are or how to assign them in unity but maybe you can make some sense of this.

Edited by Porkjet
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 4 weeks later...

Woooow! thanks you very much for the mod and special for the plugin this is exactly what i need thank you! :sticktongue:

But i think i found i a bug, because i am creating extendable Engines with this mod and want to add HotRockets! Effects but always the effects were visible before i hit 'Activate Engine' here a image! :rolleyes:

Edited by Fr3aKyHDx
Found a Bug!
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...