Tuesday 12 April 2016

Unity GUI errors

Recently i've been getting a lot of GUI errors. This is one of the errors that flags up in my console:

Reported delta does not match with progression of time. Check that the OnInteractivePreviewGUI function only updates the Animator on Repaint events.

If you're unsure why you're getting an error (not specifically this one) try resetting your layout. As mad as this sounds, it's fixed a multitude of errors for me now.. buggy old Unity.

Mecanim update bone bug!


If you want to go back and edit your rig after you have already exported it into Unity, and created an avatar - you're going to have a fun time.

Unity doesn't seem to take to updating files very well - especially avatar files. This is the problem I faced and how I fixed it:

1.) Export Rig into Unity - everything hunky dory, avatar bones configured. Great.
2.) Export animations - link to avatar. Everything working okay.
3.) Update rig in Maya (in my case, the positioning of the bones were changed)
4.) Re-export to Unity, overwriting the old avatar file.
5.) Look at animations, things are looking wroooong. Intersection issues everywhere. WHAT IS GOING ON.

And the solution:
6.) Make an entirely new avatar file, re-link animations to new avatar file. Eureka! Things work.

I can only assume that when you create and configure a new avatar, Unity will set this in stone, even if the file is overwritten. Creating an entirely new avatar forces Unity to re-do this configuration process, thus updating any bone/rig changes.

Tuesday 5 April 2016

Delete half frames

I came across something really annoying the other day whilst I was re-timing my animation.
I select all my character's controls, and scaled the keys down - as I wanted a certain part of the animation to be faster.

I then right clicked and attempted to 'snap' the newly scaled keys, only to find that because some keys were next to one another to begin with, they couldn't snap to the same frame - bummer!

This leaves you with a whole bunch of keyframes that are now on a time value of eg: 1.5, 2.034, 10.56767 etc. Not cool! You will never see these keys, as you will only ever be able to view one frame at a time - thus rendering them useless!

So, grab my script here: AT_cleanSubFrames.py

Then, select all curves you want to clean (delete any half frames) and run it! Begone fowl subframes!

Hope this helps someone. :)