Showing posts with label Maya. Show all posts
Showing posts with label Maya. Show all posts

Wednesday, November 20, 2013

BUG: keyframe cmd with option flag

import maya.cmds as cmds
cube=cmds.polyCube()[0]
cmds.setKeyframe(cube,t=[0,8,25])
cmds.keyframe('%s_visibility' % cube, edit=True, r=True, timeChange=5, time=(0,8), option = "insert")

I'm trying to add to the Red9 animTools and want to be able to offset an entire hierarchies animations in one go, this is already supported however I want to add the ability of specifying a timeRange. Imaging you have a huge chunk of anim data and want to shift a section of it for a character by 10 frames. Currently shifting keys in the timeline won't ripple, it uses the segmentOver and causes a mess. Also you need to have all the objects selected when doing it and there's no numeric input. So I want to add it to the offestTime code.

This is all up and running except I've hit another crash bug, 100% repeatable crash and it boils down to the 'option' flag as used above. Give it a go, boom. Now I accept that in this case the sparse keys are an issue, but really the code should catch this.

cheers

Mark

Wednesday, July 3, 2013

Another Maya Bug - Resample curve major issues




Hopefully you've all seen the new interactive curve filtering I've been working on for the Red9 StudioPack linked above, if not I recommend you watch it if you're ever dealing with dense MoCap data.

Anyway as I was doing this I noticed another bug in the way Maya is managing curve data, thought I had to share this to warn all you animators of the effect of using the 'resampleCurve' to run a bake on dense data.



Ignore the UI, this is a prototype of a new build which will manage filtering on steps, something that's been requested by a few people. What you're seeing here is just the slider pumping values directly into the standard Maya Resample Curve option....what the way the curve shifts in time as you increase the steps!!!!!!

Don't believe me, try it!

I've logged this as a bug so we'll have to see what happens.

cheers

Mark

Friday, June 29, 2012

BUG: Just to confirm!!!

2013 SAP rotate Order, here you go! Not good, do NOT INSTALL for animations as you're going to be in a world of pain with this release. Confirmed as a bug with AD.

MAYA 2013SAP : BUG: rotateOrders from Mark Jackson on Vimeo.

Thursday, June 28, 2012

BUG 2013 - Huge Bug for Animation

WARNING: we've, or rather Brad's just found a kick ass bug in 2013 SAP release. The rotation orders are broken, doesn't matter what you change them too, gimbal still happens as if it were set to xyz order. Kind of a major bug me thinks, see what AD have to say about it. It's fine in the initial 2013 release.

Tuesday, January 10, 2012

fileDialog2 in Maya2012

Just thought I'd point out a change in the Maya fileDialog2 command return in 2012. So lets say you run the following and in the dialogue you type in a filename 'BloodyGreat' but don't add any file extension
import maya.cmds as cmds
print cmds.fileDialog2(fm=0)[0]
In Maya2011 the return would be what ever the path you browsed to + 'BloodyGreat' but in 2012 the return now handles filenames without extensions by adding .* to the path, so the return would now be 'BloodyGreat.*' This has broken a number of our old UI's as we expect to be able to strip the extension off inorder to force the correct one. Easy fix, but a bugger to find the bug in the first place!

Our issue was that we were using `substitute $ext $filepath ""` so now that the $ext is .* you're substituting a wildcard for nothing, which returns, NOTHING!

One last thing to point out with this, if you'd passed in any fileType filters to the command then the return will pick the current type and return that extension, which I guess is a good thing. This .* is only when the dialog is set to 'All Files' Mark

Tuesday, October 25, 2011

MasterClass finally on Vimeo

Finally added the MasterClass to Vimeo for you all to enjoy... thanks for watching!
Autodesk MasterClass - Live Animation Binding from Mark Jackson on Vimeo.
Don't forget the Toolkit link below

Monday, October 17, 2011

MasterClass update

I've been asked by a few people for a version of the MasterClass code that will run in earlier versions of Maya. The code I shipped originally relied on PyMel as well as Python 2.6 so wouldn't run under Maya 2009. I'm just finishing converting the module, no bug deal really. Hopefully should have a version ready in the next day or two.

cheers

Mark

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 ); }

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

Thursday, May 26, 2011

Another day, another bug....

So I've been testing Maya2012 to see if it's ready to push out to the studio and found a couple of killer bugs.

#Bug:CharacterSets and GraphEditor
The first is a true show-stopper. If you have any node linked to characterSets, the graphEditor fails to show you your animation curves for the transform correctly. No stacked view, no curves unless you select each channel separately. No 'F' frame-all. Nothing. Kind of stops us in our tracks seeing as all our Rigs link via a characterSet. Hopefully this will be fixed in the next HotFix.

#Bug: HumanIK setAttr/channelBox/callback
So let's say you have a HumanIK Rig in 2012 and you move one of the IK effectors, now you'll see the callback where the rig only updates on mouse release, this is a limitation they put in for performance reasons apparently. But crutially if you try and do anything under the hood, or even changing data in the channelBox, this call back prevents any of the attributes from being modified. Seriously try it, grab an IK effector on the HIK Rig and just try changing a value in the channelBox....ooops!

So let's say you were trying to setAttr in code, the only way to do this is to wrap the call in context that Maya is internally calling... and this is selection sensitive too.

select the control....
hikManipStart(1,1); //(trans,rots)
do something.......
hikManipStop;

Not a good day for 2012.. coffee!

Sunday, April 3, 2011

Maya Bug: pointOnPolyConstraint

I was playing over the weekend and found a bug in the pointOnPolyConstraint code that ships with Maya2011, it doesn't support namespaces. Just to clarify, if you select a component, then a transform and use the 'constrain>point on poly' menuItem it'll fail on source objects with namespaces. The bug is in the Python code that assembles the command prior to passing it to the mel scope. Reading through this you have to query why the hell they build up the commands like this, built it in python, then pass a string back to mel to then run and eval on the string?? Why the hell not just run it from the python scope?

Anyway, the problem file is this one:

C:\Program Files\Autodesk\Maya 2011 Subscription Advantage Pack\Python\lib\site-packages\maya\app\general\pointOnPolyConstraint.py

Around line 18 there's a .split() to get the node name back, unfortunately in the constraint node that gets generated it doesn't support the nodes namespace in the attributes that get generated and the command fails. Easy to fix, open the file up and replace the following:

name = strings[0].split( '.' )[0]
#replace with the following
name = strings[0].split( '.' )[0].split(':')[-1]

Fixes it. Another one to log with support. Not yet tried it on Maya 2012 but I suspect the same will be the case

Mark

Wednesday, November 17, 2010

Hidden Audio functionality in Maya2011

New Audio Handling in Maya2011

I wanted to point out a couple of hidden features for Audio handling that aren't in the docs and that kind of slipped into Maya2011 via the CameraSequencer upgrades. The audio node in Maya used to just have 2 main attrs, path and offset, that was all you could do, point it to a wav and set the start time. If you now look at an audio node in 2011 there's a ton of new attributes to control the behaviour of the audio. Unfortunately most of this is hidden unless you're using the AttributeEditor or CameraSequencer, in which case RMB on a sound you'll get access to Mute, that's about it. In the Trax sound is still just a simple, poorly supported add-on..... or is it?



Firstly there's now a Mute attr, so you can mute out those audio's you don't want, this displays in both Sequencer and Trax, but for Trax you have to set the attr direct.  Now for the more complex stuff. If you're used to editing in Trax you're used to sliding the start and end times, trimming the clip etc. There's no UI support for Sound for any of this, BUT you can still do it via the attr's directly.



So, 2 sets of attrs work together. Offset and EndFrame, SourceStart and SourceEnd. The Offset is no longer what it used to be, this is the start of the clip nothing more. If like us you have tons of sound code designed to offset audio then it's all stuffed! you need to manage both Offset and EndFrame at the same time now in order to shift a sound node along time.

However, using the Source attrs you can now trim the audio, directly in Maya..... there's not a lot been mentioned about this and we only found it by accident.

 The 2 sound nodes here are the same bit of audio, but the lower has been offset to start at frm 120, because the source start has also been moved to frm120 the audio is still in sync with the original one, just trimmed to start later on. The end source has been moved in, trimming the audio to stop earlier. You can also add silence to the start of the sound if needed.

Thought I'd share that as it's actually going to be really useful, think I'll push for the UI  integration from Autodesk so that the sound node is treated like the clips are, about to be trimmed directly rather than having to set the attrs up manually.

Mark