
- Posts: 46
- Joined: Fri Sep 04, 2015 12:45 pm
Hi there,
This script runs automatically when I open a comp and changes the path where the saver saves the video. Can you tell me where I am going wrong with this script? It fails on the line : tx[1].Clip=newpath
Any help would be greatly appreciated.
Best wishes
Ziggx
This script runs automatically when I open a comp and changes the path where the saver saves the video. Can you tell me where I am going wrong with this script? It fails on the line : tx[1].Clip=newpath
- Code: Select all
-- if the comp file path does NOT include the directory "Master" and
-- if there is a saver in the comp, it will change the render
-- directory to match the
print("autorun - update saver path if required")
fp=comp:GetAttrs().COMPS_FileName
print(fp)
if string.find(fp,"/Master/") then
-- master file so nothing to do...
print("Master file so do nothing")
else
-- not a master file so do something
print("checking for saver...")
tx=comp:GetToolList(false,"Saver")[1]
if not (tx ==nil) then
-- we got a saver...
print("got saver...")
tablefp=split(fp,"/")
newdir=tablefp[#tablefp-1]
if not (comp:GetToolList(false,"Saver")[1] == nil) then
fn=comp:GetToolList(false,"Saver")[1]:GetAttrs().TOOLST_Clip_Name
path=fn[1]
if string.find(path,"/Master/") then
newpath=string.gsub(path,"Master",newdir)
tx[1].Clip=newpath
print("Changed the saver path!")
else
print("No change to the saver path")
end
end
else
print("No saver to update :(")
end
end
Any help would be greatly appreciated.
Best wishes
Ziggx