Animation plot data

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  02 February 2013
Animation plot data


Does anybody know if there is a way to export the plot data from the graph editor in Maya? I can see the time/value plot data using Spreadsheet... from the Curves menu in the graph editor, but would like to be able to export this to create a graph in other software (such as MatLab or Excel) using time as the x axis and the value as the y axis.

Any ideas?


  02 February 2013
You can easily do this with a script, either MEL or Python. The latter would probably be recommendable due to it's more advanced string editing methods and most importantly the inclusion of an XML module.


here's some example python code. very simple, creates an xml on C: with the time/value information for every curve selected in the GraphEditor

import maya.cmds as cmds
from xml.dom.minidom import Document

xmlDoc = Document()

root = xmlDoc.createElement('curveData')

animCurves = cmds.keyframe(query=True, name=True, sl=True)

for c in animCurves:
	curveElement = xmlDoc.createElement('curve')
	curveElement.setAttribute('name', str(c))
	keyTimes = cmds.keyframe(c, q=True, tc=True)
	for t in keyTimes:
		frameElement = xmlDoc.createElement('frame')
		value = cmds.keyframe(c, time=(t,), q=True, vc=True)[0]
		frameElement.setAttribute('time', str(t))
		frameElement.setAttribute('value', str(value))
file = open('C:/animInfo.xml', 'w')

Last edited by Nyro : 02 February 2013 at 07:27 PM.
  02 February 2013
Built in method ( 'Not pretty')

File>Export[] choose move format.

Altho' if I had need to do something like this often I'd write/use something like what Nyro was kind enough to write above
  02 February 2013
Many thanks for the reply's. I couldn't find a built in method, not sure I fully understood the post, but I have Export All and Export Selection, and I think this just relates to the objects within the scene rather than plot data for the anim curves.

I tried the script and got this error...

# Error: IOError: 13 #

You'll have to excuse my dumbness, I've no experience with scripting.

Last edited by andyman121 : 02 February 2013 at 06:22 PM.
  02 February 2013
Can you turn on linenumbers in errors? You can do that in the script Editors menu.

But just by looking at the error, I'm guessing you either a) don't have a C: drive because you're not on Windows (are you using a Mac?) or b) you don't have file creation/write permission.
  02 February 2013
Hi, yes with line numbers this is the error:

# Error: line 1: IOError: file <maya console> line 27: 13 #

I am on windows and do have a C drive, and on my home PC so should have full permissions
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:30 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.