import os

filepath = os.getcwd()


for subdir, dirs, files in os.walk(filepath):
  for file in files:
    if file.endswith('.dae'):
      getVpath = subdir.replace('/home/carkiller/.local/share/BeamNG.drive/0.35/mods/unpacked/st_ocean_road', '')
      vPath = getVpath + '/' + file
      print(vPath)
      with open (filepath + '/' + 'items.level.json', 'a') as a:
        a.write('{"class":"TSStatic","__parent":"StaticObjects","position":[0,0,50],"collisionType":"Visible Mesh Final","playAmbient":false,"shapeName":"' + vPath + '"}')
        a.write('\n')