Class 4 - Week 1 - Restoring Corrupted Reference Files

While referencing files into your shot has a ton of benefits, such as
smaller file sizes, being able to easily edit or replace objects, and
also getting you used to how most studios work, there is one major
disadvantage that has the possibility of destroying almost all of
your animation. This happens when the connection to the referenced
files becomes corrupt, causing the file to not open anymore, or if it
does open, to have all the animation wiped out of your file. Either
scenario is soul crushing as it means that you will now have to
restart you animation from scratch, or from a previously saved file
(although, even that is not a certainty as the corruption also has
the possibly of affecting many of your backups as well). This
becomes even worse when it happens a few hours before the
deadline, giving you little time to try and restore what you've lost.

Now, while there is no absolute way you can prevent this from
happening, there is a way to notice the issue early on and keep it
from affecting too many of your backups. Simply close off Maya
and reopen your file every few hours or so and you'll be able to notice
the corruption sooner and avoid losing too much work.

But as we all know, when you get into the animation "zone" it can be
quite easy to forget to close off Maya that often. If it ever happens
that you've lost most of your animation as well as the backups, don't
despair just yet. Because if you're lucky and the stars are lined up
just right, there is a few ways to save your animation and bring it back
from the depths of corruption.

The first is to visit this post on the AM Support Center that covers
how to fix the issue by copying the animation from an old corrupted
rig to a new one. This is by far the most efficient method of saving
your file as it requires little to no trial and error.

AM Support Center

This following method is quite a bit trickier, however if you're
unable to open your file no matter how long you let it sit, this
may be the way to go.

The only requirements for this to work is that you have at least one
working backup of your file and that you've been saving them as .ma
files and not .mb files. This will allow you to edit the code of the
Maya file, allowing you to hopefully retrieve the animation. Please
note that this was tested with Maya 2011, and although I'm fairly
certain it will work with most versions of Maya, there may be some
differences.

It's also a great idea to turn on incremental saving in Maya, that
way even if you forgot to version up your file, you should still have
at least one working file. To do this, go to "File > Save Scene > Options"
and check "Incremental save"

While you can open up a .ma file with any text editor, I would
recommend using the following free programs as they are
specifically built for editing code, which is pretty useful:


I would also suggest avoiding Microsoft Word as it adds it's own bits
of code, most likely corrupting the file even further.

Now we come to the part you've been waiting for: how to restore the
Maya file! The process is actually very simple. Before monkeying
around with any code though, it's a good idea to make a duplicate of
both the last working copy of your file and the corrupted file. This
way, if you accidentally save the code after altering it, you'll have
a backup in case something went wrong.

Open up the corrupted file in your preferred text editor, which you
should be able to do by simply dragging the file into the already
opened text editor. If that doesn't work, open up the text editor and
under "File > Open" browse for the Maya file.

When you first open the Maya file, it can be quite intimidating.
With the possibility of tens of thousands of lines of code, most of it
sounding like gibberish. It can be very easy to become lost and not
know what to do. Luckily for us, there is an easy way to find what we
need.

Search for the phrase:
createNode script -n "sceneConfigurationScriptNode";

You should see something like this,


Once you've found that, select all the code from that phrase right up
to the very end of the document and copy it.

That's it for Phase 1! On to Phase 2!

Open the duplicated version of the last working Maya file in your
text editor.

Search for the same phrase as before,
createNode script -n "sceneConfigurationScriptNode";
but this time, select all the code from there to the end and replace
it with the previously copied code.

That's all there is to it! This should have replaced all the
animation from the corrupted file into the working version of the
file. There may be some small issues and problems that come up,
but they are usually easily fixed and are nothing compared to
redoing your animation.

If this method doesn't work for you, or if you have multiple characters
in the scene, there is another way. Drew Rilett sent me this method and
I must say that it is much more versatile than the above method. You can
see Drew's in-depth coverage of it here on his blog DrewRilett.com

I hope this helps you out and if you have any problems or trouble
restoring your file, please feel free to contact Cameron or me by
Skype, comment, or PM and we'd be more than happy to help you out
in any way we can.

1 comment:

  1. And your deep study of the issues helped me again with a corrupted file :P Fantastic!

    ReplyDelete