ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/OniSplit/Physics/ObjectAnimationImporter.cs
Revision: 1114
Committed: Wed Jan 22 14:08:57 2020 UTC (5 years, 8 months ago) by iritscen
File size: 1235 byte(s)
Log Message:
Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File Contents

# Content
1 using System;
2 using System.Collections.Generic;
3 using System.IO;
4
5 namespace Oni.Physics
6 {
7 internal class ObjectAnimationImporter : Importer
8 {
9 public ObjectAnimationImporter(string[] args)
10 {
11 }
12
13 public override void Import(string filePath, string outputDirPath)
14 {
15 string name = Path.GetFileNameWithoutExtension(filePath);
16
17 if (name.StartsWith("OBAN", StringComparison.Ordinal))
18 name = name.Substring(4);
19
20 var scene = Dae.Reader.ReadFile(filePath);
21
22 var importer = new ObjectDaeImporter(null, new Dictionary<string, Akira.AkiraDaeNodeProperties> {
23 { scene.Id, new ObjectDaeNodeProperties {
24 HasPhysics = true,
25 Animations = { new ObjectAnimationClip {
26 } }
27 } }
28 });
29
30 importer.Import(scene);
31
32 BeginImport();
33
34 foreach (var node in importer.Nodes)
35 {
36 foreach (var anim in node.Animations)
37 ObjectDatWriter.WriteAnimation(anim, this);
38 }
39
40 Write(outputDirPath);
41 }
42 }
43 }