FbxGlobalSettingsTest.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // ***********************************************************************
  2. // Copyright (c) 2017 Unity Technologies. All rights reserved.
  3. //
  4. // Licensed under the ##LICENSENAME##.
  5. // See LICENSE.md file in the project root for full license information.
  6. // ***********************************************************************
  7. using NUnit.Framework;
  8. using Autodesk.Fbx;
  9. using System.Collections.Generic;
  10. namespace Autodesk.Fbx.UnitTests
  11. {
  12. public class FbxGlobalSettingsTest : Base<FbxGlobalSettings>
  13. {
  14. [Test]
  15. public void TestBasics()
  16. {
  17. var scene = FbxScene.Create(Manager, "");
  18. var settings = scene.GetGlobalSettings();
  19. settings.SetAxisSystem(FbxAxisSystem.MayaYUp);
  20. var axes = settings.GetAxisSystem();
  21. Assert.AreEqual(axes, FbxAxisSystem.MayaYUp);
  22. settings.SetSystemUnit(FbxSystemUnit.m);
  23. var units = settings.GetSystemUnit();
  24. Assert.AreEqual(units, FbxSystemUnit.m);
  25. var settingsB = scene.GetGlobalSettings();
  26. Assert.AreEqual(settings, settingsB);
  27. var scene2 = FbxScene.Create(Manager, "");
  28. var settings2 = scene2.GetGlobalSettings();
  29. Assert.AreNotEqual(settings, settings2);
  30. // Cover all the equality and inequality operators
  31. Assert.That(settings != settings2);
  32. Assert.That(settings as FbxObject != settings2 as FbxObject);
  33. Assert.That(settings as FbxEmitter != settings2 as FbxEmitter);
  34. // test SetDefaultCamera
  35. settings.SetDefaultCamera("camera");
  36. Assert.AreEqual ("camera", settings.GetDefaultCamera ());
  37. // test SetAmbientColor
  38. settings.SetAmbientColor(new FbxColor(1,1,1));
  39. Assert.AreEqual (new FbxColor (1, 1, 1), settings.GetAmbientColor ());
  40. // test SetTimeMode
  41. settings.SetTimeMode(FbxTime.EMode.eFrames100);
  42. Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames100));
  43. }
  44. }
  45. }