source: OniSplit/Physics/ObjectAnimationImporter.cs@ 1149

Last change on this file since 1149 was 1114, checked in by iritscen, 5 years ago

Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.IO;
4
5namespace 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}
Note: See TracBrowser for help on using the repository browser.