FbxSkeletonTest.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 System.Collections;
  9. using Autodesk.Fbx;
  10. namespace Autodesk.Fbx.UnitTests
  11. {
  12. public class FbxSkeletonTest : FbxNodeAttributeBase<FbxSkeleton>
  13. {
  14. [Test]
  15. public void TestBasics ()
  16. {
  17. var skeleton = CreateObject ("skeleton");
  18. base.TestBasics(skeleton, FbxNodeAttribute.EType.eSkeleton);
  19. Assert.IsFalse (skeleton.GetSkeletonTypeIsSet());
  20. skeleton.SetSkeletonType(FbxSkeleton.EType.eLimb);
  21. Assert.AreEqual (FbxSkeleton.EType.eLimb, skeleton.GetSkeletonType ());
  22. Assert.AreEqual (FbxSkeleton.EType.eRoot, skeleton.GetSkeletonTypeDefaultValue ());
  23. Assert.IsTrue (skeleton.IsSkeletonRoot());
  24. Assert.AreEqual (FbxSkeleton.sDefaultLimbLength, skeleton.GetLimbLengthDefaultValue());
  25. Assert.AreEqual (FbxSkeleton.sDefaultSize, skeleton.GetLimbNodeSizeDefaultValue());
  26. Assert.IsFalse (skeleton.GetLimbNodeColorIsSet());
  27. // Note: alpha does not seem to go through SetLimbNodeColor.
  28. Assert.IsTrue (skeleton.SetLimbNodeColor(new FbxColor(0.5, 0.8, 0.2)));
  29. Assert.AreEqual (new FbxColor(0.5, 0.8, 0.2), skeleton.GetLimbNodeColor());
  30. Assert.AreEqual (new FbxColor(0.8, 0.8, 0.8), skeleton.GetLimbNodeColorDefaultValue());
  31. skeleton.Reset();
  32. Assert.AreEqual (new FbxColor(0.8, 0.8, 0.8), skeleton.GetLimbNodeColor());
  33. Assert.AreEqual (skeleton.Size, skeleton.FindProperty(FbxSkeleton.sSize));
  34. Assert.AreEqual (skeleton.LimbLength, skeleton.FindProperty(FbxSkeleton.sLimbLength));
  35. }
  36. }
  37. }