ScriptSpot

Forum topic · Scripts Wanted

Exporting Key Frame Data

By ST3D2020 · 2011-01-06

Description

I’d like to export a scene object list with respective start and end key frame numbers that i can then copy or modify. Seems simple enough but i don't know where to start. Any ideas?

Comments (7)

start from the help

Anubis · 2011-01-19

Well, everything is simple at all if you know it, but this description is still blured for me. You need only first and last key? on each animated property of all objects (and their modifiers)?

There is enough freelancers ready to write such scripts, but you said that you just looking from where to start, and I presume you want to write it alone, so... their is enough info in the help (check for controllers and keys), but lets append a few words though.

1st, here is some very basic example (just for illustration)

b = box name:"foo" -- create box
-- animate Z pos at time 10 and 30
with animate on at time 10 b.pos.z = 20
with animate on at time 30 b.pos.z = 60

$foo.position.z_position.isAnimated -- true
$foo.position.z_position.controller.supportsKeys -- true

-- put MAXKeyArray to variable:
keys = $foo.position.z_position.controller.keys
-->> #keys(0f, 10f, 30f)
-- or the same as above but more shorter:
keys = $foo[3][1][3].controller.keys
 
keys.count -- 3
keys[1] -- 1st key
keys[3] -- last key, or...
keys[keys.count]

c = b[3][1][3].controller
at time keys[3].time c.value -- 60.0
keys[3].value -- 60.0
keys[3].time -- 30f

For Excel you can format to CSV files. And for the keys itself need to save 2 things - their time and value (key.time , key.value). Also need to decide how will 'save' the controller. If you use the full path, like for example '$Foo.position.z_position.controller' then this data CAN be applied back to object named 'Foo' AND it should has the same controller. OR you should design your workflow on how to identify the controllers (to can apply data from one to another). And so on...

Shortly to say, similar scripts are asked many times and if they was really simple then there will been a tons of them online, but here are possible many scenarios.

Hope this helps anyway.

[EDIT]
Here is a screen shot of my simple KeyEditor script that I use to edit, save to or update from CSV my keys. Not batch optimized (edit one controller at a time) but fits my needs.

KeyEditor

Attachments

I could use your KeyEditor

ST3D2020 · 2011-01-19

I'm not sure I could write a script that could do all that I'd like...but I could use your KeyEditor script is it on the site?

ah, sorry

Anubis · 2011-01-19

am not plane to share it, just post it to understand better what you ask.

ST3D2020 · 2011-01-20

It looks like what I'm after.
Let me know if you'll have it available anytime. I am willing to pay for it or your services.

ok

Anubis · 2011-01-21

check your mail box

Graph · 2011-01-07

how about an example of the formatting?

Wish lists

ST3D2020 · 2011-01-18

Something Excel would recognize or that I could cut and past showing:
Object or Group name
Keyframe in no.
Keyframe out no.

It would be nice if this list were an editable list in Max that would adjust existing animated object key frames in a table format.

Better that it could import a list of similar names and adjust the key frames of existing animated objects based on this imported list.

Even better that an imported list of objects with key frames creates dummy objects with start and end key frames using a simple modifier or visibility on and off at start and end numbers.

Imported and exported data could be interchangable.