Jump to content

[Tutorial] Fixing emissive animations for Unity 4.3+


Recommended Posts

Fixing emissive animation for unity 4.3+

  1. Open Unity
  2. Click the little menu icon to the right of the Inspector tab
  3. Select the Debug option
  4. Select your animation in the Project Tab
  5. In the Inspector change Animation type from 2 to 1
  6. Go to Edit > Project Settings > Editor
  7. In the Inspector tab set Asset Serialization mode to Force Text
  8. Browse your PC for the .anim file and open it with a plain text editor, notepad will do
  9. Change all ClassID from 23 to 21
  10. Remove all material. prefixes from the attribute: sections but leave the rest (ie "material._EmissiveColor.r" becomes "_EmissiveColor.r")
  11. Save the file
  12. Export your project
  13. Remember to assign the animation in the config file

Thanks to Sumghai for the help

--------------

Original post

I followed the stickied tutorial as close as I could, but I'm afraid there is something I must be doing wrong

This is the unity screenshot of what I have

http://i.imgur.com/lxhhNk1.png

And this is what it looks like in-game, at the very edge of overheating there is still no change in color

http://i.imgur.com/XN80xEf.png

Edited by mbartelsm
Link to comment
Share on other sites

yep, 4.2.2 or earlier;

you need the Animation component, not the newer Animator component. Unity no longer supports the older component and materials animation is broken on it. Or you have to wait til Part Tools gets updated again to support newer Unity animation components.

Link to comment
Share on other sites

Making emissives only seems to work with Unity 4.2.2 (or earlier), so if you're using the latest version of the editor it likely won't work

I'm using the latest version of Unity, and in order to get animated emissives to work, I had to hack up the animation files with a text editor to force it to use the legacy (i.e. not the new mecanim) animation system:

http://answers.unity3d.com/questions/622005/legacy-animation-system-cannot-animate-colors.html

Since I could get this hack to work consistently in my projects, I should probably write a proper tutorial for this - maybe this weekend.

Link to comment
Share on other sites

With a text editor? I tried and all I see are random symbols

Whoops, missing bit of critical info!

In Unity, go to Edit > Project Settings > Editor - in the Inspector window/dialog/pane that appears, set the Asset Serialization mode to Force Text. This forces Unity to recompile all the animation files to use plain text rather than the default binary setting.

Link to comment
Share on other sites

Ok, finally managed to fix it

  1. Open Unity
  2. Click the little menu icon to the right of the Inspector tab
  3. Select the Debug option
  4. Select your animation in the Project Tab
  5. In the Inspector change Animation type from 2 to 1
  6. Go to Edit > Project Settings > Editor
  7. In the Inspector tab set Asset Serialization mode to Force Text
  8. Browse your PC for the .anim file and open it with a plain text editor, notepad will do
  9. Change all ClassID from 23 to 21
  10. Remove all material. prefixes from the attribute: sections but leave the rest (ie "material._EmissiveColor.r" becomes "_EmissiveColor.r")
  11. Save the file
  12. Export your project
  13. Remember to assign the animation in the config file

Thanks to Sumghai for the help

Edited by mbartelsm
Link to comment
Share on other sites

Ok, finally managed to fix it

  1. Open Unity
  2. Click the little menu icon to the right of the Inspector tab
  3. Select the Debug option
  4. Select your animation in the Project Tab
  5. In the Inspector change Animation type from 2 to 1
  6. Go to Edit > Project Settings > Editor
  7. In the Inspector tab set Asset Serialization mode to Force Text
  8. Browse your PC for the .anim file and open it with a plain text editor, notepad will do
  9. Change all ClassID from 23 to 21
  10. Remove all material. prefixes from the attribute: sections but leave the rest (ie "material._EmissiveColor.r" becomes "_EmissiveColor.r")
  11. Save the file
  12. Export your project
  13. Remember to assign the animation in the config file

Thanks to Sumghai for the help

No worries!

And folks, it looks like mbartelsm beat me to the punch with regards to the tutorial - this is very helpful for those who've accidentally saved their project under a new version of Unity (Unity projects aren't backwards-compatible) :)

Link to comment
Share on other sites

Horay! Thanks mbartelsm

Uhh, kind of horay, now I actually have to go back and apply this to all those engines

Actually I think I should just rebuild the entire MACE line, I'm sure I can do a much better job now after working on that F100

Link to comment
Share on other sites

hello ! (i 'm french my English is very simple ) and a big thank for this tut !!!!

look at this thread it's my begin , and at the end I was trying an emissive

to the gear light, by the animator method but I have limited knowledge, and I find

an alternate solution , a fixed emissive moving behind an other texture to simulate

the falloff of the lamp ..

today I find this post and I try :

the result I have an emissive animated with my light gear , it's great but ..

When the I accelerate the time the light stay ON an it's impossible to activate or

deactivate this light . (made the test with unity 4.3 blender 2.71)

1 - Open Unity

-OK I load my part, extend the asset and change the animation to GENERIC

and Hit CTRL+D give me possibility to save the anim file .

-Next I create an new asset animator controller, do the stuff and put the anim file

in my box state (under tab animator)

-in my game object I add an Animator Component and assign my animator controller

- I do the stuff concerning the emissive light, whit the three R,G,B value ok

- next I save my scene.

2 - Click the little menu icon to the right of the Inspector tab

3 - Select the Debug option

4 - Select your animation in the Project Tab

- so I take my anim file and in the debug window do the stuff animation type (2 ->1)

(generic to legacy)

5 - Go to Edit > Project Settings > Editor

In the Inspector tab set Asset Serialization mode to Force Text

- ok

6 - Browse your PC for the .anim file and open it with a plain text editor, notepad will do

- I open the anim file with Notepad+ and do all the change classe ID 23 to 21

and reassigning the attribute for color

to have this "_EmissiveColor.r" for example .

- And I save the file .

And here I think I make something wrong:

I delete the animator controller, and replace it by an animation (legacy system)

put the anim file in , it's work ) and I compile the whole thing !

So the result is it's work by day but stay on by night !!

should I stay with the animator component for export , I'm not sure I have tried

animation with animator sometime it's work but (lot of error in debug window).

I know I'm a total ignorant and perhaps it's not the time yet to do this thing, but

everything seem to be working and no error in KSP debug windows.

Please have you any clue, for this problem ?

It's working yes it's great but I miss something I think !!

Merci beaucoup pour le tuto thank you very much ..

Edited by stephm
Link to comment
Share on other sites

so it sounds like you have the emissive animation working? but during time warp you can't activate or deactivate it? Most right-click functions are disabled during time warp, that's normal. make sure you have dropped all the way to 1x time warp to see if the right-click functions are working or not. as far as Animator vs Animation component, for KSP it should be Animation component, the legacy component.

Link to comment
Share on other sites

hi !

@nli2work:

yes it's working during day light , I use time warp to accelerate the transition to night to see the light effect

but in fact if the is off the go pass on , or stay on and after pass in night mod the become blocked on it's strange.

According to the tuto, my anim file is in legacy mod with an animation component now (ok for that )

so it's ok for KSP ,and the anim file have the rgb emissive stored too (cool)

in debug ksp windows they are no error message so I think it's other thing.

to resuming : on day light I can toggle light with enough problem !!! (I'm not sure for my translation here, no problem for toggling light)

but after the transition (passage !) to night the light stay on and the toggle action as no effect !

thk !!

@+

Link to comment
Share on other sites

doesn't seem like it's a problem related to the animation. maybe your test vessel is out of electric charge by the time you accelerate to night time? seems unlikely cause, but I'm out of ideas as to why the function would be unavailable during the night. :/ sorry I can't be of more help.

Link to comment
Share on other sites

hi !

Ah may be the electrical I do all my test on a plane without power and solar panel !

I test right now ! (never retested since I encounter this problem do UV at this moment 133 mesh exactly !!!!!)

I try !.............

nli2work, thank you very much it's working !!!!!, no power, bug the light ????,but with batteries everything seem work fine !!

As far I know I always put power on my different craft, but focalized to the gear test I forgot to do that :) !!!

But I'm not enough competent to keep the model with this fake generic legacy Light animation, they no relative

bug or message error, I keep this config for my personnel usage .

And switch the model to a mechanic solution (a non animated emissive moving behind a plane textured light off)

(sorry for the my other post this not the subject of this thread.)

Thk for the tuto to do emissive with 4.3 unity version and thank nli2work for the batterie bug lol !!

bye !

Edited by stephm
Link to comment
Share on other sites

  • 2 weeks later...

I appreciate the efforts you made to help out fellow modders. Sadly I'm still stuck, I must be blind. I'm running Unity 4.5.2f1. If I go to Edit->Project Settings->Editor, and look for Asset Serialization Mode, I don't see any Asset Serialization Mode. The closest I have is Serialization Mode, but it's a numerical value. Assuming that the two fields are the same, what numerical value should I use to get the Force Text mode?

Here's a picture if that'll help:

iqAgCWh.png

Thanks! :)

Link to comment
Share on other sites

click on the small down arrow with 3 bars button, next to the lock icon and above the cog icon. change to "Normal" instead of "Debug" mode, you should get a drop down for serialization mode. if not, try serialization mode 2

Link to comment
Share on other sites

click on the small down arrow with 3 bars button, next to the lock icon and above the cog icon. change to "Normal" instead of "Debug" mode, you should get a drop down for serialization mode. if not, try serialization mode 2

Well derp on me! I didn't realize I had the editor in debug mode. That did the trick, I'm able to save the overheat animation as a text file and then edit it as the instructions say. I'm still not able to get the animation to play. Not sure why, does the GameObject in Unity need both an Animator component and an Animation component? I tried that but no luck. I keep getting this error:

[LOG 20:06:35.207] PartLoader: Compiling Part 'WildBlueIndustries/NuclearEngines/Aerospike/part/NuclearAerospike'

[WRN 20:06:35.218] PartLoader Warning: Variable ThermalAnim not found in Part

In my part file, I have:

MODULE

{

name = ModuleAnimateHeat

ThermalAnim = overheat

}

When I export the module, is there a way to know if the animation is included in the .mu?

This is the first time I've tried doing an animation, so I might be missing a few steps.

Thanks again for your help. :)

Link to comment
Share on other sites

you only want the Animation component. Animator is new component in Unity 4 and is not supported by KSP.

I'm using 4.2.2 so I'm not familiar with the workflow after editing the animation clip manually. But I'm guessing once you've edited the animation file changing it to legacy mode,

remove the Animator Component,

make sure the Rig in the import object is set to Legacy.

add Animation component if not already there, and assign the animation clip. should see it play now when you scrub the timeline in Animation window.

Add emissive animation keys

export.

Link to comment
Share on other sites

Well, I gave up on 4.5.2, I just could not get it to work. I did have 4.2.2 downloaded, and followed the tutorial again, starting from scratch. This time I made sure to set the animation on the animation component. Here's the result:

XfNonuY.png

At last, I have an emissive on my part! Now that I know how, I can edit the animation to work how I want.

Thank you much for your help! :)

Link to comment
Share on other sites

very nice! Something that wasn't explicitly stated in the original tutorial. the Emissive map can be full RGB instead of grayscale. The RBG values are added to your _MainTex, along with the Emissive color in the KSP shader. That gives you flexibility to have different parts glow different colors

Link to comment
Share on other sites

very nice! Something that wasn't explicitly stated in the original tutorial. the Emissive map can be full RGB instead of grayscale. The RBG values are added to your _MainTex, along with the Emissive color in the KSP shader. That gives you flexibility to have different parts glow different colors

OOOO that is good to know! I presume that instead of changing the RGB values, I'd just change the alpha? So like, it starts at alpha 0 and then reaches alpha 1?

Edited by Angel-125
Link to comment
Share on other sites

You can push the alpha past 1 for ultra glow. I animate the RGB as well so lower heating it's more red, and higher heating it's more yellow/white. just have to experiment and see what you get. alot of different factors working in combination.

Edited by nli2work
Link to comment
Share on other sites

very nice! Something that wasn't explicitly stated in the original tutorial. the Emissive map can be full RGB instead of grayscale. The RBG values are added to your _MainTex, along with the Emissive color in the KSP shader. That gives you flexibility to have different parts glow different colors

Thanks for the tip :) I can only imagine crazy glowing effect we can do with various colors.

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...