Page 1 of 1

Can I make the animation in the timeline stop at the end?

Posted: Thu Dec 29, 2022 11:06 am
by Hugging_Bear
Hi guys,

I've what might be a very stupid question. Is there a way to make the animation stop at the end of the blue area of the timeline? Mine keeps looping the animation endlessly. That isn't a problem while working on a fairly short scene (a few seconds). But I'm working at the end of a fairly long scene and get annoyed that I have to keep pressing 'Jump to end' button.
I know, I can use the arrow keys to 'scrub' the timeline but that brings a 'slow motion' effect and I would like to see the animation at a more natural speed.
I looked at the preference menu but couldn't find any settings there. I would be surprised if a sophisticated program like Moho doesn't have already an option for such a simple problem.

Thanks in advance!

Re: Can I make the animation in the timeline stop at the end?

Posted: Thu Dec 29, 2022 12:13 pm
by slowtiger
I assume that you're talking about the playback in project view.

You can always shorten the area of playback by alt-right-cllick and alt-left-click in the frame number line of the timeline.

Making Moho play back only once is not possible.

Re: Can I make the animation in the timeline stop at the end?

Posted: Thu Dec 29, 2022 2:58 pm
by hayasidist
This is a layerscript. It will stop playback after one run. It affects only the document in which it is active. You still need to press "stop" to reset it.

Add it to ANY layer that is visible (layerscripts only run if the layer is evaluated) OR add it to a "dummy" layer and use layer visibility to enable / disable its functionality.

Code: Select all

function LayerScript(moho)
	local myKey = "hs_start_" .. moho.document:Name()
	local wasPlaying = "hs_play_" .. moho.document:Name()
	local stop = _G[wasPlaying] and not moho:IsPlaying()
	local stopped = not moho:IsPlaying() and not _G[wasPlaying]
	if stop then
		MOHO.MohoGlobals.PlayStart = _G[myKey]
	end
	if stopped then 
		_G[myKey] = MOHO.MohoGlobals.PlayStart
	end
	if moho:IsPlaying() then
		MOHO.MohoGlobals.PlayStart = moho.frame
	end
	_G[wasPlaying] = moho:IsPlaying()
end
any issues let me know!

Re: Can I make the animation in the timeline stop at the end?

Posted: Fri Dec 30, 2022 10:35 am
by Hugging_Bear
slowtiger wrote: Thu Dec 29, 2022 12:13 pm I assume that you're talking about the playback in project view.

You can always shorten the area of playback by alt-right-cllick and alt-left-click in the frame number line of the timeline.

Making Moho play back only once is not possible.
Thanks Slowtiger! You saved my day! (and many to follow). The alt-left-click tip was just what I needed. I don't mind the looping at the last few seconds of the scene, as long it isn't jumping back at its very beginning.

Re: Can I make the animation in the timeline stop at the end?

Posted: Fri Dec 30, 2022 10:38 am
by Hugging_Bear
hayasidist wrote: Thu Dec 29, 2022 2:58 pm This is a layerscript. It will stop playback after one run. It affects only the document in which it is active. You still need to press "stop" to reset it.

Add it to ANY layer that is visible (layerscripts only run if the layer is evaluated) OR add it to a "dummy" layer and use layer visibility to enable / disable its functionality.

Code: Select all

function LayerScript(moho)
	local myKey = "hs_start_" .. moho.document:Name()
	local wasPlaying = "hs_play_" .. moho.document:Name()
	local stop = _G[wasPlaying] and not moho:IsPlaying()
	local stopped = not moho:IsPlaying() and not _G[wasPlaying]
	if stop then
		MOHO.MohoGlobals.PlayStart = _G[myKey]
	end
	if stopped then 
		_G[myKey] = MOHO.MohoGlobals.PlayStart
	end
	if moho:IsPlaying() then
		MOHO.MohoGlobals.PlayStart = moho.frame
	end
	_G[wasPlaying] = moho:IsPlaying()
end
any issues let me know!
Thanks for your tip but I'll go with slowtiger's solution. Yours seems a bit complicated and a lot of work.