View Full Version : Create keys on non Pos Rot Scale channels

07-19-2010, 12:15 PM
I've been hunting through the lscript docs lately and I have been having a hard time finding info on creating keys on channels that aren't Pos Rot or Scale. I am currently trying to figure out how to create a key on the RotItemBlend and PosItemBlend channels of an object (which are found in the motion modifier panel). Can anyone shed some light on this?


07-19-2010, 04:46 PM
Through the channel oa.

But in order to do it on RotItemBlend etc, you have to find it first. You do that by traversing the channel tree (See GE for the visual representation) using firstChannel(), nextChannel() and ChannelGroup(). The last one is what allows you to skip into channelgroups aswell as go to the next groups within the same group. You likely have to look at some later release notes on ChannelGroup() because it was far from complete on inception. Why they didnt just do firstChannelGroup() and nextChannelGroup() is beyond me. It certainly would have been alot easier to read. From the looks of thing, it seems NT Team took the easy way out and didn't bother with groups very much lately. Your luck.

generic {
keyvalue = 1.1234;
item = Scene().firstSelect();
chan = item.firstChannel();
while(chan && chan.name != "Ctrl.RotItemBlend") {
chan = item.nextChannel();
if(chan) {
chan.createKey(Scene().currenttime, keyvalue);

07-19-2010, 04:53 PM
thanks evenflcw. ill take a look into it. at least now I have somewhere to start from :thumbsup:

07-19-2010, 04:55 PM
I edited the previous post. Fleshed it out abit. You're welcome.

07-19-2010, 05:09 PM
Much appreciated, thanks again