Script to move in timeline to frame Zero

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
negroclarito
Posts: 123
Joined: Sun Feb 28, 2010 6:38 am

Script to move in timeline to frame Zero

Post by negroclarito »

Hi everyone.
I want to find a script to move in timeline to frame Zero.
I know there is a mynd tools plugin that copies the frames without going to frame zero.
The one I need is a button that transports me to frame zero and it can work in 13.5. I think there was one before, but I can't find it.

Thank you
User avatar
Greenlaw
Posts: 9269
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Script to move in timeline to frame Zero

Post by Greenlaw »

You can use Design Mode for that. The shortcut is Shift-Control D. This sends you to frame 0. Use the shortcut again and it sends you back to the animation frame you came from.

In MQC, there's a Design Mode button than can be click-toggled with a pen or mouse.
Last edited by Greenlaw on Sun Jun 27, 2021 4:09 pm, edited 1 time in total.
User avatar
Hoptoad
Posts: 618
Joined: Sun Jan 03, 2016 4:19 pm
Location: Florida

Re: Script to move in timeline to frame Zero

Post by Hoptoad »

Ooo, I like this shortcut. Thanks for posting.

Gems like this is why I browse the forum.
Daxel
Posts: 996
Joined: Wed Mar 27, 2019 8:34 pm

Re: Script to move in timeline to frame Zero

Post by Daxel »

I think that you can alternatively use control + space to switch to design mode.
User avatar
SimplSam
Posts: 1048
Joined: Thu Mar 13, 2014 5:09 pm
Location: London, UK
Contact:

Re: Script to move in timeline to frame Zero

Post by SimplSam »

negroclarito wrote: Sun Jun 27, 2021 8:33 am ..
The one I need is a button that transports me to frame zero and it can work in 13.5.
..
I thought I would knock up a simple Go to frame Zero script for those tablet warriors who don't like keyboards.

ZIP Package (with Icon): https://github.com/SimplSam/moho-go-zer ... o_zero.zip

Code: Select all

-- **************************************************
-- Tool to emulate Design mode keyboard toggle
-- Go to frame 0 and back
-- **************************************************

ScriptName = "SS_GoZero"

-- **************************************************
-- General information about this script #510628
-- **************************************************

SS_GoZero = {}

function SS_GoZero:Name()
    return 'Go to Frame Zero'
end

function SS_GoZero:Version()
    return '1.0'
end

function SS_GoZero:UILabel()
    return 'Go to Frame Zero'
end

function SS_GoZero:Creator()
    return 'SimplSam'
end

function SS_GoZero:Description()
    return "Toggle timeline to Frame 0 (Design mode) and back"
end


-- **************************************************
-- Is Relevant / Is Enabled
-- **************************************************

function SS_GoZero:IsRelevant(moho)
    return true
end

function SS_GoZero:IsEnabled(moho)
    return true
end

-- **************************************************
-- The guts of this script
-- **************************************************

function SS_GoZero:Run(moho)
    if (moho.frame ~= 0) then
        SS_GoZero.lastFrame = moho.frame
        moho:SetCurFrame(0)
    else
        if (SS_GoZero.lastFrame) then
            moho:SetCurFrame(SS_GoZero.lastFrame)
        end
    end
end
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
negroclarito
Posts: 123
Joined: Sun Feb 28, 2010 6:38 am

Re: Script to move in timeline to frame Zero

Post by negroclarito »

Greenlaw wrote: Sun Jun 27, 2021 8:57 am You can use Design Mode for that. The shortcut is Shift-Control D. This sends you to frame 0. Use the shortcut again and it sends you back to the animation frame you came from.

In MQC, there's a Design Mode button than can be click-toggled with a pen or mouse.
Yes... It's working. PERFECT!!!. This is what I need. This can save a lot of time.
Thank you :D
Last edited by negroclarito on Mon Jun 28, 2021 3:11 pm, edited 1 time in total.
User avatar
negroclarito
Posts: 123
Joined: Sun Feb 28, 2010 6:38 am

Re: Script to move in timeline to frame Zero

Post by negroclarito »

SimplSam wrote: Mon Jun 28, 2021 4:51 am
negroclarito wrote: Sun Jun 27, 2021 8:33 am ..
The one I need is a button that transports me to frame zero and it can work in 13.5.
..
I thought I would knock up a simple Go to frame Zero script for those tablet warriors who don't like keyboards.

ZIP Package (with Icon): https://github.com/SimplSam/moho-go-zer ... o_zero.zip

Code: Select all

-- **************************************************
-- Tool to emulate Design mode keyboard toggle
-- Go to frame 0 and back
-- **************************************************

ScriptName = "SS_GoZero"

-- **************************************************
-- General information about this script #510628
-- **************************************************

SS_GoZero = {}

function SS_GoZero:Name()
    return 'Go to Frame Zero'
end

function SS_GoZero:Version()
    return '1.0'
end

function SS_GoZero:UILabel()
    return 'Go to Frame Zero'
end

function SS_GoZero:Creator()
    return 'SimplSam'
end

function SS_GoZero:Description()
    return "Toggle timeline to Frame 0 (Design mode) and back"
end


-- **************************************************
-- Is Relevant / Is Enabled
-- **************************************************

function SS_GoZero:IsRelevant(moho)
    return true
end

function SS_GoZero:IsEnabled(moho)
    return true
end

-- **************************************************
-- The guts of this script
-- **************************************************

function SS_GoZero:Run(moho)
    if (moho.frame ~= 0) then
        SS_GoZero.lastFrame = moho.frame
        moho:SetCurFrame(0)
    else
        if (SS_GoZero.lastFrame) then
            moho:SetCurFrame(SS_GoZero.lastFrame)
        end
    end
end
The shortcut Greenlaw told me is working perfect. I also want to try also this script.
Thank you :D
Post Reply