Created
March 8, 2013 14:38
-
-
Save PierrickKoch/5116845 to your computer and use it in GitHub Desktop.
import *.stl scale and pack in one total.blend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import bpy | |
| def process(filepath): | |
| print("import %s"%filepath) | |
| bpy.ops.import_mesh.stl(filepath=filepath) | |
| for obj in bpy.context.selected_objects: | |
| obj.scale = (.01, .01, .01) | |
| print("done") | |
| bpy.ops.object.select_all(action='SELECT') | |
| bpy.ops.object.delete() | |
| for directory, dirnames, filenames in os.walk("."): | |
| for filename in filenames: | |
| if filename.lower().endswith(".stl"): | |
| process(filename) | |
| bpy.ops.wm.save_mainfile(filepath="total.blend", compress=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment