Tutorial/Mass Convert Models with id-daemon's tools and Python
This tutorial will show you how to convert most, if not all, of the model assets into OBJ files and XNALara files for importing.
This will NOT teach you how to import the models into 3D software!
- Python 3.5+
- id-daemon's Overwatch_model.rar
- id-daemon's Overwatch Texture tool
- id-daemon's list of all models/textures
- WinRAR, 7zip or some other program capable of decompressing a RAR file.
- The following Python Script
# This script was based on Metssfm's organize_extracted_ow_textures.py script. # Modified for model use by Kjasi import os import sys import re import subprocess import glob from shutil import copyfile #version requirement if(sys.version_info < (3,5)): print("This script requires Python 3.5+") sys.exit(1) # Specific Names of models to extract. Examples: "Tracer" or "Junkrat" will extract all models with those names in them. targetName = "" # Various files and directories we need. inputTxt = "F:\\Overwatch\\Software\\models_index.txt" # The text file we will parse. ModelProgram = "F:\\Overwatch\Software\\Overwatch_model.exe" # Path to id-daemon's Overwatch_model.exe SkeletonProgram = "F:\\Overwatch\Software\\overwatch_skeleton.exe" # Path to id-daemon's Overwatch_skeleton.exe inputDir = "F:\\Overwatch\\Data\\files\\" # Path to extracted files outputDir = "F:\\Overwatch\\Data\\Organized\\" # Where to put the organized files. # DO NOT MODIFY ANYTHING BELOW THIS LINE!! print("Starting...") contents = None with open(inputTxt) as f: contents = f.readlines() print("Scanning files...") filelist = glob.glob(inputDir+'/00C/*', recursive=True) curDir = None #modelList =  note = None print("Attempting to export...") for s in contents: # For each line if("package" in s): # If it's the start of a package curDir = None # If we found a new package, reset working directory. note = None #modelList =  if("model" in s): # If it's a model reference if("->" in s): # If it has a note to it if (targetName == "") or (targetName in s): note = s.split("-> ").split("\n").replace(":", " ") # Extract the note from the string note = re.sub('[?!@#$]', '', note) # Strip invalid characters print("found note: " + note) modelfilename = s.split("model ").split(" size") # get the model's filename modelfilename.strip() print("found modelfile: " + modelfilename) for filename in filelist: if filename.endswith(modelfilename+".00C"): if(os.path.isfile(filename)): print("Processing File: "+modelfilename+" from "+filename) os.makedirs(outputDir+note, exist_ok=True) # Create a directory accordingly curDir = outputDir+note+"\\" # Set working directory to that os.chdir(curDir) targetfilename = filename.split("\\")[-1].split(".00C") copyfile(filename, curDir+targetfilename) if(os.path.isfile(ModelProgram)): subprocess.call([ModelProgram, curDir+targetfilename]) if(os.path.isfile(SkeletonProgram)): subprocess.call([SkeletonProgram, curDir+targetfilename]) continue continue if("texture" in s): # If it's a texture reference if(curDir): # If a directory is specified# by a note at the moment os.makedirs(curDir, exist_ok=True) # Create a directory accordingly texName = s.split("texture ").split(" size") + ".dds" # Extract the texture name from the line try: copyfile(inputDir+"DDS\\"+texName, curDir+texName) print("wrote texture to: "+curDir+texName) except: print("Texture not found: "+texName) continue
- Follow the Extracting Tutorial to pull out all of the model files from the 00C folder. You will also want all the textures from the 004 and 04D folders. Note the directory you've extracted them to! I've put my files into F:\Overwatch\Data.
- Download and Install Python.
- Extract the Overwatch_skeleton.exe and Overwatch_model.exe from id-daemon's Overwatch_model.rar to a directory of your choosing. I shall be putting them into F:\Overwatch\Software.
- Extract the model_index.txt and place it into your Overwatch\Software directory.
- Extract the Overwatch_texture.exe from the Overwatch_texture.rar file.
- Copy the Overwatch_texture.exe to your Overwatch\Data\files folder. (The 00C, 004, and 04D directories should be in the same folder as Overwatch_texture.exe.)
- Double-click the Overwatch_texture.exe. This will start reading the 004 and 04D folders, and convert most/all of the images into DDS images and place them in a DDS folder.
- Copy the Python script above and paste it into a text file named ow_Converter.py and save it into your Overwatch\Software directory. We will be using this script in a bit!
- Edit the ow_Converter.py, and change the paths and directories to match your system. Make sure to use double \ when listing directories. Example: "F:\Overwatch\Software\models_index.txt" would become "F:\\Overwatch\\Software\\models_index.txt"
- (OPTIONAL) Specify a character to extract in the targetName variable. Example: targetName = "Tracer" would export only models with the Tracer tag. If targetName = "", then all models will be exported.
- Save the ow_Converter.py
- Wait for Overwatch_texture.exe to finish, if it has not already completed.
- Double-click the ow_Converter.py or Right-click->Run with IDLE.
- Wait for the script to finish.
- You can now import the OBJs and/or xnalara file into your software.
Optional post-tutorial steps
- Follow steps 7+ of the Convert Overwatch Images to TGA with Photoshop tutorial to convert the DDS files in each character's directory to TGA files, or another format of your choosing.
|Overwatch_texture.exe won't convert images, or gives me an empty directory!||Older versions of the program didn't support file extensions. Download the latest version, and it should work. (Or use a mass file-renamer to remove the file's extensions.)|