BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
BrawlLib.Modeling.Wavefront Class Reference

Static Public Member Functions

static void Serialize (string outPath, params object[] assets)
 

Member Function Documentation

◆ Serialize()

static void BrawlLib.Modeling.Wavefront.Serialize ( string  outPath,
params object[]  assets 
)
inlinestatic
11 {
12 using (FileStream stream = new FileStream(outPath, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
13 {
14 using (StreamWriter writer = new StreamWriter(stream))
15 {
16 writer.WriteLine(
17 $"#Wavefront OBJ file, generated by {Application.ProductName} v{Application.ProductVersion}");
18
19 foreach (object o in assets)
20 {
21 if (o is MDL0VertexNode)
22 {
23 WriteVertexGroup(writer, (o as MDL0VertexNode).Vertices);
24 }
25 else if (o is MDL0NormalNode)
26 {
27 WriteNormalGroup(writer, o as MDL0NormalNode);
28 }
29 else if (o is MDL0UVNode)
30 {
31 WriteUVGroup(writer, o as MDL0UVNode);
32 }
33 else if (o is MDL0ObjectNode)
34 {
35 foreach (DrawCall c in ((MDL0ObjectNode) o)._drawCalls)
36 {
37 WritePolygon(writer, c);
38 }
39 }
40 }
41
42 writer.Flush();
43 }
44 }
45 }
Definition: MDL0ObjectNode.cs:2040
Definition: MDL0NormalNode.cs:10
Definition: MDL0ObjectNode.cs:21
Definition: MDL0UVNode.cs:10
Definition: MDL0VertexNode.cs:11

The documentation for this class was generated from the following file: