Redraw timeline to make new keyframes visible

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
Breinmeester
Posts: 294
Joined: Thu May 13, 2010 2:01 pm

Redraw timeline to make new keyframes visible

Post by Breinmeester » Mon Jan 18, 2016 9:57 am

I always run into this problem when im setting new keys on the timeline in LUA that it will only refresh and show the new keyframes when the timeline indicator is moved. Does anybody know that code that will make the keyframes show up in the timeline at the moment of creation? Thanks.
hayasidist
Posts: 2131
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Redraw timeline to make new keyframes visible

Post by hayasidist » Mon Jan 18, 2016 6:37 pm

I think it's moho:UpdateSelectedChannels() but that may be dependant on exactly which channels you're not seeing updated

http://www.aslua.com/index.php?show=met ... nels&id=58



there's also moho:NewKeyframe(channel)

http://www.aslua.com/index.php?show=met ... rame&id=57
Breinmeester
Posts: 294
Joined: Thu May 13, 2010 2:01 pm

Re: Redraw timeline to make new keyframes visible

Post by Breinmeester » Tue Jan 19, 2016 6:04 pm

Thanks. I got it working.

Code: Select all

moho:NewKeyframe(CHANNEL_BONE)
moho.layer:UpdateCurFrame()
For channel codes check the lm_channel_codes.lua in utilities folder.
Post Reply