Blender 3D: Noob to Pro/Import and Render a SolidWorks Model/vrmlbatch.py

""" Registration info for Blender menus: Name: 'VRML batch loader' Blender: 237  Group: 'Import'  Tooltip: 'Loads all .wrl files from a user defined folder'  """ #-- #-- # #-- import Blender import sys import os print "loading script" filename = "" def f(name): # file selector callback global filename filename = name path = Blender.sys.dirname(filename) ext = '.wrl' print "Searching " + path for filename in os.listdir(path): if filename.endswith(ext): #check to make sure its a wrl file Blender.Load(path + "/" + filename) print "finished" Blender.Window.FileSelector(f, "Open files in this dir")
 * 1) !BPY
 * 1) Author Ewout                                     - Version 1.0 -  5 Aug 05
 * 2) Using Blender file dialog: b2b revision by Ewout - Version 1.1 - 16 Aug 05
 * 1) The purpose of this script is to automatically load wrl (VRML) files,
 * 2) saved out from Solidworks assemblies as individual part files, from a
 * 3) source folder.When finished loading save as .blend before continuing.
 * 1) Depending on the source of the VRML files, you may have some empty files,
 * 2) which results in a message from blender: "ERROR: Found no data"
 * 3) just keep your mouse moving and ignore this message :o)
 * 1) Copyright 2005. Not for resale.