Script for updating mesh models in Blender projects while preserving their properties (textures, colors, materials, etc.).
- Updates mesh geometry while preserving UV maps, materials, and other properties
- Supports multiple file formats: STL, GLB, GLTF
- Configuration-based batch updating
- Preserves object hierarchy and transformations
- Place
update_blend_file.shin the same folder as your main Blender file - Edit
update_blend_file.shand fill in the name of your blend file - Configure
scripts/config.jsonto define which parts to update - Run:
./update_blend_file.sh
Edit scripts/config.json to specify:
- Individual parts by exact path
- Path patterns using wildcards
Example:
{
"parts": [
{
"name": "./parts_in_use/part.stl"
}
],
"paths": [
"./parts_in_use/*.stl"
]
}- STL (imported with 0.001 scale)
- GLB
- GLTF
The script:
- Imports new mesh geometry from specified files
- Matches them with existing objects in the Blender scene by name
- Replaces only the geometry while preserving:
- UV maps
- Materials
- Textures
- Object properties
- Hierarchy and parenting
- Blender (command-line accessible)
- Python (included with Blender)