- Posts: 13
- Joined: Fri Dec 25, 2020 8:18 pm
- Real Name: Pourang Kakouei
- Code: Select all
print("Set Step Value")
--==============================================================
-- Main()
--
-- Typical set-up for a script developed in an IDE. Sets globals
-- and connects to the active comp. Initializes UI Manger.
--==============================================================
function main()
-- get fusion instance
_fusion = getFusion()
-- ensure a fusion instance was retrieved
if not _fusion then
error("Please open the Fusion GUI before running this tool.")
end
-- Set up aliases to the UI Manager framework
ui = _fusion.UIManager
disp = bmd.UIDispatcher(ui)
-- get composition
_comp = _fusion.CurrentComp
SetActiveComp(_comp)
-- ensure a composition is active
if not _comp then
error("Please open a composition before running this tool.")
end
x = composition:AskUser("Set Frame Step Value", {
{"step", "Text", Name = "Frame Step Value: ", Default = 1, Lines = 1,},
} )
step = tonumber(x["step"])
if step then
comp:SetPrefs("Comp.Transport.FrameStep",step)
end
end
--======================== ENVIRONMENT SETUP ============================--
------------------------------------------------------------------------
-- getFusion()
--
-- check if global fusion is set, meaning this script is being
-- executed from within fusion
--
-- Arguments: None
-- Returns: handle to the Fusion instance
------------------------------------------------------------------------
function getFusion()
if fusion == nil then
-- remotely get the fusion ui instance
fusion = bmd.scriptapp("Fusion", "localhost")
end
return fusion
end -- end of getFusion()
main()
Save that as setStepValue.lua in your Scripts/Comp/ folder. When run, it will let you set the Step value to any number you like. Note it's not advisable to put a fractional framerate in there. If you're running at 23.976 or 29.97, just round it up and realize that you might have to manually correct for the drift occasionally.