Frame Edit Unhide Script

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.')

I’m trying to make a GUI for it, but I’m terrible at it. :slight_smile:

You can freely move frames from visible to hidden and back, but Revoscan caches things enough that you have to keep reloading the project for it to be current with your changes. I’m also convinced that the preview in Frame Edit mode doesn’t show you every frame.

I have exporting selected frames to a new project/scan working as code but haven’t integrated it yet.

The GUI looks good so far. If you know HTML, you can also use it to build a GUI using certain frameworks.

But I don’t quite understand how it works, you delete frames in RevoScan and you can restore them with the tool?

It was clear that frames weren’t actually being deleted because the number of files never change, but I couldn’t figure out where it was storing the information of what frames to ignore. Turns out that there is a byte in the .inf file that flags whether or not a frame is “deleted” and you can just flip it back and forth.

2 Likes