I have several models(more than 1000) in FBX format and I want to decrease their polygon count. I'm using decimate modifier. Since there are so many models and the task is not too complicated, I was wondering if it was possible to do this with python scripting. I looked around the internet but all the scripting tutorials I found were doing scripting inside the blender. But what I want is a script which scans all the models in a folder and outputs their low poly version.
I'd recommend using instant-meshes with it's batch mode. You could write a python script like this one to do all the files in your folder:
import subprocess import os models_folder = 'C:/folder' models = sorted(os.listdir(models_folder)) output_folder = 'C:/output_folder' instant_meshes_path = 'C:/Instant_Meshes.exe' for file in models: # Desired number of faces for the model faces = 2500 subprocess.call([ instant_meshes_path, '--faces', str(faces), os.path.join(models_folder, file), os.path.join(output_folder, file) ])