Tutorial/Mass Convert Models with id-daemon's tools and Python

From owdev
Jump to: navigation, search

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!

Software Needed

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+")

# 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.


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("-> ")[1].split("\n")[0].replace(":", " ")					# Extract the note from the string
				note = re.sub('[[email protected]#$]', '', note)								# Strip invalid characters
				print("found note: " + note)
				modelfilename = s.split("model ")[1].split(" size")[0]						# get the model's filename
				print("found modelfile: " + modelfilename)
				for filename in filelist:
					if filename.endswith(modelfilename+".00C"):
							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
							targetfilename = filename.split("\\")[-1].split(".00C")[0]
							copyfile(filename, curDir+targetfilename)
								subprocess.call([ModelProgram, curDir+targetfilename])
								subprocess.call([SkeletonProgram, curDir+targetfilename])
	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 ")[1].split(" size")[0] + ".dds"						# Extract the texture name from the line
				copyfile(inputDir+"DDS\\"+texName, curDir+texName)
				print("wrote texture to: "+curDir+texName)
				print("Texture not found: "+texName)


  1. 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.
  2. Download and Install Python.
  3. 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.
  4. Extract the model_index.txt and place it into your Overwatch\Software directory.
  5. Extract the Overwatch_texture.exe from the Overwatch_texture.rar file.
  6. 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.)
  7. 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.
  8. 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!
  9. 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"
  10. (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.
  11. Save the ow_Converter.py
  12. Wait for Overwatch_texture.exe to finish, if it has not already completed.
  13. Double-click the ow_Converter.py or Right-click->Run with IDLE.
  14. Wait for the script to finish.
  15. You can now import the OBJs and/or xnalara file into your software.

Optional post-tutorial steps

  1. 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.


Problem Solution
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.)