Decimate modifier script that decimates models in a directory and overwrites them after decimating to the given ratio.
Note: Currently tested only on .dae models and using Collapse decimation type on bpy 3.6
-
Install python >= 3.10
-
Create a virtual environment (required only if you have multiple python version)
python3.10 -m venv blender_ws
-
Source the venv
cd blender_ws
source ./bin/activate
-
Create directories scripts, wheels and download bpy 3.6 and place it in the wheels directory
mkdir wheels
-
Then install the wheel in venv
cd wheels
pip install bpy-3.6.0-cp310-cp310-manylinux_2_28_x86_64.whl
Once you've completed the installation, place the decimate modifier script in the scripts directory.
Change the below mentioned variables according to your needs
decimate_ratio
, min_number_of_faces
, path_to_model_directory
decimate_ratio - The ratio in which the model must be decimated.
min_number_of_faces - The minimum number of faces a model should have if it's to be decimated (just to preserve the model's shape)
path_to_model_directory - The path to the directory containing the .dae models.
- The scripts will search for all the .dae files in the given directory
-
Once above steps are completed go the the scripts directory and execute the following command.
blender -b -P decimate_models.py
Once completed your models should be decimated and placed in the same location.
- Please open an issue if found any.