Mercurial > msvpvf
changeset 11:2ec81711f0c7
Move python files to this repo
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 26 Jan 2022 20:36:07 -0500 |
parents | |
children | 59501244594c |
files | LICENSE README.md gui.py msvpvf.py scripts/bulkconvert.bat scripts/bulkconvert.sh |
diffstat | 6 files changed, 168 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE Wed Jan 26 20:36:07 2022 -0500 @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Paper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Wed Jan 26 20:36:07 2022 -0500 @@ -0,0 +1,15 @@ +# msvpvf +msvpvf.py, based on msvpvf which can be found [here](https://www.focusonvegas.com/movie-studio-vegas-pro-version-faker/) + +this could probably be very heavily optimized but it works for now + +# compatibility +as far as i know, there are 3 generations of project files: + +Gen 1 | Gen 2 | Gen 3 +--- | --- | --- +8.0 - 11.0 | 12.0 - 14.0 | 15.0 - Now + +of course, all generations later than the generation before can open these files, for example vegas 14 can open vegas 10 project files + +feel free to correct me on this, i haven't used 15.0+ in over 2 years
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gui.py Wed Jan 26 20:36:07 2022 -0500 @@ -0,0 +1,58 @@ +import tkinter +import tkinter.filedialog +import msvpvf +import os + +def round_down(num, divisor): + return num - (num%divisor) + +def open_veg_file(): + filepath.set(tkinter.filedialog.askopenfilename(title="Select project file", filetypes=[("Project files", ".veg .vf"), ("All Files", "*.*")])) + with open(filepath.get(), 'rb') as file: + version_of_file.set("Project file version: %s" % (str(bytearray(file.read())[0x46]))) + window.update_idletasks() + # eventually add shit here + +def save_veg_file(): + with open(filepath.get(), 'rb') as f: + path = bytearray(f.read()) + for i in listbox.curselection(): + prefix, data = msvpvf.type_hex(i) + path[0x18:0x27] = data + path[0x46] = int(default_version.get()) + outputfn = prefix + "_V" + default_version.get() + "_" + os.path.basename(os.path.splitext(filepath.get())[0]) + outputfn += ".vf" if prefix == "MS" else ".veg" + name = tkinter.filedialog.asksaveasfilename(defaultextension='.vf' if prefix == "MS" else '.veg', initialfile=outputfn, filetypes=[("Project files", ".veg .vf"), ("All Files", "*.*")]) + with open(name, 'wb') as f: + f.write(path) + + +window = tkinter.Tk() +window.geometry("225x200") + +filepath = tkinter.StringVar(window) +version_of_file = tkinter.StringVar(window) +selected_version = tkinter.IntVar() + + +button = tkinter.Button(text="Open", command=open_veg_file) +button.pack(pady=5) +list_items = tkinter.StringVar(value=("VEGAS Pro", "Movie Studio")) +listbox = tkinter.Listbox(window, height=2, listvariable=list_items) +listbox.select_set(0) +listbox.pack(pady=5) + +supported_versions = ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"] +default_version = tkinter.StringVar() +default_version.set(supported_versions[3]) + +menu = tkinter.OptionMenu(window, default_version, *supported_versions) +menu.pack(pady=5) +button = tkinter.Button(text="Save", command=save_veg_file) +button.pack(pady=5) + +tkinter.Label(window, textvariable=version_of_file).pack(pady=5) +window.title("msvpvf") +window.minsize(225, 200) + +window.mainloop()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/msvpvf.py Wed Jan 26 20:36:07 2022 -0500 @@ -0,0 +1,59 @@ +import sys, argparse, os + +def prog_type(byte): + if byte == 0xF6: + return "Movie Studio" + elif byte == 0xEF: + return "VEGAS Pro" + else: + return "Unknown" + +def type_hex(type): + if type == "vf" or type == 1: + return "MS", [0xF6, 0x1B, 0x3C, 0x53, 0x35, 0xD6, 0xF3, 0x43, 0x8A, 0x90, 0x64, 0xB8, 0x87, 0x23, 0x1F, 0x7F] + elif type == "veg" or type == 0: + return "PRO", [0xEF, 0x29, 0xC4, 0x46, 0x4A, 0x90, 0xD2, 0x11, 0x87, 0x22, 0x00, 0xC0, 0x4F, 0x8E, 0xDB, 0x8A] + else: + return + +def main(args): + if args.input: + inputfile = args.input + if os.path.exists(inputfile): + with open(inputfile, "rb") as fp: + test = bytearray(fp.read()) + else: + print("Input file doesn't exist!") + exit() + project = prog_type(test[0x18]) + print("Project file version: " + project + " " + str(test[0x46]) + ".0") + if not args.version: + answer = "" + else: + answer = args.version + while answer not in ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18"]: + answer = str(input("Which version of VEGAS would you like it to be spoofed to? [8-18]: ")) + if not args.type: + answer2 = "" + while answer2 not in ["veg", "vf"]: + answer2 = input("Would you like it to be VEGAS Pro or Movie Studio? [veg,vf]: ").lower() + else: + answer2 = args.type + filename_prefix, typehex = type_hex(answer2) + test[0x18:0x27] = typehex + test[0x46] = int(answer) + filename_wo_ext = os.path.basename(os.path.splitext(inputfile)[0]) + if args.output: + outputfile = args.output + else: + outputfile = os.path.abspath(os.path.dirname(inputfile)) + "/" + filename_prefix + "_V" + answer + "_" + str(filename_wo_ext) + "." + answer2 + with open(outputfile, 'wb') as target: + target.write(test) +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('-i', '--input', help="input file", metavar='<input>', required=True) + parser.add_argument('-o', '--output', help="output file, defaults to '(MS,VEG)_(version)_(original name).(vf,veg)'", metavar='<output>') + parser.add_argument('-v', '--version', help="output file version", metavar='<version>') + parser.add_argument('-t', '--type', help="output file type, vf/veg", metavar='<type>') + args = parser.parse_args() + main(args)