Jump to content

Running color animation and mesh animation at same time


Recommended Posts

I've managed to create a test part that includes both standard mesh animation and color animation, driving Color property of KSP/UnlitColor material on one of animated parts.

I can execute mesh animation with ModuleAnimateGeneric, but i don't know how to also start Color animation at the same time. Is there an extra parameter that ModuleAnimateGeneric can parse ?

Or, is there a custom plugin that can run two animations at the same time ?

Link to comment
Share on other sites

18 hours ago, fatcargo said:

I've managed to create a test part that includes both standard mesh animation and color animation, driving Color property of KSP/UnlitColor material on one of animated parts.

I can execute mesh animation with ModuleAnimateGeneric, but i don't know how to also start Color animation at the same time. Is there an extra parameter that ModuleAnimateGeneric can parse ?

Or, is there a custom plugin that can run two animations at the same time ?

Select the two animation objects in the file browser? panel in Unity. Right-click and do Animation > Compile Selected.

Next: click the little hamburger menu here and select Debug.

2wlcgnr.png

In the new set of properties, tick the tickbox Legacy because KSP needs animations to be Unity legacy type. Click the hamburger menu and change back to Normal.

This should be quite enough for your combined animation to work.

Edited by JadeOfMaar
Link to comment
Share on other sites

THANKS FOR THE PIC ! IT WORKED ! That small thing ... so much difference. And now i can use ModuleAnimateGeneric, no need for exotic stuff (yet :) ).

I have to note that info is scattered across several threads but here is what i found :

This is useful reference to see how parts are constructed, i used "light" demo to confirm my Unity install worked properly,

 

"Central" reference with information (there may be smaller bits of info one can miss if tired/distracted),

In my case, my mesh was imported as FBX file with Animation component, added to GameObject that holds PartTools.

I've added a plain KSP/UnlitColor material to small piece of mesh to be used as color indicator (which is child of other meshes in animation).

Then i created a new property animation (i guess this is appropriate name for it) and in "Reference" field wrote path to my color indicator mesh as first_level_child_of_imported_file/child_level_1/color_indicator_mesh. You can see this in yt video posted in Color Animation Editor thread when demonstrating Reference setup to "HierarchyEmissive" part of video. Pay attention at what is going on when watching it, it is easy to miss crucial details as design process is quite quick.

This animation is targeting property "_Color" (note the leading underscore) found in KSP/UnlitColor material assigned to color_indicator_mesh.

Then i selected my color_indicator_mesh in scene tab and opened Animation tab (menu Window > Animation or CTRL+6) and edited keys as needed.

Next step was to, inside Project tab, CTRL+click multi-select both animation imported along with FBX and a newly created property animation, then right-click on any of selected items and from menu choose Animation > Compile Selected.

This creates a new animation named "CompiledAnimation" in same folder as source animations. Don't forget to set "Legacy" flag as noted in previous post.

Now i added that to a list of animations to root item where original imported animation resides. So there were three animations, original, property and freshly compiled one in animation array (i also added property animation).

Finally, i did the usual exporting step and copied to GameData.

After that i added CompiledAnimation to ModuleAnimateGeneric in animationName field, tested and that was it. It worked :)

More useful bits of info to ones learning : while i was trying to make it work, i had two types of failures : part compiler failed to compile part and subsequently model was not found. Not much to do here except try again.This error is visible during load. Second failure type was far more dangerous - it made my KSP game eat up nearly all of my RAM, it used up 6.5GB in middle of load. For several times i barely managed to end task before it turned my machine into crawling pile of mud. :) One more thing : do not be alarmed when editing keys in property animation and see property names in yellow coilor with "(Missing!)" text,  it works and it can be tested by dragging animation cursor.

I'll try emissives next, they need extra step for creating textures. Which brings me to my next question : @JadeOfMaar some long time ago i've read on forums about limits for number of lights in scene. Does this apply to emissives as well ? I wouldn't want to burden player's machines with even more ultra-deluxe bang-whizz-splash :)

 

Edited by fatcargo
Link to comment
Share on other sites

32 minutes ago, fatcargo said:

I'll try emissives next, they need extra step for creating textures. Which brings me to my next question : @JadeOfMaar some long time ago i've read on forums about limits for number of lights in scene. Does this apply to emissives as well ? I wouldn't want to burden player's machines with even more ultra-deluxe bang-whizz-splash :) 

The spotlight limit (in the Pause menu, defaults to 8 but you can raise it) does not apply to emissives. These are merely a texture effect that: does not give off light; does not respect light and shadow cast onto them. Their brightness level is absolute when they draw.

Link to comment
Share on other sites

Ohh that's perfect ! That means i can add emissive, not worry about (too much) overhead and it will work in dark ! Yay ! Oh and update : i removed source anims, compiled anim works completely alone but i'm also curious about a possibility of adding curves for animating properties with arbitrarily set animation keys, even if animation with imported mesh does not have reserved time slots for it.

Here is a post that hints at this,

 

 

Edited by fatcargo
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...