Here is a little Python script that will search for frames you’ve ‘deleted’ in the Key Frame Edit mode and unhide them. Doesn’t affect selective edits within frames, only frames that were completely removed.
It’s probably not great Python code but it seems to work. Always back up your files!
import glob, os
# Replace with path to files
# Subfolders are searched recursively
source_dir = os.path.normpath("C:\\ProjectFolder")
# location of hidden file byte and values
hidden_flag_pos = 6
hide_flag = b'\x01'
unhide_flag = b'\x00'
def hide_files(filelist):
for filename in filelist:
with open(filename, 'r+b') as f:
f.seek(hidden_flag_pos)
f.write(hide_flag)
def unhide_files(filelist):
for filename in filelist:
with open(filename, 'r+b') as f:
f.seek(hidden_flag_pos)
f.write(unhide_flag)
def check_for_hidden(filename):
with open(filename, 'r+b') as f:
f.seek(hidden_flag_pos)
if f.read(1) == hide_flag:
return True
source_file_list = glob.glob(f"{source_dir}\\**\\frame*.inf", recursive=True)
if len(source_file_list) == 0:
raise SystemExit('No frame files found.')
hidden_file_list = []
unhidden_file_list = []
print('Checking for hidden frames...')
for filename in source_file_list:
if check_for_hidden(filename) == True:
hidden_file_list.append(filename)
else:
unhidden_file_list.append(filename)
print(f'{len(hidden_file_list)} hidden frames.')
print(f'{len(unhidden_file_list)} unhidden frames.')
if len(hidden_file_list)>0:
print('Unhiding frames...')
unhide_files(hidden_file_list)
print('Done.')