From 59818ea30d9d0d49004c605857ff4bc14bbcb8ea Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Thu, 22 Feb 2018 11:47:06 +0100 Subject: [PATCH] Remove unused Fusion Comp scripts (discussed with team) --- .../Comp/colorbleed/SE_LoaderTweaker.lua | 107 ------------------ .../predivide_postmultiply_BC_and_CC.py | 25 ---- .../Comp/colorbleed/search_replace_paths.py | 107 ------------------ .../Comp/colorbleed/set_relative_paths.py | 96 ---------------- 4 files changed, 335 deletions(-) delete mode 100644 setup/fusion/scripts/Comp/colorbleed/SE_LoaderTweaker.lua delete mode 100644 setup/fusion/scripts/Comp/colorbleed/predivide_postmultiply_BC_and_CC.py delete mode 100644 setup/fusion/scripts/Comp/colorbleed/search_replace_paths.py delete mode 100644 setup/fusion/scripts/Comp/colorbleed/set_relative_paths.py diff --git a/setup/fusion/scripts/Comp/colorbleed/SE_LoaderTweaker.lua b/setup/fusion/scripts/Comp/colorbleed/SE_LoaderTweaker.lua deleted file mode 100644 index 0d54536d7d..0000000000 --- a/setup/fusion/scripts/Comp/colorbleed/SE_LoaderTweaker.lua +++ /dev/null @@ -1,107 +0,0 @@ ------------------------------------------------------------- --- Change various options in Loadertools, Revision: 2.1 --- --- --- place in Fusion:\Scripts\Comp --- --- written by Isaac Guenard (izyk@eyeonline.com) / Sean Konrad --- created : January 24rd, 2005 --- modified by Eric Westphal (Eric@SirEdric.de), February 2007 ------------------------------------------------------------- - - -MissingFramesOpt = {"Do Not Change", "Fail", "Hold Previous", "Output Black", "Wait"} -DepthOpt={"Do Not Change", "Format", "Default", "int8", "int16", "float16", "float32"} -GeneralOpt={"Do Not Change", "Off", "On"} -HoldOpt={"Do Not Change", "Set to..."} -PixelOpt={"Do Not Change", "From File", "Default", "Custom (set below)"} - -ret = comp.AskUser("SirEdric's Tweak-All-Loaders", { - {"AlphaSolid", "Dropdown", Options = GeneralOpt}, - {"PostMultiply", "Dropdown", Options = GeneralOpt}, - {"InvertAlpha", "Dropdown", Options = GeneralOpt}, - {"MissingFrames", "Dropdown", Options = MissingFramesOpt}, - {"Depth", "Dropdown", Options = DepthOpt}, - {"PixelAspect", "Dropdown", Options = PixelOpt}, - {"CustomPixelAspect", "Position", Default={1,1} }, - {"HoldFirstOpt", Name="Hold First Frame", "Dropdown", Options = HoldOpt}, - {"HoldFirst", Name = "Hold first Frame for", "Screw", Default = 0, Min = 0, Max=500, Integer = true}, - {"HoldLastOpt", Name="Hold Last Frame", "Dropdown", Options = HoldOpt}, - {"HoldLast", Name = "Hold first Frame for", "Screw", Default = 0, Min = 0, Max=500, Integer = true}, - {"Selected", Name = "Affect Selected Tools Only", "Checkbox", Default = 0} - }) - -if ret then - composition:StartUndo("SE_LoaderTweaker") - MyPixX=ret.CustomPixelAspect[1] - MyPixY=ret.CustomPixelAspect[2] - print(MyPixX.."bb".. MyPixY) - print() - print("SE_LoaderTweaker is about to change...") - print("...AlphaSolid to ["..GeneralOpt[ret.AlphaSolid+1].."]") - print("...PostMultiply to ["..GeneralOpt[ret.PostMultiply+1].."]") - print("...InvertAlpha to ["..GeneralOpt[ret.InvertAlpha+1].."]") - print("...Missing Frames to [".. MissingFramesOpt[ret.MissingFrames + 1].."]") - print("...Depth to ["..DepthOpt[ret.Depth+1].."]") - print("...PixelAspect to ["..PixelOpt[ret.PixelAspect+1].."]") - print("...CustomPixelAspect(if selected): X="..MyPixX.." Y="..MyPixY) - print("...Hold First Frame to ["..HoldOpt[ret.HoldFirstOpt+1]..": " .. ret.HoldFirst.."]") - print("...Hold Last Frame to ["..HoldOpt[ret.HoldLastOpt+1]..": " .. ret.HoldLast.."]") - if ret.Selected then - print("...... *** on selected tools only! ***") - end - print("---------------------------------------------------") - print() - - -- ((ret.Selected ==1)) will return true if the - -- selected checkbox is enabled..... - - for i, v in composition:GetToolList((ret.Selected == 1)) do - id = v:GetAttrs().TOOLS_RegID - MyName = v:GetAttrs().TOOLS_Name - if id == "Loader" then - print("Changing "..MyName.." Options:") - if ret.AlphaSolid > 0 then -- check for 'DoNothing' - print("MakeAlphaSolid set to: "..(ret.AlphaSolid-1)) - v.MakeAlphaSolid = (ret.AlphaSolid-1) - end - if ret.PostMultiply > 0 then -- check for 'DoNothing' - print("PostMultiplyByAlpha set to: "..(ret.PostMultiply-1)) - v.PostMultiplyByAlpha = (ret.PostMultiply-1) - end - if ret.InvertAlpha > 0 then -- check for 'DoNothing' - print("InvertAlpha set to: "..(ret.InvertAlpha-1)) - v.InvertAlpha = (ret.InvertAlpha-1) - end - if ret.MissingFrames >0 then -- check for 'DoNothing' - print("MissingFrames set to: "..(ret.MissingFrames-1)) - v.MissingFrames = (ret.MissingFrames-1) - end - if ret.Depth >0 then -- check for 'DoNothing' - print("Depth set to: "..(ret.Depth-1)) - v.Depth = (ret.Depth-1) - end - if ret.PixelAspect >0 then -- check for 'DoNothing' - print("PixelAspect set to: "..(ret.PixelAspect-1)) - v.PixelAspect = (ret.PixelAspect-1) - if ret.PixelAspect == 3 then - v.CustomPixelAspect={MyPixX, MyPixY} - end - end - if ret.HoldFirstOpt >0 then -- check for 'DoNothing' - print("HoldFirstFrame set to: "..(ret.HoldFirst)) - v.HoldFirstFrame = (ret.HoldFirst) - end - - if ret.HoldLastOpt >0 then -- check for 'DoNothing' - print("HoldLastFrame set to: "..(ret.HoldLast)) - v.HoldLastFrame = (ret.HoldLast) - end - - print(v:GetAttrs().TOOLS_Name) - end - end -composition:EndUndo(true) -end - -print() diff --git a/setup/fusion/scripts/Comp/colorbleed/predivide_postmultiply_BC_and_CC.py b/setup/fusion/scripts/Comp/colorbleed/predivide_postmultiply_BC_and_CC.py deleted file mode 100644 index 9834625109..0000000000 --- a/setup/fusion/scripts/Comp/colorbleed/predivide_postmultiply_BC_and_CC.py +++ /dev/null @@ -1,25 +0,0 @@ - -class FusionLockComp(object): - def __init__(self, undoQueueName="Script CMD"): - # Lock flow - comp.Lock() - # Start undo event - comp.StartUndo(undoQueueName) - - def __enter__(self): - return None - - def __exit__(self, type, value, traceback): - comp.EndUndo(True) - comp.Unlock() - -idList = set(["BrightnessContrast", "ColorCorrector"]) -attrName = "PreDividePostMultiply" - -with FusionLockComp("BC & CC set PreMultiplyPostDivide to 1"): - toolsDict = comp.GetToolList(False) - if toolsDict: - for i, tool in toolsDict.items(): - if tool.ID in idList: - for input in tool.GetInputList().values(): - setattr(tool, attrName, 1.0) \ No newline at end of file diff --git a/setup/fusion/scripts/Comp/colorbleed/search_replace_paths.py b/setup/fusion/scripts/Comp/colorbleed/search_replace_paths.py deleted file mode 100644 index 7fdfb6e388..0000000000 --- a/setup/fusion/scripts/Comp/colorbleed/search_replace_paths.py +++ /dev/null @@ -1,107 +0,0 @@ -import os -import re - - -class FusionLockComp(object): - def __init__(self, undoQueueName="Script CMD"): - # Lock flow - comp.Lock() - # Start undo event - comp.StartUndo(undoQueueName) - - def __enter__(self): - return None - - def __exit__(self, type, value, traceback): - comp.EndUndo(True) - comp.Unlock() - - -def replaceStr(inputString, srchFor, srchTo, caseSensitive=True): - if caseSensitive: - return inputString.replace(srchFor, srchTo) - else: - regex = re.compile(re.escape(srchFor), re.IGNORECASE) - return regex.sub(srchTo, inputString) - - -def searchReplaceLoaderSavers(): - userResponse = comp.AskUser("Repath All Loaders", - {1:{1:"Loaders", 2:"Checkbox", "Name":"Loaders", "NumAcross":3, "Default":1}, - 2:{1:"Savers", 2:"Checkbox", "Name":"Savers", "NumAcross":3, "Default":1}, - 3:{1:"Proxy", 2:"Checkbox", "Name":"Proxy", "NumAcross":3, "Default":1}, - 4:{1:"Source", 2:"Text", "Name":"Enter pattern to search for"}, - 5:{1:"Replacement", 2:"Text", "Name":"Enter the replacement path"}, - 6:{1:"Valid", 2:"Checkbox", "Name":"Check If New Path is Valid", "Default":1}, - 7:{1:"CaseSensitive", 2:"Checkbox", "Name":"Case Sensitive", "Default":1}, - 8:{1:"SelectedOnly", 2:"Checkbox", "Name":"Selected Only", "Default":0}, - 9:{1:"PreserveGlobalIn", 2:"Checkbox", "Name":"Preserve Global In Point", "Default":1} - } - ) - - if userResponse: - srchFor = userResponse['Source'] - if not srchFor: - raise RuntimeError("No source string specified.") - - srchTo = userResponse['Replacement'] - if not srchTo: - raise RuntimeError("No replacement string specified.") - - doLoaders = userResponse['Loaders'] - doSavers = userResponse['Savers'] - doProxy = userResponse['Proxy'] - doValidate = userResponse['Valid'] - doCaseSensitive = userResponse['CaseSensitive'] - doSelectedOnly = bool(userResponse['SelectedOnly']) - doPreserveGlobalIn = bool(userResponse['PreserveGlobalIn']) - - - with FusionLockComp('Path Remap - "{0}" to "{1}"'.format(srchFor, srchTo)): - toolsDict = comp.GetToolList(doSelectedOnly) - for i, tool in toolsDict.items(): - toolId = tool.ID - if toolId == "Loader" or toolId == "Saver": - tool_a = tool.GetAttrs() - if (doLoaders or doProxy) and toolId == "Loader": - clipTable = tool_a['TOOLST_Clip_Name'] - altclipTable = tool_a['TOOLST_AltClip_Name'] - startTime = tool_a['TOOLNT_Clip_Start'] - - if doPreserveGlobalIn: - oldGlobalIn = tool.GlobalIn[comp.CurrentTime] - - if doLoaders: - for n, name in clipTable.items(): - #for i in table.getn(clipTable): - if name: - newPath = replaceStr(name, srchFor, srchTo, doCaseSensitive) - print (name, newPath) - if not doValidate or os.path.exists(comp.MapPath(newPath)): - tool.Clip[startTime[n]] = newPath - else: - print( "FAILED : New clip does not exist; skipping sequence.\n {0} .. {1}".format(name, newPath)) - - if doProxy: - for n, name in altclipTable.items(): - if name: - newPath = replaceStr(name, srchFor, srchTo, doCaseSensitive) - if not doValidate or os.path.exists(comp.MapPath(newPath)): - tool.ProxyFilename[startTime[n]] = newPath - else: - print( "FAILED : New proxy clip does not exist; skipping sequence.\n {0} .. {1}".format(name, newPath)) - - if doPreserveGlobalIn: - tool.GlobalIn[comp.CurrentTime] = oldGlobalIn - - if doSavers and toolId == "Saver": - for i, name in tool_a['TOOLST_Clip_Name'].items(): - newPath = replaceStr(name, srchFor, srchTo, doCaseSensitive) - if not doValidate or os.path.exists(os.path.dirname(comp.MapPath(newPath))): - tool.Clip[comp. ] = newPath - else: - print( "FAILED : Output directory does not exist; skipping saver.\n {0} .. {1}".format(name, newPath)) - -searchReplaceLoaderSavers() - - \ No newline at end of file diff --git a/setup/fusion/scripts/Comp/colorbleed/set_relative_paths.py b/setup/fusion/scripts/Comp/colorbleed/set_relative_paths.py deleted file mode 100644 index d3a011162b..0000000000 --- a/setup/fusion/scripts/Comp/colorbleed/set_relative_paths.py +++ /dev/null @@ -1,96 +0,0 @@ -import os -import re - - -class FusionLockComp(object): - def __init__(self, undoQueueName="Script CMD"): - # Lock flow - comp.Lock() - # Start undo event - comp.StartUndo(undoQueueName) - - def __enter__(self): - return None - - def __exit__(self, type, value, traceback): - comp.EndUndo(True) - comp.Unlock() - - -def makeRelativePath(root, path): - try: - return "Comp:\{0}".format(os.path.relpath(os.path.abspath(fusion.MapPath(path)), root)) - except ValueError: - print("Warning -- Can't define relative path for: {0}".format(path)) - return path - -def pathToCurrentComp(): - return comp.GetAttrs()["COMPS_FileName"] - - -def cbRelativePaths(): - userResponse = comp.AskUser("Make paths relative", - { - 1:{1:"Loaders", 2:"Checkbox", "Name":"Loaders", "NumAcross":3, "Default":1}, - 2:{1:"Savers", 2:"Checkbox", "Name":"Savers", "NumAcross":3, "Default":1}, - 3:{1:"Proxy", 2:"Checkbox", "Name":"Proxy", "NumAcross":3, "Default":1}, - 4:{1:"SelectedOnly", 2:"Checkbox", "Name":"Selected Only", "Default":0} - } - ) - - if userResponse: - - root = pathToCurrentComp() - if not root: - raise RuntimeError("Fusion file has not been saved. Can't make paths relative") - if root: - root = os.path.dirname(root) - - # set root - os.chdir(root) - - doLoaders = userResponse['Loaders'] - doSavers = userResponse['Savers'] - doProxy = userResponse['Proxy'] - doSelectedOnly = bool(userResponse['SelectedOnly']) - - - - with FusionLockComp('Make paths relative'): - toolsDict = comp.GetToolList(doSelectedOnly) - for i, tool in toolsDict.items(): - toolId = tool.ID - if toolId == "Loader" or toolId == "Saver": - tool_a = tool.GetAttrs() - if (doLoaders or doProxy) and toolId == "Loader": - clipTable = tool_a['TOOLST_Clip_Name'] - altclipTable = tool_a['TOOLST_AltClip_Name'] - startTime = tool_a['TOOLNT_Clip_Start'] - - # Preserve global in - oldGlobalIn = tool.GlobalIn[comp.CurrentTime] - - if doLoaders: - for n, name in clipTable.items(): - if name: - newPath = makeRelativePath(root, name) - tool.Clip[startTime[n]] = newPath - - if doProxy: - for n, name in altclipTable.items(): - if name: - newPath = makeRelativePath(root, name) - tool.ProxyFilename[startTime[n]] = newPath - - # Set global in (to what we preserved) - tool.GlobalIn[comp.CurrentTime] = oldGlobalIn - - if doSavers and toolId == "Saver": - for i, name in tool_a['TOOLST_Clip_Name'].items(): - if name: - newPath = makeRelativePath(root, name) - tool.Clip[comp.TIME_UNDEFINED] = newPath - -cbRelativePaths() - - \ No newline at end of file