Monday, September 19, 2011

HotKey Alt<> broken in 2012

Just a quick post about the hotkey mapping in 2012. The main Alt<> keys which advance time in the UI's are now broken in the GrapthEditor, this has been driving some of our animator mad as you can imagine. The command thats now bound to it in 2012 is wrong (a fix in due from Autodesk but not sure if it'll get into the SP1 release). So the bug is that the commands bound to the NextFrame and PreviousFrame calls look if the current UI is a scriptedPanel and only advance the time if that panel is the CameraSequencer...Wrong! Here's the fix for the NextFrame, for Previous from just put -1 in the `cuurentTime -q` -1 block
string $currentPanel = `getPanel -withFocus`; 
if((`getPanel -to $currentPanel`== "scriptedPanel") && (`scriptedPanel -q -type $currentPanel`== "sequenceEditorPanel"))
{ 
sequenceManager -ct ( `sequenceManager -q -ct ` + 1 ); 
} 
else { currentTime ( `currentTime -q` + 1 );}

Maya's current command bound to the Alt> key
string $currentPanel = `getPanel -withFocus`; 
string $panelType = `getPanel -to $currentPanel`; 
if ($panelType == "scriptedPanel") 
{ 
    string $scriptedPanelType = `scriptedPanel -q -type $currentPanel`; 
    if ( $scriptedPanelType == "sequenceEditorPanel")
    { sequenceManager -ct ( `sequenceManager -q -ct ` + 1 ); }
}
else { currentTime ( `currentTime -q` + 1 ); }

Thursday, August 18, 2011

Maya Command Completion issues in Python

Something Dave discovered a while ago and has just come back to bite us again is that the dot code completion in the scriptEditor in Maya is actually RUNNING the code inside Python property blocks when you call a dot complete (Ctrl+Space). It's not just returning the function/property list by using something like the inspect module, but actually running the property itself. The same is true when
you hit return to accept and fill that function/property in the script editor.

Test it, add this in a Python Script window:

import pymel.core as pCore

class AutoCompleteTest(object):

    def __init__(self):
        pass

    @property
    def Test(self):
        print "Im being CALLED Multiple times!!!!!\n" 
        pCore.newFile(force=True)


Now do the following:

com=AutoCompleteTest()

turn on ’Command Completion’ and do a dot complete to inspect the com object you just made!

The property is now being RUN. So what you ask? Well lets say you are doing something stupid like the fileNew example above, just by trying to get code completion you've actually nuked your scene. Also because it's doing this for all the inspect calls it means that it's running all code, in all property blocks which makes it very, very slow!

Mark


Tuesday, August 16, 2011

More Playblast issues - Frame Syncing issues with Xvid

So we thought all was good, we've moved from wrapping the FFDS encoder to using a native 64bit version of Xvid in playblasts and all is good.... or so we thought. It turns out that the default Xvid Encoder settings DO NOT maintain frame counts correctly, randomly inserting padding frames into the Avi. So if you load an avi with baked in FrameCounter from Maya into Virtual Dub and step through it you'll see the frame counters get out of sync. We're only talking 2 or 3 frames but that's enough to completely stuff facial lip sync up and cause anybody using these avi's as master guides to have problems.


The cure is simple, launch the Configure Encoder settingsUI from your Start>Programs>Xvid folder and make sure you turn OFF the B-VOP's (b-frames) under the Profiles@level>more>profile UI. All of a sudden all is in sync and happy. God damned all the time we've wasted getting these working!

Mark

Monday, August 8, 2011

MasterClass links now up!

Just checked on TheArea and it looks like the MasterClass links are up a day early:

http://area.autodesk.com/siggraph2011/masterclasses

Also it looks like Autodesk forgot to add the download link to the Python Module so I've added it here for the time being until they sort the site out:


AnimationBinder.py 

Hope you enjoy....and yes you do have to register to see them, I think they're tracking numbers.

If you're having issues logging in please be aware that when you've registered you have to logout and log back in to view it, as per the banner that Autodesk put up which nobody, including me has read:





Mark

Thursday, August 4, 2011

MasterClass - Live Animation Binding

A few folk have mailed to ask when the MasterClass is being presented so I thought I'd do some blatant self promotion and spill the beans...... The MasterClasses are now online only, Autodesk figure they get a bigger audience this way and it stops me looking like an arse doing it live! (well, less of an arse anyway!) It should go live on TheArea under their Siggraph feed on Tuesday 9th. Here's the basic outline, although it got expanded slightly since this into using HIK as an intermediate object, and mapping to raw optical moCap data. Hope you find it useful!

"This Master Class will outline a method of transferring character animations between any source data and a given animation rig using a binder template file. This method was originally designed to enable Motion Capture data to be mapped to our in-house rigging systems whilst allowing for easy manipulation, but quickly evolved into a retargeting system in its own right. In the most basic form it allows for MoCap fbx files to be dropped directly onto your animation rigs. However, expanding the technique allows you to transfer animations between characters even when their skeletal structures and proportions are completely different. Because it relies on a Binder File and isn't code based it gives you the flexibility to manage any skeleton structure, allowing you to add custom bind nodes between any character specific joint and it's relative Rig Controller. Finally because the bind is a preset file it makes it very easy to bulk process animations, casting CharacterA's animation library straight to CharacterB."

Wednesday, July 13, 2011

Lost Animation when loading Referenced Rigs

This is Particularly relevant to referenced Rigs which have characterSets.

So this has come up a few times on the forums and I've also had emails asking how to fix it so thought I'd drop some info up here. The issue is that at some point the referenceEdits that connect Animation Data to a referenced rig can get broken or corrupted. This means you can be animating away all day, saving incrementals as you go, completely unaware that when you load this scene in, all animation will be lost..or so it would seem.

see this post recently:
http://forums.cgsociety.org/showthread.php?f=7&t=990314

The issue is usually the referenceEdits themselves. What sometimes happens is that the 'connectAttr' block in the referenceEdits gets blanked. We have no idea why, neither does Autodesk, it's completely random. Its also more common on files that came from 2010 and have been loaded in 2011. It also was an issue with rigs that had characterSets on the early release of 2011 IF you were using AnimLayers. (pre hotfix2)

So what to look for?

If you open up the Reference Editor then go to file>referenceEdits. In there you should get a list of all the edits performed since that file was initially referenced in. It's basically a macro that the file load uses to reconstruct the file. So, take a look in the list, see if you still have a large 'connectAttr' block. These should be the connections from the characterSet (placeholder list) to the anim curves themselves. If these edits get corrupted then as I said, you can spend all day saving incremental saves which are all broken but you wouldn't have been aware of them until you reloaded the scenes and the reference list got re-passed.

Now there are some good things to help you. Firstly the fact that the connections aren't there doesn't mean that there's no link from the anim curves to the reference. What happens is that the curves will be left connected to the references RN reference node. If you graph the referenceNode in the hypershade you should still see the connected anim data. It's what happens when you unload a reference, the anim data is cast back to the referenceNode for safe keeping.

So, graph the data, see if it's there, look at the referenceEdit list, see if it is correct or not. If you have no 'ConnectAttrs' then its the same issues we have.

Fixing it is a different issue. Basically we need to write a little tool which spins through the characterSet plugs, then the animCurves left connected to the RN node, does a nameMatch, then reconnects the data. The following dropped into a Python script Tab should do it, just select the characterSet you want reconnected!

import pymel.core as pm
import maya.cmds as cmds
cSet,type=pm.ls(sl=True,st=True)
refNode=cSet.referenceFile().refNode

if not type=='character':
   raise StandardError('You must select a CharacterSet to reconnect')
if not refNode:
   raise StandardError('Given characterSet is not from a referenced file')

animCurves=refNode.listConnections(type='animCurve',s=True)
cSetPlugs=pm.aliasAttr(cSet,q=True)

for plug in cSetPlugs[::2]:
   for anim in animCurves:
       if anim.split(':')[-1].endswith(plug):
           print '%s >> %s' % (anim,plug)
           pm.connectAttr('%s.output' % anim,'%s.%s' % (cSet,plug),force=True)

Simple but effective fix to get round the bug. I think in light of the amount of people posting things like this I'll follow this up with the Maya dev team again. We get this maybe once a month if that, actually probably less than that now we're all on 2011SAP release.

hope that helps folks. I know, referencing is like a black art, god knows I had enough help 7 or 8 years ago when we first started with referenced pipelines.... so thought I'd share the Bug work around.


Mark

Friday, July 8, 2011

MasterClass - FINISHED!

Autodesk MasterClass 'Live Animation Binding':

Damn that took a lot of work, hope its worth it and people actually find it interesting. So hopefully in the next few weeks it'll be up on the Area just before Siggraph, not sure when Autodesk start the advertising push so keep your eyes open for it. Think I deserve a beer now, might even treat myself to a nice bottle of single malt...