private static MapLayoutResource _LoadLayout(int id) { var pathFormat = "Map/m{0}/m{0}.blend"; var scene = BlenderScene.FromFile(String.Format(pathFormat, id)); return(MapLayoutResource.FromScene("parts", scene)); }
/// <summary> /// append map parts to layout list /// </summary> /// <param name="res"></param> /// <param name="offset"></param> /// <param name="targetList"></param> private static void _AppendParts(MapLayoutResource res, Matrix offset, List <LayoutInfo> targetList) { foreach (var entry in res.Entries) { targetList.Add(new LayoutInfo() { ModelId = entry.ModelId, Layout = entry.Layout * offset }); } }
public static MapLayoutResource FromScene(String uid, BlenderScene scene) { var res = new MapLayoutResource(uid); foreach (var n in scene.LinkList) { var match = _ModelIdRegex.Match(n.TargetFileName); int modelId = int.Parse(match.Groups[1].Value); res.m_entryList.Add(new Entry() { ModelId = modelId, Layout = n.Layout }); } return(res); }