Blender IndexError: bpy_prop_collection
Go into Object Mode before calling that function.
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
I try write a game with GoranM/bdx plugin. When i create plate with texture and  try export to code I get fatal error.

Traceback (most recent call last):
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\ops\exprun.py", line 225, in execute
      export(self, context, bpy.context.scene.bdx.multi_blend_export, bpy.context.scene.bdx.diff_export)
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\ops\exprun.py", line 123, in export
      bpy.ops.export_scene.bdx(filepath=file_path, scene_name=scene.name, exprun=True)
    File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\bpy\ops.py", line 189, in call
      ret = op_call(self.idname_py(), None, kw)
  RuntimeError: Error: Traceback (most recent call last):
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 903, in execute
      return export(context, self.filepath, self.scene_name, self.exprun, self.apply_modifier)
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 829, in export
      "models": srl_models(objects, apply_modifier),
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 117, in srl_models
      verts = vertices(mesh)
    File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 53, in vertices
      vert_uv = list(uv_layer[li].uv)
  IndexError: bpy_prop_collection[index]: index 0 out of range, size 0
location: C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\bpy\ops.py:189
location: :-1

Maybe someone had same problem and you know how to fix it?