Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def exportFbx(filename)
if Sketchup.open_file(filename) then
model = Sketchup.active_model
dir = File.dirname(filename)
basename = File.basename(filename,'.*')
#model.save_thumbnail "#{dir}/#{basename}.png"
model.export "#{dir}/#{basename}.fbx", false
else
puts "Failed to Load fbx."
end
end
def exportDir(path)
Dir[path + '/*'].sort.each do |name|
puts name
if File.file?(name) and name[/.+\.skp$/]
exportFbx(File.expand_path(name))
elsif File.directory?(name)
exportDir(name)
end
end
end
exportDir('c:/project/sketchup/model')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.