Jump to content

[Tutorial] Downgrading your Unity project to 4.2.2


Recommended Posts

Tutorial: Downgrading your Unity project to 4.2.2

Premise

As KSP is based on the Unity game engine, add-on authors would use the Unity editor to configure the models, textures and animations used in add-on parts prior to export via SQUAD's KSP PartTools.

From Unity 4.3 onwards, the editor has migrated to using mecanim as the default animation system. However, KSP still uses what is now known as the "legacy" animation system in order to properly animate changes in textures (such as engine heat-driven emissives), which mecanim does not properly support. Some time ago mbartelsm and I devised a workaround to make Unity 4.3 and above allow legacy animations for emissives, but said workaround is no longer applicable for Unity 4.6 and above.

A more permanent solution is thus to downgrade an existing Unity 4.3 or 4.6 project to 4.2.2, the last version of Unity that still offered full support for the legacy animation system for textures.


Required Items

- Your existing Unity 4.3+ editor installation

- An installer for Unity 4.2.2, from the Unity Download Archive

- Your Unity project folder, containing the assets you use for making KSP parts such as models and textures


Assumptions

- Your Unity project has an Assets subfolder, where your Blender models, textures and other resources reside

- Your KSP PartTools 0.20/0.23 installation also resides inside the Assets subfolder


Instructions

1) Back up your project

Downgrading Unity project versions is a very risky and potentially destructive process - in the worst case scenario, your models/textures will survive, but you will have to recreate the Unity scene files, the PartTools hierarchy, the material definitions and animations. As such, I strongly recommend keeping a backup of your Unity 4.3/4.6+ project before proceeding with the rest of the tutorial, in case you botch the downgrade.

2) Install Unity 4.2.2 in a separate directory from your existing Unity 4.3/4.6+ installation

You'll need your existing Unity installation to prepare your project for the downgrade.

3) Open your project in Unity 4.3/4.6+

4) Go to Edit > Project Settings > Editor and make the following changes:

- Set Version Control > Mode to Visible Meta Files

- Set Asset Serialisation > Mode to Force Text

This will create meta files for every asset (models, textures, animations) you have, which contain information such as how the asset should be imported and what scripts (such as KSP PartTools) are associated with them.

5) Save your project and close Unity 4.3/4.6+

6) Open Unity 4.2.2 and create a new, empty project

7) Go to Edit > Project Settings > Editor and make sure that the new project also has the following settings:

- Set Version Control > Mode to Visible Meta Files

- Set Asset Serialisation > Mode to Force Text

8) Save your new 4.2.2 project and close Unity 4.2.2

9) Move (or copy) the contents of your Unity 4.3/4.6+ project Assets folder into the new Unity 4.2.2 project Assets folder

10) Open your new 4.2.2 project again in Unity 4.2.2

Unity will now attempt to rebuild your project in 4.2.2 using the meta files you generated in Step 4.

11) When project has been rebuilt, check that your GameObject hierarchy have all been re-imported properly

You may need to re-set your KSP PartTools GameData directory, but that should be trivial

12) Once you're absolutely certain your downgrade has been successful:

- Uninstall Unity 4.3/4.6+

- Delete your old Unity 4.3/4.6+ project folder

- Delete your backups


Troubleshooting

I'm getting a typeTree.m_Children.front ().m_Type != SerializeTraits::GetTypeString (NULL) error in my Unity 4.2.2 console!

This means you haven't serialized your assets properly in your original Unity 4.3/4.6+ project - see Step 3, 4 and 5.

(More specifically, this error occurs because Unity 4.3/4.6 makes use of metadata that Unity 4.2.2 will not recognize, and the problem is exacerbated if you're using hidden meta files. By enabling visible meta files and forcing them to be written out to text format, you will allow Unity 4.2.2 to look at the Unity 4.3/4.6+ and strip out the bits that it doesn't need)


Disclaimer

I accept no personal responsibility for any incidental or consequential damages / loss of data resulting from the (mis)use of the aforementioned procedure.


Sources

http://answers.unity3d.com/questions/317047/lowering-unity-project-version.html

http://answers.unity3d.com/questions/578547/convert-project-back-to-422.html

Link to comment
Share on other sites

Hi sumghai

I'd like to place this under Common Problems and Solutions, but I'd like the reader to understand clearly when this is needed.

From a user point of view what problems would be solved by this? in PM You said "locking out of editing emissive animations". Is that all?

Edited by Cpt. Kipard
Link to comment
Share on other sites

I can answer this one. I grabbed Unity 4.3 when I first started, having missed the requirement for Unity 4.2.2 for animations etc. I ended up abandoning everything and starting again and re-rigging every part in 4.2.2 when I realised my mistake, because the 4.3 project wasn't backwards compatible.

I use a separate scene for each part, so using the method Sumghai would have saved me considerable work if I'd known about it.

We've seen a lot of this lately: "I'm using Unity 5 and I've got this issue". We all know what the answer boils down to, so this is a valuable resource to be able to point those people to.

Link to comment
Share on other sites

That doesn't answer the question though. You're saying this helps you migrate multiple scenes. I asked what other problems do higher Unity versions cause and more specifically how do they manifest.

Like I said, I need to know what the user will see during their workflow. How else are modders meant to understand that this is the solution to their problems without wasting time waiting for a response in a thread they start.

Link to comment
Share on other sites

From a user point of view what problems would be solved by this? in PM You said "locking out of editing emissive animations". Is that all?

Yeah, the downgrade primarily resolves the issue of not being able to create/edit emissive animations.

I can answer this one. I grabbed Unity 4.3 when I first started, having missed the requirement for Unity 4.2.2 for animations etc. I ended up abandoning everything and starting again and re-rigging every part in 4.2.2 when I realised my mistake, because the 4.3 project wasn't backwards compatible.

I use a separate scene for each part, so using the method Sumghai would have saved me considerable work if I'd known about it.

I've never had to resort to one scene file per part. From 4.2.2 to 4.6+ I was always able to put all my parts/internals/props in the same scene file. The only time I would ever have separate scene files is when distinguishing between various projects (e.g. I have separate scene files for FusTek Station Parts, SDHI SMS, SDHI AeroFairings, SDHI Strobe-o-Matic, RealChutes)

As for animations in 4.3/4.6+, you can still do standard part animations with them (e.g. moving cargo doors). It's just that 4.3/4.6+ no longer allows you to do emissives, unless you use the mecanim-based Animator component (whereas KSP only supports the legacy Animation component)

Link to comment
Share on other sites

Wow! Thanks Sumghai! This is very useful. When I started I used 4.3.3 and man oh man that as a mistake.

Edit: fortunately my models are not too complex to animate so just reimported them into 4.2.2.

Edit2: Even though U5 is better, I'm going to hate trying to port everything over. At least I already use convex collision meshs.

Edited by Eskandare
Link to comment
Share on other sites

  • 1 year later...

Just wondering if the OP is still applicable for Unity 5.2.4 and KSP...

Asking because I'm trying to create a window lighting emissive animation, and everything seems to work fine in Unity... Except, when I write the .mu, I get an error that the animation needs to be declared as 'legacy'... And the model refuses to load in KSP... If I remove the animation, the model loads perfectly...

Link to comment
Share on other sites

Yes, Ive tried using both, and NEITHER methos eems to be working for me... I used the method in nli2work's thread, and thats the one that gave me the lgacy error... I dont remember if the older method in the OP did or not though... I'm not at my computer, so I cant try again till later

Link to comment
Share on other sites

compiled animations aren't flagged as Legacy, minor oversight in PartTools.

to set the compiled clip to Legacy, select the anim clip, in the very upper right next to the Lock icon, click the 3 lines with downward triangle icon, select Debug, you'll see more information about the asset, near the top is a check box "Legacy". tick that, and set inspector back to Normal mode. 
KeepProjectSettingsPane.gif

Link to comment
Share on other sites

  • 4 weeks later...
On 6/1/2016 at 6:44 PM, Stone Blue said:

Yes, Ive tried using both, and NEITHER methos eems to be working for me... I used the method in nli2work's thread, and thats the one that gave me the lgacy error... I dont remember if the older method in the OP did or not though... I'm not at my computer, so I cant try again till later

I'm a little late getting to this party but did you get it working?

I just created 12 emissives on 1 part with Unity 5.3.5 today so, this method still works.

Edited by Fengist
Link to comment
Share on other sites

@Fengist No... I couldnt get nli2's method to work... Instead, I click on the model icon in the Assets window, and in the Inspector window, I click "Rig", then click the drop down for "Animation Type", and select "Legacy"...

No idea if it actually does anything, since I'm having all kinds of trouble with animations now...It DOES get rid of the "animation not set to Legacy" error in the Console, when writing the model... :P

And I still have not been able to get heat emissives working... I can get light emissives to work, but not heat ones...

I'm thinking I may just give up the idea of modding KSP, or at least take a long hiatus... Its not the concepts, or ideas I'm having trouble with... Its Blender and Unity just making no sense at times with how to actually DO the things I KNOW can be done... I guess learning curve is just too high for me... :P Add in that there is a lack of documentation from Squad, and 90% of the Blender/Unity tutorials specific to KSP are all outdated, using earlier versions of Part Tools, KSP itself, Blender & Unity... So trying to follow most of the tutorials is very difficult...

Edited by Stone Blue
Link to comment
Share on other sites

Man, I've been in the same boat you are in many times, often times I've had to sit there for hours getting fragmented information together to finally achieve what I wanted. So keep on going on, PM me if you have issues I'll try to help as best as i can.

 

Now for your heat emissive issue, have you tried to make your heat emissive animation just a generic animation to see if you can actually see it in-game? If you can see it in-game, then you may not see the heat emissive simply because your configs are not set correctly. What module are you using? FXModuleAnimateThrottle or the heat animation one (ModuleAnimateHeat IRC)?

Link to comment
Share on other sites

Ok, I haven't worked with heat emissives so I can't be any help there.  If it were the light emissives. That I've figured out.

Now one thing I do differently and I don't know that this matters... In the inspector, at the top right, there's a lock icon.  Beside that is an icon with 3 bars and a dropdown arrow.  I click on that 3 bars icon and select debug.  Then I select my animation in Assets and and click on the legacy box back in the inspector.  I doubt it does anything different but then again, this is Unity and it logic goes out the window the minute you start it up.  The other thing I do that works and I'm not sure why, whenever I create an animation in Unity it insists on putting an animatOR on the part.  I delete all of those and drag the animation to the inspector instead. I assume you're doing the same.

As for documentation?  Yea. I feel your pain.

As for Blender, I took one look at that backwards piece of crap when I first wanted to learn modding and it make me never want to mod.  Eventually, I found a tutorial on here by Beale on Wings 3D and couldn't be happier. It's not all glitzy and doesn't do a lot of the things others do, but to make quick, easy, simple models... well, the Maritime Pack is made with it.

I dunno if this'll make life any easier but, here's a small program I wrote that takes the Unity text .anim files and does the conversion noted in the OP. If you're doing a bunch like I did in the screenshot, it saves a bit of time.

screenshot.jpg

Download

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