Skip to content

Instantly share code, notes, and snippets.

@TheBloke
Last active September 8, 2020 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBloke/f17a3594a60e0990205f20825d493b1c to your computer and use it in GitHub Desktop.
Save TheBloke/f17a3594a60e0990205f20825d493b1c to your computer and use it in GitHub Desktop.
diff --git 1/Downloads/MakeLocal2/MakeLocal/Scripts/support/Loader_MakeLocal.lua 2/Library/Application Support/Blackmagic Design/Fusion/Scripts/support/Loader_MakeLocal.lua
index 1d43afb..408e86f 100644
--- 1/Downloads/MakeLocal2/MakeLocal/Scripts/support/Loader_MakeLocal.lua
+++ 2/Library/Application Support/Blackmagic Design/Fusion/Scripts/support/Loader_MakeLocal.lua
@@ -53,7 +53,7 @@ SEPARATOR = package.config:sub(1,1) -- Folder separator used by the Operating Sy
local PLATFORM = (FuPLATFORM_WINDOWS and 'Windows') or (FuPLATFORM_MAC and 'Mac') or (FuPLATFORM_LINUX and 'Linux')
COMPDEPTH = 2
-ASSETFOLDER = [[elements\]]
+ASSETFOLDER = (PLATFORM == 'Windows') and [[elements\]] or [[elements/]]
function split(strInput, delimit)
@@ -120,9 +120,9 @@ if not tool then tool = comp.ActiveTool end
-- Get clip path
local attrs=tool:GetAttrs()
local path = tool.Clip[tu]
-path = string.gsub(path, '/', '\\')
+if PLATFORM == 'Windows' then path = string.gsub(path, '/', '\\') end
tool:SetData("source", path)
-local elemtable = split(path, "\\")
+local elemtable = split(path, SEPARATOR)
-- Store current Trim points
local trimIn = tool.ClipTimeStart[tu]
@@ -150,7 +150,7 @@ local k = 0
-- Find last entry in table
for i,j in ipairs(elemtable) do
- --print(j)
+ print(j)
k = i
end
@@ -184,11 +184,11 @@ end
--print("Parsing comp path:")
local fp = parseFilename(composition:GetAttrs().COMPS_FileName)
-local pathtable = split(fp.FullPath, "\\")
+local pathtable = split(fp.FullPath, SEPARATOR)
k = 0
for i,j in ipairs(pathtable) do
- --print(j)
+ print(j)
k = i
end
@@ -200,11 +200,11 @@ local currentPath = ""
local targetPath = ""
for i=1, pathdepth-COMPDEPTH do
- currentPath = currentPath..pathtable[i]..SEPARATOR
- targetPath = targetPath..elemtable[i]..SEPARATOR
+ if pathtable[i] then currentPath = currentPath..pathtable[i]..SEPARATOR end
+ if elemtable[i] then targetPath = targetPath..elemtable[i]..SEPARATOR end
end
-print(currentPath)
-print(targetPath)
+--print(currentPath)
+--print(targetPath)
if currentPath == targetPath then
@@ -220,7 +220,7 @@ local dialog = composition:AskUser("", {
path = ""
for i,j in ipairs(elemtable) do
- path = path..j.."\\"
+ path = path..j..SEPARATOR
end
local newlocation = ""
@@ -260,7 +260,7 @@ else
end
end
-tool.Clip = newlocation.."\\"..elfile
+tool.Clip = newlocation..SEPARATOR..elfile
print("Setting In/Out Points:")
print("Global Out = "..globalOut)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment