Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ImportFbxCommand.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.ComponentModel;
5 using System.IO;
6 using SiliconStudio.Core.Serialization.Assets;
7 using SiliconStudio.Paradox.DataModel;
8 using SiliconStudio.Paradox.Effects.Data;
9 
10 namespace SiliconStudio.BuildEngine
11 {
12  [CommandDependsOn(typeof(Paradox.Importer.FBX.MeshConverter))]
13  [Description("Import FBX")]
15  {
16  /// <inheritdoc/>
17  public override string Title { get { string title = "Import FBX "; try { title += Path.GetFileName(SourcePath) ?? "[File]"; } catch { title += "[INVALID PATH]"; } return title; } }
18 
19  public bool InverseNormals { get; set; }
20 
21  public static bool IsSupportingExtensions(string ext)
22  {
23  return !String.IsNullOrEmpty(ext) && ext.ToLower().Equals(".fbx");
24  }
25 
26  protected override ModelData LoadModel(ICommandContext commandContext, AssetManager assetManager)
27  {
28  var meshConverter = this.CreateMeshConverter(commandContext, assetManager);
29  var sceneData = meshConverter.Convert(SourcePath, Location);
30  return sceneData;
31  }
32 
33  protected override AnimationClip LoadAnimation(ICommandContext commandContext, AssetManager assetManager)
34  {
35  var meshConverter = this.CreateMeshConverter(commandContext, assetManager);
36  var sceneData = meshConverter.ConvertAnimation(SourcePath, Location);
37  return sceneData;
38  }
39 
40  private Paradox.Importer.FBX.MeshConverter CreateMeshConverter(ICommandContext commandContext, AssetManager assetManager)
41  {
42  return new Paradox.Importer.FBX.MeshConverter(commandContext.Logger)
43  {
44  InverseNormals = this.InverseNormals,
45  TextureTagSymbol = this.TextureTagSymbol,
46  ViewDirectionForTransparentZSort = this.ViewDirectionForTransparentZSort,
47  AllowUnsignedBlendIndices = this.AllowUnsignedBlendIndices
48  };
49  }
50 
51  public override bool ShouldSpawnNewProcess()
52  {
53  return true;
54  }
55 
56  public override string ToString()
57  {
58  return "Import FBX " + base.ToString();
59  }
60  }
61 }
override AnimationClip LoadAnimation(ICommandContext commandContext, AssetManager assetManager)
An aggregation of AnimationCurve with their channel names.
Data type for SiliconStudio.Paradox.Effects.Model.
Definition: EngineData.cs:241
static bool IsSupportingExtensions(string ext)
override ModelData LoadModel(ICommandContext commandContext, AssetManager assetManager)