I Hate Animation Layers! (Maya)

Ok. My animator likes the animation layer. I hate them.

The problem(s):

  1. Sometimes the animation layer corrupt the file. I don’t know how. When you try to select, delete or do anything with the animation layer(s) then Maya crashes, if it is using script editor, viewport, node editor or anything else. I must open the MA file in a text editor and delete all the AnimLayer nodes by hand.

  2. I have some “flip/mirror animation” scripts that basically copies the animation curve from left side to right and back (using PyMels ‘CopyKey’). Haha, I thought this worked like a charm until animation layers did say hello. I try to bake down the animation and most of the time it works. But sometime, I get the weirdest results.

So my question, what should I use instead (of animation Layers). I talked to an animator about using the Track Editor and all that, but he said that it wasn’t perfect either. What do you guys use at your studio? Do you let the animators use animation layers, and if so, how do you solve all these problems?

animation layers are fine. we use them in big productions and i as the tech supervisor encourage that HOWEVER, we make sure that the animators all know how to use them properly through training, math orientation and education. i animate as well and they are good stuff…

usually, animation layers are used improperly by the animators which leads to problems like yours.

compared to pair blending, animation layers are OK. pair blending is a definite NO…
oh, and scene timewarp is also not recommended…very painful to fix when using renderMan or anything cached/sequential…

a very safe and fast way(at least for how we do stuff here in this country) is to work on major animation edits and everything in motion builder, do all the animation layers there and then just load the data back to MAYA. i know it sounds confusing and backwards but it really works. motion builder is fast and the animation tools are very solid. only minor tweaks are done in MAYA.

Look at the Red9 tools to deal with animation mirroring and you might be able to better deal with the code needed for your own mirror animation tool

Also make sure your Maya copies are updated to latest service pack and you shouldn’t be having layer file corruption problems, not sure what version your in though.
Don’t use trax, animation layers work fine, maybe have the Animators bake down the layers more often and make sure there isn’t something else going on in the file that is causing the problem.

Less layers the better.
Brad

[QUOTE=Ella;26259]Ok. My animator likes the animation layer. I hate them.

The problem(s):

  1. Sometimes the animation layer corrupt the file. I don’t know how. When you try to select, delete or do anything with the animation layer(s) then Maya crashes, if it is using script editor, viewport, node editor or anything else. I must open the MA file in a text editor and delete all the AnimLayer nodes by hand.

  2. I have some “flip/mirror animation” scripts that basically copies the animation curve from left side to right and back (using PyMels ‘CopyKey’). Haha, I thought this worked like a charm until animation layers did say hello. I try to bake down the animation and most of the time it works. But sometime, I get the weirdest results.

So my question, what should I use instead (of animation Layers). I talked to an animator about using the Track Editor and all that, but he said that it wasn’t perfect either. What do you guys use at your studio? Do you let the animators use animation layers, and if so, how do you solve all these problems?[/QUOTE]

Ok, thanks guys. It’s really interesting to hear that animation layers are working well for you. And it’s good to hear that we should stay away from trax.

We are using Maya 2014 SP3. Brad, you said things was updated in latest service pack: is this 2015 you mean then?

In our animation pipeline right now, we’re not using motion builder at all. We’re using Maya for all of the animation work.

I will have a look at Red9’s tool. Maybe that will solve some problems we have, though we will still have the random animation layer crashes. But have any of you copied curves from animation layers and of so, what command are you using? And do you guys know clean way of know if an object is connected to an animation layer.

Thanks again for the answers!
Ella

red9 is awesome…

the only thing preventing me from implementing that thing into our pipeline is a japanese maya tools pack that has similar functionalities to red9. and it is in japanese so red9 got voted out :frowning:

Nice to hear it’s working well, we did actually have a translated pack at one point for Red9 (or maybe it was Chinese I can’t remember now. Another studio had hacked the menu’s and I was thinking of doing language support via a text mapping file, just never seemed to have the interest to warrant doing it. If that’s not the case then I can always look into that, maybe for the proPack support branch that we’re working on now.

In terms of dealing with animLayers in tools, yes they’re a right, royal pain in the arse, BUT if you’re coding your own systems have a look at the Red9 pack anyway as there’s a context manager in python that manages animLayers for me, and I see no reason why that wouldn’t work for other codebases too. It’s in the Red9_AnimationUtils code.

cheers

Mark

On rare occasions, we get corrupted files using animation layers. In our case, it is caused by cycles. Specifically, animBlendNodes have attributes that are being plugged into themselves. I wrote a script that breaks all the bad connections. It stops Maya from crashing, but all the animation that was in the animLayers is lost. (The anim curves are still in the file, but they are not hooked up to anything.) I am on the latest Service Pack, and all of our Animators should be, too.

I tried to make a test file to send to Autodesk, but could not reproduce the problem. (Could not send our Animator’s broken file because of proprietary information and whatnot.)

That’s an interesting catch, we’ve suffered anim decoupling at work but have always put that down to a persistent bug in referencing. I’ll have to look out for that cycle issue, do you have any more info?
If you grab the latest StudioPack there’s a fix for the lost animation issue, allows you to reconnect the anim curves based on selected controllers and deals with animLayer reconnects, or rather it does in the GitHub build. It’s saved many a file!

Thanks mates,

I will have a look into Red9’s tool as soon at I have time to priorities Maya script bugs. It might solve the problems we have with copying and pasting from the animation layers.

RFlannery: I have not investigated the animation layer crash to much, but it doesn’t sound too unlikely that it is an cycling problem.

Here is the script to stop Maya from crashing, if the problem is caused by cycles. It is pretty rough. We didn’t end up using it because of the lost animation, but it was good for telling us exactly where the cycles were.

from maya import cmds

numDeletedConnections = 0
animBlendNodeList = cmds.ls(type="animBlendNodeBase")
for animBlendNode in animBlendNodeList:
    print '---> ', animBlendNode
    conns = cmds.listConnections(animBlendNode, source=False, destination=True) or []
    if animBlendNode in conns:
        connAttrs = cmds.listConnections(animBlendNode, source=False, destination=True, connections=True, plugs=True)
        it = iter(connAttrs)
        for srcAttr in it:
            destAttr = it.next()
            if srcAttr.startswith(animBlendNode+'.') and destAttr.startswith(animBlendNode+'.'):
                print srcAttr, destAttr
                numDeletedConnections = numDeletedConnections + 1
                cmds.disconnectAttr(srcAttr, destAttr)
                
print numDeletedConnections

Mark, good to know you have something for the lost animation problem. I will have to check it out next week.

[QUOTE=RFlannery;26332]Here is the script to stop Maya from crashing, if the problem is caused by cycles. It is pretty rough. We didn’t end up using it because of the lost animation, but it was good for telling us exactly where the cycles were.

from maya import cmds

numDeletedConnections = 0
animBlendNodeList = cmds.ls(type="animBlendNodeBase")
for animBlendNode in animBlendNodeList:
    print '---> ', animBlendNode
    conns = cmds.listConnections(animBlendNode, source=False, destination=True) or []
    if animBlendNode in conns:
        connAttrs = cmds.listConnections(animBlendNode, source=False, destination=True, connections=True, plugs=True)
        it = iter(connAttrs)
        for srcAttr in it:
            destAttr = it.next()
            if srcAttr.startswith(animBlendNode+'.') and destAttr.startswith(animBlendNode+'.'):
                print srcAttr, destAttr
                numDeletedConnections = numDeletedConnections + 1
                cmds.disconnectAttr(srcAttr, destAttr)
                
print numDeletedConnections

Mark, good to know you have something for the lost animation problem. I will have to check it out next week.[/QUOTE]

Dude! That script worked perfectly on the scene I tested it on. I haven’t tried it before just because I assumed I would lose animation data (read lazy). I will have to try it on some more animations, when we get the problem again. Have both solved cycling animation and crashes when selecting animation layers or controls connected to the layers. Only tested it on two files.
Where did you loose data? On the objects where the blend animBlendNode was disconnected? Didn’t seem to change anything for the affected controls in my end.

We lost animation for all objects that were on animation layers other than the base one. Good to know that doesn’t always happen. (And don’t worry about the lazy thing. I’ve been lazy, too, and haven’t yet tried Mark J’s script for reconnecting the disconnected anim curves. Mostly because we haven’t had anyone run into this issue since this thread was started.)

That is petty much what happend when I deleted all the reference in the ma files to the animation layers (to “uncorruppt” the file), all animation data except base animation gone. I did send a crash report to Autodesk, but I dont think it will help. Which version on Maya are you on now, if you havent have this problem in a while? Have you upgraded? We are still on 2014 SP3.

We’re on 2015 SP5. The upgrade was done before this thread started. I suspect the reason we haven’t seen this issue again has more to do with the Animators using animation layers less often (because of this crashing/lost-data problem and also because not all of our internal tools support them).

I wanted to follow up on this as we’re doing some investigations with major file hang issues now. It seems that somehow cycles are indeed getting generated on animLayers and I suspect it’s to do with characterSets and how, when referencing, everything goes via a placeholder list. I wondered if you guys were running referenced rigs with characterSets when you had the cycle issues?

If these cycles existed in the file before the animators saved then they’d have seen the results because the animnation would have been corrupted, and we’re not seeing that. What we are seeing is that files suddenly stop loading and this is the culprit.

cheers

Mark

Hi Mark!

We’re not using any character sets or character sub sets here. Still getting cycles. I have read about this problem before happening when using character sets, but like I said, we’re not.

Seems like when I talked to a animator he don’t have the problem while animation. But then, when he opens the file the next time to work on it, the file get corrupt (of course not all files or all the time, but when we have these problem). This made me think if it has something to do with how Maya saves scenes. Worth noticing this has happened to both ma and mb files.

[S]Here is my theory: I think it has to do with the reference, specifically the reference edits. I just tried on my dummy files and was able to fix it, I just removed all connect attribute edits that had happened on the effected controls. And the animation works perfectly! No animation loss. It says something like this:

connectAttr “NameSpace:ControlLongName.attribute” “AnimLayer2.dagSetMembers” - nextAvailable

We have had these weird problems before with the reference edits, where the skin cluster got fucked up. I have no idea how the reference edits works, and what they really do, but they seem a bit shaky. [/S]

If you find anything out, update please!

Edit: I do get animation loss data from deleting the connected attributes. I didnt look to carefully. I think it’s more likely that is has to do with the animBlendNodes.

We are not using character sets either, but we are using referenced rigs.

Know I’m reviving a pretty old thread, but figured I’d share this post I made recently on resolving this issue: