Page 1 of 1
Using Clear()?
Posted: Sat May 21, 2011 3:27 am
by Dodgy
Hiya,
I'm trying to clear the bone pos channel, but I keep getting an error. here is what I'm doing:
mybone.fAnimPos:Clear()
as
mybone.fAnimPos:StoreValue()
works, and Clear is in the same class as StoreValue, so I thought they'd be the same....
Anyone use this and can tell me how to get it to work?
Thanks,
Mike
Re: Using Clear()?
Posted: Sun May 22, 2011 11:30 pm
by Rudiger
Dodgy wrote:Hiya,
I'm trying to clear the bone pos channel, but I keep getting an error. here is what I'm doing:
mybone.fAnimPos:Clear()
as
mybone.fAnimPos:StoreValue()
works, and Clear is in the same class as StoreValue, so I thought they'd be the same....
Anyone use this and can tell me how to get it to work?
Thanks,
Mike
When I was updating my Nudge scripts for version 7, I noticed that the Clear method now requires an integer argument whereas before it didn't require any arguments at all. The first value I tried was 0, which appeared to work at first, but I noticed some problems when the layer was shifted by the Sequencer. As a wild guess, I then tried layer:TotalTimingOffset(), and it seemed to do the trick, at least for my particular use of it.
You can try this value as well, but realise that it's a total guess on my part, and I have no idea what this parameter is actually for. Otherwise, you can try emailing Mike Clifton and ask him what parameter we should provide for this method.
Posted: Mon May 23, 2011 12:10 am
by Dodgy
Thanks Rudiger, I'll try emailing him and let you know the response. This is for a complementary script for Morph dials, to key the phoneme bone using a papagayo dat file.
Posted: Mon May 23, 2011 12:27 am
by Rudiger
Dodgy wrote:Thanks Rudiger, I'll try emailing him and let you know the response. This is for a complementary script for Morph dials, to key the phoneme bone using a papagayo dat file.
Neat!
Posted: Mon May 23, 2011 12:40 am
by Dodgy
The rest of it works already, I just need to clear the animation channel before applying the keys. I could just cycle through and delete them by hand, but it'd be nice to know why this doesn't work, or if it's a bug.
Posted: Mon May 23, 2011 4:28 pm
by Dodgy
Try using:
mybone.fAnimPos:Clear(0)
A channel always needs at least one keyframe to store the initial
value. The number you pass to the Clear function tells the channel
what frame to keep as the only one. Typically, this is frame 0.
-Mike
It works, so I'm going to upload the script soon as I can get an ftp connection
