- from .datafile import Statement
- keywords = { ".mat": "material",
- ".mesh": "mesh",
- ".object": "object",
- ".tech": "technique",
- ".tex2d": "texture2d" }
- with open(os.path.join(path, base+"_resources.mdc"), "w") as res_out:
- for r in refs:
- if self.skip_existing and os.path.exists(os.path.join(path, r.name)):
- continue
-
- st = Statement(keywords[os.path.splitext(r.name)[1]], r.name)
- st.sub = r.statements
- st.write_to_file(res_out)
+ filter = None
+ if self.skip_existing:
+ filter = lambda r: not os.path.exists(os.path.join(path, r.name))
+ scene_res.write_collection(os.path.join(path, base+"_resources.mdc"), exclude=self=True, filter)