public Polygon[] GetPolys() { if (m_polygons != null) { return(m_polygons); } ConvertPoly conv = new ConvertPoly(m_nifFile); return(conv.Polys.ToArray()); }
/// <summary> /// Converts a nif /// </summary> /// <param name="type"></param> /// <param name="targetFilename"></param> public void Convert(ConvertType type, string targetFilename) { switch (type) { case ConvertType.WaveFrontObject: ConvertWavefront wf = new ConvertWavefront(m_nifFile); if (IsNodeDrawable != null) { wf.IsNodeDrawable += delegate(NiAVObject node) { return(IsNodeDrawable(node)); }; } wf.Start(); wf.Write(targetFilename); break; case ConvertType.PolyText: case ConvertType.Poly: ConvertPoly conv = new ConvertPoly(m_nifFile); if (IsNodeDrawable != null) { conv.IsNodeDrawable += delegate(NiAVObject node) { return(IsNodeDrawable(node)); }; } conv.Start(); m_polygons = conv.Polys.ToArray(); if (type == ConvertType.PolyText) { conv.WritePlain(targetFilename); } else { conv.Write(targetFilename); } break; } }
public Polygon[] GetPolys() { if (m_polygons != null) return m_polygons; ConvertPoly conv = new ConvertPoly(m_nifFile); return conv.Polys.ToArray(); }
/// <summary> /// Converts a nif /// </summary> /// <param name="type"></param> /// <param name="targetFilename"></param> public void Convert(ConvertType type, string targetFilename) { switch (type) { case ConvertType.WaveFrontObject: ConvertWavefront wf = new ConvertWavefront(m_nifFile); wf.Write(targetFilename); break; case ConvertType.PolyText: case ConvertType.Poly: ConvertPoly conv = new ConvertPoly(m_nifFile); m_polygons = conv.Polys.ToArray(); if (type == ConvertType.PolyText) conv.WritePlain(targetFilename); else conv.Write(targetFilename); break; } }