negative keyframes

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
ggoblin
Posts: 266
Joined: Wed Jan 19, 2022 2:09 pm

negative keyframes

Post by ggoblin »

I read about all the headaches negative keyframes cause in slowing moho to a grind.

When I was looking up the syntax for creating a shape I came across this entry in the mohoscripting.com website:

Image
https://mohoscripting.com/methods/82

Which if correct suggests that when creating a shape if we don't give a frame number for which frame we want to create the shape on, Moho will default to creating it on frame -1,000,000 , ie negative 1 million.

Just wondering is this the reason we are getting negative frames?
ggoblin
Posts: 266
Joined: Wed Jan 19, 2022 2:09 pm

Re: negative keyframes

Post by ggoblin »

Just thinking about it, its probably just a typo..
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: negative keyframes

Post by SimplSam »

ggoblin wrote: Sat Jun 25, 2022 10:01 pm Just thinking about it, its probably just a typo..
or not ...

It is like the earliest time the asset can be added to the timeline. i.e. At the absolute beginning. Moho has a -/+ 1 million frame limit.
Moho 14.1 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.1 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam


Sam
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: negative keyframes

Post by synthsin75 »

Yeah, I don't think it's a typo.

When I wrote my script to delete negative keyframes, shape keys didn't seem to be the major culprit. At least in the problem files I was testing on at the time.

BTW, the negative timeline is technically longer that -1 million frames. I have at least one script in development that intentionally writes keys beyond -1 million, so my negative keyframes script won't touch them.
ggoblin
Posts: 266
Joined: Wed Jan 19, 2022 2:09 pm

Re: negative keyframes

Post by ggoblin »

So if its not a typo, but by design, whats the purpose? I'm guessing that since it been around before ver 9.5 according to the docs and its clearly documented, then its not a bug and it must serve some purpose?

With my very limited understanding I would have thought the default frame to create a new shape would be frame 0?

Does that mean if I CreateShape without specifying a frame and then say on frame 24 I keyframe a 90 degree rotation of that shape. Moho will have to interpolate 1,000,024 frames to rotate my shape by 90 degrees? One way to kill any application.. :D
User avatar
synthsin75
Posts: 9981
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: negative keyframes

Post by synthsin75 »

It likely exists so, if you move the layer on the sequencer, the shape still exists in the layer's negative timeline that you could pull into the document's positive timeline.

But since frame zero is keyed as soon as you add a keyframe elsewhere, there isn't much risk of shapes interpolating from far in the negative timeline.


We've never been able to isolate what causes the problematic negative keyframes. Otherwise I'm sure Lost Marble would have addressed it by now.
Post Reply