# -*- coding: utf-8 -*-
# AUTHOR Dries Vervoort (Luxion)
# VERSION 0.0.1
# Batch render Toy Train models to images.
import os

def getGeometryImportOptions():
  importOptions = lux.getImportOptions()
  importOptions['center_geometry'] = False
  importOptions['snap_to_ground'] = True
  importOptions['up_vector'] = 2
  importOptions['adjust_camera_look_at'] = False
  importOptions['adjust_environment'] = False
  importOptions['update_mode'] = False
  importOptions['group_by_shader'] = False
  importOptions['group_by'] = 2
  importOptions['new_import'] = False
  importOptions['tessellation_quality'] = 0.15
  importOptions['accurate_tessellation'] = True
  return importOptions

def main():
  values = [("ifold", lux.DIALOG_FOLDER, "Folder to import STEP models from:", None)]
  opts = lux.getInputDialog(title = "Batch Render Model Collection",
                            desc = "Renders a collection of models in a folder to images.",
                            values = values,
                            id = "batchrenderSTEPmodels.py.luxion")
  if not opts: return

  importExtension = "step"

  importFolder = opts["ifold"]

  importOptions = getGeometryImportOptions()
  print(importOptions)

  modelList = []
  for file in os.listdir(importFolder):
    if file.endswith(importExtension):
      modelList.append(file)
      print(modelList)

      importPath = importFolder + os.path.sep + file
      print(importPath)

main()