View Full Version : Inserting time into all keyed tracks in scene
10-27-2005, 10:14 AM
I want to write a function that will insert time into all the keyed tracks in a scene, at a given point, lets say the sliderTime. In other words, I want to be able to move all keys that are to the right of the currentTime to the right by a given amount.
Is there a simple way to do this (such as a global array that stores all the keys in the scene), or do I need to step through every conceivable parameter in the scene to try to find all the keys?
Also, I'd like to be able to avoid opening a track view if possible. I want the operation to happen "behind the scenes" so to speak.
10-27-2005, 11:44 AM
I've modified another script of mine to do what you need. It searches through an array of objects looking for animated tracks and shifts them accordingly. Read inside the script for more information. It is a function not a macroscript, if you think you're going to use it that much let me know and I'll write you a handy interface.
10-27-2005, 03:17 PM
Thanks, Joshua, but I'm affraid I didn't explain my problem completely.
I don't just need node keys to be shifted, but ALL keys that may be in the scene. This could include keys in the channels of sound, video post, global tracks, environment, render effects, render elements, renderer, global shadow parameters, scene materials, medit materials, and of course, objects (I read this list straight off the track view).
In other words, I want to write a tool that can insert time into the total scene, and I can have confidence that ALL tracks in the scene have this time inserted so everything says synced correctly.
Is there not some global array of key values that I can just walk through and modify times for?
10-28-2005, 11:57 AM
I was afraid that might be the case, and I knew of the limitation. I'll fix it when I can find a way to access the scene root node and then it's subanims. I'm sure it's there, I just can't remember it. I've been working with trackviewnodes and sceneroot but I'm missing the mark! Maybe someone can remind me...
10-28-2005, 03:22 PM
Thanks, that was the same problem I was having. I just couldn't get those things to do anything usefull for me!
10-28-2005, 04:02 PM
How far did you get? might be something in there to job my memory.
10-28-2005, 04:52 PM
Not very far. RootNode just seems to be a parent to all objects in the scene whose .parent property is undefined (go figure!). Doesn't seem to contain non-node tracks.
TrackViewNodes appears to allow access to three of the main tracks in the track view: Video Post, Global Tracks, and Raytrace Engine Globals. These are accessed with index numbers, such as trackViewNodes etc...
It is interesting to note that when using the dope sheet, if you turn on Modify Subtree and Modify Child Keys, you can insert/delete/slide keys around on the World track and everything in the scene that's keyframed is affected, including animated materials, render effects, etc. That's essentially what I want to be able to do with code, without having to launch a track view (although if manipulating a track view UI with Maxscript was the only way to do this in code, I would do it).
10-28-2005, 04:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.