diff --git a/.gitignore b/.gitignore index ec96079..b531e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -194,3 +194,4 @@ _scratch* *.pyc .vs .DS_Store +*.blend1 diff --git a/FbxCli/InflateCommand.cs b/FbxCli/InflateCommand.cs new file mode 100644 index 0000000..3e9a146 --- /dev/null +++ b/FbxCli/InflateCommand.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using NCommander; + +namespace FbxCli; + +public class InflateCommand : Command +{ + public static readonly InflateCommand Value = new(); + + private InflateCommand() + { + Name = "inflate"; + Description = "Decompress a sequence of bytes"; + Params = + [ + new Parameter + { + Name = "filename", + Description = "File to get the bytes from", + ParameterType = ParameterType.String, + IsOptional = true, + } + ]; + Options = + [ + new Option + { + Name = "hex-out", + Description = "Display the output as a space-separated sequence of hexadecimal bytes", + Type = ParameterType.Flag, + } + ]; + } + + protected override void InternalExecute(Dictionary args) + { + var filename = string.Empty; + if (args.ContainsKey("filename")) + filename = (string)args["filename"]; + + var hexOut = false; + if (args.ContainsKey("hex-out")) + hexOut = (bool)args["hex-out"]; + + using var stream = ( + string.IsNullOrWhiteSpace(filename) || filename == "-" + ? System.Console.OpenStandardInput() + : File.Open(filename, FileMode.Open)); + using var zs = new ZLibStream(stream, CompressionMode.Decompress, + true); + using var stdout = System.Console.OpenStandardOutput(); + using var writer = System.Console.Out; + + var total = 0; + var buffer = new byte[4096]; + while (true) + { + var numBytesRead = zs.Read(buffer, 0, 4096); + if (numBytesRead < 1) + break; + total += numBytesRead; + if (hexOut) + { + int i; + for (i = 0; i < numBytesRead; i++) + { + writer.Write("{0:x2} ", buffer[i]); + if (i % 16 == 7) + writer.Write(" "); + if (i % 16 == 15) + writer.WriteLine(); + } + + if (i % 16 != 0) + writer.WriteLine(); + } + else + stdout.Write(buffer, 0, numBytesRead); + } + } +} diff --git a/FbxCli/LsCommand.cs b/FbxCli/LsCommand.cs index b906d0e..8005431 100644 --- a/FbxCli/LsCommand.cs +++ b/FbxCli/LsCommand.cs @@ -251,8 +251,8 @@ void SetIndexes(int n) Console.WriteLine($" Frame count precise: {t.GetFrameCountPrecise()}"); Console.WriteLine($" Field count: {t.GetFieldCount()}"); Console.WriteLine($" Global time mode: {FbxTime.GetGlobalTimeMode()}"); - Console.WriteLine($" FBXSDK_TC_MILLISECOND: {FbxTime.FBXSDK_TC_MILLISECOND}"); - Console.WriteLine($" FBXSDK_TC_SECOND: {FbxTime.FBXSDK_TC_SECOND}"); + Console.WriteLine($" FBXSDK_TC_MILLISECOND: {FbxTimeCode.FBXSDK_TC_MILLISECOND}"); + Console.WriteLine($" FBXSDK_TC_SECOND: {FbxTimeCode.FBXSDK_TC_SECOND}"); break; case "sprop": N = obj.GetSrcPropertyCount(); diff --git a/FbxCli/PrintCommand.cs b/FbxCli/PrintCommand.cs index 501074c..4855964 100644 --- a/FbxCli/PrintCommand.cs +++ b/FbxCli/PrintCommand.cs @@ -70,14 +70,24 @@ protected override void InternalExecute(Dictionary args) } if (parse) { - using (var reader = new StreamReader(filename)) + var fhi = FbxImporter.GetFileHeaderInfo(filename); + List parseObjects = null; + if (fhi.mBinary) + { + using var fs = File.OpenRead(filename); + var bp = BinaryParser.FromFileVersion(fhi.mFileVersion, fs, filename); + fs.Seek(27, SeekOrigin.Begin); + parseObjects = bp.ReadFile(); + } + else { + using var reader = new StreamReader(filename); var p = new Parser(new Tokenizer(reader, filename:filename)); - var objs = p.ReadFile(); - foreach (var obj in objs) - { - PrintParseObject(obj); - } + parseObjects = p.ReadFile(); + } + foreach (var obj in parseObjects) + { + PrintParseObject(obj); } continue; } diff --git a/FbxCli/Program.cs b/FbxCli/Program.cs index a998b05..9649d50 100644 --- a/FbxCli/Program.cs +++ b/FbxCli/Program.cs @@ -11,6 +11,7 @@ public static void Main(string[] args) PrintCommand.Value); commander.Commands.Add(ExploreCommand.Value.Name, ExploreCommand.Value); + commander.Commands.Add(InflateCommand.Value.Name, InflateCommand.Value); if (args == null || args.Length < 1) { commander.ProcessArgs("help"); diff --git a/FbxCppTests/AnimCurveNodeTest.cpp b/FbxCppTests/AnimCurveNodeTest.cpp index a019e1d..1f0f35d 100644 --- a/FbxCppTests/AnimCurveNodeTest.cpp +++ b/FbxCppTests/AnimCurveNodeTest.cpp @@ -12,7 +12,7 @@ void AnimCurveNodeTest_Create_NoChannels() FbxAnimCurveNode* acn = FbxAnimCurveNode::Create(manager, ""); // then: - AssertEqual(0, acn->GetChannelsCount()); + AssertEqual(0, (signed int)acn->GetChannelsCount()); AssertEqual(1, CountProperties(acn)); } @@ -23,7 +23,7 @@ void AnimCurveNodeTest_AddChannel_TwoPropertiesOneChannel() FbxAnimCurveNode* acn = FbxAnimCurveNode::Create(manager, ""); // require: - AssertEqual(0, acn->GetChannelsCount()); + AssertEqual(0, (signed int)acn->GetChannelsCount()); AssertEqual(1, CountProperties(acn)); // when: @@ -31,7 +31,7 @@ void AnimCurveNodeTest_AddChannel_TwoPropertiesOneChannel() // then: AssertEqual(2, CountProperties(acn)); - AssertEqual(1, acn->GetChannelsCount()); + AssertEqual(1, (signed int)acn->GetChannelsCount()); AssertEqual(0, acn->GetCurveCount(0)); FbxProperty prop = acn->GetFirstProperty(); @@ -51,7 +51,7 @@ void AnimCurveNodeTest_ConnectToChannel_AddsSrcConnection() // require: AssertEqual(2, CountProperties(acn)); - AssertEqual(1, acn->GetChannelsCount()); + AssertEqual(1, (signed int)acn->GetChannelsCount()); AssertEqual(0, acn->GetCurveCount(0)); // when: @@ -59,7 +59,7 @@ void AnimCurveNodeTest_ConnectToChannel_AddsSrcConnection() // then: AssertEqual(2, CountProperties(acn)); - AssertEqual(1, acn->GetChannelsCount()); + AssertEqual(1, (signed int)acn->GetChannelsCount()); AssertEqual(1, acn->GetCurveCount(0)); AssertEqual(1, ac->GetDstPropertyCount()); AssertEqual("channel1", ac->GetDstProperty(0).GetName()); diff --git a/FbxCppTests/AnimCurveTest.cpp b/FbxCppTests/AnimCurveTest.cpp index c5e8604..2271d04 100644 --- a/FbxCppTests/AnimCurveTest.cpp +++ b/FbxCppTests/AnimCurveTest.cpp @@ -496,6 +496,75 @@ void FbxAnimCurve_Create_HasNamespacePrefix() AssertEqual("AnimCurve::", obj->GetNameSpacePrefix()); } +void FbxAnimCurve_KeyGet() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxAnimCurve* ac = FbxAnimCurve::Create(manager, "asdf"); + + // expect: + AssertEqual(0, ac->KeyGetCount()); + + // when: + FbxTime* time; + time = new FbxTime(100); + FbxAnimCurveKey key = FbxAnimCurveKey(*time, 1.5f); + int i; + i = ac->KeyAdd(*time, key); + AssertEqual(0, i); + + // then: + AssertEqual(1, ac->KeyGetCount()); + FbxAnimCurveKey key2; + key2 = ac->KeyGet(0); + AssertEqual(100LL, key2.GetTime().Get()); + AssertEqual(1.5f, key.GetValue()); +} + +void FbxAnimCurve_KeyGet_KeysAreSortedByTimeValue() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxAnimCurve* ac = FbxAnimCurve::Create(manager, "asdf"); + FbxTime* time; + time = new FbxTime(0); + FbxAnimCurveKey key1 = FbxAnimCurveKey(*time, 0.5f); + int i; + i = ac->KeyAdd(*time, key1); + AssertEqual(0, i); + time = new FbxTime(2000); + FbxAnimCurveKey key2 = FbxAnimCurveKey(*time, 2.5f); + i = ac->KeyAdd(*time, key2); + AssertEqual(1, i); + + // expect: + AssertEqual(2, ac->KeyGetCount()); + FbxAnimCurveKey key = ac->KeyGet(0); + AssertEqual(0LL, key.GetTime().Get()); + AssertEqual(0.5f, key.GetValue()); + key = ac->KeyGet(1); + AssertEqual(2000LL, key.GetTime().Get()); + AssertEqual(2.5f, key.GetValue()); + + // when: + time = new FbxTime(1000); + FbxAnimCurveKey key3 = FbxAnimCurveKey(*time, 1.5f); + i = ac->KeyAdd(*time, key3); + AssertEqual(1, i); + + // then: + AssertEqual(3, ac->KeyGetCount()); + key = ac->KeyGet(0); + AssertEqual(0LL, key.GetTime().Get()); + AssertEqual(0.5f, key.GetValue()); + key = ac->KeyGet(1); + AssertEqual(1000LL, key.GetTime().Get()); + AssertEqual(1.5f, key.GetValue()); + key = ac->KeyGet(2); + AssertEqual(2000LL, key.GetTime().Get()); + AssertEqual(2.5f, key.GetValue()); +} + void AnimCurveTest::RegisterTestCases() { AddTestCase(AnimCurveDef_Defaults); @@ -509,5 +578,7 @@ void AnimCurveTest::RegisterTestCases() AddTestCase(AnimCurve_ThreeKeyVaryInTime_EvaluationsAreCorrect); AddTestCase(AnimCurve_ThreeKeyVaryInValue_EvaluationsAreCorrect); AddTestCase(FbxAnimCurve_Create_HasNamespacePrefix); + AddTestCase(FbxAnimCurve_KeyGet); + AddTestCase(FbxAnimCurve_KeyGet_KeysAreSortedByTimeValue); } diff --git a/FbxCppTests/Assertions.cpp b/FbxCppTests/Assertions.cpp index d69da4e..9e1b572 100644 --- a/FbxCppTests/Assertions.cpp +++ b/FbxCppTests/Assertions.cpp @@ -1,5 +1,6 @@  #include "Assertions.h" +#include "print.h" #include @@ -40,6 +41,11 @@ void _AssertEqual(const char* expected, FbxString& actual, const char* filename, _AssertEqual(expected, actual.Buffer(), filename, line); } +void _AssertEqual(string& expected, FbxString& actual, const char* filename, int line) +{ + _AssertEqual(expected.c_str(), actual.Buffer(), filename, line); +} + void _AssertEqual(FbxVector4 expected, FbxVector4 actual, const char* filename, int line) { if (expected != actual) @@ -153,12 +159,72 @@ void _AssertEqual(FbxLongLong expected, FbxLongLong actual, const char* filename } } -void _AssertNotEqual(void* expected, void* actual, const char* filename, int line) +void _AssertEqual(FbxDateTime expected, FbxDateTime actual, const char* filename, int line) +{ + if (expected != actual) + { + stringstream ss; + ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line; + throw new string(ss.str()); + } +} + +void _AssertEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line) +{ + if (!(expected == actual)) + { + stringstream ss; + ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line; + throw new string(ss.str()); + } +} + +void _AssertEqual(long expected, long actual, const char* filename, int line) +{ + if (!(expected == actual)) + { + stringstream ss; + ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line; + throw new string(ss.str()); + } +} + +void _AssertEqual(long expected, FbxLongLong actual, const char* filename, int line) +{ + if (!(expected == actual)) + { + stringstream ss; + ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line; + throw new string(ss.str()); + } +} + +void _AssertEqual(int expected, long actual, const char* filename, int line) +{ + _AssertEqual((long)expected, actual, filename, line); +} + +void _AssertEqual(FbxTime expected, FbxTime actual, const char* filename, int line) +{ + _AssertEqual(expected.Get(), actual.Get(), filename, line); +} + +void _AssertNotEqual(void* not_expected, void* actual, const char* filename, int line) +{ + if (not_expected == actual) + { + stringstream ss; + ss << "Expected not(" << not_expected << ") but got " << actual << ", at " << filename << ":" << line; + throw new string(ss.str()); + } +} + +void _AssertNotEqual(FbxDataType not_expected, FbxDataType actual, const char* filename, int line) { - if (expected == actual) + if (not_expected == actual) { stringstream ss; - ss << "Expected not(" << expected << ") but got " << actual << ", at " << filename << ":" << line; + ss << "Expected not equal to " << not_expected << " but got " << actual << ", at " << filename << ":" << line; throw new string(ss.str()); } } diff --git a/FbxCppTests/Assertions.h b/FbxCppTests/Assertions.h index 2f7c1cc..b6302dd 100644 --- a/FbxCppTests/Assertions.h +++ b/FbxCppTests/Assertions.h @@ -2,18 +2,27 @@ #ifndef __FBXCPPTESTS_ASSERTIONS_H #define __FBXCPPTESTS_ASSERTIONS_H +#include #include void _AssertEqual(int expected, int actual, const char* filename, int line); void _AssertEqual(void* expected, void* actual, const char* filename, int line); void _AssertEqual(const char* expected, const char* actual, const char* filename, int line); void _AssertEqual(const char* expected, FbxString& actual, const char* filename, int line); +void _AssertEqual(std::string& expected, FbxString& actual, const char* filename, int line); void _AssertEqual(FbxVector4 expected, FbxVector4 actual, const char* filename, int line); void _AssertEqual(double expected, double actual, const char* filename, int line, double epsilon=0); void _AssertEqual(FbxMatrix expected, FbxMatrix actual, const char* filename, int line, double epsilon=0); void _AssertEqual(FbxAMatrix expected, FbxAMatrix actual, const char* filename, int line, double epsilon=0); void _AssertEqual(FbxLongLong expected, FbxLongLong actual, const char* filename, int line); +void _AssertEqual(FbxDateTime expected, FbxDateTime actual, const char* filename, int line); +void _AssertEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line); +void _AssertEqual(long expected, long actual, const char* filename, int line); +void _AssertEqual(long expected, FbxLongLong actual, const char* filename, int line); +void _AssertEqual(int expected, long actual, const char* filename, int line); +void _AssertEqual(FbxTime expected, FbxTime actual, const char* filename, int line); void _AssertNotEqual(void* expected, void* actual, const char* filename, int line); +void _AssertNotEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line); void _AssertNull(void* actual, const char* filename, int line); void _AssertNotNull(void* actual, const char* filename, int line); void _AssertTrue(bool condition, const char* filename, int line); diff --git a/FbxCppTests/DeformerTest.cpp b/FbxCppTests/DeformerTest.cpp index 95fd3ac..180d8f7 100644 --- a/FbxCppTests/DeformerTest.cpp +++ b/FbxCppTests/DeformerTest.cpp @@ -3,7 +3,18 @@ using namespace std; +void Deformer_Create_HasNamespacePrefix() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxSkin* obj = FbxSkin::Create(manager, "asdf"); + + // then: + AssertEqual("Deformer::", obj->GetNameSpacePrefix());; +} + void DeformerTest::RegisterTestCases() { + AddTestCase(Deformer_Create_HasNamespacePrefix); } diff --git a/FbxCppTests/EFbxTypeTest.cpp b/FbxCppTests/EFbxTypeTest.cpp new file mode 100644 index 0000000..1d7dc90 --- /dev/null +++ b/FbxCppTests/EFbxTypeTest.cpp @@ -0,0 +1,41 @@ + +#include "Tests.h" + +using namespace std; + +void EFbxType_IdentifiersHaveSpecificValues() +{ + // expect: + AssertEqual(0, (int)EFbxType::eFbxUndefined); + AssertEqual(1, (int)EFbxType::eFbxChar); + AssertEqual(2, (int)EFbxType::eFbxUChar); + AssertEqual(3, (int)EFbxType::eFbxShort); + AssertEqual(4, (int)EFbxType::eFbxUShort); + AssertEqual(5, (int)EFbxType::eFbxUInt); + AssertEqual(6, (int)EFbxType::eFbxLongLong); + AssertEqual(7, (int)EFbxType::eFbxULongLong); + AssertEqual(8, (int)EFbxType::eFbxHalfFloat); + AssertEqual(9, (int)EFbxType::eFbxBool); + AssertEqual(10, (int)EFbxType::eFbxInt); + AssertEqual(11, (int)EFbxType::eFbxFloat); + AssertEqual(12, (int)EFbxType::eFbxDouble); + AssertEqual(13, (int)EFbxType::eFbxDouble2); + AssertEqual(14, (int)EFbxType::eFbxDouble3); + AssertEqual(15, (int)EFbxType::eFbxDouble4); + AssertEqual(16, (int)EFbxType::eFbxDouble4x4); + AssertEqual(17, (int)EFbxType::eFbxEnum); + AssertEqual(-17, (int)EFbxType::eFbxEnumM); + AssertEqual(18, (int)EFbxType::eFbxString); + AssertEqual(19, (int)EFbxType::eFbxTime); + AssertEqual(20, (int)EFbxType::eFbxReference); + AssertEqual(21, (int)EFbxType::eFbxBlob); + AssertEqual(22, (int)EFbxType::eFbxDistance); + AssertEqual(23, (int)EFbxType::eFbxDateTime); + AssertEqual(24, (int)EFbxType::eFbxTypeCount); +} + +void EFbxTypeTest::RegisterTestCases() +{ + AddTestCase(EFbxType_IdentifiersHaveSpecificValues); +} + diff --git a/FbxCppTests/FbxAxisSystemTest.cpp b/FbxCppTests/FbxAxisSystemTest.cpp new file mode 100644 index 0000000..2ad494f --- /dev/null +++ b/FbxCppTests/FbxAxisSystemTest.cpp @@ -0,0 +1,28 @@ + +#include "Tests.h" + +using namespace std; + +void FbxAxisSystem_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxAxisSystem* obj; + + // when: + obj = new FbxAxisSystem(); + + // then: + int sign = 0; + AssertEqual(FbxAxisSystem::EFrontVector::eParityOdd, obj->GetFrontVector(sign)); + AssertEqual(1, sign); + AssertEqual(FbxAxisSystem::EUpVector::eYAxis, obj->GetUpVector(sign)); + AssertEqual(1, sign); + AssertEqual(FbxAxisSystem::ECoordSystem::eRightHanded, obj->GetCoorSystem()); +} + +void FbxAxisSystemTest::RegisterTestCases() +{ + AddTestCase(FbxAxisSystem_Create_HasDefaults); +} + diff --git a/FbxCppTests/FbxCppTests.csproj b/FbxCppTests/FbxCppTests.csproj index 3de97f5..4edd378 100644 --- a/FbxCppTests/FbxCppTests.csproj +++ b/FbxCppTests/FbxCppTests.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/FbxCppTests/FbxDataTypeTest.cpp b/FbxCppTests/FbxDataTypeTest.cpp new file mode 100644 index 0000000..453ba4d --- /dev/null +++ b/FbxCppTests/FbxDataTypeTest.cpp @@ -0,0 +1,80 @@ + +#include "Tests.h" + +using namespace std; + +void FbxDataType_DefaultConstructor_AttributesSet() +{ + // when: + FbxDataType dt = FbxDataType::Create("int", EFbxType::eFbxInt); + // then: + AssertTrue(dt.Valid()); + AssertEqual("int", dt.GetName()); + AssertEqual(EFbxType::eFbxInt, dt.GetType()); +} + +void FbxDataType_OperatorEquals_MatchesSelfButNotIdenticalObjects() +{ + // when: + FbxDataType dt1 = FbxDataType::Create("int", EFbxType::eFbxInt); + FbxDataType dt2 = FbxDataType::Create("int", EFbxType::eFbxInt); + + // then: + AssertTrue(dt1.Valid()); + AssertTrue(dt2.Valid()); + AssertEqual(dt1.GetName(), dt2.GetName()); + AssertEqual(dt1.GetType(), dt2.GetType()); + AssertEqual(dt1, dt1); + AssertEqual(dt1, dt1); + AssertTrue(dt1 == dt1); + AssertTrue(dt2 == dt2); + AssertFalse(dt1 != dt1); + AssertFalse(dt2 != dt2); + AssertNotEqual(FbxIntDT, dt1); + AssertNotEqual(FbxIntDT, dt2); + AssertFalse(FbxIntDT == dt1); + AssertFalse(FbxIntDT == dt2); + AssertTrue(FbxIntDT != dt1); + AssertTrue(FbxIntDT != dt2); + AssertNotEqual(dt1, dt2); + AssertFalse(dt1 == dt2); + AssertTrue(dt1 != dt2); +} + +void FbxDataType_FbxGetDataTypeFromEnum_YieldsCorrectDataType() +{ + // expect: + AssertEqual(FbxUndefinedDT, FbxGetDataTypeFromEnum(EFbxType::eFbxUndefined)); + AssertEqual(FbxCharDT, FbxGetDataTypeFromEnum(EFbxType::eFbxChar)); + AssertEqual(FbxUCharDT, FbxGetDataTypeFromEnum(EFbxType::eFbxUChar)); + AssertEqual(FbxShortDT, FbxGetDataTypeFromEnum(EFbxType::eFbxShort)); + AssertEqual(FbxUShortDT, FbxGetDataTypeFromEnum(EFbxType::eFbxUShort)); + AssertEqual(FbxUIntDT, FbxGetDataTypeFromEnum(EFbxType::eFbxUInt)); + AssertEqual(FbxLongLongDT, FbxGetDataTypeFromEnum(EFbxType::eFbxLongLong)); + AssertEqual(FbxULongLongDT, FbxGetDataTypeFromEnum(EFbxType::eFbxULongLong)); + AssertEqual(FbxHalfFloatDT, FbxGetDataTypeFromEnum(EFbxType::eFbxHalfFloat)); + AssertEqual(FbxBoolDT, FbxGetDataTypeFromEnum(EFbxType::eFbxBool)); + AssertEqual(FbxIntDT, FbxGetDataTypeFromEnum(EFbxType::eFbxInt)); + AssertEqual(FbxFloatDT, FbxGetDataTypeFromEnum(EFbxType::eFbxFloat)); + AssertEqual(FbxDoubleDT, FbxGetDataTypeFromEnum(EFbxType::eFbxDouble)); + AssertEqual(FbxDouble2DT, FbxGetDataTypeFromEnum(EFbxType::eFbxDouble2)); + AssertEqual(FbxDouble3DT, FbxGetDataTypeFromEnum(EFbxType::eFbxDouble3)); + AssertEqual(FbxDouble4DT, FbxGetDataTypeFromEnum(EFbxType::eFbxDouble4)); + AssertEqual(FbxDouble4x4DT, FbxGetDataTypeFromEnum(EFbxType::eFbxDouble4x4)); + AssertEqual(FbxEnumDT, FbxGetDataTypeFromEnum(EFbxType::eFbxEnum)); + AssertEqual(FbxEnumDT, FbxGetDataTypeFromEnum(EFbxType::eFbxEnumM)); + AssertEqual(FbxStringDT, FbxGetDataTypeFromEnum(EFbxType::eFbxString)); + AssertEqual(FbxTimeDT, FbxGetDataTypeFromEnum(EFbxType::eFbxTime)); + AssertEqual(FbxReferenceDT, FbxGetDataTypeFromEnum(EFbxType::eFbxReference)); + AssertEqual(FbxBlobDT, FbxGetDataTypeFromEnum(EFbxType::eFbxBlob)); + AssertEqual(FbxDistanceDT, FbxGetDataTypeFromEnum(EFbxType::eFbxDistance)); + AssertEqual(FbxDateTimeDT, FbxGetDataTypeFromEnum(EFbxType::eFbxDateTime)); +} + +void FbxDataTypeTest::RegisterTestCases() +{ + AddTestCase(FbxDataType_DefaultConstructor_AttributesSet); + AddTestCase(FbxDataType_OperatorEquals_MatchesSelfButNotIdenticalObjects); + AddTestCase(FbxDataType_FbxGetDataTypeFromEnum_YieldsCorrectDataType); +} + diff --git a/FbxCppTests/FbxDataTypesTest.cpp b/FbxCppTests/FbxDataTypesTest.cpp new file mode 100644 index 0000000..d62312e --- /dev/null +++ b/FbxCppTests/FbxDataTypesTest.cpp @@ -0,0 +1,1026 @@ + +#include "Tests.h" + +using namespace std; + +void FbxDataTypes_FbxUndefinedDT_HasDefaultsAndIsNotValid() +{ + // expect: + AssertFalse(FbxUndefinedDT.Valid()); + AssertEqual(EFbxType::eFbxUndefined, FbxUndefinedDT.GetType()); + AssertEqual("", FbxUndefinedDT.GetName()); +} + +void FbxDataTypes_FbxBoolDT_HasDefaults() +{ + // expect: + AssertTrue(FbxBoolDT.Valid()); + AssertEqual(EFbxType::eFbxBool, FbxBoolDT.GetType()); + AssertEqual("Bool", FbxBoolDT.GetName()); +} + +void FbxDataTypes_FbxCharDT_HasDefaults() +{ + // expect: + AssertTrue(FbxCharDT.Valid()); + AssertEqual(EFbxType::eFbxChar, FbxCharDT.GetType()); + AssertEqual("Byte", FbxCharDT.GetName()); +} + +void FbxDataTypes_FbxUCharDT_HasDefaults() +{ + // expect: + AssertTrue(FbxUCharDT.Valid()); + AssertEqual(EFbxType::eFbxUChar, FbxUCharDT.GetType()); + AssertEqual("UByte", FbxUCharDT.GetName()); +} + +void FbxDataTypes_FbxShortDT_HasDefaults() +{ + // expect: + AssertTrue(FbxShortDT.Valid()); + AssertEqual(EFbxType::eFbxShort, FbxShortDT.GetType()); + AssertEqual("Short", FbxShortDT.GetName()); +} + +void FbxDataTypes_FbxUShortDT_HasDefaults() +{ + // expect: + AssertTrue(FbxUShortDT.Valid()); + AssertEqual(EFbxType::eFbxUShort, FbxUShortDT.GetType()); + AssertEqual("UShort", FbxUShortDT.GetName()); +} + +void FbxDataTypes_FbxIntDT_HasDefaults() +{ + // expect: + AssertTrue(FbxIntDT.Valid()); + AssertEqual(EFbxType::eFbxInt, FbxIntDT.GetType()); + AssertEqual("Integer", FbxIntDT.GetName()); +} + +void FbxDataTypes_FbxUIntDT_HasDefaults() +{ + // expect: + AssertTrue(FbxUIntDT.Valid()); + AssertEqual(EFbxType::eFbxUInt, FbxUIntDT.GetType()); + AssertEqual("UInteger", FbxUIntDT.GetName()); +} + +void FbxDataTypes_FbxLongLongDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLongLongDT.Valid()); + AssertEqual(EFbxType::eFbxLongLong, FbxLongLongDT.GetType()); + AssertEqual("LongLong", FbxLongLongDT.GetName()); +} + +void FbxDataTypes_FbxULongLongDT_HasDefaults() +{ + // expect: + AssertTrue(FbxULongLongDT.Valid()); + AssertEqual(EFbxType::eFbxULongLong, FbxULongLongDT.GetType()); + AssertEqual("ULongLong", FbxULongLongDT.GetName()); +} + +void FbxDataTypes_FbxFloatDT_HasDefaults() +{ + // expect: + AssertTrue(FbxFloatDT.Valid()); + AssertEqual(EFbxType::eFbxFloat, FbxFloatDT.GetType()); + AssertEqual("Float", FbxFloatDT.GetName()); +} + +void FbxDataTypes_FbxHalfFloatDT_HasDefaults() +{ + // expect: + AssertTrue(FbxHalfFloatDT.Valid()); + AssertEqual(EFbxType::eFbxHalfFloat, FbxHalfFloatDT.GetType()); + AssertEqual("HalfFloat", FbxHalfFloatDT.GetName()); +} + +void FbxDataTypes_FbxDoubleDT_HasDefaults() +{ + // expect: + AssertTrue(FbxDoubleDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxDoubleDT.GetType()); + AssertEqual("Number", FbxDoubleDT.GetName()); +} + +void FbxDataTypes_FbxDouble2DT_HasDefaults() +{ + // expect: + AssertTrue(FbxDouble2DT.Valid()); + AssertEqual(EFbxType::eFbxDouble2, FbxDouble2DT.GetType()); + AssertEqual("Vector2", FbxDouble2DT.GetName()); +} + +void FbxDataTypes_FbxDouble3DT_HasDefaults() +{ + // expect: + AssertTrue(FbxDouble3DT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxDouble3DT.GetType()); + AssertEqual("Vector", FbxDouble3DT.GetName()); +} + +void FbxDataTypes_FbxDouble4DT_HasDefaults() +{ + // expect: + AssertTrue(FbxDouble4DT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxDouble4DT.GetType()); + AssertEqual("Vector4", FbxDouble4DT.GetName()); +} + +void FbxDataTypes_FbxDouble4x4DT_HasDefaults() +{ + // expect: + AssertTrue(FbxDouble4x4DT.Valid()); + AssertEqual(EFbxType::eFbxDouble4x4, FbxDouble4x4DT.GetType()); + AssertEqual("Matrix", FbxDouble4x4DT.GetName()); +} + +void FbxDataTypes_FbxEnumDT_HasDefaults() +{ + // expect: + AssertTrue(FbxEnumDT.Valid()); + AssertEqual(EFbxType::eFbxEnum, FbxEnumDT.GetType()); + AssertEqual("Enum", FbxEnumDT.GetName()); +} + +void FbxDataTypes_FbxStringDT_HasDefaults() +{ + // expect: + AssertTrue(FbxStringDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxStringDT.GetType()); + AssertEqual("KString", FbxStringDT.GetName()); +} + +void FbxDataTypes_FbxTimeDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTimeDT.Valid()); + AssertEqual(EFbxType::eFbxTime, FbxTimeDT.GetType()); + AssertEqual("Time", FbxTimeDT.GetName()); +} + +void FbxDataTypes_FbxReferenceDT_HasDefaults() +{ + // expect: + AssertTrue(FbxReferenceDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxReferenceDT.GetType()); + AssertEqual("Reference", FbxReferenceDT.GetName()); +} + +void FbxDataTypes_FbxBlobDT_HasDefaults() +{ + // expect: + AssertTrue(FbxBlobDT.Valid()); + AssertEqual(EFbxType::eFbxBlob, FbxBlobDT.GetType()); + AssertEqual("Blob", FbxBlobDT.GetName()); +} + +void FbxDataTypes_FbxDistanceDT_HasDefaults() +{ + // expect: + AssertTrue(FbxDistanceDT.Valid()); + AssertEqual(EFbxType::eFbxDistance, FbxDistanceDT.GetType()); + AssertEqual("Distance", FbxDistanceDT.GetName()); +} + +void FbxDataTypes_FbxDateTimeDT_HasDefaults() +{ + // expect: + AssertTrue(FbxDateTimeDT.Valid()); + AssertEqual(EFbxType::eFbxDateTime, FbxDateTimeDT.GetType()); + AssertEqual("DateTime", FbxDateTimeDT.GetName()); +} + +void FbxDataTypes_FbxColor3DT_HasDefaults() +{ + // expect: + AssertTrue(FbxColor3DT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxColor3DT.GetType()); + AssertEqual("Color", FbxColor3DT.GetName()); +} + +void FbxDataTypes_FbxColor4DT_HasDefaults() +{ + // expect: + AssertTrue(FbxColor4DT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxColor4DT.GetType()); + AssertEqual("ColorAndAlpha", FbxColor4DT.GetName()); +} + +void FbxDataTypes_FbxCompoundDT_HasDefaults() +{ + // expect: + AssertTrue(FbxCompoundDT.Valid()); + AssertEqual(EFbxType::eFbxUndefined, FbxCompoundDT.GetType()); + AssertEqual("Compound", FbxCompoundDT.GetName()); +} + +void FbxDataTypes_FbxReferenceObjectDT_HasDefaults() +{ + // expect: + AssertTrue(FbxReferenceObjectDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxReferenceObjectDT.GetType()); + AssertEqual("object", FbxReferenceObjectDT.GetName()); +} + +void FbxDataTypes_FbxReferencePropertyDT_HasDefaults() +{ + // expect: + AssertTrue(FbxReferencePropertyDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxReferencePropertyDT.GetType()); + AssertEqual("ReferenceProperty", FbxReferencePropertyDT.GetName()); +} + +void FbxDataTypes_FbxVisibilityDT_HasDefaults() +{ + // expect: + AssertTrue(FbxVisibilityDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxVisibilityDT.GetType()); + AssertEqual("Visibility", FbxVisibilityDT.GetName()); +} + +void FbxDataTypes_FbxVisibilityInheritanceDT_HasDefaults() +{ + // expect: + AssertTrue(FbxVisibilityInheritanceDT.Valid()); + AssertEqual(EFbxType::eFbxBool, FbxVisibilityInheritanceDT.GetType()); + AssertEqual("Visibility Inheritance", FbxVisibilityInheritanceDT.GetName()); +} + +void FbxDataTypes_FbxUrlDT_HasDefaults() +{ + // expect: + AssertTrue(FbxUrlDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxUrlDT.GetType()); + AssertEqual("Url", FbxUrlDT.GetName()); +} + +void FbxDataTypes_FbxXRefUrlDT_HasDefaults() +{ + // expect: + AssertTrue(FbxXRefUrlDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxXRefUrlDT.GetType()); + AssertEqual("XRefUrl", FbxXRefUrlDT.GetName()); +} + +void FbxDataTypes_FbxTranslationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTranslationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxTranslationDT.GetType()); + AssertEqual("Translation", FbxTranslationDT.GetName()); +} + +void FbxDataTypes_FbxRotationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxRotationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxRotationDT.GetType()); + AssertEqual("Rotation", FbxRotationDT.GetName()); +} + +void FbxDataTypes_FbxScalingDT_HasDefaults() +{ + // expect: + AssertTrue(FbxScalingDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxScalingDT.GetType()); + AssertEqual("Scaling", FbxScalingDT.GetName()); +} + +void FbxDataTypes_FbxQuaternionDT_HasDefaults() +{ + // expect: + AssertTrue(FbxQuaternionDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxQuaternionDT.GetType()); + AssertEqual("Quaternion", FbxQuaternionDT.GetName()); +} + +void FbxDataTypes_FbxLocalTranslationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLocalTranslationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxLocalTranslationDT.GetType()); + AssertEqual("Lcl Translation", FbxLocalTranslationDT.GetName()); +} + +void FbxDataTypes_FbxLocalRotationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLocalRotationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxLocalRotationDT.GetType()); + AssertEqual("Lcl Rotation", FbxLocalRotationDT.GetName()); +} + +void FbxDataTypes_FbxLocalScalingDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLocalScalingDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxLocalScalingDT.GetType()); + AssertEqual("Lcl Scaling", FbxLocalScalingDT.GetName()); +} + +void FbxDataTypes_FbxLocalQuaternionDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLocalQuaternionDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxLocalQuaternionDT.GetType()); + AssertEqual("Lcl Quaternion", FbxLocalQuaternionDT.GetName()); +} + +void FbxDataTypes_FbxTransformMatrixDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTransformMatrixDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4x4, FbxTransformMatrixDT.GetType()); + AssertEqual("Matrix Transformation", FbxTransformMatrixDT.GetName()); +} + +void FbxDataTypes_FbxTranslationMatrixDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTranslationMatrixDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4x4, FbxTranslationMatrixDT.GetType()); + AssertEqual("Matrix Translation", FbxTranslationMatrixDT.GetName()); +} + +void FbxDataTypes_FbxRotationMatrixDT_HasDefaults() +{ + // expect: + AssertTrue(FbxRotationMatrixDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4x4, FbxRotationMatrixDT.GetType()); + AssertEqual("Matrix Rotation", FbxRotationMatrixDT.GetName()); +} + +void FbxDataTypes_FbxScalingMatrixDT_HasDefaults() +{ + // expect: + AssertTrue(FbxScalingMatrixDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4x4, FbxScalingMatrixDT.GetType()); + AssertEqual("Matrix Scaling", FbxScalingMatrixDT.GetName()); +} + +void FbxDataTypes_FbxMaterialEmissiveDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialEmissiveDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialEmissiveDT.GetType()); + AssertEqual("Emissive", FbxMaterialEmissiveDT.GetName()); +} + +void FbxDataTypes_FbxMaterialEmissiveFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialEmissiveFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialEmissiveFactorDT.GetType()); + AssertEqual("EmissiveFactor", FbxMaterialEmissiveFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialAmbientDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialAmbientDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialAmbientDT.GetType()); + AssertEqual("Ambient", FbxMaterialAmbientDT.GetName()); +} + +void FbxDataTypes_FbxMaterialAmbientFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialAmbientFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialAmbientFactorDT.GetType()); + AssertEqual("AmbientFactor", FbxMaterialAmbientFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialDiffuseDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialDiffuseDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialDiffuseDT.GetType()); + AssertEqual("Diffuse", FbxMaterialDiffuseDT.GetName()); +} + +void FbxDataTypes_FbxMaterialDiffuseFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialDiffuseFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialDiffuseFactorDT.GetType()); + AssertEqual("DiffuseFactor", FbxMaterialDiffuseFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialBumpDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialBumpDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialBumpDT.GetType()); + AssertEqual("Bump", FbxMaterialBumpDT.GetName()); +} + +void FbxDataTypes_FbxMaterialNormalMapDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialNormalMapDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialNormalMapDT.GetType()); + AssertEqual("NormalMap", FbxMaterialNormalMapDT.GetName()); +} + +void FbxDataTypes_FbxMaterialTransparentColorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialTransparentColorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialTransparentColorDT.GetType()); + AssertEqual("Transparent", FbxMaterialTransparentColorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialTransparencyFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialTransparencyFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialTransparencyFactorDT.GetType()); + AssertEqual("TransparencyFactor", FbxMaterialTransparencyFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialSpecularDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialSpecularDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialSpecularDT.GetType()); + AssertEqual("Specular", FbxMaterialSpecularDT.GetName()); +} + +void FbxDataTypes_FbxMaterialSpecularFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialSpecularFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialSpecularFactorDT.GetType()); + AssertEqual("SpecularFactor", FbxMaterialSpecularFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialShininessDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialShininessDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialShininessDT.GetType()); + AssertEqual("Shininess", FbxMaterialShininessDT.GetName()); +} + +void FbxDataTypes_FbxMaterialReflectionDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialReflectionDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialReflectionDT.GetType()); + AssertEqual("Reflection", FbxMaterialReflectionDT.GetName()); +} + +void FbxDataTypes_FbxMaterialReflectionFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialReflectionFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialReflectionFactorDT.GetType()); + AssertEqual("ReflectionFactor", FbxMaterialReflectionFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialDisplacementDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialDisplacementDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialDisplacementDT.GetType()); + AssertEqual("Displacement", FbxMaterialDisplacementDT.GetName()); +} + +void FbxDataTypes_FbxMaterialVectorDisplacementDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialVectorDisplacementDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialVectorDisplacementDT.GetType()); + AssertEqual("VectorDisplacement", FbxMaterialVectorDisplacementDT.GetName()); +} + +void FbxDataTypes_FbxMaterialCommonFactorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialCommonFactorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxMaterialCommonFactorDT.GetType()); + AssertEqual("Unknown Factor", FbxMaterialCommonFactorDT.GetName()); +} + +void FbxDataTypes_FbxMaterialCommonTextureDT_HasDefaults() +{ + // expect: + AssertTrue(FbxMaterialCommonTextureDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxMaterialCommonTextureDT.GetType()); + AssertEqual("Unknown texture", FbxMaterialCommonTextureDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementUndefinedDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementUndefinedDT.Valid()); + AssertEqual(EFbxType::eFbxUndefined, FbxLayerElementUndefinedDT.GetType()); + AssertEqual("LayerElementUndefined", FbxLayerElementUndefinedDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementNormalDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementNormalDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxLayerElementNormalDT.GetType()); + AssertEqual("LayerElementNormal", FbxLayerElementNormalDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementBinormalDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementBinormalDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxLayerElementBinormalDT.GetType()); + AssertEqual("LayerElementBinormal", FbxLayerElementBinormalDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementTangentDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementTangentDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxLayerElementTangentDT.GetType()); + AssertEqual("LayerElementTangent", FbxLayerElementTangentDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementMaterialDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementMaterialDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxLayerElementMaterialDT.GetType()); + AssertEqual("LayerElementMaterial", FbxLayerElementMaterialDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementTextureDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementTextureDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxLayerElementTextureDT.GetType()); + AssertEqual("LayerElementTexture", FbxLayerElementTextureDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementPolygonGroupDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementPolygonGroupDT.Valid()); + AssertEqual(EFbxType::eFbxInt, FbxLayerElementPolygonGroupDT.GetType()); + AssertEqual("LayerElementPolygonGroup", FbxLayerElementPolygonGroupDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementUVDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementUVDT.Valid()); + AssertEqual(EFbxType::eFbxDouble2, FbxLayerElementUVDT.GetType()); + AssertEqual("LayerElementUV", FbxLayerElementUVDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementVertexColorDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementVertexColorDT.Valid()); + AssertEqual(EFbxType::eFbxDouble4, FbxLayerElementVertexColorDT.GetType()); + AssertEqual("LayerElementVertexColor", FbxLayerElementVertexColorDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementSmoothingDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementSmoothingDT.Valid()); + AssertEqual(EFbxType::eFbxInt, FbxLayerElementSmoothingDT.GetType()); + AssertEqual("LayerElementSmoothing", FbxLayerElementSmoothingDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementCreaseDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementCreaseDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxLayerElementCreaseDT.GetType()); + AssertEqual("LayerElementCrease", FbxLayerElementCreaseDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementHoleDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementHoleDT.Valid()); + AssertEqual(EFbxType::eFbxBool, FbxLayerElementHoleDT.GetType()); + AssertEqual("LayerElementHole", FbxLayerElementHoleDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementUserDataDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementUserDataDT.Valid()); + AssertEqual(EFbxType::eFbxReference, FbxLayerElementUserDataDT.GetType()); + AssertEqual("LayerElementUserData", FbxLayerElementUserDataDT.GetName()); +} + +void FbxDataTypes_FbxLayerElementVisibilityDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLayerElementVisibilityDT.Valid()); + AssertEqual(EFbxType::eFbxBool, FbxLayerElementVisibilityDT.GetType()); + AssertEqual("LayerElementVisibility", FbxLayerElementVisibilityDT.GetName()); +} + +void FbxDataTypes_FbxAliasDT_HasDefaults() +{ + // expect: + AssertTrue(FbxAliasDT.Valid()); + AssertEqual(EFbxType::eFbxEnum, FbxAliasDT.GetType()); + AssertEqual("Alias", FbxAliasDT.GetName()); +} + +void FbxDataTypes_FbxPresetsDT_HasDefaults() +{ + // expect: + AssertTrue(FbxPresetsDT.Valid()); + AssertEqual(EFbxType::eFbxEnum, FbxPresetsDT.GetType()); + AssertEqual("Presets", FbxPresetsDT.GetName()); +} + +void FbxDataTypes_FbxStatisticsDT_HasDefaults() +{ + // expect: + AssertTrue(FbxStatisticsDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxStatisticsDT.GetType()); + AssertEqual("Statistics", FbxStatisticsDT.GetName()); +} + +void FbxDataTypes_FbxTextLineDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTextLineDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxTextLineDT.GetType()); + AssertEqual("TextLine", FbxTextLineDT.GetName()); +} + +void FbxDataTypes_FbxUnitsDT_HasDefaults() +{ + // expect: + AssertTrue(FbxUnitsDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxUnitsDT.GetType()); + AssertEqual("Units", FbxUnitsDT.GetName()); +} + +void FbxDataTypes_FbxWarningDT_HasDefaults() +{ + // expect: + AssertTrue(FbxWarningDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxWarningDT.GetType()); + AssertEqual("Warning", FbxWarningDT.GetName()); +} + +void FbxDataTypes_FbxWebDT_HasDefaults() +{ + // expect: + AssertTrue(FbxWebDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxWebDT.GetType()); + AssertEqual("Web", FbxWebDT.GetName()); +} + +void FbxDataTypes_FbxActionDT_HasDefaults() +{ + // expect: + AssertTrue(FbxActionDT.Valid()); + AssertEqual(EFbxType::eFbxBool, FbxActionDT.GetType()); + AssertEqual("Action", FbxActionDT.GetName()); +} + +void FbxDataTypes_FbxCameraIndexDT_HasDefaults() +{ + // expect: + AssertTrue(FbxCameraIndexDT.Valid()); + AssertEqual(EFbxType::eFbxInt, FbxCameraIndexDT.GetType()); + AssertEqual("Camera Index", FbxCameraIndexDT.GetName()); +} + +void FbxDataTypes_FbxCharPtrDT_HasDefaults() +{ + // expect: + AssertTrue(FbxCharPtrDT.Valid()); + AssertEqual(EFbxType::eFbxString, FbxCharPtrDT.GetType()); + AssertEqual("charptr", FbxCharPtrDT.GetName()); +} + +void FbxDataTypes_FbxConeAngleDT_HasDefaults() +{ + // expect: + AssertTrue(FbxConeAngleDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxConeAngleDT.GetType()); + AssertEqual("Cone angle", FbxConeAngleDT.GetName()); +} + +void FbxDataTypes_FbxEventDT_HasDefaults() +{ + // expect: + AssertTrue(FbxEventDT.Valid()); + AssertEqual(EFbxType::eFbxUndefined, FbxEventDT.GetType()); + AssertEqual("event", FbxEventDT.GetName()); +} + +void FbxDataTypes_FbxFieldOfViewDT_HasDefaults() +{ + // expect: + AssertTrue(FbxFieldOfViewDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxFieldOfViewDT.GetType()); + AssertEqual("FieldOfView", FbxFieldOfViewDT.GetName()); +} + +void FbxDataTypes_FbxFieldOfViewXDT_HasDefaults() +{ + // expect: + AssertTrue(FbxFieldOfViewXDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxFieldOfViewXDT.GetType()); + AssertEqual("FieldOfViewX", FbxFieldOfViewXDT.GetName()); +} + +void FbxDataTypes_FbxFieldOfViewYDT_HasDefaults() +{ + // expect: + AssertTrue(FbxFieldOfViewYDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxFieldOfViewYDT.GetType()); + AssertEqual("FieldOfViewY", FbxFieldOfViewYDT.GetName()); +} + +void FbxDataTypes_FbxFogDT_HasDefaults() +{ + // expect: + AssertTrue(FbxFogDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxFogDT.GetType()); + AssertEqual("Fog", FbxFogDT.GetName()); +} + +void FbxDataTypes_FbxHSBDT_HasDefaults() +{ + // expect: + AssertTrue(FbxHSBDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxHSBDT.GetType()); + AssertEqual("HSB", FbxHSBDT.GetName()); +} + +void FbxDataTypes_FbxIKReachTranslationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxIKReachTranslationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxIKReachTranslationDT.GetType()); + AssertEqual("IK Reach Translation", FbxIKReachTranslationDT.GetName()); +} + +void FbxDataTypes_FbxIKReachRotationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxIKReachRotationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxIKReachRotationDT.GetType()); + AssertEqual("IK Reach Rotation", FbxIKReachRotationDT.GetName()); +} + +void FbxDataTypes_FbxIntensityDT_HasDefaults() +{ + // expect: + AssertTrue(FbxIntensityDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxIntensityDT.GetType()); + AssertEqual("Intensity", FbxIntensityDT.GetName()); +} + +void FbxDataTypes_FbxLookAtDT_HasDefaults() +{ + // expect: + AssertTrue(FbxLookAtDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxLookAtDT.GetType()); + AssertEqual("Look at", FbxLookAtDT.GetName()); +} + +void FbxDataTypes_FbxOcclusionDT_HasDefaults() +{ + // expect: + AssertTrue(FbxOcclusionDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxOcclusionDT.GetType()); + AssertEqual("Occlusion", FbxOcclusionDT.GetName()); +} + +void FbxDataTypes_FbxOpticalCenterXDT_HasDefaults() +{ + // expect: + AssertTrue(FbxOpticalCenterXDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxOpticalCenterXDT.GetType()); + AssertEqual("OpticalCenterX", FbxOpticalCenterXDT.GetName()); +} + +void FbxDataTypes_FbxOpticalCenterYDT_HasDefaults() +{ + // expect: + AssertTrue(FbxOpticalCenterYDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxOpticalCenterYDT.GetType()); + AssertEqual("OpticalCenterY", FbxOpticalCenterYDT.GetName()); +} + +void FbxDataTypes_FbxOrientationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxOrientationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxOrientationDT.GetType()); + AssertEqual("Orientation", FbxOrientationDT.GetName()); +} + +void FbxDataTypes_FbxRealDT_HasDefaults() +{ + // expect: + AssertTrue(FbxRealDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxRealDT.GetType()); + AssertEqual("Real", FbxRealDT.GetName()); +} + +void FbxDataTypes_FbxRollDT_HasDefaults() +{ + // expect: + AssertTrue(FbxRollDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxRollDT.GetType()); + AssertEqual("Roll", FbxRollDT.GetName()); +} + +void FbxDataTypes_FbxScalingUVDT_HasDefaults() +{ + // expect: + AssertTrue(FbxScalingUVDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxScalingUVDT.GetType()); + AssertEqual("Scaling UV", FbxScalingUVDT.GetName()); +} + +void FbxDataTypes_FbxShapeDT_HasDefaults() +{ + // expect: + AssertTrue(FbxShapeDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxShapeDT.GetType()); + AssertEqual("Shape", FbxShapeDT.GetName()); +} + +void FbxDataTypes_FbxStringListDT_HasDefaults() +{ + // expect: + AssertTrue(FbxStringListDT.Valid()); + AssertEqual(EFbxType::eFbxEnumM, FbxStringListDT.GetType()); + AssertEqual("stringlist", FbxStringListDT.GetName()); +} + +void FbxDataTypes_FbxTextureRotationDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTextureRotationDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxTextureRotationDT.GetType()); + AssertEqual("TextureRotation", FbxTextureRotationDT.GetName()); +} + +void FbxDataTypes_FbxTimeCodeDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTimeCodeDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxTimeCodeDT.GetType()); + AssertEqual("TimeCode", FbxTimeCodeDT.GetName()); +} + +void FbxDataTypes_FbxTimeWarpDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTimeWarpDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxTimeWarpDT.GetType()); + AssertEqual("TimeWarp", FbxTimeWarpDT.GetName()); +} + +void FbxDataTypes_FbxTranslationUVDT_HasDefaults() +{ + // expect: + AssertTrue(FbxTranslationUVDT.Valid()); + AssertEqual(EFbxType::eFbxDouble3, FbxTranslationUVDT.GetType()); + AssertEqual("Translation UV", FbxTranslationUVDT.GetName()); +} + +void FbxDataTypes_FbxWeightDT_HasDefaults() +{ + // expect: + AssertTrue(FbxWeightDT.Valid()); + AssertEqual(EFbxType::eFbxDouble, FbxWeightDT.GetType()); + AssertEqual("Weight", FbxWeightDT.GetName()); +} + +void FbxDataTypesTest::RegisterTestCases() +{ + AddTestCase(FbxDataTypes_FbxUndefinedDT_HasDefaultsAndIsNotValid); + AddTestCase(FbxDataTypes_FbxBoolDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxCharDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxUCharDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxShortDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxUShortDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxIntDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxUIntDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLongLongDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxULongLongDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxFloatDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxHalfFloatDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDoubleDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDouble2DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDouble3DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDouble4DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDouble4x4DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxEnumDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxStringDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTimeDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxReferenceDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxBlobDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDistanceDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxDateTimeDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxColor3DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxColor4DT_HasDefaults); + AddTestCase(FbxDataTypes_FbxCompoundDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxReferenceObjectDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxReferencePropertyDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxVisibilityDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxVisibilityInheritanceDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxUrlDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxXRefUrlDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTranslationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxRotationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxScalingDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxQuaternionDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLocalTranslationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLocalRotationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLocalScalingDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLocalQuaternionDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTransformMatrixDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTranslationMatrixDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxRotationMatrixDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxScalingMatrixDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialEmissiveDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialEmissiveFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialAmbientDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialAmbientFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialDiffuseDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialDiffuseFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialBumpDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialNormalMapDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialTransparentColorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialTransparencyFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialSpecularDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialSpecularFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialShininessDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialReflectionDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialReflectionFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialDisplacementDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialVectorDisplacementDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialCommonFactorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxMaterialCommonTextureDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementUndefinedDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementNormalDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementBinormalDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementTangentDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementMaterialDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementTextureDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementPolygonGroupDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementUVDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementVertexColorDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementSmoothingDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementCreaseDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementHoleDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementUserDataDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLayerElementVisibilityDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxAliasDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxPresetsDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxStatisticsDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTextLineDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxUnitsDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxWarningDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxWebDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxActionDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxCameraIndexDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxCharPtrDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxConeAngleDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxEventDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxFieldOfViewDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxFieldOfViewXDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxFieldOfViewYDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxFogDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxHSBDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxIKReachTranslationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxIKReachRotationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxIntensityDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxLookAtDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxOcclusionDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxOpticalCenterXDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxOpticalCenterYDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxOrientationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxRealDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxRollDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxScalingUVDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxShapeDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxStringListDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTextureRotationDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTimeCodeDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTimeWarpDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxTranslationUVDT_HasDefaults); + AddTestCase(FbxDataTypes_FbxWeightDT_HasDefaults); +} + diff --git a/FbxCppTests/FbxDocumentInfoTest.cpp b/FbxCppTests/FbxDocumentInfoTest.cpp new file mode 100644 index 0000000..78b4057 --- /dev/null +++ b/FbxCppTests/FbxDocumentInfoTest.cpp @@ -0,0 +1,143 @@ + +#include "Tests.h" + +using namespace std; + +void FbxDocumentInfo_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxDateTime dt0 = FbxDateTime(); + FbxProperty prop; + + // when: + FbxDocumentInfo* docinfo = FbxDocumentInfo::Create(manager, ""); + + // then: + AssertEqual(15, CountProperties(docinfo)); + + prop = docinfo->FindProperty("DocumentUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("DocumentUrl", prop.GetName()); + AssertEqual("DocumentUrl", prop.GetHierarchicalName()); + AssertEqual(FbxUrlDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->LastSavedUrl); + + prop = docinfo->FindProperty("SrcDocumentUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("SrcDocumentUrl", prop.GetName()); + AssertEqual("SrcDocumentUrl", prop.GetHierarchicalName()); + AssertEqual(FbxUrlDT, prop.GetPropertyDataType()); + AssertEqual(FbxString(""), prop.Get()); + AssertTrue(prop == docinfo->Url); + + prop = docinfo->FindProperty("Original"); + AssertTrue(prop.IsValid()); + AssertEqual("Original", prop.GetName()); + AssertEqual("Original", prop.GetHierarchicalName()); + AssertEqual(FbxCompoundDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->Original); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationVendor"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVendor", prop.GetName()); + AssertEqual("Original|ApplicationVendor", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->Original_ApplicationVendor); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationName"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationName", prop.GetName()); + AssertEqual("Original|ApplicationName", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->Original_ApplicationName); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationVersion"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVersion", prop.GetName()); + AssertEqual("Original|ApplicationVersion", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->Original_ApplicationVersion); + + prop = docinfo->FindPropertyHierarchical("Original|DateTime_GMT"); + AssertTrue(prop.IsValid()); + AssertEqual("DateTime_GMT", prop.GetName()); + AssertEqual("Original|DateTime_GMT", prop.GetHierarchicalName()); + AssertEqual(FbxDateTimeDT, prop.GetPropertyDataType()); + AssertEqual(dt0, prop.Get()); + AssertTrue(prop == docinfo->Original_DateTime_GMT); + + prop = docinfo->FindPropertyHierarchical("Original|FileName"); + AssertTrue(prop.IsValid()); + AssertEqual("FileName", prop.GetName()); + AssertEqual("Original|FileName", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->Original_FileName); + + prop = docinfo->FindProperty("LastSaved"); + AssertTrue(prop.IsValid()); + AssertEqual("LastSaved", prop.GetName()); + AssertEqual("LastSaved", prop.GetHierarchicalName()); + AssertEqual(FbxCompoundDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->LastSaved); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationVendor"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVendor", prop.GetName()); + AssertEqual("LastSaved|ApplicationVendor", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->LastSaved_ApplicationVendor); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationName"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationName", prop.GetName()); + AssertEqual("LastSaved|ApplicationName", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->LastSaved_ApplicationName); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationVersion"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVersion", prop.GetName()); + AssertEqual("LastSaved|ApplicationVersion", prop.GetHierarchicalName()); + AssertEqual(FbxStringDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->LastSaved_ApplicationVersion); + + prop = docinfo->FindPropertyHierarchical("LastSaved|DateTime_GMT"); + AssertTrue(prop.IsValid()); + AssertEqual("DateTime_GMT", prop.GetName()); + AssertEqual("LastSaved|DateTime_GMT", prop.GetHierarchicalName()); + AssertEqual(FbxDateTimeDT, prop.GetPropertyDataType()); + AssertEqual(dt0, prop.Get()); + AssertTrue(prop == docinfo->LastSaved_DateTime_GMT); + + prop = docinfo->FindProperty("DocumentEmbeddedUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("DocumentEmbeddedUrl", prop.GetName()); + AssertEqual("DocumentEmbeddedUrl", prop.GetHierarchicalName()); + AssertEqual(FbxUrlDT, prop.GetPropertyDataType()); + AssertEqual("", prop.Get()); + AssertTrue(prop == docinfo->EmbeddedUrl); + + prop = docinfo->FindProperty("SceneThumbnail"); + AssertTrue(prop.IsValid()); + AssertEqual("SceneThumbnail", prop.GetName()); + AssertEqual("SceneThumbnail", prop.GetHierarchicalName()); + AssertEqual(FbxReferenceObjectDT, prop.GetPropertyDataType()); + AssertEqual(NULL, prop.Get()); +} + +void FbxDocumentInfoTest::RegisterTestCases() +{ + AddTestCase(FbxDocumentInfo_Create_HasDefaults); +} + diff --git a/FbxCppTests/FbxGlobalSettingsTest.cpp b/FbxCppTests/FbxGlobalSettingsTest.cpp new file mode 100644 index 0000000..f0aa741 --- /dev/null +++ b/FbxCppTests/FbxGlobalSettingsTest.cpp @@ -0,0 +1,244 @@ + +#include "Tests.h" + +using namespace std; + +void FbxGlobalSettings_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxGlobalSettings* settings = FbxGlobalSettings::Create(manager, ""); + FbxProperty prop; + + // expect: + AssertNotNull(settings); + AssertEqual(0, settings->GetSrcObjectCount()); + AssertEqual(0, settings->GetDstObjectCount()); + AssertEqual(0, settings->GetSrcPropertyCount()); + AssertEqual(0, settings->GetDstPropertyCount()); + + AssertEqual(20, CountProperties(settings)); + + prop = settings->FindProperty("UpAxis"); + AssertTrue(prop.IsValid()); + AssertEqual("UpAxis", prop.GetName()); + AssertEqual("UpAxis", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxAxisSystem::EUpVector::eXAxis, prop.Get()); + + prop = settings->FindProperty("UpAxisSign"); + AssertTrue(prop.IsValid()); + AssertEqual("UpAxisSign", prop.GetName()); + AssertEqual("UpAxisSign", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + + prop = settings->FindProperty("FrontAxis"); + AssertTrue(prop.IsValid()); + AssertEqual("FrontAxis", prop.GetName()); + AssertEqual("FrontAxis", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxAxisSystem::EFrontVector::eParityOdd, prop.Get()); + + prop = settings->FindProperty("FrontAxisSign"); + AssertTrue(prop.IsValid()); + AssertEqual("FrontAxisSign", prop.GetName()); + AssertEqual("FrontAxisSign", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + + prop = settings->FindProperty("CoordAxis"); + AssertTrue(prop.IsValid()); + AssertEqual("CoordAxis", prop.GetName()); + AssertEqual("CoordAxis", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxAxisSystem::ECoordSystem::eRightHanded, prop.Get()); + + prop = settings->FindProperty("CoordAxisSign"); + AssertTrue(prop.IsValid()); + AssertEqual("CoordAxisSign", prop.GetName()); + AssertEqual("CoordAxisSign", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + + prop = settings->FindProperty("OriginalUpAxis"); + AssertTrue(prop.IsValid()); + AssertEqual("OriginalUpAxis", prop.GetName()); + AssertEqual("OriginalUpAxis", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(-1, prop.Get()); + + prop = settings->FindProperty("OriginalUpAxisSign"); + AssertTrue(prop.IsValid()); + AssertEqual("OriginalUpAxisSign", prop.GetName()); + AssertEqual("OriginalUpAxisSign", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + + prop = settings->FindProperty("UnitScaleFactor"); + AssertTrue(prop.IsValid()); + AssertEqual("UnitScaleFactor", prop.GetName()); + AssertEqual("UnitScaleFactor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.0d, prop.Get()); + + prop = settings->FindProperty("OriginalUnitScaleFactor"); + AssertTrue(prop.IsValid()); + AssertEqual("OriginalUnitScaleFactor", prop.GetName()); + AssertEqual("OriginalUnitScaleFactor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.0d, prop.Get()); + + prop = settings->FindProperty("AmbientColor"); + AssertTrue(prop.IsValid()); + AssertEqual("AmbientColor", prop.GetName()); + AssertEqual("AmbientColor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble3, prop.GetPropertyDataType().GetType()); + FbxColor color = prop.Get(); + AssertEqual(0.0d, color.mRed); + AssertEqual(0.0d, color.mGreen); + AssertEqual(0.0d, color.mBlue); + + prop = settings->FindProperty("DefaultCamera"); + AssertTrue(prop.IsValid()); + AssertEqual("DefaultCamera", prop.GetName()); + AssertEqual("DefaultCamera", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("Producer Perspective", prop.Get()); + + prop = settings->FindProperty("TimeMode"); + AssertTrue(prop.IsValid()); + AssertEqual("TimeMode", prop.GetName()); + AssertEqual("TimeMode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxTime::EMode::eDefaultMode, prop.Get()); + + prop = settings->FindProperty("TimeProtocol"); + AssertTrue(prop.IsValid()); + AssertEqual("TimeProtocol", prop.GetName()); + AssertEqual("TimeProtocol", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxTime::EProtocol::eDefaultProtocol, prop.Get()); + + prop = settings->FindProperty("SnapOnFrameMode"); + AssertTrue(prop.IsValid()); + AssertEqual("SnapOnFrameMode", prop.GetName()); + AssertEqual("SnapOnFrameMode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual((int)FbxGlobalSettings::ESnapOnFrameMode::eNoSnap, prop.Get()); + + prop = settings->FindProperty("TimeSpanStart"); + AssertTrue(prop.IsValid()); + AssertEqual("TimeSpanStart", prop.GetName()); + AssertEqual("TimeSpanStart", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxTime, prop.GetPropertyDataType().GetType()); + AssertEqual(FbxTime(0), prop.Get()); + + prop = settings->FindProperty("TimeSpanStop"); + AssertTrue(prop.IsValid()); + AssertEqual("TimeSpanStop", prop.GetName()); + AssertEqual("TimeSpanStop", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxTime, prop.GetPropertyDataType().GetType()); + AssertEqual(FbxTime(141120000L), prop.Get()); + + prop = settings->FindProperty("CustomFrameRate"); + AssertTrue(prop.IsValid()); + AssertEqual("CustomFrameRate", prop.GetName()); + AssertEqual("CustomFrameRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(-1.0d, prop.Get()); + + prop = settings->FindProperty("TimeMarker"); + AssertTrue(prop.IsValid()); + AssertEqual("TimeMarker", prop.GetName()); + AssertEqual("TimeMarker", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxUndefined, prop.GetPropertyDataType().GetType()); + AssertEqual(0.0d, prop.Get()); + + prop = settings->FindProperty("CurrentTimeMarker"); + AssertTrue(prop.IsValid()); + AssertEqual("CurrentTimeMarker", prop.GetName()); + AssertEqual("CurrentTimeMarker", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(-1, prop.Get()); + + AssertEqual(-1, settings->GetOriginalUpAxis()); + + FbxAxisSystem a = settings->GetAxisSystem(); + int sign = 0; + AssertEqual(FbxAxisSystem::EUpVector::eYAxis, a.GetUpVector(sign)); + AssertEqual(1, sign); + AssertEqual(FbxAxisSystem::EFrontVector::eParityOdd, a.GetFrontVector(sign)); + AssertEqual(1, sign); + AssertEqual(FbxAxisSystem::ECoordSystem::eRightHanded, a.GetCoorSystem( )); + + FbxSystemUnit su = settings->GetSystemUnit(); + AssertEqual(1.0d, su.GetMultiplier()); + AssertEqual("cm", su.GetScaleFactorAsString()); + AssertEqual("Centimeters", su.GetScaleFactorAsString_Plurial()); + AssertTrue(FbxSystemUnit::cm == su); + + su = settings->GetOriginalSystemUnit(); + AssertEqual(1.0d, su.GetMultiplier()); + AssertEqual("cm", su.GetScaleFactorAsString()); + AssertEqual("Centimeters", su.GetScaleFactorAsString_Plurial()); + AssertTrue(FbxSystemUnit::cm == su); + + color = settings->GetAmbientColor(); + AssertEqual(0.0d, color.mRed); + AssertEqual(0.0d, color.mGreen); + AssertEqual(0.0d, color.mBlue); + + AssertEqual("Producer Perspective", settings->GetDefaultCamera()); + + AssertEqual(FbxTime::EMode::eFrames30, settings->GetTimeMode()); + AssertEqual(FbxTime::EProtocol::eFrameCount, settings->GetTimeProtocol()); + AssertEqual(FbxGlobalSettings::ESnapOnFrameMode::eNoSnap, settings->GetSnapOnFrameMode()); + FbxTimeSpan ts; + settings->GetTimelineDefaultTimeSpan(ts); + AssertEqual(0L, ts.GetStart().Get()); + AssertEqual(141120000L, ts.GetStop().Get()); + AssertEqual(141120000L, ts.GetDuration().Get()); + AssertEqual(-1.0d, settings->GetCustomFrameRate()); + + AssertEqual(0, settings->GetTimeMarkerCount()); + AssertEqual(-1, settings->GetCurrentTimeMarker()); +} + +void FbxGlobalSettings_SetTimeMode_DifferentFromProperty() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxGlobalSettings* settings = FbxGlobalSettings::Create(manager, ""); + FbxProperty prop; + prop = settings->FindProperty("TimeMode"); + + // expect: + AssertEqual((int)FbxTime::EMode::eDefaultMode, prop.Get()); + AssertEqual(FbxTime::EMode::eFrames30, settings->GetTimeMode()); + + // when: + settings->SetTimeMode(FbxTime::EMode::eFrames48); + // then: + AssertEqual((int)FbxTime::EMode::eFrames48, prop.Get()); + AssertEqual(FbxTime::EMode::eFrames48, settings->GetTimeMode()); + + // when: + settings->SetTimeMode(FbxTime::EMode::eFrames30); + // then: + AssertEqual((int)FbxTime::EMode::eFrames30, prop.Get()); + AssertEqual(FbxTime::EMode::eFrames30, settings->GetTimeMode()); + + // when: + settings->SetTimeMode(FbxTime::EMode::eDefaultMode); + // then: + AssertEqual((int)FbxTime::EMode::eDefaultMode, prop.Get()); + AssertEqual(FbxTime::EMode::eFrames30, settings->GetTimeMode()); +} + +void FbxGlobalSettingsTest::RegisterTestCases() +{ + AddTestCase(FbxGlobalSettings_Create_HasDefaults); + AddTestCase(FbxGlobalSettings_SetTimeMode_DifferentFromProperty); +} + diff --git a/FbxCppTests/FbxIOSettingsTest.cpp b/FbxCppTests/FbxIOSettingsTest.cpp new file mode 100644 index 0000000..f94ae9b --- /dev/null +++ b/FbxCppTests/FbxIOSettingsTest.cpp @@ -0,0 +1,2262 @@ +#include "objects.h" + +#include "Tests.h" + +using namespace std; + +void FbxIOSettings_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxIOSettings* settings = FbxIOSettings::Create(manager, ""); + FbxProperty prop; + + // expect: + AssertNotNull(settings); + AssertEqual(0, settings->GetSrcObjectCount()); + AssertEqual(0, settings->GetDstObjectCount()); + AssertEqual(0, settings->GetSrcPropertyCount()); + AssertEqual(0, settings->GetDstPropertyCount()); + + AssertFalse(settings->GetProperty(IOSN_PLUGIN_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_UI_WIDTH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_UI_HEIGHT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_VERSIONS_URL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PI_VERSION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PRESET_SELECTED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PRESETS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_STATISTICS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNITS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_INCLUDE_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ADV_OPT_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AXISCONV_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CAMERA_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_LIGHT_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EXTRA_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONSTRAINTS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_INPUTCONNECTIONS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_INFORMATION_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UP_AXIS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UP_AXIS_MAX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ZUPROTATION_MAX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AXISCONVERSION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AUTO_AXIS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FILE_UP_AXIS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PRESETS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_STATISTICS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNITS_SCALE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TOTAL_UNITS_SCALE_TB).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SCALECONVERSION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MASTERSCALE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DYN_SCALE_CONVERSION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNITSELECTOR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AUDIO).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ANIMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DEFORMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MARKERS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CHARACTER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CHARACTER_AS_MAYA_HIK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CHARACTER_TYPE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CHARACTER_TYPE_DESC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SETLOCKEDATTRIB).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TRIANGULATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MRCUSTOMATTRIBUTES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MESHPRIMITIVE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MESHTRIANGLE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MESHPOLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_NURB).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PATCH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BIP2FBX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ASCIIFBX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TAKE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYMESHPRIMITIVEAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYMESHTRIANGLEAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYMESHPOLYAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYNURBSAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYNURBSSURFACEAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMETRYPATCHAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TANGENTS_BINORMALS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SMOOTH_MESH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SELECTION_SET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ANIMATIONONLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SELECTIONONLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONEWIDTHHEIGHTLOCK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONEASDUMMY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONEMAX4BONEWIDTH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONEMAX4BONEHEIGHT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BONEMAX4BONETAPER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_REMOVE_SINGLE_KEY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CURVE_FILTER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONSTRAINT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UI).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHOW_UI_MODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHOW_WARNINGS_MANAGER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GENERATE_LOG_DATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PERF_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_REMOVEBADPOLYSFROMMESH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_META_DATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CACHE_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CACHE_SIZE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MERGE_MODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MERGE_MODE_DESCRIPTION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ONE_CLICK_MERGE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ONE_CLICK_MERGE_TEXTURE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SAMPLINGPANEL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FILE_FORMAT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FBX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF).IsValid()); + AssertFalse(settings->GetProperty(IOSN_OBJ).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_BASE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BIOVISION_BVH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTIONANALYSIS_HTR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTIONANALYSIS_TRC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ACCLAIM_ASF).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ACCLAIM_AMC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VICON_C3D).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SKINS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_POINTCACHE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_QUATERNION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_NAMETAKE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHAPE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHAPEATTRIBUTES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHAPEATTRIBUTE_VALUES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_LIGHT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_LIGHTATTENUATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CAMERA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VIEW_CUBE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BINDPOSE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EMBEDTEXTURE_GRP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EMBEDTEXTURE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EMBEDDED_FOLDER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONVERTTOTIFF).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNLOCK_NORMALS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CREASE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FINESTSUBDIVLEVEL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEANIMATIONLAYERS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKECOMPLEXANIMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMESTART).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMEEND).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMESTEP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMESTARTNORESET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMEENDNORESET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BAKEFRAMESTEPNORESET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_USEMATRIXFROMPOSE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_NULLSTOPIVOT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PIVOTTONULLS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GEOMNORMALPERPOLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MAXBONEASBONE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MAXNURBSSTEP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PROTECTDRIVENKEYS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DEFORMNULLSASJOINTS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ENVIRONMENT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SAMPLINGRATESELECTOR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SAMPLINGRATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_APPLYCSTKEYRED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CSTKEYREDTPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CSTKEYREDRPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CSTKEYREDSPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CSTKEYREDOPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_APPLYKEYREDUCE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_KEYREDUCEPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_APPLYKEYSONFRM).IsValid()); + AssertFalse(settings->GetProperty(IOSN_APPLYKEYSYNC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_APPLYUNROLL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNROLLPREC).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNROLLPATH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UNROLLFORCEAUTO).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AUTOTANGENTSONLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SMOOTHING_GROUPS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_HARDEDGES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EXP_HARDEDGES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BLINDDATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_INPUTCONNECTIONS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_INSTANCES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_REFERENCES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONTAINEROBJECTS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BYPASSRRSINHERITANCE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FORCEWEIGHTNORMALIZE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHAPEANIMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SMOOTHKEYASUSER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SCALEFACTOR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_AXISCONVERSIONMETHOD).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UPAXIS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SELECTIONSETNAMEASPOINTCACHE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_KEEPFRAMERATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ATTENUATIONASINTENSITYCURVE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_RESAMPLE_ANIMATION_CURVES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TIMELINE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TIMELINE_SPAN).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BUTTON_WEB_UPDATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BUTTON_EDIT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BUTTON_OK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BUTTON_CANCEL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MENU_EDIT_PRESET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MENU_SAVE_PRESET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_UIL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_PRODUCT_FAMILY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_UI_XPOS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PLUGIN_UI_YPOS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FBX_EXTENTIONS_SDK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FBX_EXTENTIONS_SDK_WARNING).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_FRAME_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_START).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_TAKE_NAME).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_TRIANGULATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_SINGLEMATRIX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLADA_FRAME_RATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF_TRIANGULATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF_DEFORMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF_WELD_VERTICES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF_OBJECT_DERIVATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DXF_REFERENCE_NODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_OBJ_REFERENCE_NODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_OBJ_TRIANGULATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_OBJ_DEFORMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_REFERENCENODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_TEXTURE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_MATERIAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_ANIMATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_MESH).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_LIGHT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_CAMERA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_AMBIENT_LIGHT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_RESCALING).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_FILTER).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_SMOOTHGROUP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_TAKE_NAME).IsValid()); + AssertFalse(settings->GetProperty(IOSN_3DS_TEXUVBYPOLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ZOOMEXTENTS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GLOBAL_AMBIENT_COLOR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EDGE_ORIENTATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VERSIONS_UI_ALIAS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VERSIONS_COMP_DESCRIPTIONS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MODEL_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_DEVICE_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CHARACTER_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ACTOR_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONSTRAINT_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MEDIA_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TEMPLATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PIVOT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GLOBAL_SETTINGS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MERGE_LAYER_AND_TIMEWARP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_GOBO).IsValid()); + AssertFalse(settings->GetProperty(IOSN_LINK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MATERIAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TEXTURE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MODEL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_NORMAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_BINORMAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_TANGENT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VERTEXCOLOR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_POLYGROUP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SMOOTHING).IsValid()); + AssertFalse(settings->GetProperty(IOSN_USERDATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VISIBILITY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EDGECREASE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_VERTEXCREASE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_HOLE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EMBEDDED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PASSWORD).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PASSWORD_ENABLE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CURRENT_TAKE_NAME).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COLLAPSE_EXTERNALS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COMPRESS_ARRAYS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COMPRESS_LEVEL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_COMPRESS_MINSIZE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EMBEDDED_PROPERTIES_SKIP).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EXPORT_FILE_VERSION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_SHOW_UI_WARNING).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ADD_MATERIAL_TO_EDIT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_ENABLE_TEX_DISPLAY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_PREFERED_ENVELOPPE_SYSTEM).IsValid()); + AssertFalse(settings->GetProperty(IOSN_FIRST_TIME_RUN_NOTICE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_EXTRACT_EMBEDDED_DATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CALCULATE_LEGACY_SHAPE_NORMAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_USETMPFILEPERIPHERAL).IsValid()); + AssertFalse(settings->GetProperty(IOSN_CONSTRUCTIONHISTORY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_RELAXED_FBX_CHECK).IsValid()); + AssertFalse(settings->GetProperty(IOSN_KEEP_PRODUCER_CAM_SRCOBJ).IsValid()); + AssertFalse(settings->GetProperty(IMP_INFORMATION_GRP).IsValid()); + AssertFalse(settings->GetProperty(IMP_SETLOCKEDATTRIB).IsValid()); + AssertFalse(settings->GetProperty(IMP_ADD_MATERIAL_TO_EDIT).IsValid()); + AssertFalse(settings->GetProperty(IMP_ENABLE_TEX_DISPLAY).IsValid()); + AssertFalse(settings->GetProperty(IMP_PREFERED_ENVELOPPE_SYSTEM).IsValid()); + AssertFalse(settings->GetProperty(IMP_ENVIRONMENT).IsValid()); + AssertFalse(settings->GetProperty(IMP_VIEW_CUBE).IsValid()); + AssertFalse(settings->GetProperty(IMP_ZOOMEXTENTS).IsValid()); + AssertFalse(settings->GetProperty(IMP_GLOBAL_AMBIENT_COLOR).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONE).IsValid()); + AssertFalse(settings->GetProperty(IMP_ATTENUATIONASINTENSITYCURVE).IsValid()); + AssertFalse(settings->GetProperty(IMP_QUATERNION).IsValid()); + AssertFalse(settings->GetProperty(IMP_PROTECTDRIVENKEYS).IsValid()); + AssertFalse(settings->GetProperty(IMP_DEFORMNULLSASJOINTS).IsValid()); + AssertFalse(settings->GetProperty(IMP_NULLSTOPIVOT).IsValid()); + AssertFalse(settings->GetProperty(IMP_POINTCACHE).IsValid()); + AssertFalse(settings->GetProperty(IMP_SHAPEANIMATION).IsValid()); + AssertFalse(settings->GetProperty(IMP_CONSTRAINTS_GRP).IsValid()); + AssertFalse(settings->GetProperty(IMP_CONSTRAINT).IsValid()); + AssertFalse(settings->GetProperty(IMP_CHARACTER).IsValid()); + AssertFalse(settings->GetProperty(IMP_CHARACTER_AS_MAYA_HIK).IsValid()); + AssertFalse(settings->GetProperty(IMP_CHARACTER_TYPE).IsValid()); + AssertFalse(settings->GetProperty(IMP_PERF_GRP).IsValid()); + AssertFalse(settings->GetProperty(IMP_REMOVEBADPOLYSFROMMESH).IsValid()); + AssertFalse(settings->GetProperty(IMP_META_DATA).IsValid()); + AssertFalse(settings->GetProperty(IMP_SHOW_UI_WARNING).IsValid()); + AssertFalse(settings->GetProperty(IMP_UNLOCK_NORMALS).IsValid()); + AssertFalse(settings->GetProperty(IMP_CREASE).IsValid()); + AssertFalse(settings->GetProperty(IMP_SMOOTHING_GROUPS).IsValid()); + AssertFalse(settings->GetProperty(IMP_HARDEDGES).IsValid()); + AssertFalse(settings->GetProperty(IMP_BLINDDATA).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONE_WIDTHHEIGHTLOCK).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONEASDUMMY).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONEMAX4BONEWIDTH).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONEMAX4BONEHEIGHT).IsValid()); + AssertFalse(settings->GetProperty(IMP_BONEMAX4BONETAPER).IsValid()); + AssertFalse(settings->GetProperty(IMP_SHAPE).IsValid()); + AssertFalse(settings->GetProperty(IMP_FORCEWEIGHTNORMALIZE).IsValid()); + AssertFalse(settings->GetProperty(IMP_APPLYCSTKEYRED).IsValid()); + AssertFalse(settings->GetProperty(IMP_CSTKEYREDTPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_CSTKEYREDRPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_CSTKEYREDSPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_CSTKEYREDOPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_AUTOTANGENTSONLY).IsValid()); + AssertFalse(settings->GetProperty(IMP_APPLYKEYREDUCE).IsValid()); + AssertFalse(settings->GetProperty(IMP_KEYREDUCEPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_APPLYKEYSONFRM).IsValid()); + AssertFalse(settings->GetProperty(IMP_APPLYKEYSYNC).IsValid()); + AssertFalse(settings->GetProperty(IMP_APPLYUNROLL).IsValid()); + AssertFalse(settings->GetProperty(IMP_UNROLLPREC).IsValid()); + AssertFalse(settings->GetProperty(IMP_UNROLLPATH).IsValid()); + AssertFalse(settings->GetProperty(IMP_UNROLLFORCEAUTO).IsValid()); + AssertFalse(settings->GetProperty(IMP_UP_AXIS).IsValid()); + AssertFalse(settings->GetProperty(IMP_UP_AXIS_MAX).IsValid()); + AssertFalse(settings->GetProperty(IMP_ZUPROTATION_MAX).IsValid()); + AssertFalse(settings->GetProperty(IMP_FILE_UP_AXIS).IsValid()); + AssertFalse(settings->GetProperty(IMP_BUTTON_WEB_UPDATE).IsValid()); + AssertFalse(settings->GetProperty(IMP_PI_VERSION).IsValid()); + AssertFalse(settings->GetProperty(EXP_INFORMATION_GRP).IsValid()); + AssertFalse(settings->GetProperty(EXP_SCALEFACTOR).IsValid()); + AssertFalse(settings->GetProperty(EXP_AXISCONVERSIONMETHOD).IsValid()); + AssertFalse(settings->GetProperty(EXP_UPAXIS).IsValid()); + AssertFalse(settings->GetProperty(EXP_SHOW_UI_WARNING).IsValid()); + AssertFalse(settings->GetProperty(EXP_LIGHTATTENUATION).IsValid()); + AssertFalse(settings->GetProperty(EXP_ENVIRONMENT).IsValid()); + AssertFalse(settings->GetProperty(EXP_SELECTIONONLY).IsValid()); + AssertFalse(settings->GetProperty(EXP_INPUTCONNECTIONS_GRP).IsValid()); + AssertFalse(settings->GetProperty(EXP_INPUTCONNECTIONS).IsValid()); + AssertFalse(settings->GetProperty(EXP_BYPASSRRSINHERITANCE).IsValid()); + AssertFalse(settings->GetProperty(EXP_CONVERTTOTIFF).IsValid()); + AssertFalse(settings->GetProperty(EXP_BONE).IsValid()); + AssertFalse(settings->GetProperty(EXP_POINTCACHE).IsValid()); + AssertFalse(settings->GetProperty(EXP_SMOOTHKEYASUSER).IsValid()); + AssertFalse(settings->GetProperty(EXP_QUATERNION).IsValid()); + AssertFalse(settings->GetProperty(EXP_CONSTRAINTS_GRP).IsValid()); + AssertFalse(settings->GetProperty(EXP_CONSTRAINT).IsValid()); + AssertFalse(settings->GetProperty(EXP_CHARACTER).IsValid()); + AssertFalse(settings->GetProperty(EXP_MRCUSTOMATTRIBUTES).IsValid()); + AssertFalse(settings->GetProperty(EXP_MESHPRIMITIVE).IsValid()); + AssertFalse(settings->GetProperty(EXP_MESHTRIANGLE).IsValid()); + AssertFalse(settings->GetProperty(EXP_MESHPOLY).IsValid()); + AssertFalse(settings->GetProperty(EXP_NURB).IsValid()); + AssertFalse(settings->GetProperty(EXP_PATCH).IsValid()); + AssertFalse(settings->GetProperty(EXP_BIP2FBX).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMNORMALPERPOLY).IsValid()); + AssertFalse(settings->GetProperty(EXP_TANGENTSPACE).IsValid()); + AssertFalse(settings->GetProperty(EXP_SMOOTHMESH).IsValid()); + AssertFalse(settings->GetProperty(EXP_SELECTIONSET).IsValid()); + AssertFalse(settings->GetProperty(EXP_FINESTSUBDIVLEVEL).IsValid()); + AssertFalse(settings->GetProperty(EXP_MAXBONEASBONE).IsValid()); + AssertFalse(settings->GetProperty(EXP_MAXNURBSSTEP).IsValid()); + AssertFalse(settings->GetProperty(EXP_CREASE).IsValid()); + AssertFalse(settings->GetProperty(EXP_BLINDDATA).IsValid()); + AssertFalse(settings->GetProperty(EXP_NURBSSURFACEAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_SMOOTHING_GROUPS).IsValid()); + AssertFalse(settings->GetProperty(EXP_HARDEDGES).IsValid()); + AssertFalse(settings->GetProperty(EXP_ANIMATIONONLY).IsValid()); + AssertFalse(settings->GetProperty(EXP_INSTANCES).IsValid()); + AssertFalse(settings->GetProperty(EXP_CONTAINEROBJECTS).IsValid()); + AssertFalse(settings->GetProperty(EXP_TRIANGULATE).IsValid()); + AssertFalse(settings->GetProperty(EXP_EDGE_ORIENTATION).IsValid()); + AssertFalse(settings->GetProperty(EXP_SELECTIONSETNAMEASPOINTCACHE).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMETRYMESHPRIMITIVEAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMETRYMESHTRIANGLEAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMETRYMESHPOLYAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMETRYNURBSAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_GEOMETRYPATCHAS).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS).IsValid()); + AssertFalse(settings->GetProperty(EXP_SHAPE).IsValid()); + AssertFalse(settings->GetProperty(EXP_SHAPEATTRIBUTES).IsValid()); + AssertFalse(settings->GetProperty(EXP_SHAPEATTRIBUTESVALUES).IsValid()); + AssertFalse(settings->GetProperty(EXP_APPLYKEYREDUCE).IsValid()); + AssertFalse(settings->GetProperty(EXP_KEYREDUCEPREC).IsValid()); + AssertFalse(settings->GetProperty(EXP_APPLYKEYSONFRM).IsValid()); + AssertFalse(settings->GetProperty(EXP_APPLYKEYSYNC).IsValid()); + AssertFalse(settings->GetProperty(EXP_APPLYUNROLL).IsValid()); + AssertFalse(settings->GetProperty(EXP_UNROLLPREC).IsValid()); + AssertFalse(settings->GetProperty(EXP_UNROLLPATH).IsValid()); + AssertFalse(settings->GetProperty(EXP_UNROLLFORCEAUTO).IsValid()); + AssertFalse(settings->GetProperty(EXP_BUTTON_WEB_UPDATE).IsValid()); + AssertFalse(settings->GetProperty(EXP_PI_VERSION).IsValid()); + AssertFalse(settings->GetProperty(EXP_BUTTON_EDIT).IsValid()); + AssertFalse(settings->GetProperty(EXP_BUTTON_OK).IsValid()); + AssertFalse(settings->GetProperty(EXP_BUTTON_CANCEL).IsValid()); + AssertFalse(settings->GetProperty(EXP_MENU_EDIT_PRESET).IsValid()); + AssertFalse(settings->GetProperty(EXP_MENU_SAVE_PRESET).IsValid()); + AssertFalse(settings->GetProperty(EXP_CONSTRUCTIONHISTORY).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_REFERENCENODE).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_TEXTURE).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_MATERIAL).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_ANIMATION).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_MESH).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_LIGHT).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_CAMERA).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_AMBIENT_LIGHT).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_RESCALING).IsValid()); + AssertFalse(settings->GetProperty(EXP_3DS_TEXUVBYPOLY).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_START).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_FRAME_COUNT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_FRAME_RATE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_ACTOR_PREFIX).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_RENAME_DUPLICATE_NAMES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_EXACT_ZERO_AS_OCCLUDED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_SET_OCCLUDED_TO_LAST_VALID_POSITION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_AS_OPTICAL_SEGMENTS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_ASF_SCENE_OWNED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_MOTION_FROM_GLOBAL_POSITION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_GAPS_AS_VALID_DATA).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_C3D_REAL_FORMAT).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_CREATE_REFERENCE_NODE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_TRANSLATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_BASE_T_IN_OFFSET).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_BASE_R_IN_PREROTATION).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_DUMMY_NODES).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_LIMITS).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_FRAME_RATE_USED).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_FRAME_RANGE).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_WRITE_DEFAULT_AS_BASE_TR).IsValid()); + AssertFalse(settings->GetProperty(IOSN_MOTION_UP_AXIS_USED_IN_FILE).IsValid()); + + AssertEqual(275, CountProperties(settings)); + + prop = settings->GetProperty(IOSROOT); + AssertTrue(prop == settings->RootProperty); + AssertTrue(prop.IsValid()); + AssertTrue(prop == settings->RootProperty); + AssertFalse(prop != settings->RootProperty); + AssertEqual("", prop.GetName()); + AssertEqual("", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxUndefined, prop.GetPropertyDataType().GetType()); + + prop = settings->GetProperty(IOSN_IMPORT); + AssertTrue(prop.IsValid()); + AssertEqual("Import", prop.GetName()); + AssertEqual("Import", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FIRST_TIME_RUN_NOTICE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("FirstTimeRunNotice", prop.GetName()); + AssertEqual("Import|FirstTimeRunNotice", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FIRST_TIME_RUN_NOTICE); + AssertTrue(prop.IsValid()); + AssertEqual("FirstTimeRunNotice", prop.GetName()); + AssertEqual("Import|FirstTimeRunNotice|FirstTimeRunNotice", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("*** Welcome! ***", prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInGrp", prop.GetName()); + AssertEqual("Import|PlugInGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_PRESETS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("PresetsGrp", prop.GetName()); + AssertEqual("Import|PresetsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_PRESETS); + AssertTrue(prop.IsValid()); + AssertEqual("Presets", prop.GetName()); + AssertEqual("Import|PresetsGrp|Presets", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(0, prop.GetEnumCount()); + prop = settings->GetProperty(IMP_STATISTICS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("StatisticsGrp", prop.GetName()); + AssertEqual("Import|StatisticsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_STATISTICS); + AssertTrue(prop.IsValid()); + AssertEqual("Statistics", prop.GetName()); + AssertEqual("Import|StatisticsGrp|Statistics", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_INCLUDE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("IncludeGrp", prop.GetName()); + AssertEqual("Import|IncludeGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_MERGE_MODE); + AssertTrue(prop.IsValid()); + AssertEqual("MergeMode", prop.GetName()); + AssertEqual("Import|IncludeGrp|MergeMode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + AssertEqual(3, prop.GetEnumCount()); + AssertEqual("Add", prop.GetEnumValue(0)); + AssertEqual("Add and update animation", prop.GetEnumValue(1)); + AssertEqual("Update animation", prop.GetEnumValue(2)); + prop = settings->GetProperty(IMP_MERGE_MODE_DESCRIPTION); + AssertTrue(prop.IsValid()); + AssertEqual("MergeModeDescription", prop.GetName()); + AssertEqual("Import|IncludeGrp|MergeModeDescription", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("---", prop.Get()); + prop = settings->GetProperty(IMP_ONE_CLICK_MERGE); + AssertTrue(prop.IsValid()); + AssertEqual("OneClickMerge", prop.GetName()); + AssertEqual("Import|IncludeGrp|OneClickMerge", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_ONE_CLICK_MERGE_TEXTURE); + AssertTrue(prop.IsValid()); + AssertEqual("OneClickMergeTexture", prop.GetName()); + AssertEqual("Import|IncludeGrp|OneClickMergeTexture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_GEOMETRY); + AssertTrue(prop.IsValid()); + AssertEqual("Geometry", prop.GetName()); + AssertEqual("Import|IncludeGrp|Geometry", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_ANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Animation", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_EXTRA_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("ExtraGrp", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_CAMERA_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("CameraGrp", prop.GetName()); + AssertEqual("Import|IncludeGrp|CameraGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_LIGHT_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("LightGrp", prop.GetName()); + AssertEqual("Import|IncludeGrp|LightGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_AUDIO); + AssertTrue(prop.IsValid()); + AssertEqual("Audio", prop.GetName()); + AssertEqual("Import|IncludeGrp|Audio", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_EMBEDDED_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("EmbedTexture", prop.GetName()); + AssertEqual("Import|IncludeGrp|EmbedTexture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_EXTRACT_FOLDER); + AssertTrue(prop.IsValid()); + AssertEqual("ExtractFolder", prop.GetName()); + AssertEqual("Import|IncludeGrp|EmbedTexture|ExtractFolder", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_DEFORMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Deformation", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|Deformation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ADV_OPT_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("AdvOptGrp", prop.GetName()); + AssertEqual("Import|AdvOptGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX_EXT_SDK_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("FBXExtentionsSDK", prop.GetName()); + AssertEqual("Import|FBXExtentionsSDK", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX_EXTENTIONS_SDK_WARNING); + AssertTrue(prop.IsValid()); + AssertEqual("FBXExtentionsSDKWarning", prop.GetName()); + AssertEqual("Import|FBXExtentionsSDK|FBXExtentionsSDKWarning", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("Add your custom properties here.", prop.Get()); + prop = settings->GetProperty(IMP_UNITS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsGrp", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_AXISCONV_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("AxisConvGrp", prop.GetName()); + AssertEqual("Import|AdvOptGrp|AxisConvGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_UI); + AssertTrue(prop.IsValid()); + AssertEqual("UI", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UI", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_CACHE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("Cache", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Cache", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_UI_WIDTH); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIWidth", prop.GetName()); + AssertEqual("Import|PlugInGrp|PlugInUIWidth", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(500, prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_UI_HEIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIHeight", prop.GetName()); + AssertEqual("Import|PlugInGrp|PlugInUIHeight", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(500, prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_UI_XPOS); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIXpos", prop.GetName()); + AssertEqual("Import|PlugInGrp|PlugInUIXpos", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(100, prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_UI_YPOS); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIYpos", prop.GetName()); + AssertEqual("Import|PlugInGrp|PlugInUIYpos", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(100, prop.Get()); + prop = settings->GetProperty(IMP_PRESET_SELECTED); + AssertTrue(prop.IsValid()); + AssertEqual("PresetSelected", prop.GetName()); + AssertEqual("Import|PlugInGrp|PresetSelected", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_UIL); + AssertTrue(prop.IsValid()); + AssertEqual("UILIndex", prop.GetName()); + AssertEqual("Import|PlugInGrp|UILIndex", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(7, prop.GetEnumCount()); + AssertEqual("ENU", prop.GetEnumValue(0)); + AssertEqual("DEU", prop.GetEnumValue(1)); + AssertEqual("FRA", prop.GetEnumValue(2)); + AssertEqual("JPN", prop.GetEnumValue(3)); + AssertEqual("KOR", prop.GetEnumValue(4)); + AssertEqual("CHS", prop.GetEnumValue(5)); + AssertEqual("PTB", prop.GetEnumValue(6)); + prop = settings->GetProperty(IMP_PLUGIN_PRODUCT_FAMILY); + AssertTrue(prop.IsValid()); + AssertEqual("PluginProductFamily", prop.GetName()); + AssertEqual("Import|PlugInGrp|PluginProductFamily", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_SCALECONVERSION); + AssertTrue(prop.IsValid()); + AssertEqual("ScaleConversion", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|ScaleConversion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_TOTAL_UNITS_SCALE_TB); + AssertTrue(prop.IsValid()); + AssertEqual("TotalUnitsScale", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|TotalUnitsScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_DYN_SCALE_CONVERSION); + AssertTrue(prop.IsValid()); + AssertEqual("DynamicScaleConversion", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|DynamicScaleConversion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_UNITSELECTOR); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsSelector", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|UnitsSelector", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(9, prop.GetEnumCount()); + AssertEqual("Millimeters", prop.GetEnumValue(0)); + AssertEqual("Centimeters", prop.GetEnumValue(1)); + AssertEqual("Decimeters", prop.GetEnumValue(2)); + AssertEqual("Meters", prop.GetEnumValue(3)); + AssertEqual("Kilometers", prop.GetEnumValue(4)); + AssertEqual("Inches", prop.GetEnumValue(5)); + AssertEqual("Feet", prop.GetEnumValue(6)); + AssertEqual("Yards", prop.GetEnumValue(7)); + AssertEqual("Miles", prop.GetEnumValue(8)); + prop = settings->GetProperty(IMP_MASTERSCALE); + AssertTrue(prop.IsValid()); + AssertEqual("MasterScale", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|MasterScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.000000, prop.Get()); + prop = settings->GetProperty(IMP_UNITS_SCALE); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsScale", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UnitsGrp|UnitsScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.000000, prop.Get()); + prop = settings->GetProperty(IMP_SAMPLINGPANEL); + AssertTrue(prop.IsValid()); + AssertEqual("SamplingPanel", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|SamplingPanel", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_SAMPLINGRATESELECTOR); + AssertTrue(prop.IsValid()); + AssertEqual("SamplingRateSelector", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|SamplingPanel|SamplingRateSelector", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(3, prop.GetEnumCount()); + AssertEqual("Scene", prop.GetEnumValue(0)); + AssertEqual("File", prop.GetEnumValue(1)); + AssertEqual("Custom", prop.GetEnumValue(2)); + prop = settings->GetProperty(IMP_SAMPLINGRATE); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterSamplingRate", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|SamplingPanel|CurveFilterSamplingRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(30.000000, prop.Get()); + prop = settings->GetProperty(IMP_CURVEFILTERS); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilter", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|CurveFilter", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_TAKE); + AssertTrue(prop.IsValid()); + AssertEqual("Take", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|Take", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(-1, prop.Get()); + AssertEqual(0, prop.GetEnumCount()); + prop = settings->GetProperty(IMP_KEEPFRAMERATE); + AssertTrue(prop.IsValid()); + AssertEqual("KeepFrameRate", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|KeepFrameRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_TIMELINE); + AssertTrue(prop.IsValid()); + AssertEqual("TimeLine", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|TimeLine", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_TIMELINE_SPAN); + AssertTrue(prop.IsValid()); + AssertEqual("TimeLineSpan", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|TimeLineSpan", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_BAKEANIMATIONLAYERS); + AssertTrue(prop.IsValid()); + AssertEqual("BakeAnimationLayers", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|BakeAnimationLayers", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MARKERS); + AssertTrue(prop.IsValid()); + AssertEqual("Markers", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|ExtraGrp|Markers", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_CAMERA); + AssertTrue(prop.IsValid()); + AssertEqual("Camera", prop.GetName()); + AssertEqual("Import|IncludeGrp|CameraGrp|Camera", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_LIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("Light", prop.GetName()); + AssertEqual("Import|IncludeGrp|LightGrp|Light", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_SHOW_WARNINGS_MANAGER); + AssertTrue(prop.IsValid()); + AssertEqual("ShowWarningsManager", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UI|ShowWarningsManager", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_GENERATE_LOG_DATA); + AssertTrue(prop.IsValid()); + AssertEqual("GenerateLogData", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UI|GenerateLogData", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_PLUGIN_VERSIONS_URL); + AssertTrue(prop.IsValid()); + AssertEqual("PluginVersionsURL", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UI|PluginVersionsURL", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("http://download.autodesk.com/us/fbx/versions/fbxversion.xml", prop.Get()); + prop = settings->GetProperty(IMP_SHOW_UI_MODE); + AssertTrue(prop.IsValid()); + AssertEqual("ShowUIMode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|UI|ShowUIMode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_SKINS); + AssertTrue(prop.IsValid()); + AssertEqual("Skins", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|Deformation|Skins", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_USEMATRIXFROMPOSE); + AssertTrue(prop.IsValid()); + AssertEqual("UseMatrixFromPose", prop.GetName()); + AssertEqual("Import|IncludeGrp|Animation|Deformation|UseMatrixFromPose", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_AXISCONVERSION); + AssertTrue(prop.IsValid()); + AssertEqual("AxisConversion", prop.GetName()); + AssertEqual("Import|AdvOptGrp|AxisConvGrp|AxisConversion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_AUTO_AXIS); + AssertTrue(prop.IsValid()); + AssertEqual("AutoAxis", prop.GetName()); + AssertEqual("Import|AdvOptGrp|AxisConvGrp|AutoAxis", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_CACHE_SIZE); + AssertTrue(prop.IsValid()); + AssertEqual("CacheSize", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Cache|CacheSize", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(8, prop.Get()); + prop = settings->GetProperty(IMP_FILEFORMAT); + AssertTrue(prop.IsValid()); + AssertEqual("FileFormat", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IOSN_EXPORT); + AssertTrue(prop.IsValid()); + AssertEqual("Export", prop.GetName()); + AssertEqual("Export", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_FIRST_TIME_RUN_NOTICE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("FirstTimeRunNotice", prop.GetName()); + AssertEqual("Export|FirstTimeRunNotice", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_FIRST_TIME_RUN_NOTICE); + AssertTrue(prop.IsValid()); + AssertEqual("FirstTimeRunNotice", prop.GetName()); + AssertEqual("Export|FirstTimeRunNotice|FirstTimeRunNotice", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("*** Welcome! ***", prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInGrp", prop.GetName()); + AssertEqual("Export|PlugInGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_PRESETS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("PresetsGrp", prop.GetName()); + AssertEqual("Export|PresetsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_PRESETS); + AssertTrue(prop.IsValid()); + AssertEqual("Presets", prop.GetName()); + AssertEqual("Export|PresetsGrp|Presets", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(0, prop.GetEnumCount()); + prop = settings->GetProperty(EXP_STATISTICS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("StatisticsGrp", prop.GetName()); + AssertEqual("Export|StatisticsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_STATISTICS); + AssertTrue(prop.IsValid()); + AssertEqual("Statistics", prop.GetName()); + AssertEqual("Export|StatisticsGrp|Statistics", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_INCLUDE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("IncludeGrp", prop.GetName()); + AssertEqual("Export|IncludeGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_GEOMETRY); + AssertTrue(prop.IsValid()); + AssertEqual("Geometry", prop.GetName()); + AssertEqual("Export|IncludeGrp|Geometry", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_ANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Animation", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_EXTRA_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("ExtraGrp", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|ExtraGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_CAMERA_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("CameraGrp", prop.GetName()); + AssertEqual("Export|IncludeGrp|CameraGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_LIGHT_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("LightGrp", prop.GetName()); + AssertEqual("Export|IncludeGrp|LightGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_AUDIO); + AssertTrue(prop.IsValid()); + AssertEqual("Audio", prop.GetName()); + AssertEqual("Export|IncludeGrp|Audio", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_EMBEDTEXTURE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("EmbedTextureGrp", prop.GetName()); + AssertEqual("Export|IncludeGrp|EmbedTextureGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_BAKECOMPLEXANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("BakeComplexAnimation", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_ADV_OPT_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("AdvOptGrp", prop.GetName()); + AssertEqual("Export|AdvOptGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_FBX_EXT_SDK_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("FBXExtentionsSDK", prop.GetName()); + AssertEqual("Export|FBXExtentionsSDK", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_FBX_EXTENTIONS_SDK_WARNING); + AssertTrue(prop.IsValid()); + AssertEqual("FBXExtentionsSDKWarning", prop.GetName()); + AssertEqual("Export|FBXExtentionsSDK|FBXExtentionsSDKWarning", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("Add your custom properties here.", prop.Get()); + prop = settings->GetProperty(EXP_UNITS_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsGrp", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_AXISCONV_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("AxisConvGrp", prop.GetName()); + AssertEqual("Export|AdvOptGrp|AxisConvGrp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_UI); + AssertTrue(prop.IsValid()); + AssertEqual("UI", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UI", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_DEFORMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Deformation", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|Deformation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_CACHE_GRP); + AssertTrue(prop.IsValid()); + AssertEqual("Cache", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Cache", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_UI_WIDTH); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIWidth", prop.GetName()); + AssertEqual("Export|PlugInGrp|PlugInUIWidth", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(500, prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_UI_HEIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIHeight", prop.GetName()); + AssertEqual("Export|PlugInGrp|PlugInUIHeight", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(500, prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_UI_XPOS); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIXpos", prop.GetName()); + AssertEqual("Export|PlugInGrp|PlugInUIXpos", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(100, prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_UI_YPOS); + AssertTrue(prop.IsValid()); + AssertEqual("PlugInUIYpos", prop.GetName()); + AssertEqual("Export|PlugInGrp|PlugInUIYpos", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(100, prop.Get()); + prop = settings->GetProperty(EXP_UIL); + AssertTrue(prop.IsValid()); + AssertEqual("UILIndex", prop.GetName()); + AssertEqual("Export|PlugInGrp|UILIndex", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(7, prop.GetEnumCount()); + AssertEqual("ENU", prop.GetEnumValue(0)); + AssertEqual("DEU", prop.GetEnumValue(1)); + AssertEqual("FRA", prop.GetEnumValue(2)); + AssertEqual("JPN", prop.GetEnumValue(3)); + AssertEqual("KOR", prop.GetEnumValue(4)); + AssertEqual("CHS", prop.GetEnumValue(5)); + AssertEqual("PTB", prop.GetEnumValue(6)); + prop = settings->GetProperty(EXP_PLUGIN_PRODUCT_FAMILY); + AssertTrue(prop.IsValid()); + AssertEqual("PluginProductFamily", prop.GetName()); + AssertEqual("Export|PlugInGrp|PluginProductFamily", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_PRESET_SELECTED); + AssertTrue(prop.IsValid()); + AssertEqual("PresetSelected", prop.GetName()); + AssertEqual("Export|PlugInGrp|PresetSelected", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_USETMPFILEPERIPHERAL); + AssertTrue(prop.IsValid()); + AssertEqual("UseTmpFilePeripheral", prop.GetName()); + AssertEqual("Export|PlugInGrp|UseTmpFilePeripheral", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_TOTAL_UNITS_SCALE_TB); + AssertTrue(prop.IsValid()); + AssertEqual("TotalUnitsScale", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp|TotalUnitsScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_DYN_SCALE_CONVERSION); + AssertTrue(prop.IsValid()); + AssertEqual("DynamicScaleConversion", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp|DynamicScaleConversion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_UNITSELECTOR); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsSelector", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp|UnitsSelector", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(0, prop.GetEnumCount()); + prop = settings->GetProperty(EXP_UNITS_SCALE); + AssertTrue(prop.IsValid()); + AssertEqual("UnitsScale", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp|UnitsScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.000000, prop.Get()); + prop = settings->GetProperty(EXP_MASTERSCALE); + AssertTrue(prop.IsValid()); + AssertEqual("MasterScale", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UnitsGrp|MasterScale", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(1.000000, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMESTART); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameStart", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStart", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMEEND); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameEnd", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameEnd", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(200, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMESTEP); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameStep", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStep", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + prop = settings->GetProperty(EXP_BAKE_RESAMPLE_ANIMATION_CURVES); + AssertTrue(prop.IsValid()); + AssertEqual("ResampleAnimationCurves", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|ResampleAnimationCurves", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMESTARTNORESET); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameStartNoReset", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStartNoReset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMEENDNORESET); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameEndNoReset", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameEndNoReset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_BAKEFRAMESTEPNORESET); + AssertTrue(prop.IsValid()); + AssertEqual("BakeFrameStepNoReset", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStepNoReset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_CURVEFILTERS); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilter", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_APPLYCSTKEYRED); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterApplyCstKeyRed", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_SAMPLINGRATE); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterSamplingRate", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterSamplingRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(30.000000, prop.Get()); + prop = settings->GetProperty(EXP_CSTKEYREDTPREC); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterCstKeyRedTPrec", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedTPrec", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(0.000090, prop.Get()); + prop = settings->GetProperty(EXP_CSTKEYREDRPREC); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterCstKeyRedRPrec", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedRPrec", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(0.009000, prop.Get()); + prop = settings->GetProperty(EXP_CSTKEYREDSPREC); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterCstKeyRedSPrec", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedSPrec", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(0.004000, prop.Get()); + prop = settings->GetProperty(EXP_CSTKEYREDOPREC); + AssertTrue(prop.IsValid()); + AssertEqual("CurveFilterCstKeyRedOPrec", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedOPrec", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(0.009000, prop.Get()); + prop = settings->GetProperty(EXP_AUTOTANGENTSONLY); + AssertTrue(prop.IsValid()); + AssertEqual("AutoTangentsOnly", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|AutoTangentsOnly", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_NAMETAKE); + AssertTrue(prop.IsValid()); + AssertEqual("UseSceneName", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|ExtraGrp|UseSceneName", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_REMOVE_SINGLE_KEY); + AssertTrue(prop.IsValid()); + AssertEqual("RemoveSingleKey", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|ExtraGrp|RemoveSingleKey", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_BINDPOSE); + AssertTrue(prop.IsValid()); + AssertEqual("BindPose", prop.GetName()); + AssertEqual("Export|IncludeGrp|BindPose", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_PIVOTTONULLS); + AssertTrue(prop.IsValid()); + AssertEqual("PivotToNulls", prop.GetName()); + AssertEqual("Export|IncludeGrp|PivotToNulls", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_EMBEDTEXTURE); + AssertTrue(prop.IsValid()); + AssertEqual("EmbedTexture", prop.GetName()); + AssertEqual("Export|IncludeGrp|EmbedTextureGrp|EmbedTexture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_CAMERA); + AssertTrue(prop.IsValid()); + AssertEqual("Camera", prop.GetName()); + AssertEqual("Export|IncludeGrp|CameraGrp|Camera", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_LIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("Light", prop.GetName()); + AssertEqual("Export|IncludeGrp|LightGrp|Light", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_SKINS); + AssertTrue(prop.IsValid()); + AssertEqual("Skins", prop.GetName()); + AssertEqual("Export|IncludeGrp|Animation|Deformation|Skins", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_SHOW_WARNINGS_MANAGER); + AssertTrue(prop.IsValid()); + AssertEqual("ShowWarningsManager", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UI|ShowWarningsManager", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_GENERATE_LOG_DATA); + AssertTrue(prop.IsValid()); + AssertEqual("GenerateLogData", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UI|GenerateLogData", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_PLUGIN_VERSIONS_URL); + AssertTrue(prop.IsValid()); + AssertEqual("PluginVersionsURL", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UI|PluginVersionsURL", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("http://download.autodesk.com/us/fbx/versions/fbxversion.xml", prop.Get()); + prop = settings->GetProperty(EXP_SHOW_UI_MODE); + AssertTrue(prop.IsValid()); + AssertEqual("ShowUIMode", prop.GetName()); + AssertEqual("Export|AdvOptGrp|UI|ShowUIMode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_CACHE_SIZE); + AssertTrue(prop.IsValid()); + AssertEqual("CacheSize", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Cache|CacheSize", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(8, prop.Get()); + prop = settings->GetProperty(EXP_FILEFORMAT); + AssertTrue(prop.IsValid()); + AssertEqual("FileFormat", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX); + AssertTrue(prop.IsValid()); + AssertEqual("Fbx", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX_CURRENT_TAKE_NAME); + AssertTrue(prop.IsValid()); + AssertEqual("Current_Take_Name", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Current_Take_Name", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX_MODEL); + AssertTrue(prop.IsValid()); + AssertEqual("Model", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Model", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_NORMAL); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementNormal", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementNormal", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_BINORMAL); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementBinormal", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementBinormal", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_TANGENT); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementTangent", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementTangent", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_VERTEXCOLOR); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementVertexColor", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVertexColor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_POLYGROUP); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementPolygroup", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementPolygroup", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_SMOOTHING); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementSmoothing", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementSmoothing", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_USERDATA); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementUserData", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementUserData", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_VISIBILITY); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementVisibility", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVisibility", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_EDGECREASE); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementEdgeCrease", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementEdgeCrease", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_VERTEXCREASE); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementVertexCrease", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVertexCrease", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_HOLE); + AssertTrue(prop.IsValid()); + AssertEqual("LayerElementHole", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|LayerElementHole", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_TEXTURE); + AssertTrue(prop.IsValid()); + AssertEqual("Texture", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Texture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_MATERIAL); + AssertTrue(prop.IsValid()); + AssertEqual("Material", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Material", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_LINK); + AssertTrue(prop.IsValid()); + AssertEqual("Link", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Link", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_SHAPE); + AssertTrue(prop.IsValid()); + AssertEqual("Shape", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Shape", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_GOBO); + AssertTrue(prop.IsValid()); + AssertEqual("Gobo", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Gobo", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_AUDIO); + AssertTrue(prop.IsValid()); + AssertEqual("Audio", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Audio", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_ANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Animation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Animation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_CHARACTER); + AssertTrue(prop.IsValid()); + AssertEqual("Character", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Character", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_GLOBAL_SETTINGS); + AssertTrue(prop.IsValid()); + AssertEqual("Global_Settings", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Global_Settings", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_PIVOT); + AssertTrue(prop.IsValid()); + AssertEqual("Pivot", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Pivot", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_MERGE_LAYER_AND_TIMEWARP); + AssertTrue(prop.IsValid()); + AssertEqual("Merge_Layer_and_Timewarp", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Merge_Layer_and_Timewarp", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_FBX_TEMPLATE); + AssertTrue(prop.IsValid()); + AssertEqual("Template", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Template", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_FBX_CONSTRAINT); + AssertTrue(prop.IsValid()); + AssertEqual("Constraint", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Constraint", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_EXTRACT_EMBEDDED_DATA); + AssertTrue(prop.IsValid()); + AssertEqual("ExtractEmbeddedData", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|ExtractEmbeddedData", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_CALCULATE_LEGACY_SHAPE_NORMAL); + AssertTrue(prop.IsValid()); + AssertEqual("CalculateLegacyShapeNormal", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|CalculateLegacyShapeNormal", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_FBX_PASSWORD_ENABLE); + AssertTrue(prop.IsValid()); + AssertEqual("Password_Enable", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Password_Enable", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_FBX_PASSWORD); + AssertTrue(prop.IsValid()); + AssertEqual("Password", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Password", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_FBX_MODEL_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Model_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Model_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_FBX_DEVICE_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Device_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Device_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_FBX_CHARACTER_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Character_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Character_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_FBX_ACTOR_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Actor_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Actor_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_FBX_CONSTRAINT_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Constraint_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Constraint_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_FBX_MEDIA_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("Media_Count", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|Media_Count", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_RELAXED_FBX_CHECK); + AssertTrue(prop.IsValid()); + AssertEqual("RelaxedFbxCheck", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|RelaxedFbxCheck", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_KEEP_PRODUCER_CAM_SRCOBJ); + AssertTrue(prop.IsValid()); + AssertEqual("KeepProducerCamSrcObj", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Fbx|KeepProducerCamSrcObj", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(IMP_DXF); + AssertTrue(prop.IsValid()); + AssertEqual("Dxf", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Dxf", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_DXF_WELD_VERTICES); + AssertTrue(prop.IsValid()); + AssertEqual("WeldVertices", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Dxf|WeldVertices", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_DXF_OBJECT_DERIVATION); + AssertTrue(prop.IsValid()); + AssertEqual("ObjectDerivation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Dxf|ObjectDerivation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(3, prop.GetEnumCount()); + AssertEqual("By layer", prop.GetEnumValue(0)); + AssertEqual("By entity", prop.GetEnumValue(1)); + AssertEqual("By block", prop.GetEnumValue(2)); + prop = settings->GetProperty(IMP_DXF_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("ReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|Dxf|ReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_OBJ); + AssertTrue(prop.IsValid()); + AssertEqual("Obj", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Obj", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_OBJ_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("ReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Obj|ReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS); + AssertTrue(prop.IsValid()); + AssertEqual("Max_3ds", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_3DS_REFERENCENODE); + AssertTrue(prop.IsValid()); + AssertEqual("ReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|ReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_TEXTURE); + AssertTrue(prop.IsValid()); + AssertEqual("Texture", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Texture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_MATERIAL); + AssertTrue(prop.IsValid()); + AssertEqual("Material", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Material", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_ANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Animation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Animation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_MESH); + AssertTrue(prop.IsValid()); + AssertEqual("Mesh", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Mesh", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_LIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("Light", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Light", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_CAMERA); + AssertTrue(prop.IsValid()); + AssertEqual("Camera", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Camera", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_AMBIENT_LIGHT); + AssertTrue(prop.IsValid()); + AssertEqual("AmbientLight", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|AmbientLight", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_RESCALING); + AssertTrue(prop.IsValid()); + AssertEqual("Rescaling", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Rescaling", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_FILTER); + AssertTrue(prop.IsValid()); + AssertEqual("Filter", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Filter", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_3DS_SMOOTHGROUP); + AssertTrue(prop.IsValid()); + AssertEqual("Smoothgroup", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Max_3ds|Smoothgroup", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOTION_BASE); + AssertTrue(prop.IsValid()); + AssertEqual("Motion_Base", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_MOB_START); + AssertTrue(prop.IsValid()); + AssertEqual("MotionStart", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionStart", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxTime, prop.GetPropertyDataType().GetType()); + AssertEqual(0LL, prop.Get().Get()); + prop = settings->GetProperty(IMP_MOB_FRAME_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameCount", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionFrameCount", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(IMP_MOB_FRAME_RATE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRate", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionFrameRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(0.000000, prop.Get()); + prop = settings->GetProperty(IMP_MOB_ACTOR_PREFIX); + AssertTrue(prop.IsValid()); + AssertEqual("MotionActorPrefix", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionActorPrefix", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_RENAME_DUPLICATE_NAMES); + AssertTrue(prop.IsValid()); + AssertEqual("MotionRenameDuplicateNames", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionRenameDuplicateNames", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_EXACT_ZERO_AS_OCCLUDED); + AssertTrue(prop.IsValid()); + AssertEqual("MotionExactZeroAsOccluded", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionExactZeroAsOccluded", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_SET_OCCLUDED_TO_LAST_VALID_POSITION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionSetOccludedToLastValidPos", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionSetOccludedToLastValidPos", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_AS_OPTICAL_SEGMENTS); + AssertTrue(prop.IsValid()); + AssertEqual("MotionAsOpticalSegments", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionAsOpticalSegments", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_ASF_SCENE_OWNED); + AssertTrue(prop.IsValid()); + AssertEqual("MotionASFSceneOwned", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionASFSceneOwned", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOB_UP_AXIS_USED_IN_FILE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionUpAxisUsedInFile", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Motion_Base|MotionUpAxisUsedInFile", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(3, prop.Get()); + prop = settings->GetProperty(IMP_BIOVISION_BVH); + AssertTrue(prop.IsValid()); + AssertEqual("Biovision_BVH", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Biovision_BVH", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_BIOVISION_BVH_CREATE_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionCreateReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Biovision_BVH|MotionCreateReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOTIONANALYSIS_HTR); + AssertTrue(prop.IsValid()); + AssertEqual("MotionAnalysis_HTR", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_MOTIONANALYSIS_HTR_CREATE_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionCreateReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionCreateReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOTIONANALYSIS_HTR_MOTION_BASE_T_IN_OFFSET); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseTInOffset", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionBaseTInOffset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_MOTIONANALYSIS_HTR_MOTION_BASE_R_IN_PREROTATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseRInPrerotation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionBaseRInPrerotation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty("Import|AdvOptGrp|FileFormat|MotionAnalysis_TRC"); + AssertTrue(prop.IsValid()); + AssertEqual("MotionAnalysis_TRC", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|MotionAnalysis_TRC", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF); + AssertTrue(prop.IsValid()); + AssertEqual("Acclaim_ASF", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF_CREATE_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionCreateReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionCreateReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF_DUMMY_NODES); + AssertTrue(prop.IsValid()); + AssertEqual("MotionDummyNodes", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionDummyNodes", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF_MOTION_LIMITS); + AssertTrue(prop.IsValid()); + AssertEqual("MotionLimits", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionLimits", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF_MOTION_BASE_T_IN_OFFSET); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseTInOffset", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionBaseTInOffset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_ASF_MOTION_BASE_R_IN_PREROTATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseRInPrerotation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionBaseRInPrerotation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC); + AssertTrue(prop.IsValid()); + AssertEqual("Acclaim_AMC", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC_CREATE_REFERENCE_NODE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionCreateReferenceNode", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionCreateReferenceNode", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC_DUMMY_NODES); + AssertTrue(prop.IsValid()); + AssertEqual("MotionDummyNodes", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionDummyNodes", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC_MOTION_LIMITS); + AssertTrue(prop.IsValid()); + AssertEqual("MotionLimits", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionLimits", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC_MOTION_BASE_T_IN_OFFSET); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseTInOffset", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionBaseTInOffset", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(IMP_ACCLAIM_AMC_MOTION_BASE_R_IN_PREROTATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionBaseRInPrerotation", prop.GetName()); + AssertEqual("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionBaseRInPrerotation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX); + AssertTrue(prop.IsValid()); + AssertEqual("Fbx", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_ASCIIFBX); + AssertTrue(prop.IsValid()); + AssertEqual("AsciiFbx", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|AsciiFbx", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(2, prop.GetEnumCount()); + AssertEqual("Binary", prop.GetEnumValue(0)); + AssertEqual("ASCII", prop.GetEnumValue(1)); + prop = settings->GetProperty(EXP_FBX_EXPORT_FILE_VERSION); + AssertTrue(prop.IsValid()); + AssertEqual("ExportFileVersion", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|ExportFileVersion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(11, prop.GetEnumCount()); + AssertEqual("FBX202000", prop.GetEnumValue(0)); + AssertEqual("FBX201900", prop.GetEnumValue(1)); + AssertEqual("FBX201800", prop.GetEnumValue(2)); + AssertEqual("FBX201600", prop.GetEnumValue(3)); + AssertEqual("FBX201400", prop.GetEnumValue(4)); + AssertEqual("FBX201300", prop.GetEnumValue(5)); + AssertEqual("FBX201200", prop.GetEnumValue(6)); + AssertEqual("FBX201100", prop.GetEnumValue(7)); + AssertEqual("FBX201000", prop.GetEnumValue(8)); + AssertEqual("FBX200900", prop.GetEnumValue(9)); + AssertEqual("FBX200611", prop.GetEnumValue(10)); + prop = settings->GetProperty("Export|AdvOptGrp|Fbx|VersionsUIAlias"); + AssertTrue(prop.IsValid()); + AssertEqual("VersionsUIAlias", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|VersionsUIAlias", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(11, prop.GetEnumCount()); + AssertEqual("FBX 2020", prop.GetEnumValue(0)); + AssertEqual("FBX 2019", prop.GetEnumValue(1)); + AssertEqual("FBX 2018", prop.GetEnumValue(2)); + AssertEqual("FBX 2016/2017", prop.GetEnumValue(3)); + AssertEqual("FBX 2014/2015", prop.GetEnumValue(4)); + AssertEqual("FBX 2013", prop.GetEnumValue(5)); + AssertEqual("FBX 2012", prop.GetEnumValue(6)); + AssertEqual("FBX 2011", prop.GetEnumValue(7)); + AssertEqual("FBX 2010", prop.GetEnumValue(8)); + AssertEqual("FBX 2009", prop.GetEnumValue(9)); + AssertEqual("FBX 2006", prop.GetEnumValue(10)); + prop = settings->GetProperty("Export|AdvOptGrp|Fbx|VersionsCompDescriptions"); + AssertTrue(prop.IsValid()); + AssertEqual("VersionsCompDescriptions", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|VersionsCompDescriptions", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxEnum, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + AssertEqual(11, prop.GetEnumCount()); + AssertEqual("Compatible with Autodesk 2020 applications/FBX plug-ins", prop.GetEnumValue(0)); + AssertEqual("Compatible with Autodesk 2019 applications/FBX plug-ins", prop.GetEnumValue(1)); + AssertEqual("Compatible with Autodesk 2018 applications/FBX plug-ins", prop.GetEnumValue(2)); + AssertEqual("Compatible with Autodesk 2016/2017 applications/FBX plug-ins", prop.GetEnumValue(3)); + AssertEqual("Compatible with Autodesk 2014/2015 applications/FBX plug-ins", prop.GetEnumValue(4)); + AssertEqual("Compatible with Autodesk 2013 applications/FBX plug-ins", prop.GetEnumValue(5)); + AssertEqual("Compatible with Autodesk 2012 applications/FBX plug-ins", prop.GetEnumValue(6)); + AssertEqual("Compatible with Autodesk 2011 applications/FBX plug-ins", prop.GetEnumValue(7)); + AssertEqual("Compatible with Autodesk 2010 applications/FBX plug-ins and MotionBuilder 2009", prop.GetEnumValue(8)); + AssertEqual("Compatible with Autodesk 2009 applications/FBX plug-ins", prop.GetEnumValue(9)); + AssertEqual("Compatible with Autodesk 2006 FBX plug-ins and MotionBuilder 7.5, 7.0 and 6.0", prop.GetEnumValue(10)); + prop = settings->GetProperty(EXP_FBX_MODEL); + AssertTrue(prop.IsValid()); + AssertEqual("Model", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Model", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_TEXTURE); + AssertTrue(prop.IsValid()); + AssertEqual("Texture", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Texture", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_MATERIAL); + AssertTrue(prop.IsValid()); + AssertEqual("Material", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Material", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_SHAPE); + AssertTrue(prop.IsValid()); + AssertEqual("Shape", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Shape", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_GOBO); + AssertTrue(prop.IsValid()); + AssertEqual("Gobo", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Gobo", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_AUDIO); + AssertTrue(prop.IsValid()); + AssertEqual("Audio", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Audio", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_ANIMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Animation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Animation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_CHARACTER); + AssertTrue(prop.IsValid()); + AssertEqual("Character", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Character", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_GLOBAL_SETTINGS); + AssertTrue(prop.IsValid()); + AssertEqual("Global_Settings", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Global_Settings", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_PIVOT); + AssertTrue(prop.IsValid()); + AssertEqual("Pivot", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Pivot", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_TEMPLATE); + AssertTrue(prop.IsValid()); + AssertEqual("Template", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Template", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_FBX_CONSTRAINT); + AssertTrue(prop.IsValid()); + AssertEqual("Constraint", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Constraint", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_EMBEDDED); + AssertTrue(prop.IsValid()); + AssertEqual("EMBEDDED", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|EMBEDDED", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_FBX_PASSWORD_ENABLE); + AssertTrue(prop.IsValid()); + AssertEqual("Password_Enable", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Password_Enable", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_FBX_PASSWORD); + AssertTrue(prop.IsValid()); + AssertEqual("Password", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Password", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_FBX_COLLAPSE_EXTERNALS); + AssertTrue(prop.IsValid()); + AssertEqual("COLLAPSE EXTERNALS", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|COLLAPSE EXTERNALS", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_COMPRESS_ARRAYS); + AssertTrue(prop.IsValid()); + AssertEqual("Compress_Arrays", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Compress_Arrays", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_FBX_COMPRESS_LEVEL); + AssertTrue(prop.IsValid()); + AssertEqual("Compress_Level", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Compress_Level", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1, prop.Get()); + prop = settings->GetProperty(EXP_FBX_COMPRESS_MINSIZE); + AssertTrue(prop.IsValid()); + AssertEqual("Compress_Minsize", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Compress_Minsize", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(1024, prop.Get()); + prop = settings->GetProperty(EXP_FBX_EMBEDDED_PROPERTIES_SKIP); + AssertTrue(prop.IsValid()); + AssertEqual("Embedded_Skipped_Properties", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Fbx|Embedded_Skipped_Properties", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_DXF); + AssertTrue(prop.IsValid()); + AssertEqual("Dxf", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Dxf", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_DXF_DEFORMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Deformation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Dxf|Deformation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_DXF_TRIANGULATE); + AssertTrue(prop.IsValid()); + AssertEqual("Triangulate", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Dxf|Triangulate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_OBJ); + AssertTrue(prop.IsValid()); + AssertEqual("Obj", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Obj", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_OBJ_TRIANGULATE); + AssertTrue(prop.IsValid()); + AssertEqual("Triangulate", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Obj|Triangulate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_OBJ_DEFORMATION); + AssertTrue(prop.IsValid()); + AssertEqual("Deformation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Obj|Deformation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_COLLADA); + AssertTrue(prop.IsValid()); + AssertEqual("Collada", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Collada", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_COLLADA_TRIANGULATE); + AssertTrue(prop.IsValid()); + AssertEqual("Triangulate", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Collada|Triangulate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_COLLADA_SINGLEMATRIX); + AssertTrue(prop.IsValid()); + AssertEqual("SingleMatrix", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Collada|SingleMatrix", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_COLLADA_FRAME_RATE); + AssertTrue(prop.IsValid()); + AssertEqual("FrameRate", prop.GetName()); + AssertEqual("Export|AdvOptGrp|Collada|FrameRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(30.000000, prop.Get()); + prop = settings->GetProperty(EXP_MOTION_BASE); + AssertTrue(prop.IsValid()); + AssertEqual("Motion_Base", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_MOB_START); + AssertTrue(prop.IsValid()); + AssertEqual("MotionStart", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionStart", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxTime, prop.GetPropertyDataType().GetType()); + AssertEqual(0LL, prop.Get().Get()); + prop = settings->GetProperty(EXP_MOB_FRAME_COUNT); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameCount", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFrameCount", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxInt, prop.GetPropertyDataType().GetType()); + AssertEqual(0, prop.Get()); + prop = settings->GetProperty(EXP_MOB_FROM_GLOBAL_POSITION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFromGlobalPosition", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFromGlobalPosition", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_MOB_FRAME_RATE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRate", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFrameRate", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDouble, prop.GetPropertyDataType().GetType()); + AssertEqual(30.000000, prop.Get()); + prop = settings->GetProperty(EXP_MOB_GAPS_AS_VALID_DATA); + AssertTrue(prop.IsValid()); + AssertEqual("MotionGapsAsValidData", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionGapsAsValidData", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_MOB_C3D_REAL_FORMAT); + AssertTrue(prop.IsValid()); + AssertEqual("MotionC3DRealFormat", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionC3DRealFormat", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_MOB_ASF_SCENE_OWNED); + AssertTrue(prop.IsValid()); + AssertEqual("MotionASFSceneOwned", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Motion_Base|MotionASFSceneOwned", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_BIOVISION_BVH); + AssertTrue(prop.IsValid()); + AssertEqual("Biovision_BVH", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Biovision_BVH", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_BIOVISION_BVH_MOTION_TRANSLATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionTranslation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Biovision_BVH|MotionTranslation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty("Export|AdvOptGrp|FileFormat|MotionAnalysis_HTR"); + AssertTrue(prop.IsValid()); + AssertEqual("MotionAnalysis_HTR", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|MotionAnalysis_HTR", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty("Export|AdvOptGrp|FileFormat|MotionAnalysis_TRC"); + AssertTrue(prop.IsValid()); + AssertEqual("MotionAnalysis_TRC", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|MotionAnalysis_TRC", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_ASF); + AssertTrue(prop.IsValid()); + AssertEqual("Acclaim_ASF", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_ASF", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_ASF_MOTION_TRANSLATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionTranslation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionTranslation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_ASF_FRAME_RATE_USED); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRateUsed", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionFrameRateUsed", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_ASF_FRAME_RANGE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRange", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionFrameRange", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_ASF_WRITE_DEFAULT_AS_BASE_TR); + AssertTrue(prop.IsValid()); + AssertEqual("MotionWriteDefaultAsBaseTR", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionWriteDefaultAsBaseTR", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_AMC); + AssertTrue(prop.IsValid()); + AssertEqual("Acclaim_AMC", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_AMC", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_AMC_MOTION_TRANSLATION); + AssertTrue(prop.IsValid()); + AssertEqual("MotionTranslation", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionTranslation", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_AMC_FRAME_RATE_USED); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRateUsed", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionFrameRateUsed", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_AMC_FRAME_RANGE); + AssertTrue(prop.IsValid()); + AssertEqual("MotionFrameRange", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionFrameRange", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(true, prop.Get()); + prop = settings->GetProperty(EXP_ACCLAIM_AMC_WRITE_DEFAULT_AS_BASE_TR); + AssertTrue(prop.IsValid()); + AssertEqual("MotionWriteDefaultAsBaseTR", prop.GetName()); + AssertEqual("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionWriteDefaultAsBaseTR", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxBool, prop.GetPropertyDataType().GetType()); + AssertEqual(false, prop.Get()); +} + +void FbxIOSettings_ELanguage_IdentifiersHaveSpecificValues() +{ + // expect: + AssertEqual(0, (int)FbxIOSettings::ELanguage::eENU); + AssertEqual(1, (int)FbxIOSettings::ELanguage::eDEU); + AssertEqual(2, (int)FbxIOSettings::ELanguage::eFRA); + AssertEqual(3, (int)FbxIOSettings::ELanguage::eJPN); + AssertEqual(4, (int)FbxIOSettings::ELanguage::eKOR); + AssertEqual(5, (int)FbxIOSettings::ELanguage::eCHS); + AssertEqual(6, (int)FbxIOSettings::ELanguage::ePTB); + AssertEqual(7, (int)FbxIOSettings::ELanguage::eLanguageCount); +} + +void FbxIOSettings_AddPropertyGroup_CreatesPropertyGroupNotUnderIOSROOT() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxIOSettings* settings = FbxIOSettings::Create(manager, ""); + FbxDataType dt = FbxIntDT; + + // when: + FbxProperty prop = settings->AddPropertyGroup("something", dt); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("something", prop.GetName()); + AssertEqual("something", prop.GetHierarchicalName()); + AssertTrue(prop.GetParent().IsValid()); + AssertTrue(prop.GetParent().IsRoot()); +} + +void FbxIOSettings_AddPropertGroup_UnderParentCreatesPropertyUnderParent() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxIOSettings* settings = FbxIOSettings::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent = settings->AddPropertyGroup("something", dt); + + // when: + FbxProperty prop = settings->AddPropertyGroup(parent, "another", dt); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("another", prop.GetName()); + AssertEqual("something|another", prop.GetHierarchicalName()); +} + +void FbxIOSettings_AddPropertGroup_UnderParentParent() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxIOSettings* settings = FbxIOSettings::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent1 = settings->AddPropertyGroup("something", dt); + FbxProperty parent2 = settings->AddPropertyGroup(parent1, "else", dt); + + // when: + FbxProperty prop = settings->AddPropertyGroup(parent2, "another", dt); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("another", prop.GetName()); + AssertEqual("something|else|another", prop.GetHierarchicalName()); +} + +void FbxIOSettingsTest::RegisterTestCases() +{ + AddTestCase(FbxIOSettings_Create_HasDefaults); + AddTestCase(FbxIOSettings_ELanguage_IdentifiersHaveSpecificValues); + AddTestCase(FbxIOSettings_AddPropertyGroup_CreatesPropertyGroupNotUnderIOSROOT); + AddTestCase(FbxIOSettings_AddPropertGroup_UnderParentCreatesPropertyUnderParent); + AddTestCase(FbxIOSettings_AddPropertGroup_UnderParentParent); +} + diff --git a/FbxCppTests/FbxImporterTest.cpp b/FbxCppTests/FbxImporterTest.cpp new file mode 100644 index 0000000..26534e1 --- /dev/null +++ b/FbxCppTests/FbxImporterTest.cpp @@ -0,0 +1,655 @@ + +#include "Tests.h" + +using namespace std; + +void FbxImporter_Create_AllZero() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + + // expect: + AssertFalse(importer->IsFBX()); + AssertEqual(-1, importer->GetFileFormat()); +} + +void FbxImporter_IsImporting_UninitializedYieldsFalse() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result = false; + + // expect: + AssertFalse(importer->IsImporting(result)); + AssertFalse(result); +} + +void FbxImporter_GetProgress_UninitializedYieldsZero() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + + // expect: + AssertEqual(0.0, importer->GetProgress(NULL)); +} + +void FbxImporter_GetFileVersion_UninitializedYieldsZero() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(0, major); + AssertEqual(0, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileHeaderInfo_UninitializedYieldsDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(false, header->mBinary); + AssertEqual(0, header->mFileVersion); + AssertEqual(false, header->mCreationTimeStampPresent); + AssertEqual(0, header->mCreationTimeStamp.mYear); + AssertEqual(0, header->mCreationTimeStamp.mMonth); + AssertEqual(0, header->mCreationTimeStamp.mDay); + AssertEqual(0, header->mCreationTimeStamp.mHour); + AssertEqual(0, header->mCreationTimeStamp.mMinute); + AssertEqual(0, header->mCreationTimeStamp.mSecond); + AssertEqual(0, header->mCreationTimeStamp.mMillisecond); + AssertEqual("", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetIOSettings_UninitializedYieldsNull() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOSettings* result; + + // when: + result = importer->GetIOSettings(); + + // then: + AssertNull(result); +} + +void FbxImporter_Initialize_ValidFile_Succeeds1() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result; + + // when: + result = importer->Initialize(GetSample("monolith.fbx").c_str()); + + // then: + AssertTrue(result); +} + +void FbxImporter_Initialize_ValidFile_Succeeds2() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result; + + // when: + result = importer->Initialize(GetSample("monolith.fbx").c_str()); + + // then: + AssertEqual(FbxStatus::EStatusCode::eSuccess, importer->GetStatus().GetCode()); +} + +void FbxImporter_Initialize_ValidFile_Succeeds3() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result; + + // when: + result = importer->Initialize(GetSample("monolith.fbx").c_str()); + + // then: + AssertFalse(importer->GetStatus().Error()); +} + +void FbxImporter_Initialize_ValidFile_Succeeds4() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result; + + // when: + result = importer->Initialize(GetSample("monolith.fbx").c_str()); + + // then: + AssertEqual("", importer->GetStatus().GetErrorString()); +} + +void FbxImporter_IsImporting_InitializedYieldsFalse() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + bool result = false; + importer->Initialize(GetSample("monolith.fbx").c_str()); + + // expect: + AssertFalse(importer->IsImporting(result)); + AssertFalse(result); +} + +void FbxImporter_GetProgress_InitializedYieldsZero() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + importer->Initialize(GetSample("monolith.fbx").c_str()); + + // expect: + AssertEqual(0.0, importer->GetProgress(NULL)); +} + +void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + importer->Initialize(GetSample("monolith.fbx").c_str()); + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(7, major); + AssertEqual(4, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6a() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + importer->Initialize(GetSample("monolith_fbx6ascii.fbx").c_str()); + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(6, major); + AssertEqual(1, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6b() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + importer->Initialize(GetSample("monolith_fbx6binary.fbx").c_str()); + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(6, major); + AssertEqual(1, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7a() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + importer->Initialize(GetSample("monolith_fbx7ascii.fbx").c_str()); + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(7, major); + AssertEqual(7, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7b() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + int major = 0; + int minor = 0; + int revision = 0; + importer->Initialize(GetSample("monolith_fbx7binary.fbx").c_str()); + + // when: + importer->GetFileVersion(major, minor, revision); + + // then: + AssertEqual(7, major); + AssertEqual(7, minor); + AssertEqual(0, revision); +} + +void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + importer->Initialize(GetSample("monolith.fbx").c_str()); + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(true, header->mBinary); + AssertEqual(7400, header->mFileVersion); + AssertEqual(true, header->mCreationTimeStampPresent); + AssertEqual(2024, header->mCreationTimeStamp.mYear); + AssertEqual(5, header->mCreationTimeStamp.mMonth); + AssertEqual(13, header->mCreationTimeStamp.mDay); + AssertEqual(22, header->mCreationTimeStamp.mHour); + AssertEqual(30, header->mCreationTimeStamp.mMinute); + AssertEqual(25, header->mCreationTimeStamp.mSecond); + AssertEqual(938, header->mCreationTimeStamp.mMillisecond); + AssertEqual("Blender (stable FBX IO) - 4.0.1 - 5.8.12", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6a() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + importer->Initialize(GetSample("monolith_fbx6ascii.fbx").c_str()); + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(false, header->mBinary); + AssertEqual(6100, header->mFileVersion); + AssertEqual(true, header->mCreationTimeStampPresent); + AssertEqual(2024, header->mCreationTimeStamp.mYear); + AssertEqual(6, header->mCreationTimeStamp.mMonth); + AssertEqual(4, header->mCreationTimeStamp.mDay); + AssertEqual(2, header->mCreationTimeStamp.mHour); + AssertEqual(59, header->mCreationTimeStamp.mMinute); + AssertEqual(23, header->mCreationTimeStamp.mSecond); + AssertEqual(0, header->mCreationTimeStamp.mMillisecond); + AssertEqual("FBX SDK/FBX Plugins version 2020.3.4", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6b() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + importer->Initialize(GetSample("monolith_fbx6binary.fbx").c_str()); + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(true, header->mBinary); + AssertEqual(6100, header->mFileVersion); + AssertEqual(true, header->mCreationTimeStampPresent); + AssertEqual(2024, header->mCreationTimeStamp.mYear); + AssertEqual(6, header->mCreationTimeStamp.mMonth); + AssertEqual(4, header->mCreationTimeStamp.mDay); + AssertEqual(2, header->mCreationTimeStamp.mHour); + AssertEqual(59, header->mCreationTimeStamp.mMinute); + AssertEqual(23, header->mCreationTimeStamp.mSecond); + AssertEqual(0, header->mCreationTimeStamp.mMillisecond); + AssertEqual("FBX SDK/FBX Plugins version 2020.3.4", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7a() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + importer->Initialize(GetSample("monolith_fbx7ascii.fbx").c_str()); + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(false, header->mBinary); + AssertEqual(7700, header->mFileVersion); + AssertEqual(true, header->mCreationTimeStampPresent); + AssertEqual(2024, header->mCreationTimeStamp.mYear); + AssertEqual(6, header->mCreationTimeStamp.mMonth); + AssertEqual(4, header->mCreationTimeStamp.mDay); + AssertEqual(2, header->mCreationTimeStamp.mHour); + AssertEqual(59, header->mCreationTimeStamp.mMinute); + AssertEqual(23, header->mCreationTimeStamp.mSecond); + AssertEqual(0, header->mCreationTimeStamp.mMillisecond); + AssertEqual("FBX SDK/FBX Plugins version 2020.3.4", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7b() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOFileHeaderInfo* header; + importer->Initialize(GetSample("monolith_fbx7binary.fbx").c_str()); + + // when: + header = importer->GetFileHeaderInfo(); + + // then: + AssertNotNull(header); + AssertEqual(false, header->mDefaultRenderResolution.mIsOK); + AssertEqual("", header->mDefaultRenderResolution.mCameraName); + AssertEqual("", header->mDefaultRenderResolution.mResolutionMode); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionW); + AssertEqual(0.0, header->mDefaultRenderResolution.mResolutionH); + AssertEqual(true, header->mBinary); + AssertEqual(7700, header->mFileVersion); + AssertEqual(true, header->mCreationTimeStampPresent); + AssertEqual(2024, header->mCreationTimeStamp.mYear); + AssertEqual(6, header->mCreationTimeStamp.mMonth); + AssertEqual(4, header->mCreationTimeStamp.mDay); + AssertEqual(2, header->mCreationTimeStamp.mHour); + AssertEqual(59, header->mCreationTimeStamp.mMinute); + AssertEqual(23, header->mCreationTimeStamp.mSecond); + AssertEqual(0, header->mCreationTimeStamp.mMillisecond); + AssertEqual("FBX SDK/FBX Plugins version 2020.3.4", header->mCreator); + AssertEqual(false, header->mIOPlugin); + AssertEqual(false, header->mPLE); +} + +void FbxImporter_GetIOSettings_InitializedYieldsAnObject() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + FbxIOSettings* result; + FbxIOSettings* result2; + importer->Initialize(GetSample("monolith.fbx").c_str()); + + // when: + result = importer->GetIOSettings(); + + // then: + AssertNotNull(result); + AssertEqual("IOSRoot", result->GetName()); + + // when: + result2 = importer->GetIOSettings(); + + // then: + // it's the same object; + AssertEqual(result, result2); +} + +void FbxImporter_ImportAsciiFile_DoesNotFail_1() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + importer->Initialize(GetSample("empty_7a.fbx").c_str()); + FbxScene* scene = FbxScene::Create(manager, ""); + bool result; + + // when: + result = importer->Import(scene); + // then: + AssertTrue(result); + FbxDocumentInfo* docinfo = scene->GetDocumentInfo(); + AssertEqual(15, CountProperties(docinfo)); + FbxProperty prop; + + prop = docinfo->FindProperty("DocumentUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("DocumentUrl", prop.GetName()); + AssertEqual("DocumentUrl", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("empty_7a.fbx", prop.Get()); + + prop = docinfo->FindProperty("SrcDocumentUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("SrcDocumentUrl", prop.GetName()); + AssertEqual("SrcDocumentUrl", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual(FbxString(GetSample("empty_7a.fbx").c_str()), prop.Get()); + + prop = docinfo->FindProperty("Original"); + AssertTrue(prop.IsValid()); + AssertEqual("Original", prop.GetName()); + AssertEqual("Original", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxUndefined, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationVendor"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVendor", prop.GetName()); + AssertEqual("Original|ApplicationVendor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationName"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationName", prop.GetName()); + AssertEqual("Original|ApplicationName", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("Original|ApplicationVersion"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVersion", prop.GetName()); + AssertEqual("Original|ApplicationVersion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("Original|DateTime_GMT"); + AssertTrue(prop.IsValid()); + AssertEqual("DateTime_GMT", prop.GetName()); + AssertEqual("Original|DateTime_GMT", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDateTime, prop.GetPropertyDataType().GetType()); + AssertEqual(FbxDateTime(), prop.Get()); + + prop = docinfo->FindPropertyHierarchical("Original|FileName"); + AssertTrue(prop.IsValid()); + AssertEqual("FileName", prop.GetName()); + AssertEqual("Original|FileName", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindProperty("LastSaved"); + AssertTrue(prop.IsValid()); + AssertEqual("LastSaved", prop.GetName()); + AssertEqual("LastSaved", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxUndefined, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationVendor"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVendor", prop.GetName()); + AssertEqual("LastSaved|ApplicationVendor", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationName"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationName", prop.GetName()); + AssertEqual("LastSaved|ApplicationName", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("LastSaved|ApplicationVersion"); + AssertTrue(prop.IsValid()); + AssertEqual("ApplicationVersion", prop.GetName()); + AssertEqual("LastSaved|ApplicationVersion", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindPropertyHierarchical("LastSaved|DateTime_GMT"); + AssertTrue(prop.IsValid()); + AssertEqual("DateTime_GMT", prop.GetName()); + AssertEqual("LastSaved|DateTime_GMT", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxDateTime, prop.GetPropertyDataType().GetType()); + AssertEqual(FbxDateTime(), prop.Get()); + + prop = docinfo->FindProperty("DocumentEmbeddedUrl"); + AssertTrue(prop.IsValid()); + AssertEqual("DocumentEmbeddedUrl", prop.GetName()); + AssertEqual("DocumentEmbeddedUrl", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxString, prop.GetPropertyDataType().GetType()); + AssertEqual("", prop.Get()); + + prop = docinfo->FindProperty("SceneThumbnail"); + AssertTrue(prop.IsValid()); + AssertEqual("SceneThumbnail", prop.GetName()); + AssertEqual("SceneThumbnail", prop.GetHierarchicalName()); + AssertEqual(EFbxType::eFbxReference, prop.GetPropertyDataType().GetType()); + AssertEqual(NULL, prop.Get()); +} + +void FbxImporter_ImportBinaryFile_DoesNotFail_1() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + importer->Initialize(GetSample("empty_7b.fbx").c_str()); + FbxScene* scene = FbxScene::Create(manager, ""); + bool result; + + // when: + result = importer->Import(scene); + // then: + AssertTrue(result); + FbxDocumentInfo* docinfo = scene->GetDocumentInfo(); + AssertEqual(15, CountProperties(docinfo)); + FbxProperty prop; +} + +void FbxImporter_Import_DoubleColonInStringHasOddEncoding() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxImporter* importer = FbxImporter::Create(manager, ""); + importer->Initialize(GetSample("hierarchy_string_1_7b.fbx").c_str()); + FbxScene* scene = FbxScene::Create(manager, ""); + bool result; + + // when: + result = importer->Import(scene); + // then: + AssertTrue(result); + FbxProperty prop = scene->GetDocumentInfo()->FindProperty("CustomProp"); + AssertTrue(prop.IsValid()); + AssertEqual("Abc::Def", prop.Get()); +} + +void FbxImporterTest::RegisterTestCases() +{ + AddTestCase(FbxImporter_Create_AllZero); + AddTestCase(FbxImporter_IsImporting_UninitializedYieldsFalse); + AddTestCase(FbxImporter_GetProgress_UninitializedYieldsZero); + AddTestCase(FbxImporter_GetFileVersion_UninitializedYieldsZero); + AddTestCase(FbxImporter_GetFileHeaderInfo_UninitializedYieldsDefaults); + AddTestCase(FbxImporter_GetIOSettings_UninitializedYieldsNull); + AddTestCase(FbxImporter_Initialize_ValidFile_Succeeds1); + AddTestCase(FbxImporter_Initialize_ValidFile_Succeeds2); + AddTestCase(FbxImporter_Initialize_ValidFile_Succeeds3); + AddTestCase(FbxImporter_Initialize_ValidFile_Succeeds4); + AddTestCase(FbxImporter_IsImporting_InitializedYieldsFalse); + AddTestCase(FbxImporter_GetProgress_InitializedYieldsZero); + AddTestCase(FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile); + AddTestCase(FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6a); + AddTestCase(FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6b); + AddTestCase(FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7a); + AddTestCase(FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7b); + AddTestCase(FbxImporter_GetFileHeaderInfo_InitializedYieldsValues); + AddTestCase(FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6a); + AddTestCase(FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6b); + AddTestCase(FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7a); + AddTestCase(FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7b); + AddTestCase(FbxImporter_GetIOSettings_InitializedYieldsAnObject); + AddTestCase(FbxImporter_ImportAsciiFile_DoesNotFail_1); + AddTestCase(FbxImporter_ImportBinaryFile_DoesNotFail_1); + AddTestCase(FbxImporter_Import_DoubleColonInStringHasOddEncoding); +} + diff --git a/FbxCppTests/FbxNullTest.cpp b/FbxCppTests/FbxNullTest.cpp new file mode 100644 index 0000000..3bdfc07 --- /dev/null +++ b/FbxCppTests/FbxNullTest.cpp @@ -0,0 +1,62 @@ + +#include "Tests.h" + +using namespace std; + +void FbxNull_StaticInitialization() +{ + // expect: + AssertEqual(100.0d, FbxNull::sDefaultSize); + AssertEqual(FbxNull::ELook::eCross, FbxNull::sDefaultLook); + AssertEqual("Size", FbxNull::sSize); + AssertEqual("Look", FbxNull::sLook); +} + +void FbxNull_Create_SetsDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + // when: + FbxNull* n = FbxNull::Create(manager, "name"); + // then: + AssertEqual("name", n->GetName()); + AssertEqual(100.0d, n->GetSizeDefaultValue()); + AssertEqual(100.0d, n->Size.Get()); + AssertEqual(FbxNull::ELook::eCross, n->Look.Get()); +} + +void FbxNull_Reset_ResetsPropertyValues() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxNull* n = FbxNull::Create(manager, ""); + n->Size.Set(234); + n->Look.Set(FbxNull::ELook::eNone); + // require: + AssertEqual(234.0d, n->Size.Get()); + AssertEqual(FbxNull::ELook::eNone, n->Look.Get()); + // when: + n->Reset(); + // then: + AssertEqual(FbxNull::sDefaultSize, n->Size.Get()); + AssertEqual(FbxNull::sDefaultLook, n->Look.Get()); +} + +void FbxNull_Create_HasNamespacePrefix() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxNull* obj = FbxNull::Create(manager, "asdf"); + + // then: + AssertEqual("NodeAttribute::", obj->GetNameSpacePrefix());; +} + +void FbxNullTest::RegisterTestCases() +{ + AddTestCase(FbxNull_StaticInitialization); + AddTestCase(FbxNull_Create_SetsDefaults); + AddTestCase(FbxNull_Reset_ResetsPropertyValues); + AddTestCase(FbxNull_Create_HasNamespacePrefix); +} + diff --git a/FbxCppTests/FbxObjectTest.cpp b/FbxCppTests/FbxObjectTest.cpp index 5464165..d5a0b5f 100644 --- a/FbxCppTests/FbxObjectTest.cpp +++ b/FbxCppTests/FbxObjectTest.cpp @@ -808,6 +808,212 @@ void FbxObject_TypedDisconnectAllDstObjectWithInheritance_DisconnectsAllDstObjec AssertEqual(0, light->GetSrcObjectCount()); } +void FbxObject_FindPropertyHierarchical_FindsChildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxProperty prop1 = FbxProperty::Create(obj, FbxStringDT, "Abc"); + FbxProperty prop2 = FbxProperty::Create(prop1, FbxStringDT, "Def"); + FbxProperty prop3 = FbxProperty::Create(prop2, FbxStringDT, "Ghi"); + + // require: + AssertEqual("Abc", prop1.GetName()); + AssertEqual("Abc", prop1.GetHierarchicalName()); + AssertEqual("Def", prop2.GetName()); + AssertEqual("Abc|Def", prop2.GetHierarchicalName()); + AssertEqual("Ghi", prop3.GetName()); + AssertEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + FbxProperty prop = obj->FindPropertyHierarchical("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Abc", prop.GetName()); + AssertEqual("Abc", prop.GetHierarchicalName()); + AssertTrue(prop == prop1); + + // when: + prop = obj->FindProperty("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == prop1); + + // when: + prop = obj->FindPropertyHierarchical("Abc|Def"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Def", prop.GetName()); + AssertEqual("Abc|Def", prop.GetHierarchicalName()); + AssertTrue(prop == prop2); + + // when: + prop = obj->FindProperty("Def"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = obj->FindPropertyHierarchical("Abc|Def|Ghi"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Ghi", prop.GetName()); + AssertEqual("Abc|Def|Ghi", prop.GetHierarchicalName()); + AssertTrue(prop == prop3); + + // when: + prop = obj->FindProperty("Ghi"); + + // then: + AssertFalse(prop.IsValid()); +} + +void FbxObject_FindProperty_DoesNotFindsChildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxProperty prop1 = FbxProperty::Create(obj, FbxStringDT, "Abc"); + FbxProperty prop2 = FbxProperty::Create(prop1, FbxStringDT, "Def"); + FbxProperty prop3 = FbxProperty::Create(prop2, FbxStringDT, "Ghi"); + + // require: + AssertEqual("Abc", prop1.GetName()); + AssertEqual("Abc", prop1.GetHierarchicalName()); + AssertEqual("Def", prop2.GetName()); + AssertEqual("Abc|Def", prop2.GetHierarchicalName()); + AssertEqual("Ghi", prop3.GetName()); + AssertEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + FbxProperty prop = obj->FindProperty("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Abc", prop.GetName()); + AssertEqual("Abc", prop.GetHierarchicalName()); + AssertTrue(prop == prop1); + + // when: + prop = obj->FindProperty("Def"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = obj->FindProperty("Ghi"); + + // then: + AssertFalse(prop.IsValid()); +} + +void FbxObject_RootProperty_FindHierarchical_FindsChildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxProperty prop1 = FbxProperty::Create(obj, FbxStringDT, "Abc"); + FbxProperty prop2 = FbxProperty::Create(prop1, FbxStringDT, "Def"); + FbxProperty prop3 = FbxProperty::Create(prop2, FbxStringDT, "Ghi"); + + // require: + AssertEqual("Abc", prop1.GetName()); + AssertEqual("Abc", prop1.GetHierarchicalName()); + AssertEqual("Def", prop2.GetName()); + AssertEqual("Abc|Def", prop2.GetHierarchicalName()); + AssertEqual("Ghi", prop3.GetName()); + AssertEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + FbxProperty prop = obj->RootProperty.FindHierarchical("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Abc", prop.GetName()); + AssertEqual("Abc", prop.GetHierarchicalName()); + AssertTrue(prop == prop1); + + // when: + prop = obj->RootProperty.Find("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == prop1); + + // when: + prop = obj->RootProperty.FindHierarchical("Abc|Def"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Def", prop.GetName()); + AssertEqual("Abc|Def", prop.GetHierarchicalName()); + AssertTrue(prop == prop2); + + // when: + prop = obj->RootProperty.Find("Def"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = obj->RootProperty.FindHierarchical("Abc|Def|Ghi"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Ghi", prop.GetName()); + AssertEqual("Abc|Def|Ghi", prop.GetHierarchicalName()); + AssertTrue(prop == prop3); + + // when: + prop = obj->RootProperty.Find("Ghi"); + + // then: + AssertFalse(prop.IsValid()); +} + +void FbxObject_RootProperty_Find_DoesNotFindsChildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxProperty prop1 = FbxProperty::Create(obj, FbxStringDT, "Abc"); + FbxProperty prop2 = FbxProperty::Create(prop1, FbxStringDT, "Def"); + FbxProperty prop3 = FbxProperty::Create(prop2, FbxStringDT, "Ghi"); + + // require: + AssertEqual("Abc", prop1.GetName()); + AssertEqual("Abc", prop1.GetHierarchicalName()); + AssertEqual("Def", prop2.GetName()); + AssertEqual("Abc|Def", prop2.GetHierarchicalName()); + AssertEqual("Ghi", prop3.GetName()); + AssertEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + FbxProperty prop = obj->RootProperty.Find("Abc"); + + // then: + AssertTrue(prop.IsValid()); + AssertEqual("Abc", prop.GetName()); + AssertEqual("Abc", prop.GetHierarchicalName()); + AssertTrue(prop == prop1); + + // when: + prop = obj->RootProperty.Find("Def"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = obj->RootProperty.Find("Ghi"); + + // then: + AssertFalse(prop.IsValid()); +} + void FbxObjectTest::RegisterTestCases() { AddTestCase(FbxObject_Create_HasZeroProperties); @@ -850,5 +1056,9 @@ void FbxObjectTest::RegisterTestCases() AddTestCase(FbxObject_TypedGetDstObject_GetsObjectOfThatType); AddTestCase(FbxObject_TypedDisconnectAllDstObject_DisconnectsAllDstObjectOfThatType); AddTestCase(FbxObject_TypedDisconnectAllDstObjectWithInheritance_DisconnectsAllDstObjectOfThatType); + AddTestCase(FbxObject_FindPropertyHierarchical_FindsChildren); + AddTestCase(FbxObject_FindProperty_DoesNotFindsChildren); + AddTestCase(FbxObject_RootProperty_FindHierarchical_FindsChildren); + AddTestCase(FbxObject_RootProperty_Find_DoesNotFindsChildren); } diff --git a/FbxCppTests/FbxPropertyFlagsTest.cpp b/FbxCppTests/FbxPropertyFlagsTest.cpp new file mode 100644 index 0000000..20aa38a --- /dev/null +++ b/FbxCppTests/FbxPropertyFlagsTest.cpp @@ -0,0 +1,61 @@ + +#include "Tests.h" + +using namespace std; + +void FbxPropertyFlags_EInheritType_IdentifiersHaveSpecificValues() +{ + // expect: + AssertEqual(0, (int)FbxPropertyFlags::EInheritType::eOverride); + AssertEqual(1, (int)FbxPropertyFlags::EInheritType::eInherit); + AssertEqual(2, (int)FbxPropertyFlags::EInheritType::eDeleted); +} + +void FbxPropertyFlags_EFlags_IdentifiersHaveSpecificValues() +{ + // expect: + AssertEqual(0, (int)FbxPropertyFlags::EFlags::eNone); + AssertEqual(1, (int)FbxPropertyFlags::EFlags::eStatic); + AssertEqual(2, (int)FbxPropertyFlags::EFlags::eAnimatable); + AssertEqual(4, (int)FbxPropertyFlags::EFlags::eAnimated); + AssertEqual(8, (int)FbxPropertyFlags::EFlags::eImported); + AssertEqual(16, (int)FbxPropertyFlags::EFlags::eUserDefined); + AssertEqual(32, (int)FbxPropertyFlags::EFlags::eHidden); + AssertEqual(64, (int)FbxPropertyFlags::EFlags::eNotSavable); + + AssertEqual(128, (int)FbxPropertyFlags::EFlags::eLockedMember0); + AssertEqual(256, (int)FbxPropertyFlags::EFlags::eLockedMember1); + AssertEqual(512, (int)FbxPropertyFlags::EFlags::eLockedMember2); + AssertEqual(1024, (int)FbxPropertyFlags::EFlags::eLockedMember3); + AssertEqual(1920, (int)FbxPropertyFlags::EFlags::eLockedAll); + + AssertEqual(2048, (int)FbxPropertyFlags::EFlags::eMutedMember0); + AssertEqual(4096, (int)FbxPropertyFlags::EFlags::eMutedMember1); + AssertEqual(8192, (int)FbxPropertyFlags::EFlags::eMutedMember2); + AssertEqual(16384, (int)FbxPropertyFlags::EFlags::eMutedMember3); + AssertEqual(30720, (int)FbxPropertyFlags::EFlags::eMutedAll); + + AssertEqual(32768, (int)FbxPropertyFlags::EFlags::eUIDisabled); + AssertEqual(65536, (int)FbxPropertyFlags::EFlags::eUIGroup); + AssertEqual(131072, (int)FbxPropertyFlags::EFlags::eUIBoolGroup); + AssertEqual(262144, (int)FbxPropertyFlags::EFlags::eUIExpanded); + AssertEqual(524288, (int)FbxPropertyFlags::EFlags::eUINoCaption); + AssertEqual(1048576, (int)FbxPropertyFlags::EFlags::eUIPanel); + AssertEqual(2097152, (int)FbxPropertyFlags::EFlags::eUILeftLabel); + AssertEqual(4194304, (int)FbxPropertyFlags::EFlags::eUIHidden); + + AssertEqual(32767, (int)FbxPropertyFlags::EFlags::eCtrlFlags); + + AssertEqual(8355840, (int)FbxPropertyFlags::EFlags::eUIFlags); + + AssertEqual(8388607, (int)FbxPropertyFlags::EFlags::eAllFlags); + + AssertEqual(23, (int)FbxPropertyFlags::EFlags::eFlagCount); +} + +void FbxPropertyFlagsTest::RegisterTestCases() +{ + AddTestCase(FbxPropertyFlags_EInheritType_IdentifiersHaveSpecificValues); + AddTestCase(FbxPropertyFlags_EFlags_IdentifiersHaveSpecificValues); +} + diff --git a/FbxCppTests/FbxPropertyTest.cpp b/FbxCppTests/FbxPropertyTest.cpp new file mode 100644 index 0000000..2ec5028 --- /dev/null +++ b/FbxCppTests/FbxPropertyTest.cpp @@ -0,0 +1,144 @@ + +#include "Tests.h" + +using namespace std; + +void FbxProperty_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxDataType dt = FbxIntDT; + // when: + FbxProperty prop = FbxProperty::Create(obj, dt, "prop"); + // then: + AssertTrue(prop.IsValid()); + AssertEqual("prop", prop.GetName()); + AssertEqual("prop", prop.GetHierarchicalName()); + AssertTrue(prop.GetParent().IsValid()); + AssertFalse(prop.IsRoot()); + AssertTrue(prop.GetParent().IsRoot()); + AssertFalse(prop.GetChild().IsValid()); + AssertFalse(prop.GetSibling().IsValid()); + AssertFalse(prop.GetFirstDescendent().IsValid()); +} + +void FbxProperty_Create_WithParentSetsParent() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent = FbxProperty::Create(obj, dt, "parent"); + // when: + FbxProperty prop = FbxProperty::Create(parent, dt, "prop"); + AssertTrue(prop.IsValid()); + AssertEqual("prop", prop.GetName()); + AssertEqual("parent|prop", prop.GetHierarchicalName()); + AssertTrue(prop.GetParent().IsValid()); + AssertEqual("parent", prop.GetParent().GetHierarchicalName()); + AssertFalse(prop.IsRoot()); + AssertFalse(prop.GetChild().IsValid()); + AssertFalse(prop.GetSibling().IsValid()); + AssertFalse(prop.GetFirstDescendent().IsValid()); + AssertTrue(prop.IsChildOf(parent)); + AssertTrue(prop.IsDescendentOf(parent)); + AssertTrue(parent.GetChild().IsValid()); + AssertEqual("parent|prop", parent.GetChild().GetHierarchicalName()); + AssertTrue(parent.GetFirstDescendent().IsValid()); + AssertEqual("parent|prop", parent.GetFirstDescendent().GetHierarchicalName()); +} + +void FbxProperty_Find_FindsChildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent = FbxProperty::Create(obj, dt, "parent"); + FbxProperty child = FbxProperty::Create(parent, dt, "child"); + + // when: + FbxProperty prop = parent.Find("child"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == child); + + // when: + prop = parent.Find("something else"); + + // then: + AssertFalse(prop.IsValid()); +} + +void FbxProperty_Find_DoesNotFindGrandchildren() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent = FbxProperty::Create(obj, dt, "parent"); + FbxProperty child = FbxProperty::Create(parent, dt, "child"); + FbxProperty grandchild = FbxProperty::Create(child, dt, "grandchild"); + + // when: + FbxProperty prop = parent.Find("grandchild"); + + // then: + AssertFalse(prop.IsValid()); +} + +void FbxProperty_FindHierarchical_FindsDescendants() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxObject* obj = FbxObject::Create(manager, ""); + FbxDataType dt = FbxIntDT; + FbxProperty parent = FbxProperty::Create(obj, dt, "parent"); + FbxProperty child = FbxProperty::Create(parent, dt, "child"); + FbxProperty grandchild = FbxProperty::Create(child, dt, "grandchild"); + + // when: + FbxProperty prop = parent.FindHierarchical("child"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == child); + + // when: + prop = parent.FindHierarchical("child|grandchild"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == grandchild); + + // when: + prop = parent.FindHierarchical("parent|child|grandchild"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = parent.FindHierarchical("grandchild"); + + // then: + AssertFalse(prop.IsValid()); + + // when: + prop = child.FindHierarchical("grandchild"); + + // then: + AssertTrue(prop.IsValid()); + AssertTrue(prop == grandchild); +} + +void FbxPropertyTest::RegisterTestCases() +{ + AddTestCase(FbxProperty_Create_HasDefaults); + AddTestCase(FbxProperty_Create_WithParentSetsParent); + AddTestCase(FbxProperty_Find_FindsChildren); + AddTestCase(FbxProperty_Find_DoesNotFindGrandchildren); + AddTestCase(FbxProperty_FindHierarchical_FindsDescendants); +} + diff --git a/FbxCppTests/FbxSystemUnitTest.cpp b/FbxCppTests/FbxSystemUnitTest.cpp new file mode 100644 index 0000000..b5ccdf8 --- /dev/null +++ b/FbxCppTests/FbxSystemUnitTest.cpp @@ -0,0 +1,88 @@ + +#include "Tests.h" + +using namespace std; + +void FbxSystemUnit_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxSystemUnit* obj; + + // when: + obj = new FbxSystemUnit(); + + // then: + AssertEqual(1.0d, obj->GetScaleFactor()); + AssertEqual("cm", obj->GetScaleFactorAsString()); + AssertEqual("Centimeters", obj->GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, obj->GetMultiplier()); +} + +void FbxSystemUnit_StaticBuiltinsHaveDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxSystemUnit* obj; + + // when: + obj = new FbxSystemUnit(); + + // then: + AssertEqual(0.1d, FbxSystemUnit::mm.GetScaleFactor()); + AssertEqual("mm", FbxSystemUnit::mm.GetScaleFactorAsString()); + AssertEqual("Millimeters", FbxSystemUnit::mm.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::mm.GetMultiplier()); + + AssertEqual(10.0d, FbxSystemUnit::dm.GetScaleFactor()); + AssertEqual("dm", FbxSystemUnit::dm.GetScaleFactorAsString()); + AssertEqual("Decimeters", FbxSystemUnit::dm.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::dm.GetMultiplier()); + + AssertEqual(1.0d, FbxSystemUnit::cm.GetScaleFactor()); + AssertEqual("cm", FbxSystemUnit::cm.GetScaleFactorAsString()); + AssertEqual("Centimeters", FbxSystemUnit::cm.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::cm.GetMultiplier()); + + AssertEqual(100.0d, FbxSystemUnit::m.GetScaleFactor()); + AssertEqual("m", FbxSystemUnit::m.GetScaleFactorAsString()); + AssertEqual("Meters", FbxSystemUnit::m.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::m.GetMultiplier()); + + AssertEqual(100000.0d, FbxSystemUnit::km.GetScaleFactor()); + AssertEqual("km", FbxSystemUnit::km.GetScaleFactorAsString()); + AssertEqual("Kilometers", FbxSystemUnit::km.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::km.GetMultiplier()); + + AssertEqual(2.54d, FbxSystemUnit::Inch.GetScaleFactor()); + AssertEqual("in", FbxSystemUnit::Inch.GetScaleFactorAsString()); + AssertEqual("Inches", FbxSystemUnit::Inch.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::Inch.GetMultiplier()); + + AssertEqual(30.48d, FbxSystemUnit::Foot.GetScaleFactor()); + AssertEqual("ft", FbxSystemUnit::Foot.GetScaleFactorAsString()); + AssertEqual("Feet", FbxSystemUnit::Foot.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::Foot.GetMultiplier()); + + AssertEqual(160934.4d, FbxSystemUnit::Mile.GetScaleFactor()); + AssertEqual("mi", FbxSystemUnit::Mile.GetScaleFactorAsString()); + AssertEqual("Miles", FbxSystemUnit::Mile.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::Mile.GetMultiplier()); + + AssertEqual(91.44d, FbxSystemUnit::Yard.GetScaleFactor()); + AssertEqual("yd", FbxSystemUnit::Yard.GetScaleFactorAsString()); + AssertEqual("Yards", FbxSystemUnit::Yard.GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::Yard.GetMultiplier()); + + AssertEqual(0.1d, FbxSystemUnit::sPredefinedUnits->GetScaleFactor()); + AssertEqual("mm", FbxSystemUnit::sPredefinedUnits->GetScaleFactorAsString()); + AssertEqual("Millimeters", FbxSystemUnit::sPredefinedUnits->GetScaleFactorAsString_Plurial()); + AssertEqual(1.0d, FbxSystemUnit::sPredefinedUnits->GetMultiplier()); +} + +void FbxSystemUnitTest::RegisterTestCases() +{ + AddTestCase(FbxSystemUnit_Create_HasDefaults); + AddTestCase(FbxSystemUnit_StaticBuiltinsHaveDefaults); +} + diff --git a/FbxCppTests/FbxTimeCodeTest.cpp b/FbxCppTests/FbxTimeCodeTest.cpp new file mode 100644 index 0000000..fc6deda --- /dev/null +++ b/FbxCppTests/FbxTimeCodeTest.cpp @@ -0,0 +1,19 @@ + +#include "Tests.h" + +using namespace std; + +void FbxTimeCode_Constants() +{ + // expect: + AssertEqual(141120L, FBXSDK_TC_MILLISECOND); + AssertEqual(141120000L, FBXSDK_TC_SECOND); + AssertEqual(46186158L, FBXSDK_TC_LEGACY_MILLISECOND); + AssertEqual(46186158000L, FBXSDK_TC_LEGACY_SECOND); +} + +void FbxTimeCodeTest::RegisterTestCases() +{ + AddTestCase(FbxTimeCode_Constants); +} + diff --git a/FbxCppTests/FbxTimeSpanTest.cpp b/FbxCppTests/FbxTimeSpanTest.cpp new file mode 100644 index 0000000..2e23075 --- /dev/null +++ b/FbxCppTests/FbxTimeSpanTest.cpp @@ -0,0 +1,51 @@ + +#include "Tests.h" + +using namespace std; + +void FbxTimeSpan_Create_HasDefaults() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxTimeSpan ts; + ts = FbxTimeSpan(); + + // expect: + AssertEqual(0LL, ts.GetStart().Get()); + AssertEqual(0LL, ts.GetStop().Get()); + AssertEqual(0LL, ts.GetDuration().Get()); + AssertEqual(0LL, ts.GetSignedDuration().Get()); + AssertEqual(1, ts.GetDirection()); +} + +void FbxTimeSpan_Create_WithArguments() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxTimeSpan ts; + + // when: + ts = FbxTimeSpan(FbxTime(141120000L), FbxTime(423360000L)); + // then: + AssertEqual(141120000LL, ts.GetStart().Get()); + AssertEqual(423360000LL, ts.GetStop().Get()); + AssertEqual(282240000LL, ts.GetDuration().Get()); + AssertEqual(282240000LL, ts.GetSignedDuration().Get()); + AssertEqual(1, ts.GetDirection()); + + // when: + ts = FbxTimeSpan(FbxTime(423360000L), FbxTime(141120000L)); + // then: + AssertEqual(423360000LL, ts.GetStart().Get()); + AssertEqual(141120000LL, ts.GetStop().Get()); + AssertEqual(282240000LL, ts.GetDuration().Get()); + AssertEqual(-282240000LL, ts.GetSignedDuration().Get()); + AssertEqual(-1, ts.GetDirection()); +} + +void FbxTimeSpanTest::RegisterTestCases() +{ + AddTestCase(FbxTimeSpan_Create_HasDefaults); + AddTestCase(FbxTimeSpan_Create_WithArguments); +} + diff --git a/FbxCppTests/FbxTimeTest.cpp b/FbxCppTests/FbxTimeTest.cpp index 1f39b99..1cbd1e9 100644 --- a/FbxCppTests/FbxTimeTest.cpp +++ b/FbxCppTests/FbxTimeTest.cpp @@ -3,13 +3,6 @@ using namespace std; -void FbxTime_Constants() -{ - // expect: - AssertEqual(141120L, FBXSDK_TC_MILLISECOND); - AssertEqual(141120000L, FBXSDK_TC_SECOND); -} - void FbxTime_CreateLongLong_HasSeconds() { // given: @@ -377,9 +370,202 @@ void FbxTime_GetGlobalTimeMode() AssertEqual(FbxTime::EMode::eFrames30, FbxTime::GetGlobalTimeMode()); } +void FbxTime_Get_YieldsInternalRepresentation() +{ + // when: + FbxTime* time = new FbxTime(0LL); + // then: + AssertEqual(0LL, time->Get()); + // when: + time = new FbxTime(1LL); + // then: + AssertEqual(1LL, time->Get()); + // when: + time = new FbxTime(2LL); + // then: + AssertEqual(2LL, time->Get()); + // when: + time = new FbxTime(141119999L); + // then: + AssertEqual(141119999L, time->Get()); + // when: + time = new FbxTime(141120000L); + // then: + AssertEqual(141120000L, time->Get()); + // when: + time = new FbxTime(141120001L); + // then: + AssertEqual(141120001L, time->Get()); + // when: + time = new FbxTime(-1LL); + // then: + AssertEqual(-1LL, time->Get()); + // when: + time = new FbxTime(-2LL); + // then: + AssertEqual(-2LL, time->Get()); + // when: + time = new FbxTime(-141119999L); + // then: + AssertEqual(-141119999L, time->Get()); + // when: + time = new FbxTime(-141120000L); + // then: + AssertEqual(-141120000L, time->Get()); + // when: + time = new FbxTime(-141120001L); + // then: + AssertEqual(-141120001L, time->Get()); +} + +void FbxTime_CountFunctionAreIndependent() +{ + // when: + FbxTime* time = new FbxTime(516640320000LL); + // then: + AssertEqual(3661000LL, time->GetMilliSeconds()); + AssertEqual(3661, time->GetSecondCount()); + AssertEqual(61, time->GetMinuteCount()); + AssertEqual(1, time->GetHourCount()); + AssertEqual(3661.0, time->GetSecondDouble()); + + // when: + time = new FbxTime(516640461120LL); + AssertEqual(3661001LL, time->GetMilliSeconds()); + AssertEqual(3661, time->GetSecondCount()); + AssertEqual(61, time->GetMinuteCount()); + AssertEqual(1, time->GetHourCount()); + AssertEqual(3661.001, time->GetSecondDouble()); +} + +void FbxTime_EMode_Values() +{ + // expect: + AssertEqual(0, (int)FbxTime::EMode::eDefaultMode); + AssertEqual(1, (int)FbxTime::EMode::eFrames120); + AssertEqual(2, (int)FbxTime::EMode::eFrames100); + AssertEqual(3, (int)FbxTime::EMode::eFrames60); + AssertEqual(4, (int)FbxTime::EMode::eFrames50); + AssertEqual(5, (int)FbxTime::EMode::eFrames48); + AssertEqual(6, (int)FbxTime::EMode::eFrames30); + AssertEqual(7, (int)FbxTime::EMode::eFrames30Drop); + AssertEqual(8, (int)FbxTime::EMode::eNTSCDropFrame); + AssertEqual(9, (int)FbxTime::EMode::eNTSCFullFrame); + AssertEqual(10, (int)FbxTime::EMode::ePAL); + AssertEqual(11, (int)FbxTime::EMode::eFrames24); + AssertEqual(12, (int)FbxTime::EMode::eFrames1000); + AssertEqual(13, (int)FbxTime::EMode::eFilmFullFrame); + AssertEqual(14, (int)FbxTime::EMode::eCustom); + AssertEqual(15, (int)FbxTime::EMode::eFrames96); + AssertEqual(16, (int)FbxTime::EMode::eFrames72); + AssertEqual(17, (int)FbxTime::EMode::eFrames59dot94); + AssertEqual(18, (int)FbxTime::EMode::eFrames119dot88); + AssertEqual(19, (int)FbxTime::EMode::eModesCount); +} + +void FbxTime_EProtocol_Values() +{ + // expect: + AssertEqual(0, (int)FbxTime::EProtocol::eSMPTE); + AssertEqual(1, (int)FbxTime::EProtocol::eFrameCount); + AssertEqual(2, (int)FbxTime::EProtocol::eDefaultProtocol); +} + +void FbxTime_GetOneFrameValue() +{ + // expect: + AssertEqual(4704000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eDefaultMode)); + AssertEqual(1176000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames120)); + AssertEqual(1411200L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames100)); + AssertEqual(2352000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames60)); + AssertEqual(2822400L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames50)); + AssertEqual(2940000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames48)); + AssertEqual(4704000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames30)); + AssertEqual(0L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames30Drop)); + AssertEqual(4708704L, FbxTime::GetOneFrameValue(FbxTime::EMode::eNTSCDropFrame)); + AssertEqual(4708704L, FbxTime::GetOneFrameValue(FbxTime::EMode::eNTSCFullFrame)); + AssertEqual(5644800L, FbxTime::GetOneFrameValue(FbxTime::EMode::ePAL)); + AssertEqual(5880000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames24)); + AssertEqual(141120L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames1000)); + AssertEqual(5885880L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFilmFullFrame)); + AssertEqual(11289600L, FbxTime::GetOneFrameValue(FbxTime::EMode::eCustom)); + AssertEqual(1470000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames96)); + AssertEqual(1960000L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames72)); + AssertEqual(2354352L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames59dot94)); + AssertEqual(1177176L, FbxTime::GetOneFrameValue(FbxTime::EMode::eFrames119dot88)); + AssertEqual(0L, FbxTime::GetOneFrameValue(FbxTime::EMode::eModesCount)); +} + +void FbxTime_GetGlobalTimeProtocol() +{ + // expect: + AssertEqual(FbxTime::EProtocol::eFrameCount, FbxTime::GetGlobalTimeProtocol()); +} + +void FbxTime_GetFrameRate() +{ + // expect: + AssertEqual(30.0, FbxTime::GetFrameRate(FbxTime::EMode::eDefaultMode)); + AssertEqual(120.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames120)); + AssertEqual(100.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames100)); + AssertEqual(60.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames60)); + AssertEqual(50.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames50)); + AssertEqual(48.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames48)); + AssertEqual(30.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames30)); + AssertEqual(0.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames30Drop)); + AssertEqual(29.970029970029969490497023798525333404541015625, FbxTime::GetFrameRate(FbxTime::EMode::eNTSCDropFrame)); + AssertEqual(29.970029970029969490497023798525333404541015625, FbxTime::GetFrameRate(FbxTime::EMode::eNTSCFullFrame)); + AssertEqual(25.0, FbxTime::GetFrameRate(FbxTime::EMode::ePAL)); + AssertEqual(24.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames24)); + AssertEqual(1000.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames1000)); + AssertEqual(23.976023976023977724025826319120824337005615234375, FbxTime::GetFrameRate(FbxTime::EMode::eFilmFullFrame)); + AssertEqual(12.5, FbxTime::GetFrameRate(FbxTime::EMode::eCustom)); + AssertEqual(96.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames96)); + AssertEqual(72.0, FbxTime::GetFrameRate(FbxTime::EMode::eFrames72)); + AssertEqual(59.94005994005993898099404759705066680908203125, FbxTime::GetFrameRate(FbxTime::EMode::eFrames59dot94)); + AssertEqual(119.8801198801198779619880951941013336181640625, FbxTime::GetFrameRate(FbxTime::EMode::eFrames119dot88)); + AssertEqual(0.0, FbxTime::GetFrameRate(FbxTime::EMode::eModesCount)); +} + +void FbxTime_ConvertFrameRateToTimeMode() +{ + // expect: + AssertEqual(FbxTime::EMode::eFrames30, FbxTime::ConvertFrameRateToTimeMode(30.0)); + AssertEqual(FbxTime::EMode::eFrames120, FbxTime::ConvertFrameRateToTimeMode(120.0)); + AssertEqual(FbxTime::EMode::eFrames100, FbxTime::ConvertFrameRateToTimeMode(100.0)); + AssertEqual(FbxTime::EMode::eFrames60, FbxTime::ConvertFrameRateToTimeMode(60.0)); + AssertEqual(FbxTime::EMode::eFrames50, FbxTime::ConvertFrameRateToTimeMode(50.0)); + AssertEqual(FbxTime::EMode::eFrames48, FbxTime::ConvertFrameRateToTimeMode(48.0)); + AssertEqual(FbxTime::EMode::eFrames30, FbxTime::ConvertFrameRateToTimeMode(30.0)); + AssertEqual(FbxTime::EMode::eNTSCDropFrame, FbxTime::ConvertFrameRateToTimeMode(29.970029970029969490497023798525333404541015625)); + AssertEqual(FbxTime::EMode::ePAL, FbxTime::ConvertFrameRateToTimeMode(25.0)); + AssertEqual(FbxTime::EMode::eFrames24, FbxTime::ConvertFrameRateToTimeMode(24.0)); + AssertEqual(FbxTime::EMode::eFrames1000, FbxTime::ConvertFrameRateToTimeMode(1000.0)); + AssertEqual(FbxTime::EMode::eFilmFullFrame, FbxTime::ConvertFrameRateToTimeMode(23.976023976023977724025826319120824337005615234375)); + AssertEqual(FbxTime::EMode::eCustom, FbxTime::ConvertFrameRateToTimeMode(12.5)); + AssertEqual(FbxTime::EMode::eFrames96, FbxTime::ConvertFrameRateToTimeMode(96.0)); + AssertEqual(FbxTime::EMode::eFrames72, FbxTime::ConvertFrameRateToTimeMode(72.0)); + AssertEqual(FbxTime::EMode::eFrames59dot94, FbxTime::ConvertFrameRateToTimeMode(59.94005994005993898099404759705066680908203125)); + AssertEqual(FbxTime::EMode::eFrames119dot88, FbxTime::ConvertFrameRateToTimeMode(119.8801198801198779619880951941013336181640625)); + + AssertEqual(FbxTime::EMode::eFrames30Drop, FbxTime::ConvertFrameRateToTimeMode(0.0)); + AssertEqual(FbxTime::EMode::eDefaultMode, FbxTime::ConvertFrameRateToTimeMode(1.0)); + AssertEqual(FbxTime::EMode::eDefaultMode, FbxTime::ConvertFrameRateToTimeMode(10.0)); + + AssertEqual(FbxTime::EMode::ePAL, FbxTime::ConvertFrameRateToTimeMode(27.0, 2.9)); + AssertEqual(FbxTime::EMode::eFrames30, FbxTime::ConvertFrameRateToTimeMode(27.0, 3.0)); + AssertEqual(FbxTime::EMode::eFrames30, FbxTime::ConvertFrameRateToTimeMode(27.0, 3.1)); + + AssertEqual(FbxTime::EMode::ePAL, FbxTime::ConvertFrameRateToTimeMode(24.5, 0.5)); + AssertEqual(FbxTime::EMode::eDefaultMode, FbxTime::ConvertFrameRateToTimeMode(24.5, 0.4)); + AssertEqual(FbxTime::EMode::ePAL, FbxTime::ConvertFrameRateToTimeMode(24.6, 0.4)); + AssertEqual(FbxTime::EMode::eDefaultMode, FbxTime::ConvertFrameRateToTimeMode(24.41, 0.4)); + AssertEqual(FbxTime::EMode::eFrames24, FbxTime::ConvertFrameRateToTimeMode(24.4, 0.4)); + AssertEqual(FbxTime::EMode::eFrames24, FbxTime::ConvertFrameRateToTimeMode(24.3, 0.4)); +} + void FbxTimeTest::RegisterTestCases() { - AddTestCase(FbxTime_Constants); AddTestCase(FbxTime_CreateLongLong_HasSeconds); AddTestCase(FbxTime_GetSecondCount_ZeroYieldsCount); AddTestCase(FbxTime_GetSecondCount_OneYieldsCount); @@ -412,5 +598,13 @@ void FbxTimeTest::RegisterTestCases() AddTestCase(FbxTime_GetFieldCount_NegHalfYieldsOne2); AddTestCase(FbxTime_GetFieldCount_NegHalfYieldsOne3); AddTestCase(FbxTime_GetGlobalTimeMode); + AddTestCase(FbxTime_Get_YieldsInternalRepresentation); + AddTestCase(FbxTime_CountFunctionAreIndependent); + AddTestCase(FbxTime_EMode_Values); + AddTestCase(FbxTime_EProtocol_Values); + AddTestCase(FbxTime_GetOneFrameValue); + AddTestCase(FbxTime_GetGlobalTimeProtocol); + AddTestCase(FbxTime_GetFrameRate); + AddTestCase(FbxTime_ConvertFrameRateToTimeMode); } diff --git a/FbxCppTests/Makefile b/FbxCppTests/Makefile index 9ac38cd..7b3d3de 100644 --- a/FbxCppTests/Makefile +++ b/FbxCppTests/Makefile @@ -14,7 +14,7 @@ ifeq ($(FBXSDK_HOME),) endif $(info FBXSDK_HOME is [$(FBXSDK_HOME)]) -COMMON_CFLAGS :=-c -Wall -std=c++11 -I$(FBXSDK_HOME)/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/zlib/include -I../fbxcppcommon +COMMON_CFLAGS :=-c -Wall -std=c++17 -I$(FBXSDK_HOME)/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/zlib/include -I../fbxcppcommon COMMON_STATIC_LIBS := ../fbxcppcommon/bin/fbxcppcommon.a COMMON_LDFLAGS := -L/usr/lib -lz -lxml2 -liconv @@ -30,9 +30,9 @@ ifeq ($(UNAME_S),Darwin) LDFLAGS=-framework Cocoa $(COMMON_LDFLAGS) endif -TC_SOURCES=AnimCurveKeyTest.tc AnimCurveNodeTest.tc AnimCurveTest.tc AnimLayerTest.tc AnimStackTest.tc Assertions.tc CameraTest.tc ClusterTest.tc DeformerTest.tc FbxObjectTest.tc FbxTimeTest.tc GeometryBaseTest.tc GeometryTest.tc LayerContainerTest.tc LightTest.tc MatrixTest.tc MeshTest.tc NodeTest.tc NodeTransformsTest.tc PropertyTest.tc SceneTest.tc SkinTest.tc SubDeformerTest.tc SurfacePhongTest.tc TestFixture.tc TestRunner.tc main.tc LayerTest.tc -SOURCES=$(TC_SOURCES:%.tc=%.cpp) -HEADERS=Assertions.h OutputDebugStringBuf.h Tests.h +TC_SOURCES=AnimCurveKeyTest.tc AnimCurveNodeTest.tc AnimCurveTest.tc AnimLayerTest.tc AnimStackTest.tc CameraTest.tc ClusterTest.tc DeformerTest.tc FbxObjectTest.tc FbxTimeTest.tc GeometryBaseTest.tc GeometryTest.tc LayerContainerTest.tc LightTest.tc MatrixTest.tc MeshTest.tc NodeTest.tc NodeTransformsTest.tc PropertyTest.tc SceneTest.tc SkinTest.tc SubDeformerTest.tc SurfacePhongTest.tc LayerTest.tc FbxImporterTest.tc EFbxTypeTest.tc FbxPropertyFlagsTest.tc FbxDataTypeTest.tc FbxPropertyTest.tc FbxIOSettingsTest.tc FbxDocumentInfoTest.tc FbxDataTypesTest.tc FbxNullTest.tc FbxGlobalSettingsTest.tc FbxAxisSystemTest.tc FbxSystemUnitTest.tc FbxTimeSpanTest.tc FbxTimeCodeTest.tc +SOURCES=Assertions.cpp TestFixture.cpp TestRunner.cpp main.cpp Utils.cpp $(TC_SOURCES:%.tc=%.cpp) +HEADERS=Assertions.h OutputDebugStringBuf.h Tests.h Utils.h OBJECTS=$(SOURCES:%.cpp=obj/%.o) EXECUTABLE=FbxCppTests @@ -44,7 +44,7 @@ directories: mkdir -p obj bin %.cpp: ../test-cases/%.tc - dotnet ../TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll cpp $< $@ + dotnet ../TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll cpp --input ../test-cases $< $@ obj/%.o: %.cpp $(CC) $(CFLAGS) $< -o $@ diff --git a/FbxCppTests/SubDeformerTest.cpp b/FbxCppTests/SubDeformerTest.cpp index b32f8a4..e6ab79a 100644 --- a/FbxCppTests/SubDeformerTest.cpp +++ b/FbxCppTests/SubDeformerTest.cpp @@ -3,7 +3,18 @@ using namespace std; +void SubDeformer_Create_HasNamespacePrefix() +{ + // given: + FbxManager* manager = FbxManager::Create(); + FbxCluster* obj = FbxCluster::Create(manager, "asdf"); + + // then: + AssertEqual("SubDeformer::", obj->GetNameSpacePrefix());; +} + void SubDeformerTest::RegisterTestCases() { + AddTestCase(SubDeformer_Create_HasNamespacePrefix); } diff --git a/FbxCppTests/TestRunner.cpp b/FbxCppTests/TestRunner.cpp index 82fdbe0..959704d 100644 --- a/FbxCppTests/TestRunner.cpp +++ b/FbxCppTests/TestRunner.cpp @@ -2,6 +2,7 @@ #include "Tests.h" #include #include +#include using namespace std; @@ -106,34 +107,98 @@ class ScopedTestRun } }; -void RunTests() +bool CompareTestFixturesByName(TestFixture* a, TestFixture* b) { + int alen = a->Name.size(); + int blen = b->Name.size(); + int result = a->Name.compare(b->Name); + if (result < 0) + return true; + if (result == 0) + return alen < blen; + return false; +} + +int RunTests() +{ + vector args; + return RunTestsWithArgs(args); +} +int RunTestsWithArgs(vector& args) +{ + if (args.size() > 0) + { + cout << "Args:" << endl; + for (auto iter = args.begin(); iter != args.end(); iter++) + cout << " " << *iter << endl; + cout << endl; + } + + vector all_tests; + + all_tests.push_back(new NodeTest()); + all_tests.push_back(new SceneTest()); + all_tests.push_back(new LayerContainerTest()); + all_tests.push_back(new GeometryBaseTest()); + all_tests.push_back(new GeometryTest()); + all_tests.push_back(new MeshTest()); + all_tests.push_back(new FbxObjectTest()); + all_tests.push_back(new SurfacePhongTest()); + all_tests.push_back(new PropertyTest()); + all_tests.push_back(new DeformerTest()); + all_tests.push_back(new SubDeformerTest()); + all_tests.push_back(new SkinTest()); + all_tests.push_back(new ClusterTest()); + all_tests.push_back(new FbxTimeTest()); + all_tests.push_back(new AnimCurveNodeTest()); + all_tests.push_back(new AnimCurveTest()); + all_tests.push_back(new AnimLayerTest()); + all_tests.push_back(new AnimStackTest()); + all_tests.push_back(new NodeTransformsTest()); + all_tests.push_back(new MatrixTest()); + all_tests.push_back(new AnimCurveKeyTest()); + all_tests.push_back(new LightTest()); + all_tests.push_back(new CameraTest()); + all_tests.push_back(new LayerTest()); + all_tests.push_back(new FbxImporterTest()); + all_tests.push_back(new EFbxTypeTest()); + all_tests.push_back(new FbxPropertyFlagsTest()); + all_tests.push_back(new FbxDataTypeTest()); + all_tests.push_back(new FbxPropertyTest()); + all_tests.push_back(new FbxIOSettingsTest()); + all_tests.push_back(new FbxDocumentInfoTest()); + all_tests.push_back(new FbxDataTypesTest()); + all_tests.push_back(new FbxNullTest()); + all_tests.push_back(new FbxGlobalSettingsTest()); + all_tests.push_back(new FbxAxisSystemTest()); + all_tests.push_back(new FbxSystemUnitTest()); + all_tests.push_back(new FbxTimeSpanTest()); + all_tests.push_back(new FbxTimeCodeTest()); + vector tests; - tests.push_back(new NodeTest()); - tests.push_back(new SceneTest()); - tests.push_back(new LayerContainerTest()); - tests.push_back(new GeometryBaseTest()); - tests.push_back(new GeometryTest()); - tests.push_back(new MeshTest()); - tests.push_back(new FbxObjectTest()); - tests.push_back(new SurfacePhongTest()); - tests.push_back(new PropertyTest()); - tests.push_back(new DeformerTest()); - tests.push_back(new SubDeformerTest()); - tests.push_back(new SkinTest()); - tests.push_back(new ClusterTest()); - tests.push_back(new FbxTimeTest()); - tests.push_back(new AnimCurveNodeTest()); - tests.push_back(new AnimCurveTest()); - tests.push_back(new AnimLayerTest()); - tests.push_back(new AnimStackTest()); - tests.push_back(new NodeTransformsTest()); - tests.push_back(new MatrixTest()); - tests.push_back(new AnimCurveKeyTest()); - tests.push_back(new LightTest()); - tests.push_back(new CameraTest()); - tests.push_back(new LayerTest()); + if (args.size() > 0) + { + for (auto iter = all_tests.begin(); iter != all_tests.end(); iter++) + { + auto it = std::find(args.begin(), args.end(), (*iter)->Name); + if (it != std::end(args)) + tests.push_back(*iter); + } + // TODO: Warn when an arg is not found among the tests + // TODO: Warn when no tests were selected + } + else + { + tests.insert(tests.end(), all_tests.begin(), all_tests.end()); + } + + sort(tests.begin(), tests.end(), CompareTestFixturesByName); + + // Some classes need the SDK library to be initialized before we can use + // them. For example, the AnimCurveKey constructors will segfault without + // the following: + FbxManager* manager = FbxManager::Create(); cout << "Running tests..." << endl; @@ -194,4 +259,6 @@ void RunTests() cout << " " << tc->ParentFixture->Name << "." << tc->Name << endl; } } + + return failures.size(); } diff --git a/FbxCppTests/Tests.h b/FbxCppTests/Tests.h index cfc87a8..cf61bab 100644 --- a/FbxCppTests/Tests.h +++ b/FbxCppTests/Tests.h @@ -3,13 +3,16 @@ #define __FBXCPPTESTS_TESTS_H #include +#include #include "objects.h" #include "print.h" #include "properties.h" #include "Assertions.h" +#include "Utils.h" -void RunTests(); +int RunTests(); +int RunTestsWithArgs(std::vector& args); typedef void (*TestFunction)(); @@ -39,7 +42,7 @@ class TestFixture virtual void TearDown(); virtual void TearDownFixture(); - const char* Name; + std::string Name; std::vector TestCases; }; @@ -75,5 +78,19 @@ TestClass(AnimCurveKeyTest); TestClass(LightTest); TestClass(CameraTest); TestClass(LayerTest); +TestClass(FbxImporterTest); +TestClass(EFbxTypeTest); +TestClass(FbxPropertyFlagsTest); +TestClass(FbxDataTypeTest); +TestClass(FbxPropertyTest); +TestClass(FbxIOSettingsTest); +TestClass(FbxDocumentInfoTest); +TestClass(FbxDataTypesTest); +TestClass(FbxNullTest); +TestClass(FbxGlobalSettingsTest); +TestClass(FbxAxisSystemTest); +TestClass(FbxSystemUnitTest); +TestClass(FbxTimeSpanTest); +TestClass(FbxTimeCodeTest); #endif // __FBXCPPTESTS_TESTS_H diff --git a/FbxCppTests/Utils.cpp b/FbxCppTests/Utils.cpp new file mode 100644 index 0000000..2623fe4 --- /dev/null +++ b/FbxCppTests/Utils.cpp @@ -0,0 +1,27 @@ +#include +#include +#include "Utils.h" + +using namespace std; +namespace fs = std::filesystem; + +std::string GetSample(const char* filename) +{ + fs::path file = __FILE__; + fs::path current_folder = fs::current_path(); + int i; + fs::path samples_folder; + for (i = 0; i < 100; i++) + { + if (current_folder.filename() == "FbxSharp") + break; + current_folder = current_folder.parent_path(); + samples_folder = current_folder / "samples"; + if (fs::exists(samples_folder)) + break; + if (current_folder == current_folder.root_path()) + return ""; + } + fs::path desired_path = samples_folder.append(filename); + return desired_path; +} diff --git a/FbxCppTests/Utils.h b/FbxCppTests/Utils.h new file mode 100644 index 0000000..221050f --- /dev/null +++ b/FbxCppTests/Utils.h @@ -0,0 +1,8 @@ +#ifndef __FBXCPPTESTS_UTILS_H +#define __FBXCPPTESTS_UTILS_H + +#include + +std::string GetSample(const char* filename); + +#endif // __FBXCPPTESTS_UTILS_H diff --git a/FbxCppTests/gen_tests.sh b/FbxCppTests/gen_tests.sh index 6cb4f68..18241aa 100755 --- a/FbxCppTests/gen_tests.sh +++ b/FbxCppTests/gen_tests.sh @@ -1,16 +1,11 @@ #!/bin/bash -DEBUG= -if [[ "$1" == "--debug" ]]; then - DEBUG=1 -fi - -for f in ../test-cases/*.tc -do - g=`basename $f .tc` - if [[ -n "$DEBUG" ]]; then - echo "Generating $g in C++" - fi - dotnet ../TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll cpp $f $g.cpp -done +__DIR__="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" +__ROOT_DIR__="$(dirname "$(realpath "$__DIR__")")" +dotnet \ + "$__ROOT_DIR__/TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll" \ + cpp \ + --input "$__ROOT_DIR__/test-cases" \ + --output "$__DIR__" \ + "$@" diff --git a/FbxCppTests/main.cpp b/FbxCppTests/main.cpp index 446ed66..bb93bb4 100644 --- a/FbxCppTests/main.cpp +++ b/FbxCppTests/main.cpp @@ -3,6 +3,8 @@ #include #include #include /* defines FILENAME_MAX */ +#include +#include #ifdef WIN32 #include #define __getcwd _getcwd @@ -30,7 +32,13 @@ int main (int argc, char *argv[]) #endif #endif - RunTests(); + std::vector args; + for (int i = 1; i < argc; i++) + args.push_back(std::string(argv[i])); + int nFailures = RunTestsWithArgs(args); + + if (nFailures > 0) + return 1; return 0; } diff --git a/FbxCppTests/run_tests.sh b/FbxCppTests/run_tests.sh new file mode 100755 index 0000000..345d5d6 --- /dev/null +++ b/FbxCppTests/run_tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +__DIR__="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" + +make --file "$__DIR__/Makefile" && \ + "$__DIR__/bin/FbxCppTests" "$@" diff --git a/FbxSharp/BinaryParser.cs b/FbxSharp/BinaryParser.cs new file mode 100644 index 0000000..0b3cae9 --- /dev/null +++ b/FbxSharp/BinaryParser.cs @@ -0,0 +1,447 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Text; +using System.Text.RegularExpressions; + +namespace FbxSharp; + +[NotSdk] +public abstract class BinaryParser(Stream stream, string filename = null) +{ + public static BinaryParser FromFileVersion(int fileVersion, Stream stream, string filename) + { + switch (fileVersion) + { + case 7700: + case 7500: + return new BinaryParser7700(stream, filename); + case 7400: + case 7300: + return new BinaryParser7400(stream, filename); + case 6100: + return new BinaryParser6100(stream, filename); + default: + throw new ArgumentException( + $"Unrecognized file version: {fileVersion}", + nameof(fileVersion)); + } + } + + private Stream stream = stream; + private string filename = filename; + + public List ReadFile(int maxObjectsToRead = 1000) + { + var pobjects = new List(); + int i; + for (i = 0; i < maxObjectsToRead; i++) + { + var po = ReadObject(); + if (po == null) break; + pobjects.Add(po); + } + + return pobjects; + } + + protected double ReadDouble() + { + const int length = 8; + Span buffer = stackalloc byte[length]; + var count = stream.Read(buffer); + if (count != length) + throw new InvalidOperationException("count != length"); + return BinaryPrimitives.ReadDoubleLittleEndian(buffer); + } + + protected float ReadFloat() + { + const int length = 4; + Span buffer = stackalloc byte[length]; + var count = stream.Read(buffer); + if (count != length) + throw new InvalidOperationException("count != length"); + return BinaryPrimitives.ReadSingleLittleEndian(buffer); + } + + protected int ReadInt32() + { + // Little-endian + var b0 = stream.ReadByte(); + var b1 = stream.ReadByte(); + var b2 = stream.ReadByte(); + var b3 = stream.ReadByte(); + return (b3 << 24) | (b2 << 16) | (b1 << 8) | b0; + } + + protected long ReadInt64() + { + // Little-endian + long b0 = stream.ReadByte(); + long b1 = stream.ReadByte(); + long b2 = stream.ReadByte(); + long b3 = stream.ReadByte(); + long b4 = stream.ReadByte(); + long b5 = stream.ReadByte(); + long b6 = stream.ReadByte(); + long b7 = stream.ReadByte(); + return (b7 << 56) | + (b6 << 48) | + (b5 << 40) | + (b4 << 32) | + (b3 << 24) | + (b2 << 16) | + (b1 << 8) | + b0; + } + + protected string ReadString256() + { + var length = stream.ReadByte(); + Span buffer = stackalloc byte[length]; + var count = stream.Read(buffer); + if (count != length) + throw new InvalidOperationException("count != length"); + return Encoding.ASCII.GetString(buffer); + } + + protected string ReadStringN() + { + var length = ReadInt32(); + Span buffer = stackalloc byte[length]; + var count = stream.Read(buffer); + if (count != length) + throw new InvalidOperationException("count != length"); + var s = Encoding.ASCII.GetString(buffer); + if (s.Contains("\x00\x01")) + s = Regex.Replace(s, @"(.*)\000\001(.*)", "$2::$1"); + return s; + } + + protected string ReadByteSequence() + { + var length = ReadInt32(); + Span buffer = stackalloc byte[length]; + var count = stream.Read(buffer); + if (count != length) + throw new InvalidOperationException("count != length"); + // TODO: base64 + const string s = "byte_sequence:"; + var rv = s; + while (rv.Length < length) + rv += s; + rv = rv.Substring(0, length); + return rv; + } + + protected double[] ReadDoubleArray() + { + var _arrayPosition = stream.Position; + var numElements = ReadInt32(); + var flags = ReadInt32(); + switch (flags) + { + case 0: return ReadDoubleArrayElements(numElements); + case 1: return ReadDoubleArrayElementsCompressed(numElements); + default: + throw new InvalidOperationException( + $"Unrecognized double array flags:" + + $" {flags} {flags:x8}"); + } + } + + protected double[] ReadDoubleArrayElements(int numElements) + { + var _elementsPosition = stream.Position; + var numBytes = ReadInt32(); + if (numBytes != numElements * 8) + throw new InvalidOperationException( + "numBytes != numElements * 8"); + var rv = new double[numElements]; + for (var i = 0; i < numElements; i++) + rv[i] = ReadDouble(); + return rv; + } + + protected double[] ReadDoubleArrayElementsCompressed(int numElements) + { + // array data is deflate'd + var numBytes = ReadInt32(); + var _dataStartPosition = stream.Position; + var numDecompressedBytes = + sizeof(double) * numElements; + var buffer = new byte[numDecompressedBytes]; + using (var zs = new ZLibStream(stream, CompressionMode.Decompress, + true)) + { + var total = 0; + while (total < numDecompressedBytes) + { + var numBytesRead = + zs.Read(buffer, total, + numDecompressedBytes - total); + total += numBytesRead; + } + + var _dataEndPosition = stream.Position; + // zs.Read may read more from the underlying stream than + // needed, due to buffering. Therefore, we need to rewind + // the location of the stream to the actual end location + // of the compressed array. + stream.Seek(_dataStartPosition + numBytes, + SeekOrigin.Begin); + var elements = new double[numElements]; + Buffer.BlockCopy(buffer, 0, elements, 0, numDecompressedBytes); + return elements; + } + } + + protected float[] ReadFloatArray() + { + var _arrayPosition = stream.Position; + var numElements = ReadInt32(); + var elementType = ReadInt32(); + switch (elementType) + { + case 0: return ReadFloatArrayElements(numElements); + case 1: return ReadFloatArrayElementsCompressed(numElements); + default: + throw new InvalidOperationException( + $"Unrecognized element type:" + + $" {elementType} {elementType:x8}"); + } + } + protected float[] ReadFloatArrayElements(int numElements) + { + var _elementsPosition = stream.Position; + var numBytes = ReadInt32(); + if (numBytes != numElements * 4) + throw new InvalidOperationException( + $"numBytes != numElements * 4 " + + $"({numBytes} != {numElements * 4})"); + var rv = new float[numElements]; + for (var i = 0; i < numElements; i++) + rv[i] = ReadFloat(); + return rv; + } + + protected float[] ReadFloatArrayElementsCompressed(int numElements) + { + // array data is deflate'd + var numBytes = ReadInt32(); + var _dataStartPosition = stream.Position; + var numDecompressedBytes = + sizeof(float) * numElements; + var buffer = new byte[numDecompressedBytes]; + using (var zs = new ZLibStream(stream, CompressionMode.Decompress, + true)) + { + var total = 0; + while (total < numDecompressedBytes) + { + var numBytesRead = + zs.Read(buffer, total, + numDecompressedBytes - total); + total += numBytesRead; + } + + var _dataEndPosition = stream.Position; + // zs.Read may read more from the underlying stream than + // needed, due to buffering. Therefore, we need to rewind + // the location of the stream to the actual end location + // of the compressed array. + stream.Seek(_dataStartPosition + numBytes, + SeekOrigin.Begin); + var elements = new float[numElements]; + Buffer.BlockCopy(buffer, 0, elements, 0, numDecompressedBytes); + return elements; + } + } + + protected long[] ReadInt64Array() + { + var _arrayPosition = stream.Position; + var numElements = ReadInt32(); + var flags = ReadInt32(); + switch (flags) + { + case 0: return ReadInt64ArrayElements(numElements); + case 1: return ReadInt64ArrayElementsCompressed(numElements); + default: + throw new InvalidOperationException( + $"Unrecognized int64 array flags:" + + $" {flags} {flags:x8}"); + } + } + + protected long[] ReadInt64ArrayElements(int numElements) + { + var _elementsPosition = stream.Position; + var numBytes = ReadInt32(); + if (numBytes != numElements * 8) + throw new InvalidOperationException( + "numBytes != numElements * 8"); + var rv = new long[numElements]; + for (var i = 0; i < numElements; i++) + rv[i] = ReadInt64(); + return rv; + } + + protected long[] ReadInt64ArrayElementsCompressed(int numElements) + { + // array data is deflate'd + var numBytes = ReadInt32(); + var _dataStartPosition = stream.Position; + var numDecompressedBytes = + sizeof(long) * numElements; + var buffer = new byte[numDecompressedBytes]; + using (var zs = new ZLibStream(stream, CompressionMode.Decompress, + true)) + { + var total = 0; + while (total < numDecompressedBytes) + { + var numBytesRead = + zs.Read(buffer, total, + numDecompressedBytes - total); + total += numBytesRead; + } + + var _dataEndPosition = stream.Position; + // zs.Read may read more from the underlying stream than + // needed, due to buffering. Therefore, we need to rewind + // the location of the stream to the actual end location + // of the compressed array. + stream.Seek(_dataStartPosition + numBytes, + SeekOrigin.Begin); + var elements = new long[numElements]; + Buffer.BlockCopy(buffer, 0, elements, 0, numDecompressedBytes); + return elements; + } + } + + protected int[] ReadInt32Array() + { + var _arrayPosition = stream.Position; + var numElements = ReadInt32(); + var flags = ReadInt32(); + switch (flags) + { + case 0: return ReadInt32ArrayElements(numElements); + case 1: + // array data is deflate'd + var numBytes = ReadInt32(); + var _dataStartPosition = stream.Position; + var numDecompressedBytes = + sizeof(int) * numElements; + var buffer = new byte[numDecompressedBytes]; + using ( + var zs = new ZLibStream(stream, CompressionMode.Decompress, + true)) + { + var total = 0; + while (total < numDecompressedBytes) + { + var numBytesRead = + zs.Read(buffer, total, + numDecompressedBytes - total); + total += numBytesRead; + } + + var _dataEndPosition = stream.Position; + // zs.Read may read more from the underlying stream than + // needed, due to buffering. Therefore, we need to rewind + // the location of the stream to the actual end location + // of the compressed array. + stream.Seek(_dataStartPosition + numBytes, + SeekOrigin.Begin); + var elements = new int[numElements]; + Buffer.BlockCopy(buffer, 0, elements, 0, numDecompressedBytes); + return elements; + } + + break; + default: + throw new InvalidOperationException( + $"Unrecognized int array flags:" + + $" {flags} {flags:x8}"); + } + + } + + protected int[] ReadInt32ArrayElements(int numElements) + { + var numBytes = ReadInt32(); + if (numBytes != numElements * 4) + throw new InvalidOperationException( + "numBytes != numElements * 4"); + var rv = new int[numElements]; + for (var i = 0; i < numElements; i++) + rv[i] = ReadInt32(); + return rv; + } + + protected bool ReadBoolean() + { + var value = stream.ReadByte(); + if (value == 'Y') return true; + if (value == 'N') return false; + if (value == 1) return true; + if (value == 0) return false; + throw new ArgumentException( + $"Unrecognized boolean value \"{value}\""); + } + + public abstract ParseObject ReadObject(); + + + private ParseObject nullParseObject = new(); + + public void PrintParseObject(ParseObject po, TextWriter writer, + string indent = "") + { + writer.WriteLine($"{indent}{po.Location.Index:x4}:"); + var indent2 = indent + " "; + writer.WriteLine($"{indent2}next={po.Extra.nextItemOffset:x4}"); + writer.WriteLine($"{indent2}???={po.Extra.reserved0:x8}"); + writer.WriteLine($"{indent2}???={po.Extra.numValues:x8}"); + writer.WriteLine($"{indent2}???={po.Extra.reserved2:x8}"); + writer.WriteLine($"{indent2}???={po.Extra.numValuesBytes:x8}"); + writer.WriteLine($"{indent2}???={po.Extra.reserved4:x8}"); + writer.WriteLine($"{indent2}namelen={po.Extra.namelen:x2}"); + writer.WriteLine($"{indent2}name={po.Name}"); + + if (po == nullParseObject) + return; + + int i; + for (i = 0; i < po.Extra.numValues; i++) + { + writer.WriteLine($"{indent2}type={po.Extra.valuesTypes[i]:x2}"); + if (po.Extra.valuesLengths[i].HasValue) + writer.WriteLine($"{indent2}length={po.Extra.valuesLengths[i]:x8}"); + var value = po.Values[i]; + if (value is long || value is ulong) + writer.WriteLine($"{indent2}value={value:x16} ({value})"); + else if (value is uint || value is int) + writer.WriteLine($"{indent2}value={value:x8} ({value})"); + else if (value is short || value is ushort) + writer.WriteLine($"{indent2}value={value:x4} ({value})"); + else if (value is byte || value is sbyte) + writer.WriteLine($"{indent2}value={value:x2} ({value})"); + else + writer.WriteLine($"{indent2}value={value}"); + } + + foreach (var child in po.Properties) + { + PrintParseObject(child, writer, indent2); + } + + if (po.Properties.Count > 0 || po.HasEmptyBlock) + PrintParseObject(nullParseObject, writer, indent2); + } +} diff --git a/FbxSharp/BinaryParser6100.cs b/FbxSharp/BinaryParser6100.cs new file mode 100644 index 0000000..526b470 --- /dev/null +++ b/FbxSharp/BinaryParser6100.cs @@ -0,0 +1,18 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; + +namespace FbxSharp; + +[NotSdk] +public class BinaryParser6100(Stream stream, string filename = null) + : BinaryParser(stream, filename) +{ + public override ParseObject ReadObject() + { + throw new NotImplementedException(); + } +} diff --git a/FbxSharp/BinaryParser7400.cs b/FbxSharp/BinaryParser7400.cs new file mode 100644 index 0000000..8356aa8 --- /dev/null +++ b/FbxSharp/BinaryParser7400.cs @@ -0,0 +1,91 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; + +namespace FbxSharp; + +[NotSdk] +public class BinaryParser7400(Stream stream, string filename = null) + : BinaryParser(stream, filename) +{ + public override ParseObject ReadObject() + { + var location = new InputLocation( + line: 0, + column: 0, + index: (int)stream.Position, + filename); + + var nextItemOffset = ReadInt32(); + + var numValues = (uint)ReadInt32(); + var numValueBytes = (uint)ReadInt32(); + + var name = ReadString256(); + if (nextItemOffset == 0) + return null; + var po = new ParseObject() + { + Name = name, + Location = location, + + Extra = new ParseObject.BinaryParseInfo + { + nextItemOffset = nextItemOffset, + numValues = numValues, + numValuesBytes = numValueBytes, + namelen = (byte)name.Length, + } + }; + int i; + for (i = 0; i < numValues; i++) + { + var _typePosition = stream.Position; + var type = (byte)stream.ReadByte(); + object value = type switch + { + 0x43 /* C */ => ReadBoolean(), + 0x44 /* D */ => new Number(ReadDouble()), + 0x49 /* I */ => new Number(ReadInt32()), + 0x4c /* L */ => new Number(ReadInt64()), + 0x52 /* R */ => ReadByteSequence(), + 0x53 /* S */ => ReadStringN(), + 0x64 /* d */ => ReadDoubleArray(), + 0x66 /* f */ => ReadFloatArray(), + 0x69 /* i */ => ReadInt32Array(), + 0x6c /* l */ => ReadInt64Array(), + _ => throw new InvalidOperationException( + $"Unknown value type 0x{type:x8} at position 0x{_typePosition:x8}") + }; + + po.Values.Add(value); + po.Extra.valuesTypes.Add(type); + uint? valueLength = null; + if (type is 0x53 or 0x52) + valueLength = (uint?)((string)value).Length; + po.Extra.valuesLengths.Add(valueLength); + } + + po.HasEmptyBlock = false; + if (stream.Position < nextItemOffset) + { + po.HasEmptyBlock = true; + // read sub-objects + var _firstSubObjectPosition = stream.Position; + while (true) + { + var _subObjectPosition = stream.Position; + var child = ReadObject(); + if (child == null) + break; + po.HasEmptyBlock = false; + po.Properties.Add(child); + } + } + + return po; + } +} diff --git a/FbxSharp/BinaryParser7700.cs b/FbxSharp/BinaryParser7700.cs new file mode 100644 index 0000000..30f108e --- /dev/null +++ b/FbxSharp/BinaryParser7700.cs @@ -0,0 +1,89 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; + +namespace FbxSharp; + +[NotSdk] +public class BinaryParser7700(Stream stream, string filename = null) + : BinaryParser(stream, filename) +{ + public override ParseObject ReadObject() + { + var location = new InputLocation( + line: 0, + column: 0, + index: (int)stream.Position, + filename); + + var nextItemOffset = ReadInt32(); + + var reserved0 = (uint)ReadInt32(); + var numValues = (uint)ReadInt32(); + var reserved2 = (uint)ReadInt32(); + var numValueBytes = (uint)ReadInt32(); + var reserved4 = (uint)ReadInt32(); + + var name = ReadString256(); + if (nextItemOffset == 0) + return null; + var po = new ParseObject() + { + Name = name, + Location = location, + + Extra = new ParseObject.BinaryParseInfo + { + nextItemOffset = nextItemOffset, + reserved0 = reserved0, + numValues = numValues, + reserved2 = reserved2, + numValuesBytes = numValueBytes, + reserved4 = reserved4, + namelen = (byte)name.Length, // eh... + } + }; + int i; + for (i = 0; i < numValues; i++) + { + var type = (byte)stream.ReadByte(); + object value = type switch + { + 0x44 => new Number(ReadDouble()), + 0x49 => new Number(ReadInt32()), + 0x4c => new Number(ReadInt64()), + 0x52 => ReadByteSequence(), + 0x53 => ReadStringN(), + _ => throw new InvalidOperationException( + $"Unknown value type 0x{type:x8}") + }; + + po.Values.Add(value); + po.Extra.valuesTypes.Add(type); + uint? valueLength = null; + if (type is 0x53 or 0x52) + valueLength = (uint?)((string)value).Length; + po.Extra.valuesLengths.Add(valueLength); + } + + po.HasEmptyBlock = false; + if (stream.Position < nextItemOffset) + { + po.HasEmptyBlock = true; + // read sub-objects + while (true) + { + var child = ReadObject(); + if (child == null) + break; + po.HasEmptyBlock = false; + po.Properties.Add(child); + } + } + + return po; + } +} diff --git a/FbxSharp/Converter.cs b/FbxSharp/Converter.cs index 90a3bf8..990a9b1 100644 --- a/FbxSharp/Converter.cs +++ b/FbxSharp/Converter.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { var header = GetHeader(parsedObjects); if (header != null) @@ -42,13 +43,13 @@ public FbxScene ConvertScene(List parsedObjects) if (converter != null) { - return converter.ConvertScene(parsedObjects); + return converter.ConvertScene(parsedObjects, scene); } } } } - return new Converter7700().ConvertScene(parsedObjects); + return new Converter7700().ConvertScene(parsedObjects, scene); } protected ParseObject GetHeader(List parsedObjects) diff --git a/FbxSharp/Converter2000.cs b/FbxSharp/Converter2000.cs index b53ec19..9f403f5 100644 --- a/FbxSharp/Converter2000.cs +++ b/FbxSharp/Converter2000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter2000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter2001.cs b/FbxSharp/Converter2001.cs index 61f5aef..12aa476 100644 --- a/FbxSharp/Converter2001.cs +++ b/FbxSharp/Converter2001.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter2001 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter3000.cs b/FbxSharp/Converter3000.cs index 80b1432..7d0c4fd 100644 --- a/FbxSharp/Converter3000.cs +++ b/FbxSharp/Converter3000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter3000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter3001.cs b/FbxSharp/Converter3001.cs index cf7bf3a..0f38462 100644 --- a/FbxSharp/Converter3001.cs +++ b/FbxSharp/Converter3001.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter3001 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter4000.cs b/FbxSharp/Converter4000.cs index 45215bd..a93ce40 100644 --- a/FbxSharp/Converter4000.cs +++ b/FbxSharp/Converter4000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter4000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter4001.cs b/FbxSharp/Converter4001.cs index b18a3a5..1c012e0 100644 --- a/FbxSharp/Converter4001.cs +++ b/FbxSharp/Converter4001.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter4001 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter4050.cs b/FbxSharp/Converter4050.cs index 1ddd1b0..c9c6d9e 100644 --- a/FbxSharp/Converter4050.cs +++ b/FbxSharp/Converter4050.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter4050 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter5000.cs b/FbxSharp/Converter5000.cs index 3882dce..5242b61 100644 --- a/FbxSharp/Converter5000.cs +++ b/FbxSharp/Converter5000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter5000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter5800.cs b/FbxSharp/Converter5800.cs index f056dc6..103e605 100644 --- a/FbxSharp/Converter5800.cs +++ b/FbxSharp/Converter5800.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter5800 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter6000.cs b/FbxSharp/Converter6000.cs index fcccf62..42677e4 100644 --- a/FbxSharp/Converter6000.cs +++ b/FbxSharp/Converter6000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter6000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter6100.cs b/FbxSharp/Converter6100.cs index 2e8b569..84c1df9 100644 --- a/FbxSharp/Converter6100.cs +++ b/FbxSharp/Converter6100.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter6100 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7000.cs b/FbxSharp/Converter7000.cs index 977135b..07c7d4d 100644 --- a/FbxSharp/Converter7000.cs +++ b/FbxSharp/Converter7000.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7000 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7099.cs b/FbxSharp/Converter7099.cs index 0544ed5..400f0d5 100644 --- a/FbxSharp/Converter7099.cs +++ b/FbxSharp/Converter7099.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7099 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7100.cs b/FbxSharp/Converter7100.cs index 5b7b435..f574607 100644 --- a/FbxSharp/Converter7100.cs +++ b/FbxSharp/Converter7100.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7100 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7200.cs b/FbxSharp/Converter7200.cs index 3b81469..7f2a665 100644 --- a/FbxSharp/Converter7200.cs +++ b/FbxSharp/Converter7200.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7200 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7300.cs b/FbxSharp/Converter7300.cs index dfe1796..812d75e 100644 --- a/FbxSharp/Converter7300.cs +++ b/FbxSharp/Converter7300.cs @@ -6,14 +6,16 @@ namespace FbxSharp { public class Converter7300 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { var parsed = new ParseObject { Name = "Parsed Scene", Properties = parsedObjects, }; - var scene = new FbxScene(); + if (scene == null) + scene = new FbxScene(); var docs = parsed.FindPropertyByName("Documents"); if (docs != null) @@ -682,9 +684,21 @@ public static FbxLayerElement.EReferenceMode ConvertReferenceInformationType(Par } } - public static List> ConvertProperties70(ParseObject props70) + public struct PropInfo( + string name, + Type propType, + FbxDataType propType2, + object value) { - var propNamesTypesValues = new List>(); + public readonly string Name = name; + public readonly Type PropType = propType; + public readonly FbxDataType PropType2 = propType2; + public readonly object Value = value; + } + + public static List ConvertProperties70(ParseObject props70) + { + var propNamesTypesValues = new List(); foreach (var p in props70.Properties) { @@ -698,6 +712,7 @@ public static List> ConvertProperties70(ParseObject var comment = ((string)p.Values[3]); // ??? Type propType; + FbxDataType propType2; object propValue; switch (type1) @@ -708,21 +723,25 @@ public static List> ConvertProperties70(ParseObject var g = ((Number)p.Values[5]).AsDouble.Value; var b = ((Number)p.Values[6]).AsDouble.Value; propType = typeof(FbxColor); + propType2 = FbxDataTypes.FbxColor3DT; propValue = new FbxColor(r, g, b); break; case "Visibility": case "bool": propType = typeof(bool); + propType2 = FbxDataTypes.FbxBoolDT; propValue = (((Number)p.Values[4]).AsLong.Value != 0); break; case "enum": propType = typeof(long); + propType2 = FbxDataTypes.FbxEnumDT; propValue = ((Number)p.Values[4]).AsLong.Value; break; case "Vector": case "Vector3": case "Vector3D": propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; var x = ((Number)p.Values[4]).AsDouble.Value; var y = ((Number)p.Values[5]).AsDouble.Value; var z = ((Number)p.Values[6]).AsDouble.Value; @@ -730,12 +749,14 @@ public static List> ConvertProperties70(ParseObject break; case "int": propType = typeof(int); + propType2 = FbxDataTypes.FbxIntDT; propValue = (int)((Number)p.Values[4]).AsLong.Value; break; case "Lcl Translation": case "Lcl Rotation": case "Lcl Scaling": propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; x = ((Number)p.Values[4]).AsDouble.Value; y = ((Number)p.Values[5]).AsDouble.Value; z = ((Number)p.Values[6]).AsDouble.Value; @@ -745,6 +766,7 @@ public static List> ConvertProperties70(ParseObject break; case "KString": propType = typeof(string); + propType2 = FbxDataTypes.FbxStringDT; propValue = (string)p.Values[4]; break; case "FieldOfView": @@ -752,22 +774,26 @@ public static List> ConvertProperties70(ParseObject case "FieldOfViewY": case "double": propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; propValue = ((Number)p.Values[4]).AsDouble.Value; break; case "KTime": propType = typeof(FbxTime); + propType2 = FbxDataTypes.FbxTimeDT; long rawValue = ((Number)p.Values[4]).AsLong.Value; - long rawValue7700 = rawValue * FbxTime.FBXSDK_TC_MILLISECOND / FbxTime.FBXSDK_TC_LEGACY_MILLISECOND; + long rawValue7700 = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; propValue = new FbxTime(rawValue7700); break; case "Compound": propType = typeof(string); + propType2 = FbxDataTypes.FbxCompoundDT; propValue = ""; break; case "Number": if (comment != "A") throw new ConversionException(p.Location, string.Format("Invalid indicator for Number. Expected 'A'. Got '{0}' instead.", comment)); propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; propValue = ((Number)p.Values[4]).AsDouble.Value; break; default: @@ -775,8 +801,8 @@ public static List> ConvertProperties70(ParseObject } propNamesTypesValues.Add( - new Tuple( - propName, propType, propValue)); + new PropInfo( + propName, propType, propType2, propValue)); } return propNamesTypesValues; @@ -874,26 +900,27 @@ public static FbxNode ConvertNode(ParseObject obj) return node; } - public static void ImportProperty(FbxObject obj, string name, Type type, object value) + public static void ImportProperty(FbxObject obj, string name, Type type,FbxDataType type2, object value) { - var pprop = obj.FindProperty(name, type); + var pprop = obj.FindProperty(name, type2); - if (pprop == null) + if (pprop == null || !pprop.IsValid()) { - pprop = obj.CreateProperty(name, type); + pprop = FbxProperty.Create(obj, type2, name); } pprop.Set(value); } - public static void ImportProperties(FbxObject obj, IEnumerable> propinfos) + public static void ImportProperties(FbxObject obj, IEnumerable propinfos) { foreach (var propinfo in propinfos) { - var pname = propinfo.Item1; - var ptype = propinfo.Item2; - var pvalue = propinfo.Item3; + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; - ImportProperty(obj, pname, ptype, pvalue); + ImportProperty(obj, pname, ptype, ptype2, pvalue); } } @@ -1028,7 +1055,8 @@ public static FbxSurfacePhong ConvertPhongMaterial(ParseObject obj) break; case "MultiLayer": var multilayer = (((Number)prop.Values[0]).AsLong.Value != 0); - ImportProperty(material, "MultiLayer", typeof(bool), multilayer); + ImportProperty(material, "MultiLayer", typeof(bool), + FbxDataTypes.FbxBoolDT, multilayer); break; case "Properties70": ImportProperties(material, ConvertProperties70(prop)); @@ -1332,9 +1360,10 @@ public static FbxAnimCurveNode ConvertAnimationCurveNode(ParseObject obj) var propinfos = ConvertProperties70(prop); foreach (var propinfo in propinfos) { - var pname = propinfo.Item1; - var ptype = propinfo.Item2; - var pvalue = propinfo.Item3; + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; if (pname == "d") { @@ -1348,7 +1377,8 @@ public static FbxAnimCurveNode ConvertAnimationCurveNode(ParseObject obj) } else { - ImportProperty(animCurveNode, pname, ptype, pvalue); + ImportProperty(animCurveNode, pname, ptype, ptype2, + pvalue); } } break; @@ -1414,7 +1444,7 @@ public static FbxAnimCurve ConvertAnimationCurve(ParseObject obj) for (i = 0; i < Math.Min(keyTimes.Length, keyValues.Length); i++) { var rawValue = keyTimes[i]; - rawValue = rawValue * FbxTime.FBXSDK_TC_MILLISECOND / FbxTime.FBXSDK_TC_LEGACY_MILLISECOND; + rawValue = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; var time = new FbxTime(rawValue); keys[i] = new FbxAnimCurveKey(time, (float)keyValues[i]); } diff --git a/FbxSharp/Converter7400.cs b/FbxSharp/Converter7400.cs index 53d0ea8..dd0ba0d 100644 --- a/FbxSharp/Converter7400.cs +++ b/FbxSharp/Converter7400.cs @@ -6,9 +6,1858 @@ namespace FbxSharp { public class Converter7400 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public class ConversionState(bool legacyTimeCode) + { + public readonly bool LegacyTimeCode = legacyTimeCode; + } + + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene=null) + { + var parsed = new ParseObject { + Name = "Parsed Scene", + Properties = parsedObjects, + }; + + if (scene == null) + scene = new FbxScene("Scene"); + + var docs = parsed.FindPropertyByName("Documents"); + if (docs != null) + { + CheckDocuments(docs); + + foreach (var doc in docs.Properties.Skip(1)) + { + CheckDocument(doc); + } + } + + bool legacyTimeCode = false; + var headerExt = parsed.FindPropertyByName("FBXHeaderExtension"); + if (headerExt != null) + { + var otherFlags = headerExt.FindPropertyByName("OtherFlags"); + if (otherFlags != null) + { + var timeCodeDefinition = otherFlags.FindPropertyByName("TCDefinition"); + if (timeCodeDefinition != null) + { + if (timeCodeDefinition.Values.Count > 0 && + timeCodeDefinition.Values[0] != null && + timeCodeDefinition.Values[0] is Number && + ((Number)timeCodeDefinition.Values[0]).AsLong == FbxTimeCode.FBXSDK_TC_LEGACY_DEFINITION) + { + legacyTimeCode = true; + } + } + } + } + + var state = new ConversionState(legacyTimeCode); + + + if (headerExt != null) + { + var sceneInfo = headerExt.FindPropertyByName("SceneInfo"); + if (sceneInfo != null) + { + var sceneInfoProps = + sceneInfo.FindPropertyByName("Properties70"); + var docInfo = scene.GetDocumentInfo(); + ImportProperties(docInfo, + ConvertProperties70(sceneInfoProps, state)); + } + } + + var defs = parsed.FindPropertyByName("Definitions"); + CheckDefinitions(defs); + + // read and convert objects + var objs = parsed.FindPropertyByName("Objects"); + var fbxObjects = new List(); + var fbxObjectsById = new Dictionary(); + var actualIdsByInFileIds = new Dictionary(); + foreach (var obj in objs.Properties) + { + var fobj = ConvertObject(obj, fbxObjectsById, actualIdsByInFileIds, state); + // Console.WriteLine($"Converted {obj.Name} ({obj.Location}, {obj.Values[0]} ({obj.Values[0].GetType()})) to {fobj}"); + fbxObjects.Add(fobj); + fbxObjectsById[fobj.UniqueId] = fobj; + } + var inFileIdsByActualIds = new Dictionary(); + foreach (var infileId in actualIdsByInFileIds.Keys) + { + var actualId = actualIdsByInFileIds[infileId]; + inFileIdsByActualIds[actualId] = infileId; + } + + // connect objects + var conns = parsed.FindPropertyByName("Connections"); + CheckConnections(conns); + var nonDstObjs = new HashSet(fbxObjects); + var nonSrcObjs = new HashSet(fbxObjects); + foreach (var conn in conns.Properties) + { + CheckConnection(conn); + var connType = ((string)conn.Values[0]); + var asLong = ((Number)conn.Values[1]).AsLong; + if (!asLong.HasValue) throw new InvalidOperationException(); + var inFileSrcId = (ulong)asLong.Value; + var srcId = actualIdsByInFileIds[inFileSrcId]; + asLong = ((Number)conn.Values[2]).AsLong; + if (!asLong.HasValue) throw new InvalidOperationException(); + var inFileDstId = (ulong)asLong.Value; + var dstId = (inFileDstId == 0 ? 0 : actualIdsByInFileIds[inFileDstId]); + FbxObject dstObj; + FbxObject srcObj; + switch (connType) + { + case "OO": + dstObj = (dstId == 0 ? scene : fbxObjectsById[dstId]); + nonDstObjs.Remove(dstObj); + srcObj = fbxObjectsById[srcId]; + nonSrcObjs.Remove(srcObj); + dstObj.ConnectSrcObject(srcObj); + // Console.WriteLine($"Connected from {fbxObjectsById[srcId]} -> {dstObj}"); + break; + case "OP": + string propertyName = ((string)conn.Values[3]); + dstObj = (dstId == 0 ? scene.RootNode : fbxObjectsById[dstId]); + nonDstObjs.Remove(dstObj); + var dstProp = dstObj.FindProperty(propertyName); + srcObj = fbxObjectsById[srcId]; + nonSrcObjs.Remove(srcObj); + dstProp.ConnectSrcObject(srcObj); + break; + default: + throw new ConversionException(conn.Location, string.Format("Unknown connection type. Expected 'OO' or 'OP'. Got '{0}' instead.", connType)); + } + } + + // fix-up material layer elements + foreach (var node in scene.Nodes) + { + if ((node.GetNodeAttribute() as FbxLayerContainer) == null) continue; + + var lc = (FbxLayerContainer)node.GetNodeAttribute(); + foreach (var layer in lc.Layers) + { + var matelem = layer.GetMaterials(); + if (matelem == null) continue; + + int mii; + for (mii = 0; mii < matelem.MaterialIndexes.List.Count; mii++) + { + var mi = matelem.MaterialIndexes.List[mii]; + var mat = node.Materials[mi]; + matelem.GetDirectArray().Add(mat); + } + } + } + + // connect animation stacks + foreach (var stack in fbxObjects) + { + scene.ConnectSrcObject(stack); + } + + var takes = parsed.FindPropertyByName("Takes"); + CheckTakes(takes); + +// var notConnected = fbxObjects.Except(scene.SrcObjects).ToList(); + + return scene; + } + + void CheckDocuments(ParseObject docs) + { + if (docs.Properties[0].Name != "Count") + throw new ConversionException(docs.Location, "Properties list does not start with 'Count'."); + if (docs.Properties[0].Values.Count < 1) + throw new ConversionException(docs.Location, "Property 'Count' has no value."); + var count = ((Number)docs.Properties[0].Values[0]).AsLong.Value; + if (docs.Properties.Count != count + 1) + throw new ConversionException(docs.Location, "Properties list Count does not match actual number of properties."); + } + + void CheckDocument(ParseObject doc) + { + } + + void CheckDefinitions(ParseObject defs) + { + if (defs.Properties[0].Name != "Version") + throw new ConversionException(defs.Location, string.Format("Properties list does not start with 'Version'. Got '{0}' instead.", defs.Properties[0].Name)); + if (defs.Properties[0].Values.Count < 1) + throw new ConversionException(defs.Location, "Property 'Version' has no value."); + var version = ((Number)defs.Properties[0].Values[0]).AsLong.Value; + + if (defs.Properties[1].Name != "Count") + throw new ConversionException(defs.Location, "Properties list does not have a 'Count' in the second place."); + if (defs.Properties[1].Values.Count < 1) + throw new ConversionException(defs.Location, "Property 'Count' has no value."); + var count = ((Number)defs.Properties[1].Values[0]).AsLong.Value; + +// if (defs.Properties.Count != count + 2) +// throw new ConversionException(defs.Location, "Explicit count does not match actual number of properties."); + } + + Dictionary> ConvertersByObjectName = + new Dictionary> { + { "NodeAttribute", ConvertNodeAttribute }, + { "Geometry", ConvertGeometry }, + { "Model", ConvertNode }, // Node? + { "Material", ConvertMaterial }, + { "Deformer", ConvertDeformer }, + { "Video", ConvertVideo }, + { "Texture", ConvertTexture }, + { "AnimationStack", ConvertAnimationStack }, + { "AnimationLayer", ConvertAnimationLayer }, + { "AnimationCurveNode", ConvertAnimationCurveNode }, + { "AnimationCurve", ConvertAnimationCurve }, + }; + + public FbxObject ConvertObject( + ParseObject obj, + Dictionary fbxObjectsById, + Dictionary actualIdsByInFileIds, + ConversionState state) + { + if (ConvertersByObjectName.ContainsKey(obj.Name)) + { + var fbxobj = ConvertersByObjectName[obj.Name](obj, state); + if (obj != null && + obj.Values.Count > 0) + { + var inFileId = (ulong)((Number)obj.Values[0]).AsLong.Value; + actualIdsByInFileIds[inFileId] = fbxobj.GetUniqueID(); + } + return fbxobj; + } + + if (obj.Name == "Pose") + { + var fbxobj = ConvertPose(obj, fbxObjectsById, actualIdsByInFileIds, state); + if (obj != null && + obj.Values.Count > 0) + { + var inFileId = (ulong)((Number)obj.Values[0]).AsLong.Value; + actualIdsByInFileIds[inFileId] = fbxobj.GetUniqueID(); + } + return fbxobj; + } + + throw new ConversionException( + obj.Location, + string.Format( + "Unknown object type: {0}", + obj.Name)); + } + + public static FbxNodeAttribute ConvertNodeAttribute(ParseObject obj, ConversionState state) + { + var typeFlagsProp = obj.FindPropertyByName("TypeFlags"); + var typeFlags = new HashSet(typeFlagsProp.Values.Select(x => (string)x)); + // null + // root + // skeleton + if (typeFlags.Contains("Skeleton")) + { + return ConvertSkeleton(obj, state); + } + + if (typeFlags.Contains("Null")) + { + return ConvertNull(obj, state); + } + + if (typeFlags.Contains("Light")) + { + return ConvertLight(obj, state); + } + + if (typeFlags.Contains("Camera")) + { + return ConvertCamera(obj, state); + } + + throw new ConversionException( + obj.Location, + string.Format( + "Unknown FBXNodeAttribute type: '{0}'.", + typeFlags)); + } + + public static FbxSkeleton ConvertSkeleton(ParseObject obj, ConversionState state) + { + var skeleton = new FbxSkeleton(); + skeleton.Name = ((string)obj.Values[1]); + skeleton.SkeletonType = (FbxSkeleton.EType)Enum.Parse(typeof(FbxSkeleton.EType), ((string)obj.Values[2])); + + var props70 = obj.FindPropertyByName("Properties70"); + if (props70 != null) + { + foreach (var p in props70.Properties) + { + if (p.Name != "P") + throw new ConversionException(p.Location, string.Format("Incorrect name for a property list: '{0}'.", p.Name)); + + //P: "Size", "double", "Number", "",0.988142713904381 + var propName = ((string)p.Values[0]); + var type1 = ((string)p.Values[1]); + var type2 = ((string)p.Values[2]); + var comment = ((string)p.Values[3]); // ??? + object value; + if (type1 == "double") + { + value = ((Number)p.Values[4]).AsDouble.Value; + } + else + { + throw new ConversionException(p.Location, string.Format("Unknown property type. Expected 'double'. Got '{0}' instead.", type1)); + } + + switch (propName) + { + case "Size": + skeleton.Size.Value = (double)value; + break; + default: + throw new ConversionException(p.Location, string.Format("Unknown property name. Expected 'Size'. Got '{0}' instead.", propName)); + } + } + } + + return skeleton; + } + + public static FbxNull ConvertNull(ParseObject obj, ConversionState state) + { + var n = new FbxNull(); + n.Name = ((string)obj.Values[1]); + + return n; + } + + public static FbxLight ConvertLight(ParseObject obj, ConversionState state) + { + var name = ((string)obj.Values[1]); + var light = new FbxLight(name); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Properties70": + ImportProperties(light, ConvertProperties70(prop, state)); + break; + case "TypeFlags": + if (((string)prop.Values[0]) != "Light") + throw new ConversionException(prop.Location, string.Format("Unknown type in FbxLight. Expected 'Light'. Got '{0}' instead.", prop.Values[0])); + break; + case "GeometryVersion": + var gversion = ((Number)prop.Values[0]).AsLong.Value; + if (gversion != 124) + throw new ConversionException(prop.Location, string.Format("Unknown geometry version in FbxLight. Expected '124'. Got '{0}' instead.", gversion)); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property name in FbxLight. Expected 'Properties70', 'TypeFlags', or 'GeometryVersion'. Got '{0}' instead.", prop.Name)); + } + } + + return light; + } + + public static FbxCamera ConvertCamera(ParseObject obj, ConversionState state) + { + var name = ((string)obj.Values[1]); + var camera = new FbxCamera(name); + + FbxVector3 position; + FbxVector3 up; + FbxVector3 lookAt; + bool showInfoOnMoving; + bool showAudio; + FbxVector3 audioColor; + double cameraOrthoZoom; + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Properties70": + ImportProperties(camera, ConvertProperties70(prop, state)); + break; + case "TypeFlags": + if (((string)prop.Values[0]) != "Camera") + throw new ConversionException(prop.Location, string.Format("Incorrect type in FbxCamera. Expected 'Camera'. Got '{0}' instead.", (string)prop.Values[0])); + break; + case "GeometryVersion": + if (((Number)prop.Values[0]).AsLong.Value != 124) + throw new ConversionException(prop.Location, string.Format("Unknown geometry version in FbxCamera. Expected '124'. Got '{0}' instead.", ((Number)prop.Values[0]).AsLong.Value)); + break; + case "Position": + position = new FbxVector3( + ((Number)prop.Values[0]).AsDouble.Value, + ((Number)prop.Values[1]).AsDouble.Value, + ((Number)prop.Values[2]).AsDouble.Value); + break; + case "Up": + up = new FbxVector3( + ((Number)prop.Values[0]).AsDouble.Value, + ((Number)prop.Values[1]).AsDouble.Value, + ((Number)prop.Values[2]).AsDouble.Value); + break; + case "LookAt": + lookAt = new FbxVector3( + ((Number)prop.Values[0]).AsDouble.Value, + ((Number)prop.Values[1]).AsDouble.Value, + ((Number)prop.Values[2]).AsDouble.Value); + break; + case "ShowInfoOnMoving": + showInfoOnMoving = (((Number)prop.Values[0]).AsLong.Value != 0); + break; + case "ShowAudio": + showAudio = (((Number)prop.Values[0]).AsLong.Value != 0); + break; + case "AudioColor": + audioColor = new FbxVector3( + ((Number)prop.Values[0]).AsDouble.Value, + ((Number)prop.Values[1]).AsDouble.Value, + ((Number)prop.Values[2]).AsDouble.Value); + break; + case "CameraOrthoZoom": + cameraOrthoZoom = ((Number)prop.Values[0]).AsDouble.Value; + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property name in FbxCamera. Got '{0}' instead.", prop.Name)); + } + } + + return camera; + } + + public static FbxGeometry ConvertGeometry(ParseObject obj, ConversionState state) + { + var geometryType = ((string)obj.Values[2]); + + switch (geometryType) + { + case "Mesh": + return ConvertMesh(obj, state); + default: + throw new ConversionException(obj.Location, string.Format("Unknown geometry type in FbxGeometry. Expected 'Mesh'. Got '{0}' instead.", geometryType)); + } + } + + static void ExpandListToMinimum(List list, int minIndex) + { + while (list.Count <= minIndex) + { + list.Add(default(T)); + } + } + + public static FbxMesh ConvertMesh(ParseObject obj, ConversionState state) + { + var normals = new List(); + var uvs = new List(); + var visibility = new List(); + var materials = new List(); + var colors = new List(); + + var mesh = new FbxMesh(); + mesh.Name = ((string)obj.Values[1]); + + foreach (var prop in obj.Properties) + { + int index; + switch (prop.Name) + { + case "Properties70": + ImportProperties(mesh, ConvertProperties70(prop, state)); + break; + case "Vertices": + ConvertVertices(mesh, prop, state); + break; + case "PolygonVertexIndex": + mesh.PolygonIndexes = ConvertPolygonVertexIndex(prop, state); + break; + case "Edges": + // skip for now + break; + case "GeometryVersion": + if (((Number)prop.Values[0]).AsLong.Value != 124) + throw new ConversionException(prop.Location, string.Format("Unknown geometry version in FbxMesh. Expected '124'. Got '{0}' instead.", ((Number)prop.Values[0]).AsLong.Value)); + break; + case "LayerElementNormal": + index = (int)(prop.Values.Count > 0 ? ((Number)prop.Values[0]).AsLong.Value : 0); + ExpandListToMinimum(normals, index); + normals[index] = ConvertLayerElementNormal(prop, state); + break; + case "LayerElementUV": + index = (int)(prop.Values.Count > 0 ? ((Number)prop.Values[0]).AsLong.Value : 0); + ExpandListToMinimum(uvs, index); + uvs[index] = ConvertLayerElementUV(prop, state); + break; + case "LayerElementVisibility": + index = (int)(prop.Values.Count > 0 ? ((Number)prop.Values[0]).AsLong.Value : 0); + ExpandListToMinimum(visibility, index); + visibility[index] = ConvertLayerElementVisibility(prop, state); + break; + case "LayerElementMaterial": + index = (int)(prop.Values.Count > 0 ? ((Number)prop.Values[0]).AsLong.Value : 0); + ExpandListToMinimum(materials, index); + materials[index] = ConvertLayerElementMaterial(prop, state); + break; + case "LayerElementColor": + index = (int)(prop.Values.Count > 0 ? ((Number)prop.Values[0]).AsLong.Value : 0); + ExpandListToMinimum(colors, index); + colors[index] = ConvertLayerElementColor(prop, state); + break; + case "Layer": + var layer = mesh.GetLayer(mesh.CreateLayer()); + ConvertLayer(layer, prop, normals, uvs, visibility, materials, colors, state); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property name in FbxMesh. Got '{0}' instead.", prop.Name)); + } + } + + return mesh; + } + + static void ConvertLayer( + FbxLayer layer, + ParseObject obj, + List normals, + List uvs, + List visibility, + List materials, + List colors, + ConversionState state) + { + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + if (prop.Values.Count < 0) + throw new ConversionException(prop.Location, "No value for 'Version' in FbxLayer."); + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 100) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxLayer. Expected '100'. Got '{0}' instead.", version)); + break; + case "LayerElement": + var type = prop.FindPropertyByName("Type"); + if (type == null) + throw new ConversionException(prop.Location, "No Type found in FbxLayer."); + var index = prop.FindPropertyByName("TypedIndex"); + if (index == null) + throw new ConversionException(prop.Location, "No TypedIndex found in FbxLayer."); + var indexValue = (int)((Number)index.Values[0]).AsLong.Value; + switch ((string)type.Values[0]) + { + case "LayerElementNormal": + layer.SetNormals(normals[indexValue]); + break; + case "LayerElementMaterial": + layer.SetMaterials(materials[indexValue]); + break; + case "LayerElementVisibility": + layer.SetVisibility(visibility[indexValue]); + break; + case "LayerElementUV": + layer.SetUVs(uvs[indexValue]); + break; + case "LayerElementColor": + layer.SetVertexColors(colors[indexValue]); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown LayerElement type in FbxLayer. Expected 'LayerElementNormal', 'LayerElementMaterial', 'LayerElementVisibility', or 'LayerElementUV'. Got '{0}' instead.", (string)type.Values[0])); + } + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxLayer. Expected 'Version' or 'LayerElement'. Got '{0}' instead.", prop.Name)); + } + } + } + + public static FbxLayerElementNormal ConvertLayerElementNormal(ParseObject obj, ConversionState state) + { + var normals = new FbxLayerElementNormal(); + var normalsW = new List(); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101 && version != 102) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxLayerElementNormal. Expected '102'. Got '{0}' instead.", version)); + break; + case "Name": + normals.SetName((string)prop.Values[0]); + break; + case "MappingInformationType": + normals.SetMappingMode(ConvertMappingInformationType(prop, state)); + break; + case "ReferenceInformationType": + normals.SetReferenceMode(ConvertReferenceInformationType(prop, state)); + break; + case "Normals": + var dest = normals.GetDirectArray().List; + if (prop.Properties.Count > 0) + { + var source = prop.Properties[0].Values; + int i; + for (i = 0; i < source.Count; i+=3) + { + var x = ((Number)source[i + 0]).AsDouble.Value; + var y = ((Number)source[i + 1]).AsDouble.Value; + var z = ((Number)source[i + 2]).AsDouble.Value; + var v = new FbxVector4(x, y, z, 0); + dest.Add(v); + } + } + else if (prop.Values.Count > 0) + { + var source = (double[])prop.Values[0]; + + int i; + for (i = 0; i < source.Length; i+=3) + { + var x = source[i + 0]; + var y = source[i + 1]; + var z = source[i + 2]; + var v = new FbxVector4(x, y, z, 0); + dest.Add(v); + } + } + else + throw new ConversionException(prop.Location, + "Normal array not found"); + break; + case "NormalsW": + normalsW.AddRange( + prop.Properties[0].Values + .Select(n => ((Number)n).AsDouble.Value)); + break; + case "NormalsIndex": + var destindex = normals.GetIndexArray().List; + if (prop.Properties.Count > 0) + { + foreach (var i in prop.Properties[0].Values) + destindex.Add((int)i); + } + else if (prop.Values.Count > 0) + { + foreach (var i in (int[])prop.Values[0]) + destindex.Add(i); + } + else + throw new ConversionException(prop.Location, + "Normal array not found"); + + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxLayerElementNormal. Expected 'Version', 'Name', 'MappingInformationType', 'ReferenceInformationType', or 'Normals'. Got '{0}' instead.", prop.Name)); + } + } + + return normals; + } + + public static FbxLayerElementUV ConvertLayerElementUV(ParseObject obj, ConversionState state) + { + var uvs = new FbxLayerElementUV(); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxLayerElementUV. Expected '101'. Got '{0}' instead.", version)); + break; + case "Name": + uvs.Name = ((string)prop.Values[0]); + break; + case "MappingInformationType": + uvs.MappingMode = ConvertMappingInformationType(prop, state); + break; + case "ReferenceInformationType": + uvs.ReferenceMode = ConvertReferenceInformationType(prop, state); + break; + case "UV": + var dest = uvs.GetDirectArray().List; + if (prop.Properties.Count > 0) + { + dest.AddRange( + prop.Properties[0].Values + .Select(n => ((Number)n).AsDouble.Value) + .ToVector2List()); + } + else if (prop.Values.Count > 0) + { + var source = (double[])prop.Values[0]; + int i; + for (i = 0; i < source.Length; i += 2) + { + var u = source[i + 0]; + var v = source[i + 1]; + var vv = new FbxVector2(u, v); + dest.Add(vv); + } + } + else + throw new ConversionException(prop.Location, + "UV array not found"); + + break; + case "UVIndex": + var destIndex = uvs.GetIndexArray().List; + if (prop.Properties.Count>0) + { + destIndex.AddRange( + prop.Properties[0].Values + .Select(n => (int)((Number)n).AsLong.Value)); + } + else if (prop.Values.Count > 0) + { + var source = (int[])prop.Values[0]; + foreach (var i in source) + destIndex.Add(i); + } + else + throw new ConversionException("UV array not found"); + + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxLayerElementUV. Expected 'Version', 'Name', 'MappingInformationType', 'ReferenceInformationType', 'UV', or 'UVIndex'. Got '{0}' instead.", prop.Name)); + } + } + + return uvs; + } + + public static FbxLayerElementVisibility ConvertLayerElementVisibility(ParseObject obj, ConversionState state) + { + var visibility = new FbxLayerElementVisibility(); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxLayerElementVisibility. Expected '101'. Got '{0}' instead.", version)); + break; + case "Name": + visibility.Name = ((string)prop.Values[0]); + break; + case "MappingInformationType": + visibility.MappingMode = ConvertMappingInformationType(prop, state); + break; + case "ReferenceInformationType": + visibility.ReferenceMode = ConvertReferenceInformationType(prop, state); + break; + case "Visibility": + visibility.GetDirectArray().List.AddRange(prop.Properties[0].Values.Select(n => (((Number)n).AsLong.Value == 1))); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxLayerElementVisibility. Expected 'Version', 'Name', 'MappingInformationType', 'ReferenceInformationType', or 'Visibility'. Got '{0}' instead.", prop.Name)); + } + } + + return visibility; + } + + public static FbxLayerElementMaterial ConvertLayerElementMaterial(ParseObject obj, ConversionState state) + { + var material = new FbxLayerElementMaterial(); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxLayerElementMaterial. Expected '101'. Got '{0}' instead.", version)); + break; + case "Name": + material.Name = ((string)prop.Values[0]); + break; + case "MappingInformationType": + material.MappingMode = ConvertMappingInformationType(prop, state); + break; + case "ReferenceInformationType": + material.ReferenceMode = ConvertReferenceInformationType(prop, state); + break; + case "Materials": + var dest = material.MaterialIndexes.List; + if (prop.Properties.Count>0) + { + dest.AddRange( + prop.Properties[0].Values.Select(n => + (int)((Number)n).AsLong.Value)); + } + else if (prop.Values.Count > 0) + { + foreach (var i in (int[])prop.Values[0]) + { + dest.Add(i); + } + } + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxLayerElementMaterial. Expected 'Version', 'Name', 'MappingInformationType', 'ReferenceInformationType', or 'Materials'. Got '{0}' instead.", prop.Name)); + } + } + + return material; + } + + public static FbxLayerElementVertexColor ConvertLayerElementColor(ParseObject obj, ConversionState state) + { + var versionp = obj.FindPropertyByName("Version"); + if (versionp == null) throw new ConversionException(obj.Location, + "No 'Version' cound in LayerElementColor block."); + var version = ((Number)versionp.Values[0]).AsLong.Value; + switch ( version) + { + case 101: + return ConvertLayerElementColor101(obj, state); + + default: + throw new ConversionException(versionp.Location, + string.Format( + "Unknown version in LayerElementColor: {0}", + version)); + } + } + + public static FbxLayerElementVertexColor ConvertLayerElementColor101(ParseObject obj, ConversionState state) + { + var colors = new FbxLayerElementVertexColor(); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101) + throw new ConversionException(prop.Location, string.Format("Unknown Version in LayerElementColor. Expected '101'. Got '{0}' instead.", version)); + break; + case "Name": + colors.Name = ((string)prop.Values[0]); + break; + case "MappingInformationType": + colors.MappingMode = ConvertMappingInformationType( + prop, state); + if (colors.MappingMode != FbxLayerElement.EMappingMode.ByPolygonVertex) + throw new ConversionException( + prop.Location, + string.Format( + "Unsupported MappingInformationType: {0}", + colors.MappingMode)); + break; + case "ReferenceInformationType": + colors.ReferenceMode = ConvertReferenceInformationType( + prop, state); + if (colors.ReferenceMode != FbxLayerElement.EReferenceMode.IndexToDirect) + throw new ConversionException( + prop.Location, + string.Format( + "Unsupported ReferenceInformationType: {0}", + colors.ReferenceMode)); + break; + case "Colors": + colors.GetDirectArray().List.AddRange( + prop.Properties[0].Values + .Select(n => ((Number)n).AsDouble.Value) + .ToColorList()); + break; + case "ColorIndex": + colors.GetIndexArray().List.AddRange( + prop.Properties[0].Values + .Select(n => (int)((Number)n).AsLong.Value)); + break; + default: + throw new ConversionException( + prop.Location, + string.Format( + "Unknown property in FbxLayerElementVertexColor. Expected 'Version', 'Name', 'MappingInformationType', 'ReferenceInformationType', 'Colors', or 'ColorIndex'. Got '{0}' instead.", + prop.Name)); + } + } + + return colors; + } + + public static FbxLayerElement.EMappingMode ConvertMappingInformationType(ParseObject obj, ConversionState state) + { + if (obj.Values.Count < 1) + throw new ConversionException(obj.Location, "Mapping mode has no value."); + switch ((string)obj.Values[0]) + { + case "ByPolygonVertex": + return FbxLayerElement.EMappingMode.ByPolygonVertex; + case "ByPolygon": + return FbxLayerElement.EMappingMode.ByPolygon; + case "ByVertex": + return FbxLayerElement.EMappingMode.ByPolygonVertex; + case "ByEdge": + return FbxLayerElement.EMappingMode.ByEdge; + case "AllSame": + return FbxLayerElement.EMappingMode.AllSame; + default: + throw new ConversionException(obj.Location, string.Format("Unknown mapping mode. Expected 'ByPolygonVertex', 'ByPolygon', 'ByVertex', 'ByEdge', or 'AllSame'. Got '{0}' instead.", (string)obj.Values[0])); + } + } + + public static FbxLayerElement.EReferenceMode ConvertReferenceInformationType(ParseObject obj, ConversionState state) + { + if (obj.Values.Count < 1) + throw new ConversionException(obj.Location, "Reference mode has no value."); + switch ((string)obj.Values[0]) + { + case "Direct": + return FbxLayerElement.EReferenceMode.Direct; + case "IndexToDirect": + return FbxLayerElement.EReferenceMode.IndexToDirect; + default: + throw new ConversionException(obj.Location, string.Format("Unknown reference mode. Expected 'Direct' or 'IndexToDirect'. Got '{0}' instead.", (string)obj.Values[0])); + } + } + + public struct PropInfo( + string name, + Type propType, + FbxDataType propType2, + object value) + { + public readonly string Name = name; + public readonly Type PropType = propType; + public readonly FbxDataType PropType2 = propType2; + public readonly object Value = value; + } + + public static List ConvertProperties70(ParseObject props70, ConversionState state) + { + var propNamesTypesValues = new List(); + + foreach (var p in props70.Properties) + { + if (p.Name != "P") + throw new ConversionException(p.Location, string.Format("Incorrect property name. Expected 'P'. Got '{0}' instead.", p.Name)); + + // P: "Color", "ColorRGB", "Color", "",0.0313725490196078,0.0313725490196078,0.0313725490196078 + var propName = ((string)p.Values[0]); + var type1 = ((string)p.Values[1]); + var type2 = ((string)p.Values[2]); + var comment = ((string)p.Values[3]); // ??? + + Type propType; + FbxDataType propType2; + object propValue; + + switch (type1) + { + case "ColorRGB": + case "Color": + var r = ((Number)p.Values[4]).AsDouble.Value; + var g = ((Number)p.Values[5]).AsDouble.Value; + var b = ((Number)p.Values[6]).AsDouble.Value; + propType = typeof(FbxColor); + propType2 = FbxDataTypes.FbxColor3DT; + propValue = new FbxColor(r, g, b); + break; + case "Visibility": + case "bool": + propType = typeof(bool); + propType2 = FbxDataTypes.FbxBoolDT; + propValue = (((Number)p.Values[4]).AsLong.Value != 0); + break; + case "enum": + propType = typeof(long); + propType2 = FbxDataTypes.FbxEnumDT; + propValue = ((Number)p.Values[4]).AsLong.Value; + break; + case "Vector": + case "Vector3": + case "Vector3D": + propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; + var x = ((Number)p.Values[4]).AsDouble.Value; + var y = ((Number)p.Values[5]).AsDouble.Value; + var z = ((Number)p.Values[6]).AsDouble.Value; + propValue = new FbxVector3(x, y, z); + break; + case "int": + propType = typeof(int); + propType2 = FbxDataTypes.FbxIntDT; + propValue = (int)((Number)p.Values[4]).AsLong.Value; + break; + case "Lcl Translation": + case "Lcl Rotation": + case "Lcl Scaling": + propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; + x = ((Number)p.Values[4]).AsDouble.Value; + y = ((Number)p.Values[5]).AsDouble.Value; + z = ((Number)p.Values[6]).AsDouble.Value; + if (comment != "A+" && comment != "A") + throw new ConversionException(p.Location, string.Format("Invalid indicator for Lcl Scaling. Expected 'A' or 'A+'. Got '{0}' instead.", comment)); + propValue = new FbxVector3(x, y, z); + break; + case "KString": + propType = typeof(string); + propType2 = FbxDataTypes.FbxStringDT; + if (type2 == "Url") + propType2 = FbxDataTypes.FbxUrlDT; + propValue = (string)p.Values[4]; + break; + case "FieldOfView": + case "FieldOfViewX": + case "FieldOfViewY": + case "double": + propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; + propValue = ((Number)p.Values[4]).AsDouble.Value; + break; + case "KTime": + propType = typeof(FbxTime); + propType2 = FbxDataTypes.FbxTimeDT; + long rawValue = ((Number)p.Values[4]).AsLong.Value; + long rawValue7700 = rawValue; + if (state.LegacyTimeCode) + { + rawValue7700 = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; + } + propValue = new FbxTime(rawValue7700); + break; + case "Compound": + propType = typeof(string); + propType2 = FbxDataTypes.FbxCompoundDT; + propValue = ""; + break; + case "Number": + if (comment != "A") + throw new ConversionException(p.Location, string.Format("Invalid indicator for Number. Expected 'A'. Got '{0}' instead.", comment)); + propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; + propValue = ((Number)p.Values[4]).AsDouble.Value; + break; + case "DateTime": + propType = typeof(FbxDateTime); + propType2 = FbxDataTypes.FbxDateTimeDT; + propValue = new FbxDateTime(); + break; + default: + throw new ConversionException(p.Location, "Unknown property type: " + type1); + } + + propNamesTypesValues.Add( + new PropInfo( + propName, propType, propType2, propValue)); + } + + return propNamesTypesValues; + } + + public static void ConvertVertices(FbxMesh mesh, ParseObject obj, ConversionState state) + { + var values = obj.Values; // Properties[0].Values; + if (values.Count == 1 && values[0] is double[] arr) + { + mesh.InitControlPoints(arr.Length / 3); + int i; + for (i = 0; i + 2 < arr.Length; i += 3) + { + var v = new FbxVector4( + arr[i], + arr[i + 1], + arr[i + 2], + 0); + mesh.SetControlPointAt(v, i / 3); + } + } + else + { + mesh.InitControlPoints(values.Count / 3); + int i; + for (i = 0; i + 2 < values.Count; i += 3) + { + var v = new FbxVector4( + ((Number)values[i]).AsDouble.Value, + ((Number)values[i + 1]).AsDouble.Value, + ((Number)values[i + 2]).AsDouble.Value, + 0); + mesh.SetControlPointAt(v, i / 3); + } + } + } + + public static List> ConvertPolygonVertexIndex(ParseObject obj, ConversionState state) + { + var values = (int[])obj.Values[0]; // .Properties[0].Values; + int i; + var polygons = new List>(); + var current = new List(); + foreach (var v in values) + { + var n = ((Number)v).AsLong.Value; + current.Add(n < 0 ? -n - 1 : n); + if (n < 0) + { + polygons.Add(current); + current = new List(); + } + } + if (current.Count > 0) + { + polygons.Add(current); + } + return polygons; + } + + public static FbxNode ConvertNode(ParseObject obj, ConversionState state) + { + var node = new FbxNode(); + + if (obj.Values.Count < 2) + throw new ConversionException(obj.Location, string.Format("Not enough values for FbxNode. Expected 2 or more. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxNode. Expected 3. Got {0} instead.", obj.Values.Count)); + + string type; + if (obj.Values.Count == 2) + { + node.Name = ((string)obj.Values[0]); + type = ((string)obj.Values[1]); + } + else + { + node.Name = ((string)obj.Values[1]); + type = ((string)obj.Values[2]); + } + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 232) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxNode. Expected '232'. Got '{0}' instead.", version)); + break; + case "Properties70": + ImportProperties(node, ConvertProperties70(prop, state)); + break; + case "MultiLayer": + node.MultiLayer = (((Number)prop.Values[0]).AsLong.Value != 0); + break; + case "MultiTake": + node.MultiTake = (((Number)prop.Values[0]).AsLong.Value != 0); + break; + case "Shading": + if (prop.Values[0] is bool) + node.MultiTake = (bool)prop.Values[0]; + else + node.MultiTake = prop.Values[0].ToString() == "T"; + break; + case "Culling": + node.Culling = (string)prop.Values[0]; + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxNode. Expected 'Version', 'Properties70', 'MultiLayer', 'MultiTake', 'Shading', or 'Culling'. Got '{0}' instead.", prop.Name)); + } + } + + return node; + } + + public static void ImportProperty(FbxObject obj, string name, Type type, FbxDataType type2, object value) + { + var pprop = obj.FindProperty(name, type2); + if (pprop == null || !pprop.IsValid()) + pprop = obj.FindPropertyHierarchical(name, type2); + if (pprop == null || !pprop.IsValid()) + pprop = FbxProperty.Create(obj, type2, name); + pprop.Set(value); + } + + public static void ImportProperties(FbxObject obj, + IEnumerable propinfos) + { + foreach (var propinfo in propinfos) + { + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; + + ImportProperty(obj, pname, ptype, ptype2, pvalue); + } + } + + public static FbxPose ConvertPose( + ParseObject obj, + Dictionary fbxObjectsById, + Dictionary actualIdsByInFileIds, + ConversionState state) + { + var pose = new FbxPose(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values for FbxPose. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxPose. Expected 3. Got {0} instead.", obj.Values.Count)); + pose.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + long numPoseNodes = 0; + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Type": + if ((string)prop.Values[0] == "BindPose") + { + pose.SetIsBindPose(true); + } + else + { + throw new ConversionException(prop.Location, string.Format("Unknown pose type. Expected 'BindPose'. Got '{0}' instead.", (string)prop.Values[0])); + } + break; + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 100) + throw new ConversionException(prop.Location, string.Format("Unknown version. Expected 100. Got {0} instead.", version)); + break; + case "NbPoseNodes": + numPoseNodes = ((Number)prop.Values[0]).AsLong.Value; + break; + case "PoseNode": + var posenode = ConvertPoseNode(prop, fbxObjectsById, actualIdsByInFileIds, state); + pose.Add(posenode.Item1, posenode.Item2, posenode.Item3); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxPose. Expected 'Type', 'Version', 'NbPoseNodes', or 'PoseNode'. Got '{0}' instead.", prop.Name)); + } + } + + if (numPoseNodes != pose.GetCount()) + throw new ConversionException(obj.Location, string.Format("The number of pose objects ({0}) does not match the value explicit given ({1}).", pose.GetCount(), numPoseNodes)); + + return pose; + } + + public static Tuple ConvertPoseNode( + ParseObject obj, + Dictionary fbxObjectsById, + Dictionary actualIdsByInFileIds, + ConversionState state) + { + if (obj.Properties.Count != 2) + throw new ConversionException(obj.Location, "Unknown properties in PoseNode."); + + var nodeIdProp = obj.FindPropertyByName("Node"); + if (nodeIdProp == null) + throw new ConversionException(obj.Location, "No node ID found in PoseNode."); + var inFileNodeId = (ulong)((Number)nodeIdProp.Values[0]).AsLong.Value; + var nodeId = actualIdsByInFileIds[inFileNodeId]; + var node = (FbxNode)fbxObjectsById[(ulong)nodeId]; + + var matrixProp = obj.FindPropertyByName("Matrix"); + if (matrixProp == null) + throw new ConversionException(obj.Location, "No matrix found in PoseNode."); + var matrix = ConvertMatrix(matrixProp); + + return new Tuple(node, matrix, false); + } + + public static FbxMatrix ConvertMatrix(ParseObject obj) + { + double[] v; + if (obj.Properties.Count > 0) + { + var values = obj.Properties[0].Values; + if (values.Count != 16) + throw new ConversionException( + obj.Location, + $"Incorrect number of values for FbxMatrix. " + + $"Expected 16. Got {values.Count} instead."); + + v = values.Select(n => ((Number)n).AsDouble.Value).ToArray(); + } + else if (obj.Values.Count > 0) + v = (double[])obj.Values[0]; + else + throw new ConversionException("Matrix values not found"); + + var m = new FbxMatrix( + v[0], v[1], v[2], v[3], + v[4], v[5], v[6], v[7], + v[8], v[9], v[10], v[11], + v[12], v[13], v[14], v[15]); + return m; + } + + public static FbxSurfaceMaterial ConvertMaterial(ParseObject obj, ConversionState state) + { + var shadingModelProp = obj.FindPropertyByName("ShadingModel"); + if (shadingModelProp == null) + throw new ConversionException(obj.Location, "No shading model found in FbxSurfaceMaterial."); + + var shadingModel = (string)shadingModelProp.Values[0]; + if (shadingModel != "phong" && shadingModel != "Phong") + throw new ConversionException(shadingModelProp.Location, string.Format("Unknown shading model in FbxSurfaceMaterial. Expected 'phong'. Got '{0}' instead.", shadingModel)); + + return ConvertPhongMaterial(obj, state); + } + + public static FbxSurfacePhong ConvertPhongMaterial(ParseObject obj, ConversionState state) + { + var material = new FbxSurfacePhong(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxSurfacePhong. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxSurfacePhong. Expected 3. Got {0} instead.", obj.Values.Count)); + material.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 102) + throw new ConversionException(prop.Location, string.Format("Unknown version. Expected 102. Got {0} instead.", version)); + break; + case "ShadingModel": + break; + case "MultiLayer": + var multilayer = (((Number)prop.Values[0]).AsLong.Value != 0); + ImportProperty(material, "MultiLayer", typeof(bool), + FbxDataTypes.FbxBoolDT, multilayer); + break; + case "Properties70": + ImportProperties(material, ConvertProperties70(prop, state)); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxSurfacePhong. Expected 'Version', 'ShadingModel', 'MultiLayer', or 'Properties70'. Got '{0}' instead.", prop.Name)); + } + } + + return material; + } + + public static FbxObject ConvertDeformer(ParseObject obj, ConversionState state) + { + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in deformer. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for deformer. Expected 3. Got {0} instead.", obj.Values.Count)); + var type = ((string)obj.Values[2]); + + switch (type) + { + case "Skin": + return ConvertSkin(obj, state); + case "Cluster": + return ConvertCluster(obj, state); + default: + throw new ConversionException(obj.Location, string.Format("Unknown deformer type. Expected 'Skin' or 'Cluster'. Got '{0}' instead.", type)); + } + } + + public static FbxSkin ConvertSkin(ParseObject obj, ConversionState state) + { + var skin = new FbxSkin(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxSkin. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxSkin. Expected 3. Got {0} instead.", obj.Values.Count)); + skin.Name = ((string)obj.Values[1]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 101) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxSkin. Expected '101'. Got '{0}' instead.", version)); + break; + case "Link_DeformAcuracy": // TODO: double-check spelling + var accuracy = ((Number)prop.Values[0]).AsDouble.Value; + skin.DeformAccuracy = accuracy; + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxSkin. Expected 'Version' or 'Link_DeformAcuracy. Got '{0}' instead.", prop.Name)); + } + } + + return skin; + } + + public static FbxCluster ConvertCluster(ParseObject obj, ConversionState state) + { + var cluster = new FbxCluster(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxCluster. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxCluster. Expected 3. Got {0} instead.", obj.Values.Count)); + cluster.Name = ((string)obj.Values[1]); + + bool hasIndexes = false; + bool hasWeights = false; + bool hasTransform = false; + bool hasTransformLink = false; + bool hasTransformAssociateModel = false; + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 100) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxSkin. Expected '100'. Got '{0}' instead.", version)); + break; + case "UserData": + break; + case "Indexes": + if (prop.Properties.Count>0) + { + cluster.ControlPointIndices.AddRange( + prop.Properties[0].Values.Select(n => + (int)((Number)n).AsLong.Value)); + } + else if (prop.Values.Count > 0) + { + cluster.ControlPointIndices.AddRange( + (int[])prop.Values[0]); + } + else + throw new ConversionException(obj.Location, + "Cluster indexes array not found"); + hasIndexes = true; + break; + case "Weights": + if (prop.Properties.Count>0) + { + cluster.ControlPointWeights.AddRange( + prop.Properties[0].Values.Select(n => + ((Number)n).AsDouble.Value)); + } + else if (prop.Values.Count > 0) + { + cluster.ControlPointWeights.AddRange( + (double[])prop.Values[0]); + } + else + throw new ConversionException(obj.Location, + "Cluster weights not found"); + hasWeights = true; + break; + case "Transform": + cluster.Transform = ConvertMatrix(prop); + hasTransform = true; + break; + case "TransformLink": + cluster.TransformLink = ConvertMatrix(prop); + hasTransformLink = true; + break; + case "TransformAssociateModel": + cluster.SetTransformAssociateModelMatrix( + ConvertMatrix(prop)); + hasTransformAssociateModel = true; + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxCluster. Expected 'Version', 'UserData', 'Indexes', 'Weights', 'Transform', or 'TransformLink'. Got '{0}' instead.", prop.Name)); + } + } + + return cluster; + } + + public static FbxVideo ConvertVideo(ParseObject obj, ConversionState state) + { + var video = new FbxVideo(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxVideo. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxVideo. Expected 3. Got {0} instead.", obj.Values.Count)); + video.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Type": + video.Type = (string)prop.Values[0]; + break; + case "Properties70": + ImportProperties(video, ConvertProperties70(prop, state)); + break; + case "UseMipMap": + video.UseMipMap = (((Number)prop.Values[0]).AsLong.Value != 0); + break; + case "Filename": + video.Filename = (string)prop.Values[0]; + break; + case "RelativeFilename": + video.RelativeFilename = (string)prop.Values[0]; + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxVideo. Expected 'Type', 'Properties70', 'UseMipMap', 'Filename', or 'RelativeFilename'. Got '{0}' instead.", prop.Name)); + + } + } + + return video; + } + + public static FbxTexture ConvertTexture(ParseObject obj, ConversionState state) + { + var texture = new FbxTexture(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxTexture. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxTexture. Expected 3. Got {0} instead.", obj.Values.Count)); + texture.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Type": + texture.Type = (string)prop.Values[0]; + break; + case "Version": + var version = ((Number)prop.Values[0]).AsLong.Value; + if (version != 202) + throw new ConversionException(prop.Location, string.Format("Unknown Version in FbxTexture. Expected '202'. Got '{0}' instead.", version)); + break; + case "TextureName": + var name = (string)prop.Values[0]; + if (name != texture.Name) + throw new ConversionException(prop.Location, string.Format("TextureName does not match. Expected '{0}'. Got '{1}' instead.", texture.Name, name)); + break; + case "Properties70": + ImportProperties(texture, ConvertProperties70(prop, state)); + break; + case "Media": + texture.Media = (string)prop.Values[0]; + break; + case "Filename": + case "FileName": + texture.Filename = (string)prop.Values[0]; + break; + case "RelativeFilename": + texture.RelativeFilename = (string)prop.Values[0]; + break; + case "ModelUVTranslation": + texture.ModelUVTranslation = ConvertVector2(prop.Values); + break; + case "ModelUVScaling": + texture.ModelUVScaling = ConvertVector2(prop.Values); + break; + case "Texture_Alpha_Source": + texture.AlphaSource = (FbxTexture.EAlphaSource)Enum.Parse(typeof(FbxTexture.EAlphaSource), (string)prop.Values[0]); + break; + case "Cropping": + texture.Cropping = ConvertVector4(prop.Values); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxTexture: '{0}'.", prop.Name)); + } + } + + return texture; + } + + public static FbxVector2 ConvertVector2(List values, int startIndex=0) + { + return + new FbxVector2( + ((Number)values[startIndex]).AsDouble.Value, + ((Number)values[startIndex + 1]).AsDouble.Value); + } + + public static FbxVector3 ConvertVector3(List values, int startIndex=0) + { + return + new FbxVector3( + ((Number)values[startIndex]).AsDouble.Value, + ((Number)values[startIndex + 1]).AsDouble.Value, + ((Number)values[startIndex + 2]).AsDouble.Value); + } + + public static FbxVector4 ConvertVector4(List values, int startIndex=0) + { + return + new FbxVector4( + ((Number)values[startIndex]).AsDouble.Value, + ((Number)values[startIndex + 1]).AsDouble.Value, + ((Number)values[startIndex + 2]).AsDouble.Value, + ((Number)values[startIndex + 3]).AsDouble.Value); + } + + public static FbxAnimStack ConvertAnimationStack(ParseObject obj, ConversionState state) + { + var animstack = new FbxAnimStack(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxAnimStack. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxAnimStack. Expected 3. Got {0} instead.", obj.Values.Count)); + animstack.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Properties70": + ImportProperties(animstack, ConvertProperties70(prop, state)); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxAnimStack. Expected 'Properties70'. Got '{0}' instead.", prop.Name)); + } + } + + return animstack; + } + + public static FbxAnimLayer ConvertAnimationLayer(ParseObject obj, ConversionState state) + { + var animlayer = new FbxAnimLayer(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxAnimLayer. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxAnimLayer. Expected 3. Got {0} instead.", obj.Values.Count)); + animlayer.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + if (obj.Properties.Count > 0) + throw new ConversionException(obj.Location, "Expected property list to be empty."); + + return animlayer; + } + + public static FbxAnimCurveNode ConvertAnimationCurveNode(ParseObject obj, ConversionState state) + { + var animCurveNode = new FbxAnimCurveNode(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxAnimCurveNode. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxAnimCurveNode. Expected 3. Got {0} instead.", obj.Values.Count)); + animCurveNode.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Properties70": + var propinfos = ConvertProperties70(prop, state); + foreach (var propinfo in propinfos) + { + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; + + if (pname == "d") + { + } + else if (pname.StartsWith("d|")) + { + var genMethod = typeof(FbxAnimCurveNode).GetMethod("AddChannel"); + var typedMethod = genMethod.MakeGenericMethod(ptype); + typedMethod.Invoke(animCurveNode, new object[]{pname, pvalue}); + //animCurveNode.AddChannel(pname, pvalue) + } + else + { + ImportProperty(animCurveNode, pname, ptype, ptype2, pvalue); + } + } + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxAnimCurveNode. Expected 'Properties70'. Got '{0}' instead.", prop.Name)); + } + } + + return animCurveNode; + } + + public static FbxAnimCurve ConvertAnimationCurve(ParseObject obj, ConversionState state) + { + var curve = new FbxAnimCurve(); + + if (obj.Values.Count < 3) + throw new ConversionException(obj.Location, string.Format("Not enough values in FbxAnimCurve. Expected 3. Got {0} instead.", obj.Values.Count)); + if (obj.Values.Count > 3) + throw new ConversionException(obj.Location, string.Format("Too many values for FbxAnimCurve. Expected 3. Got {0} instead.", obj.Values.Count)); + curve.Name = ((string)obj.Values[1]); + var type = ((string)obj.Values[2]); + + long[] keyTimes = null; + double[] keyValues = null; + long[] attrFlags = null; + long[] attrData = null; + long[] attrRefCounts = null; + + foreach (var prop in obj.Properties) + { + switch (prop.Name) + { + case "Default": + var defaultValue = ((Number)prop.Values[0]).AsDouble.Value; + break; + case "KeyVer": + long keyVersion = ((Number)prop.Values[0]).AsLong.Value; + if (keyVersion != 4008 && keyVersion != 4009) + throw new ConversionException(prop.Location, string.Format("Unknown KeyVer. Expected 4008 or 4009. Got {0} instead.", keyVersion)); + break; + case "KeyTime": + if (prop.Properties.Count>0) + keyTimes = prop.Properties[0].Values.Select(n => ((Number)n).AsLong.Value).ToArray(); + else if (prop.Values.Count > 0) + keyTimes = (long[])prop.Values[0]; + else + throw new NotImplementedException(); + break; + case "KeyValueFloat": + if (prop.Properties.Count>0) + keyValues = prop.Properties[0].Values.Select(n => ((Number)n).AsDouble.Value).ToArray(); + else if (prop.Values.Count > 0) + keyValues = ((float[])(prop.Values[0])).Select(f => (double)f).ToArray(); + else + throw new NotImplementedException(); + break; + case "KeyAttrFlags": + if (prop.Properties.Count > 0) + attrFlags = prop.Properties[0].Values.Select(n => ((Number)n).AsLong.Value).ToArray(); + else if (prop.Values.Count > 0) + attrFlags = ((int[])(prop.Values[0])).Select(i => (long)i).ToArray(); + else + throw new NotImplementedException(); + break; + case "KeyAttrDataFloat": + if (prop.Properties.Count > 0) + attrData = prop.Properties[0].Values.Select(n => ((Number)n).AsLong.Value).ToArray(); + else if (prop.Values.Count > 0) + attrData = ((float[])(prop.Values[0])).Select(v => (long)v).ToArray(); + else + throw new NotImplementedException(); + break; + case "KeyAttrRefCount": + if (prop.Properties.Count > 0) + attrRefCounts = prop.Properties[0].Values.Select(n => ((Number)n).AsLong.Value).ToArray(); + else if (prop.Values.Count > 0) + attrRefCounts = ((int[])(prop.Values[0])).Select(v => (long)v).ToArray(); + else + throw new NotImplementedException(); + break; + default: + throw new ConversionException(prop.Location, string.Format("Unknown property in FbxAnimCurve. Expected 'Default', 'KeyVer', 'KeyTime', 'KeyValueFloat', 'KeyAttrFlags', 'KeyAttrDataFloat', or 'KeyAttrRefCount'. Got '{0}' instead.", prop.Name)); + } + } + + var keys = new FbxAnimCurveKey[Math.Min(keyTimes.Length, keyValues.Length)]; + int i; + for (i = 0; i < Math.Min(keyTimes.Length, keyValues.Length); i++) + { + var rawValue = keyTimes[i]; + if (state.LegacyTimeCode) + { + rawValue = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; + } + var time = new FbxTime(rawValue); + keys[i] = new FbxAnimCurveKey(time, (float)keyValues[i]); + } + + + int k = 0; + int m = 0; + foreach (var attrCount in attrRefCounts) + { + long data0 = attrData[4 * m + 0]; + long data1 = attrData[4 * m + 1]; + long data2 = attrData[4 * m + 2]; + long data3 = attrData[4 * m + 3]; + long flags = attrFlags[m]; + + var tangentMode = (FbxAnimCurveDef.ETangentMode)(flags & 0x00007f00); + tangentMode = tangentMode & ~FbxAnimCurveDef.ETangentMode.eTangentGenericTimeIndependent; + var interpolation = (FbxAnimCurveDef.EInterpolationType)(flags & 0x0000000e); + var weight = (FbxAnimCurveDef.EWeightedMode)(flags & 0x03000000); + var constant = (FbxAnimCurveDef.EConstantMode)(flags & 0x00000100); + var velocity = (FbxAnimCurveDef.EVelocityMode)(flags & 0x30000000); + var visibility = (FbxAnimCurveDef.ETangentVisibility)(flags & 0x00300000); + + for (i = 0; i < attrCount; i++, k++) + { + var key = keys[k]; + key.SetTangentMode(tangentMode); + key.SetInterpolation(interpolation); + key.SetTangentWeightMode(weight); + key.SetConstantMode(constant); + key.SetTangentVelocityMode(velocity); + key.SetTangentVisibility(visibility); + key.SetTangentWeightAndAdjustTangent(FbxAnimCurveDef.EDataIndex.eRightWeight, (data2 & 0x0000ffff) / 9999.0); + key.SetTangentWeightAndAdjustTangent(FbxAnimCurveDef.EDataIndex.eNextLeftWeight, ((data2 >> 16) & 0xffff) / 9999.0); +// key.SetDataFloat(AnimCurveDef.EDataIndex.eRightSlope, data0); +// key.SetDataFloat(AnimCurveDef.EDataIndex.eRightSlope, data1); +// key.SetDataFloat(AnimCurveDef.EDataIndex.eRightSlope, data2); +// key.SetDataFloat(AnimCurveDef.EDataIndex.eRightSlope, data3); + } + + m++; + } + + foreach (var key in keys) + { + curve.KeyAdd(key.GetTime(), key); + } + + return curve; + } + + void CheckConnections(ParseObject conns) + { + } + + void CheckConnection(ParseObject conn) + { + } + + void CheckTakes(ParseObject takes) { - throw new NotImplementedException(); } } } diff --git a/FbxSharp/Converter7500.cs b/FbxSharp/Converter7500.cs index bb7df50..f976fe2 100644 --- a/FbxSharp/Converter7500.cs +++ b/FbxSharp/Converter7500.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7500 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7600.cs b/FbxSharp/Converter7600.cs index 7249fe3..eb3ebf9 100644 --- a/FbxSharp/Converter7600.cs +++ b/FbxSharp/Converter7600.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public class Converter7600 : IConverter { - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null) { throw new NotImplementedException(); } diff --git a/FbxSharp/Converter7700.cs b/FbxSharp/Converter7700.cs index 5190d7d..602f42c 100644 --- a/FbxSharp/Converter7700.cs +++ b/FbxSharp/Converter7700.cs @@ -6,24 +6,21 @@ namespace FbxSharp { public class Converter7700 : IConverter { - public class ConversionState + public class ConversionState(bool legacyTimeCode) { - public ConversionState(bool legacyTimeCode) - { - LegacyTimeCode = legacyTimeCode; - } - - public readonly bool LegacyTimeCode; + public readonly bool LegacyTimeCode = legacyTimeCode; } - public FbxScene ConvertScene(List parsedObjects) + public FbxScene ConvertScene(List parsedObjects, + FbxScene scene=null) { var parsed = new ParseObject { Name = "Parsed Scene", Properties = parsedObjects, }; - var scene = new FbxScene(); + if (scene == null) + scene = new FbxScene(); var docs = parsed.FindPropertyByName("Documents"); if (docs != null) @@ -49,7 +46,7 @@ public FbxScene ConvertScene(List parsedObjects) if (timeCodeDefinition.Values.Count > 0 && timeCodeDefinition.Values[0] != null && timeCodeDefinition.Values[0] is Number && - ((Number)timeCodeDefinition.Values[0]).AsLong == FbxTime.FBXSDK_TC_LEGACY_DEFINITION) + ((Number)timeCodeDefinition.Values[0]).AsLong == FbxTimeCode.FBXSDK_TC_LEGACY_DEFINITION) { legacyTimeCode = true; } @@ -59,6 +56,20 @@ timeCodeDefinition.Values[0] is Number && var state = new ConversionState(legacyTimeCode); + + if (headerExt != null) + { + var sceneInfo = headerExt.FindPropertyByName("SceneInfo"); + if (sceneInfo != null) + { + var sceneInfoProps = + sceneInfo.FindPropertyByName("Properties70"); + var docInfo = scene.GetDocumentInfo(); + ImportProperties(docInfo, + ConvertProperties70(sceneInfoProps, state)); + } + } + var defs = parsed.FindPropertyByName("Definitions"); CheckDefinitions(defs); @@ -817,9 +828,21 @@ public static FbxLayerElement.EReferenceMode ConvertReferenceInformationType(Par } } - public static List> ConvertProperties70(ParseObject props70, ConversionState state) + public struct PropInfo( + string name, + Type propType, + FbxDataType propType2, + object value) + { + public readonly string Name = name; + public readonly Type PropType = propType; + public readonly FbxDataType PropType2 = propType2; + public readonly object Value = value; + } + + public static List ConvertProperties70(ParseObject props70, ConversionState state) { - var propNamesTypesValues = new List>(); + var propNamesTypesValues = new List(); foreach (var p in props70.Properties) { @@ -833,6 +856,7 @@ public static List> ConvertProperties70(ParseObject var comment = ((string)p.Values[3]); // ??? Type propType; + FbxDataType propType2; object propValue; switch (type1) @@ -843,21 +867,25 @@ public static List> ConvertProperties70(ParseObject var g = ((Number)p.Values[5]).AsDouble.Value; var b = ((Number)p.Values[6]).AsDouble.Value; propType = typeof(FbxColor); + propType2 = FbxDataTypes.FbxColor3DT; propValue = new FbxColor(r, g, b); break; case "Visibility": case "bool": propType = typeof(bool); + propType2 = FbxDataTypes.FbxBoolDT; propValue = (((Number)p.Values[4]).AsLong.Value != 0); break; case "enum": propType = typeof(long); + propType2 = FbxDataTypes.FbxEnumDT; propValue = ((Number)p.Values[4]).AsLong.Value; break; case "Vector": case "Vector3": case "Vector3D": propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; var x = ((Number)p.Values[4]).AsDouble.Value; var y = ((Number)p.Values[5]).AsDouble.Value; var z = ((Number)p.Values[6]).AsDouble.Value; @@ -865,12 +893,14 @@ public static List> ConvertProperties70(ParseObject break; case "int": propType = typeof(int); + propType2 = FbxDataTypes.FbxIntDT; propValue = (int)((Number)p.Values[4]).AsLong.Value; break; case "Lcl Translation": case "Lcl Rotation": case "Lcl Scaling": propType = typeof(FbxVector3); + propType2 = FbxDataTypes.FbxDouble3DT; x = ((Number)p.Values[4]).AsDouble.Value; y = ((Number)p.Values[5]).AsDouble.Value; z = ((Number)p.Values[6]).AsDouble.Value; @@ -880,6 +910,9 @@ public static List> ConvertProperties70(ParseObject break; case "KString": propType = typeof(string); + propType2 = FbxDataTypes.FbxStringDT; + if (type2 == "Url") + propType2 = FbxDataTypes.FbxUrlDT; propValue = (string)p.Values[4]; break; case "FieldOfView": @@ -887,35 +920,44 @@ public static List> ConvertProperties70(ParseObject case "FieldOfViewY": case "double": propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; propValue = ((Number)p.Values[4]).AsDouble.Value; break; case "KTime": propType = typeof(FbxTime); + propType2 = FbxDataTypes.FbxTimeDT; long rawValue = ((Number)p.Values[4]).AsLong.Value; long rawValue7700 = rawValue; if (state.LegacyTimeCode) { - rawValue7700 = rawValue * FbxTime.FBXSDK_TC_MILLISECOND / FbxTime.FBXSDK_TC_LEGACY_MILLISECOND; + rawValue7700 = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; } propValue = new FbxTime(rawValue7700); break; case "Compound": propType = typeof(string); + propType2 = FbxDataTypes.FbxCompoundDT; propValue = ""; break; case "Number": if (comment != "A") throw new ConversionException(p.Location, string.Format("Invalid indicator for Number. Expected 'A'. Got '{0}' instead.", comment)); propType = typeof(double); + propType2 = FbxDataTypes.FbxDoubleDT; propValue = ((Number)p.Values[4]).AsDouble.Value; break; + case "DateTime": + propType = typeof(FbxDateTime); + propType2 = FbxDataTypes.FbxDateTimeDT; + propValue = new FbxDateTime(); + break; default: throw new ConversionException(p.Location, "Unknown property type: " + type1); } propNamesTypesValues.Add( - new Tuple( - propName, propType, propValue)); + new PropInfo( + propName, propType, propType2, propValue)); } return propNamesTypesValues; @@ -1013,26 +1055,27 @@ public static FbxNode ConvertNode(ParseObject obj, ConversionState state) return node; } - public static void ImportProperty(FbxObject obj, string name, Type type, object value) + public static void ImportProperty(FbxObject obj, string name, Type type, FbxDataType type2, object value) { - var pprop = obj.FindProperty(name, type); - - if (pprop == null) - { - pprop = obj.CreateProperty(name, type); - } + var pprop = obj.FindProperty(name, type2); + if (pprop == null || !pprop.IsValid()) + pprop = obj.FindPropertyHierarchical(name, type2); + if (pprop == null || !pprop.IsValid()) + pprop = FbxProperty.Create(obj, type2, name); pprop.Set(value); } - public static void ImportProperties(FbxObject obj, IEnumerable> propinfos) + public static void ImportProperties(FbxObject obj, + IEnumerable propinfos) { foreach (var propinfo in propinfos) { - var pname = propinfo.Item1; - var ptype = propinfo.Item2; - var pvalue = propinfo.Item3; + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; - ImportProperty(obj, pname, ptype, pvalue); + ImportProperty(obj, pname, ptype, ptype2, pvalue); } } @@ -1169,7 +1212,8 @@ public static FbxSurfacePhong ConvertPhongMaterial(ParseObject obj, ConversionSt break; case "MultiLayer": var multilayer = (((Number)prop.Values[0]).AsLong.Value != 0); - ImportProperty(material, "MultiLayer", typeof(bool), multilayer); + ImportProperty(material, "MultiLayer", typeof(bool), + FbxDataTypes.FbxBoolDT, multilayer); break; case "Properties70": ImportProperties(material, ConvertProperties70(prop, state)); @@ -1473,9 +1517,10 @@ public static FbxAnimCurveNode ConvertAnimationCurveNode(ParseObject obj, Conver var propinfos = ConvertProperties70(prop, state); foreach (var propinfo in propinfos) { - var pname = propinfo.Item1; - var ptype = propinfo.Item2; - var pvalue = propinfo.Item3; + var pname = propinfo.Name; + var ptype = propinfo.PropType; + var ptype2 = propinfo.PropType2; + var pvalue = propinfo.Value; if (pname == "d") { @@ -1489,7 +1534,7 @@ public static FbxAnimCurveNode ConvertAnimationCurveNode(ParseObject obj, Conver } else { - ImportProperty(animCurveNode, pname, ptype, pvalue); + ImportProperty(animCurveNode, pname, ptype, ptype2, pvalue); } } break; @@ -1557,7 +1602,7 @@ public static FbxAnimCurve ConvertAnimationCurve(ParseObject obj, ConversionStat var rawValue = keyTimes[i]; if (state.LegacyTimeCode) { - rawValue = rawValue * FbxTime.FBXSDK_TC_MILLISECOND / FbxTime.FBXSDK_TC_LEGACY_MILLISECOND; + rawValue = rawValue * FbxTimeCode.FBXSDK_TC_MILLISECOND / FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND; } var time = new FbxTime(rawValue); keys[i] = new FbxAnimCurveKey(time, (float)keyValues[i]); diff --git a/FbxSharp/DeviationFromSdkAttribute.cs b/FbxSharp/DeviationFromSdkAttribute.cs new file mode 100644 index 0000000..97e5004 --- /dev/null +++ b/FbxSharp/DeviationFromSdkAttribute.cs @@ -0,0 +1,16 @@ +using System; + +namespace FbxSharp; + +/// +/// Indicates that an item is meant to be as close as possible to an item in +/// the SDK, but cannot due to a fundamental difference between C++ and C#. +/// +[AttributeUsage(AttributeTargets.All)] +public class DeviationFromSdkAttribute( + string appliesTo = null, + string notes = null) : Attribute +{ + public string AppliesTo { get; } = appliesTo; + public string Notes { get; } = notes; +} diff --git a/FbxSharp/EFbxType.cs b/FbxSharp/EFbxType.cs new file mode 100644 index 0000000..a0a12cd --- /dev/null +++ b/FbxSharp/EFbxType.cs @@ -0,0 +1,186 @@ +using System; + +namespace FbxSharp; + +public enum EFbxType +{ + eFbxUndefined, + eFbxChar, + eFbxUChar, + eFbxShort, + eFbxUShort, + eFbxUInt, + eFbxLongLong, + eFbxULongLong, + eFbxHalfFloat, + eFbxBool, + eFbxInt, + eFbxFloat, + eFbxDouble, + eFbxDouble2, + eFbxDouble3, + eFbxDouble4, + eFbxDouble4x4, + eFbxEnum = 17, + eFbxEnumM = -17, + eFbxString = 18, + eFbxTime, + eFbxReference, + eFbxBlob, + eFbxDistance, + eFbxDateTime, + eFbxTypeCount = 24 +} + +public static class EFbxTypeHelper +{ + [NotSdk] + public static Type ToDotnetType(this EFbxType fbxType) + { + switch (fbxType) + { + case EFbxType.eFbxUndefined: + throw new NotImplementedException(); + case EFbxType.eFbxChar: + return typeof(sbyte); + case EFbxType.eFbxUChar: + return typeof(char); + case EFbxType.eFbxShort: + return typeof(short); + case EFbxType.eFbxUShort: + return typeof(ushort); + case EFbxType.eFbxUInt: + return typeof(uint); + case EFbxType.eFbxLongLong: + return typeof(long); + case EFbxType.eFbxULongLong: + return typeof(ulong); + case EFbxType.eFbxHalfFloat: + return typeof(Half); + case EFbxType.eFbxBool: + return typeof(bool); + case EFbxType.eFbxInt: + return typeof(int); + case EFbxType.eFbxFloat: + return typeof(float); + case EFbxType.eFbxDouble: + return typeof(double); + case EFbxType.eFbxDouble2: + case EFbxType.eFbxDouble3: + case EFbxType.eFbxDouble4: + case EFbxType.eFbxDouble4x4: + case EFbxType.eFbxEnum: + case EFbxType.eFbxEnumM: + throw new NotImplementedException(); + case EFbxType.eFbxString: + return typeof(string); + case EFbxType.eFbxTime: + return typeof(FbxTime); + case EFbxType.eFbxReference: + case EFbxType.eFbxBlob: + case EFbxType.eFbxDistance: + throw new NotImplementedException($"Not implemented for type {fbxType}"); + case EFbxType.eFbxDateTime: + return typeof(FbxDateTime); + case EFbxType.eFbxTypeCount: + default: + throw new ArgumentOutOfRangeException(); + } + } + + [NotSdk] + public static EFbxType ToFbxType(this Type type) + { + if (type == typeof(sbyte)) + return EFbxType.eFbxChar; + if (type == typeof(sbyte)) + return EFbxType.eFbxChar; + if (type == typeof(char)) + return EFbxType.eFbxUChar; + if (type == typeof(short)) + return EFbxType.eFbxShort; + if (type == typeof(ushort)) + return EFbxType.eFbxUShort; + if (type == typeof(uint)) + return EFbxType.eFbxUInt; + if (type == typeof(long)) + return EFbxType.eFbxLongLong; + if (type == typeof(ulong)) + return EFbxType.eFbxULongLong; + if (type == typeof(Half)) + return EFbxType.eFbxHalfFloat; + if (type == typeof(bool)) + return EFbxType.eFbxBool; + if (type == typeof(int)) + return EFbxType.eFbxInt; + if (type == typeof(float)) + return EFbxType.eFbxFloat; + if (type == typeof(double)) + return EFbxType.eFbxDouble; + if (type == typeof(string)) + return EFbxType.eFbxString; + // TODO: EFbxType.eFbxDouble2 + // TODO: EFbxType.eFbxDouble3 + if (type == typeof(FbxVector3)) + return EFbxType.eFbxDouble3; + if (type == typeof(FbxColor)) + return EFbxType.eFbxDouble3; + if (type == typeof(FbxVector4)) + return EFbxType.eFbxDouble4; + // TODO: EFbxType.eFbxDouble4x4 + + // TODO: EFbxType.eFbxEnumM + if (type.IsEnum) + return EFbxType.eFbxEnum; + + if (type == typeof(FbxTime)) + return EFbxType.eFbxTime; + + if (type.IsAssignableTo(typeof(FbxObject))) + // TODO: FbxProperty? + return EFbxType.eFbxReference; + + // TODO: EFbxType.eFbxBlob + // TODO: EFbxType.eFbxDistance + + if (type == typeof(FbxDateTime)) + return EFbxType.eFbxDateTime; + + if (type == typeof(object) || + type == typeof(FbxProperty.NotValidT)) + return EFbxType.eFbxUndefined; + throw new ArgumentOutOfRangeException(nameof(type), type, null); + } + + public static EFbxType FbxTypeOf(sbyte value) => EFbxType.eFbxChar; + public static EFbxType FbxTypeOf(char value) => EFbxType.eFbxUChar; + public static EFbxType FbxTypeOf(short value) => EFbxType.eFbxShort; + public static EFbxType FbxTypeOf(ushort value) => EFbxType.eFbxUShort; + public static EFbxType FbxTypeOf(uint value) => EFbxType.eFbxUInt; + public static EFbxType FbxTypeOf(long value) => EFbxType.eFbxLongLong; + public static EFbxType FbxTypeOf(ulong value) => EFbxType.eFbxULongLong; + public static EFbxType FbxTypeOf(Half value) => EFbxType.eFbxHalfFloat; + public static EFbxType FbxTypeOf(bool value) => EFbxType.eFbxBool; + public static EFbxType FbxTypeOf(int value) => EFbxType.eFbxInt; + public static EFbxType FbxTypeOf(float value) => EFbxType.eFbxFloat; + public static EFbxType FbxTypeOf(double value) => EFbxType.eFbxDouble; + + public static EFbxType FbxTypeOf(string value) => EFbxType.eFbxString; + + // TODO: EFbxType.eFbxDouble2 + // TODO: EFbxType.eFbxDouble3 + public static EFbxType FbxTypeOf(FbxVector3 value) => EFbxType.eFbxDouble3; + // TODO: EFbxType.eFbxDouble4 + // TODO: EFbxType.eFbxDouble4x4 + + // TODO: EFbxType.eFbxEnumM + + public static EFbxType FbxTypeOf(FbxTime value) => EFbxType.eFbxTime; + + public static EFbxType FbxTypeOf(FbxObject value) => EFbxType.eFbxReference; + // TODO: FbxProperty? + + // TODO: EFbxType.eFbxBlob + // TODO: EFbxType.eFbxDistance + // TODO: EFbxType.eFbxDateTime +} \ No newline at end of file diff --git a/FbxSharp/FbxAnimCurve.cs b/FbxSharp/FbxAnimCurve.cs index f1d9fcc..942f5e5 100644 --- a/FbxSharp/FbxAnimCurve.cs +++ b/FbxSharp/FbxAnimCurve.cs @@ -10,6 +10,44 @@ public FbxAnimCurve(string name="") { } + #region Public Types + + // typedef FbxAnimCurveBase ParentClass + + #endregion + + #region Public Member Functions + + // virtual FbxClassId GetClassId() const override + + #endregion + + #region Static Public Member Functions + + // static FbxAnimCurve * Create(FbxManager *pManager, const char *pName) + + #endregion + + #region Static Public Attributes + + // static FbxClassId ClassId + + #endregion + + #region Protected Member Functions + + // virtual ~FbxAnimCurve() + + // FbxAnimCurve(FbxManager &pManager, const char *pName) + + #endregion + + #region Static Protected Attributes + + // static FbxObjectCreateProc Allocate + + #endregion + #region Animation curve creation. public static FbxAnimCurve Create(FbxScene pContainer, string pName) @@ -159,7 +197,7 @@ public virtual void KeySetTangentMode(int pKeyIndex, FbxAnimCurveDef.ETangentMod public virtual FbxAnimCurveKey KeyGet(int pIndex) { - throw new NotImplementedException(); + return (FbxAnimCurveKey)keys.GetValueAtIndex(pIndex); } public virtual float KeyGetValue(int pKeyIndex) diff --git a/FbxSharp/FbxAnimCurveNode.cs b/FbxSharp/FbxAnimCurveNode.cs index 8c48da0..342c9d3 100644 --- a/FbxSharp/FbxAnimCurveNode.cs +++ b/FbxSharp/FbxAnimCurveNode.cs @@ -8,12 +8,13 @@ public class FbxAnimCurveNode : FbxObject public FbxAnimCurveNode(String name="") : base(name) { - Properties.Add(channelRootProperty); + channelRootProperty = FbxPropertyT.StaticInit(this, "d", + 0f, false); } #region Utility Functions - protected readonly FbxPropertyT channelRootProperty = new FbxPropertyT("d"); + protected readonly FbxPropertyT channelRootProperty; protected class Channel { @@ -71,9 +72,9 @@ public void ResetChannels() public bool AddChannel(string pChnlName, T pValue) { - var prop = new FbxPropertyT(pChnlName, pValue); + var prop = FbxPropertyT.StaticInit(this, pChnlName, pValue, + false); var ch = new Channel(prop); - Properties.Add(prop); channels.Add(ch); return true; } diff --git a/FbxSharp/FbxAnimLayer.cs b/FbxSharp/FbxAnimLayer.cs index 0b2fd7b..5453bcb 100644 --- a/FbxSharp/FbxAnimLayer.cs +++ b/FbxSharp/FbxAnimLayer.cs @@ -4,9 +4,22 @@ namespace FbxSharp { public class FbxAnimLayer : FbxCollection { - public FbxAnimLayer(string name="") + public FbxAnimLayer(string name = "") : base(name) { + Weight = FbxPropertyT.StaticInit(this, "Weight", null, + default, false); + Mute = FbxPropertyT.StaticInit(this, "Mute", null, default, + false); + Solo = FbxPropertyT.StaticInit(this, "Solo", null, default, + false); + Lock = FbxPropertyT.StaticInit(this, "Lock", null, default, + false); + Color = FbxPropertyT.StaticInit(this, "Color", null, + default, false); + // BlendMode + // RotationAccumulationMode + // ScaleAccumulationMode } #region Public Types @@ -43,14 +56,14 @@ public void Reset() #region Public Attributes - public FbxPropertyT Weight = new FbxPropertyT("Weight"); - public FbxPropertyT Mute = new FbxPropertyT("Mute"); - public FbxPropertyT Solo = new FbxPropertyT("Solo"); - public FbxPropertyT Lock = new FbxPropertyT("Lock"); - public FbxPropertyT Color = new FbxPropertyT("Color"); -// public PropertyT BlendMode = new PropertyT("BlendMode"); -// public PropertyT RotationAccumulationMode = new PropertyT("RotationAccumulationMode"); -// public PropertyT ScaleAccumulationMode = new PropertyT("ScaleAccumulationMode"); + public readonly FbxPropertyT Weight; + public readonly FbxPropertyT Mute; + public readonly FbxPropertyT Solo; + public readonly FbxPropertyT Lock; + public readonly FbxPropertyT Color; + // public readonly PropertyT BlendMode; + // public readonly PropertyT RotationAccumulationMode; + // public readonly PropertyT ScaleAccumulationMode; #endregion diff --git a/FbxSharp/FbxAnimStack.cs b/FbxSharp/FbxAnimStack.cs index 1942a64..50f8fde 100644 --- a/FbxSharp/FbxAnimStack.cs +++ b/FbxSharp/FbxAnimStack.cs @@ -4,23 +4,28 @@ namespace FbxSharp { public class FbxAnimStack : FbxCollection { - public FbxAnimStack(String name="") + public FbxAnimStack(String name = "") : base(name) { - Properties.Add(Description); - Properties.Add(LocalStart); - Properties.Add(LocalStop); - Properties.Add(ReferenceStart); - Properties.Add(ReferenceStop); + Description = FbxPropertyT.StaticInit(this, "Description", + null, default, false); + LocalStart = FbxPropertyT.StaticInit(this, "LocalStart", + null, default, false); + LocalStop = FbxPropertyT.StaticInit(this, "LocalStop", + null, default, false); + ReferenceStart = FbxPropertyT.StaticInit(this, + "ReferenceStart", null, default, false); + ReferenceStop = FbxPropertyT.StaticInit(this, + "ReferenceStop", null, default, false); } #region Public Attributes - public readonly FbxPropertyT Description = new FbxPropertyT( "Description"); - public readonly FbxPropertyT LocalStart = new FbxPropertyT("LocalStart"); - public readonly FbxPropertyT LocalStop = new FbxPropertyT("LocalStop"); - public readonly FbxPropertyT ReferenceStart = new FbxPropertyT("ReferenceStart"); - public readonly FbxPropertyT ReferenceStop = new FbxPropertyT("ReferenceStop"); + public readonly FbxPropertyT Description; + public readonly FbxPropertyT LocalStart; + public readonly FbxPropertyT LocalStop; + public readonly FbxPropertyT ReferenceStart; + public readonly FbxPropertyT ReferenceStop; #endregion diff --git a/FbxSharp/FbxAxisSystem.cs b/FbxSharp/FbxAxisSystem.cs new file mode 100644 index 0000000..605a98e --- /dev/null +++ b/FbxSharp/FbxAxisSystem.cs @@ -0,0 +1,109 @@ +using System; + +namespace FbxSharp; + +public class FbxAxisSystem +{ + #region Public Types + + public enum EUpVector + { + eXAxis = 1, + eYAxis = 2, + eZAxis = 3 + } + + public enum EFrontVector + { + eParityEven = 1, + eParityOdd = 2 + } + + public enum ECoordSystem + { + eRightHanded, + eLeftHanded + } + + public enum EPreDefinedAxisSystem + { + eMayaZUp, + eMayaYUp, + eMax, + eMotionBuilder, + eOpenGL, + eDirectX, + eLightwave + } + + #endregion + + #region Public Member Functions + + // FbxAxisSystem operator= ( FbxAxisSystem pAxisSystem) + public void DeepConvertScene(FbxScene pScene) => + throw new NotImplementedException(); + + public void ConvertScene(FbxScene pScene) => + throw new NotImplementedException(); + + public void ConvertScene(FbxScene pScene, FbxNode pFbxRoot) => + throw new NotImplementedException(); + + public EFrontVector GetFrontVector(ref int pSign) + { + pSign = frontVectorSign; + return frontVector; + } + + public EUpVector GetUpVector(ref int pSign) + { + pSign = upVectorSign; + return upVector; + } + + public ECoordSystem GetCoorSystem() => coordSystem; + + // public void GetMatrix(ref FbxAMatrix pMatrix) => + // throw new NotImplementedException(); + + public void ConvertChildren(FbxNode pRoot, ref FbxAxisSystem pSrcSystem) => + throw new NotImplementedException(); + + #endregion + + #region Constructor and Destructor + + public FbxAxisSystem() + { + upVector = EUpVector.eYAxis; + upVectorSign = 1; + frontVector = EFrontVector.eParityOdd; + frontVectorSign = 1; + coordSystem = ECoordSystem.eRightHanded; + } + + public FbxAxisSystem(EUpVector pUpVector, EFrontVector pFrontVector, ECoordSystem pCoorSystem) => + throw new NotImplementedException(); + + public FbxAxisSystem(FbxAxisSystem pAxisSystem) => + throw new NotImplementedException(); + + public FbxAxisSystem(EPreDefinedAxisSystem pAxisSystem) => + throw new NotImplementedException(); + + public virtual void Dispose() => + // ~FbxAxisSystem + throw new NotImplementedException(); + + public static bool ParseAxisSystem(string pAxes, ref FbxAxisSystem pOutput) => + throw new NotImplementedException(); + + #endregion + + private EUpVector upVector; + private int upVectorSign; + private EFrontVector frontVector; + private int frontVectorSign; + private ECoordSystem coordSystem; +} \ No newline at end of file diff --git a/FbxSharp/FbxCamera.cs b/FbxSharp/FbxCamera.cs index b7d3aa7..2d112bd 100644 --- a/FbxSharp/FbxCamera.cs +++ b/FbxSharp/FbxCamera.cs @@ -4,114 +4,222 @@ namespace FbxSharp { public class FbxCamera : FbxNodeAttribute { - public FbxCamera(string name="") + public FbxCamera(string name = "") : base(name) { - Properties.Add(Position); - Properties.Add(UpVector); - Properties.Add(InterestPosition); - Properties.Add(Roll); - Properties.Add(OpticalCenterX); - Properties.Add(OpticalCenterY); - Properties.Add(BackgroundColor); - Properties.Add(TurnTable); - Properties.Add(DisplayTurnTableIcon); - Properties.Add(UseMotionBlur); - Properties.Add(UseRealTimeMotionBlur); - Properties.Add(MotionBlurIntensity); - Properties.Add(AspectRatioMode); - Properties.Add(AspectWidth); - Properties.Add(AspectHeight); - Properties.Add(PixelAspectRatio); - Properties.Add(ApertureMode); - Properties.Add(GateFit); - Properties.Add(FieldOfView); - Properties.Add(FieldOfViewX); - Properties.Add(FieldOfViewY); - Properties.Add(FocalLength); - Properties.Add(CameraFormat); - Properties.Add(UseFrameColor); - Properties.Add(FrameColor); - Properties.Add(ShowName); - Properties.Add(ShowInfoOnMoving); - Properties.Add(ShowGrid); - Properties.Add(ShowOpticalCenter); - Properties.Add(ShowAzimut); - Properties.Add(ShowTimeCode); - Properties.Add(ShowAudio); - Properties.Add(AudioColor); - Properties.Add(NearPlane); - Properties.Add(FarPlane); - Properties.Add(AutoComputeClipPlanes); - Properties.Add(FilmWidth); - Properties.Add(FilmHeight); - Properties.Add(FilmAspectRatio); - Properties.Add(FilmSqueezeRatio); - Properties.Add(FilmFormat); - Properties.Add(FilmOffsetX); - Properties.Add(FilmOffsetY); - Properties.Add(PreScale); - Properties.Add(FilmTranslateX); - Properties.Add(FilmTranslateY); - Properties.Add(FilmRollPivotX); - Properties.Add(FilmRollPivotY); - Properties.Add(FilmRollValue); - Properties.Add(FilmRollOrder); - Properties.Add(ViewCameraToLookAt); - Properties.Add(ViewFrustumNearFarPlane); - Properties.Add(ViewFrustumBackPlaneMode); - Properties.Add(BackPlaneDistance); - Properties.Add(BackPlaneDistanceMode); - Properties.Add(ViewFrustumFrontPlaneMode); - Properties.Add(FrontPlaneDistance); - Properties.Add(FrontPlaneDistanceMode); - Properties.Add(LockMode); - Properties.Add(LockInterestNavigation); - Properties.Add(BackPlateFitImage); - Properties.Add(BackPlateCrop); - Properties.Add(BackPlateCenter); - Properties.Add(BackPlateKeepRatio); - Properties.Add(BackgroundAlphaTreshold); - Properties.Add(BackPlaneOffsetX); - Properties.Add(BackPlaneOffsetY); - Properties.Add(BackPlaneRotation); - Properties.Add(BackPlaneScaleX); - Properties.Add(BackPlaneScaleY); - Properties.Add(ShowBackplate); - Properties.Add(BackgroundTexture); - Properties.Add(FrontPlateFitImage); - Properties.Add(FrontPlateCrop); - Properties.Add(FrontPlateCenter); - Properties.Add(FrontPlateKeepRatio); - Properties.Add(ShowFrontplate); - Properties.Add(FrontPlaneOffsetX); - Properties.Add(FrontPlaneOffsetY); - Properties.Add(FrontPlaneRotation); - Properties.Add(FrontPlaneScaleX); - Properties.Add(FrontPlaneScaleY); - Properties.Add(ForegroundTexture); - Properties.Add(ForegroundOpacity); - Properties.Add(DisplaySafeArea); - Properties.Add(DisplaySafeAreaOnRender); - Properties.Add(SafeAreaDisplayStyle); - Properties.Add(SafeAreaAspectRatio); - Properties.Add(Use2DMagnifierZoom); - Properties.Add(_2DMagnifierZoom); - Properties.Add(_2DMagnifierX); - Properties.Add(_2DMagnifierY); - Properties.Add(ProjectionType); - Properties.Add(OrthoZoom); - Properties.Add(UseRealTimeDOFAndAA); - Properties.Add(UseDepthOfField); - Properties.Add(FocusSource); - Properties.Add(FocusAngle); - Properties.Add(FocusDistance); - Properties.Add(UseAntialiasing); - Properties.Add(AntialiasingIntensity); - Properties.Add(AntialiasingMethod); - Properties.Add(UseAccumulationBuffer); - Properties.Add(FrameSamplingCount); - Properties.Add(FrameSamplingType); + Position = FbxPropertyT.StaticInit(this, "Position", + FbxVector3.Zero, false); + UpVector = FbxPropertyT.StaticInit(this, "UpVector", + FbxVector3.Zero, false); + InterestPosition = FbxPropertyT.StaticInit(this, + "InterestPosition", FbxVector3.Zero, false); + Roll = FbxPropertyT.StaticInit(this, "Roll", 0.0, false); + OpticalCenterX = FbxPropertyT.StaticInit(this, + "OpticalCenterX", 0.0, false); + OpticalCenterY = FbxPropertyT.StaticInit(this, + "OpticalCenterY", 0.0, false); + BackgroundColor = FbxPropertyT.StaticInit(this, + "BackgroundColor", FbxVector3.Zero, false); + TurnTable = FbxPropertyT.StaticInit(this, "TurnTable", + 0.0, false); + DisplayTurnTableIcon = FbxPropertyT.StaticInit(this, + "DisplayTurnTableIcon", false, false); + UseMotionBlur = FbxPropertyT.StaticInit(this, + "UseMotionBlur", false, false); + UseRealTimeMotionBlur = FbxPropertyT.StaticInit(this, + "UseRealTimeMotionBlur", false, false); + MotionBlurIntensity = FbxPropertyT.StaticInit(this, + "Motion Blur Intensity", 0.0, false); + AspectRatioMode = FbxPropertyT.StaticInit(this, + "AspectRatioMode", null, default, false); + AspectWidth = FbxPropertyT.StaticInit(this, "AspectWidth", + 0.0, false); + AspectHeight = FbxPropertyT.StaticInit(this, + "AspectHeight", 0.0, false); + PixelAspectRatio = FbxPropertyT.StaticInit(this, + "PixelAspectRatio", 0.0, false); + ApertureMode = FbxPropertyT.StaticInit(this, + "ApertureMode", null, default, false); + GateFit = FbxPropertyT.StaticInit(this, "GateFit", null, + default, false); + FieldOfView = FbxPropertyT.StaticInit(this, "FieldOfView", + 0.0, false); + FieldOfViewX = FbxPropertyT.StaticInit(this, + "FieldOfViewX", 0.0, false); + FieldOfViewY = FbxPropertyT.StaticInit(this, + "FieldOfViewY", 0.0, false); + FocalLength = FbxPropertyT.StaticInit(this, "FocalLength", + 0.0, false); + CameraFormat = FbxPropertyT.StaticInit(this, + "CameraFormat", null, default, false); + UseFrameColor = FbxPropertyT.StaticInit(this, + "UseFrameColor", false, false); + FrameColor = FbxPropertyT.StaticInit(this, + "FrameColor", FbxVector3.Zero, false); + ShowName = FbxPropertyT.StaticInit(this, "ShowName", false, + false); + ShowInfoOnMoving = FbxPropertyT.StaticInit(this, + "ShowInfoOnMoving", false, false); + ShowGrid = FbxPropertyT.StaticInit(this, "ShowGrid", false, + false); + ShowOpticalCenter = FbxPropertyT.StaticInit(this, + "ShowOpticalCenter", false, false); + ShowAzimut = FbxPropertyT.StaticInit(this, "ShowAzimut", + false, false); + ShowTimeCode = FbxPropertyT.StaticInit(this, "ShowTimeCode", + false, false); + ShowAudio = FbxPropertyT.StaticInit(this, "ShowAudio", + false, false); + AudioColor = FbxPropertyT.StaticInit(this, + "AudioColor", FbxVector3.Zero, false); + NearPlane = FbxPropertyT.StaticInit(this, "NearPlane", + 0.0, false); + FarPlane = FbxPropertyT.StaticInit(this, "FarPlane", 0.0, + false); + AutoComputeClipPlanes = FbxPropertyT.StaticInit(this, + "AutoComputeClipPanes", false, false); + FilmWidth = FbxPropertyT.StaticInit(this, "FilmWidth", + 0.0, false); + FilmHeight = FbxPropertyT.StaticInit(this, "FilmHeight", + 0.0, false); + FilmAspectRatio = FbxPropertyT.StaticInit(this, + "FilmAspectRatio", 0.0, false); + FilmSqueezeRatio = FbxPropertyT.StaticInit(this, + "FilmSqueezeRatio", 0.0, false); + FilmFormat = FbxPropertyT.StaticInit(this, + "FilmFormatIndex", null, default, false); + FilmOffsetX = FbxPropertyT.StaticInit(this, + "FilmOffsetX", 0.0, false); + FilmOffsetY = FbxPropertyT.StaticInit(this, "FilmOffsetY", + 0.0, false); + PreScale = FbxPropertyT.StaticInit(this, "PreScale", 0.0, + false); + FilmTranslateX = FbxPropertyT.StaticInit(this, + "FilmTranslateX", 0.0, false); + FilmTranslateY = FbxPropertyT.StaticInit(this, + "FilmTranslateY", 0.0, false); + FilmRollPivotX = FbxPropertyT.StaticInit(this, + "FilmRollPivotX", 0.0, false); + FilmRollPivotY = FbxPropertyT.StaticInit(this, + "FilmRollPivotY", 0.0, false); + FilmRollValue = FbxPropertyT.StaticInit(this, + "FilmRollValue", 0.0, false); + FilmRollOrder = FbxPropertyT.StaticInit(this, + "FilmRollOrder", null, default, false); + ViewCameraToLookAt = FbxPropertyT.StaticInit(this, + "ViewCameraToLookAt", false, false); + ViewFrustumNearFarPlane = FbxPropertyT.StaticInit(this, + "ViewFrustumNearFarPlane", false, false); + ViewFrustumBackPlaneMode = + FbxPropertyT.StaticInit(this, + "ViewFrustumBackPlaneMode", null, default, false); + BackPlaneDistance = FbxPropertyT.StaticInit(this, + "BackPlaneDistance", 0.0, false); + BackPlaneDistanceMode = + FbxPropertyT.StaticInit(this, + "BackPlaneDistanceMode", null, default, false); + ViewFrustumFrontPlaneMode = + FbxPropertyT.StaticInit(this, + "ViewFrustumFrontPlaneMode", null, default, false); + FrontPlaneDistance = FbxPropertyT.StaticInit(this, + "FrontPlaneDistance", 0.0, false); + FrontPlaneDistanceMode = + FbxPropertyT.StaticInit(this, + "FrontPlaneDistanceMode", null, default, false); + LockMode = FbxPropertyT.StaticInit(this, "LockMode", false, + false); + LockInterestNavigation = FbxPropertyT.StaticInit(this, + "LockInterestNavigation", false, false); + BackPlateFitImage = FbxPropertyT.StaticInit(this, + "BackPlateFitImage", false, false); + BackPlateCrop = FbxPropertyT.StaticInit(this, + "BackPlateCrop", false, false); + BackPlateCenter = FbxPropertyT.StaticInit(this, + "BackPlateCenter", false, false); + BackPlateKeepRatio = FbxPropertyT.StaticInit(this, + "BackPlateKeepRatio", false, false); + BackgroundAlphaTreshold = FbxPropertyT.StaticInit(this, + "BackgroundAlphaTreshold", 0.0, false); + BackPlaneOffsetX = FbxPropertyT.StaticInit(this, + "BackPlaneOffsetX", 0.0, false); + BackPlaneOffsetY = FbxPropertyT.StaticInit(this, + "BackPlaneOffsetY", 0.0, false); + BackPlaneRotation = FbxPropertyT.StaticInit(this, + "BackPlaneRotation", 0.0, false); + BackPlaneScaleX = FbxPropertyT.StaticInit(this, + "BackPlaneScaleX", 0.0, false); + BackPlaneScaleY = FbxPropertyT.StaticInit(this, + "BackPlaneScaleY", 0.0, false); + ShowBackplate = FbxPropertyT.StaticInit(this, + "ShowBackplate", false, false); + BackgroundTexture = FbxPropertyT.StaticInit(this, + "Background Texture", null, default, false); + FrontPlateFitImage = FbxPropertyT.StaticInit(this, + "FrontPlateFitImage", false, false); + FrontPlateCrop = FbxPropertyT.StaticInit(this, + "FrontPlateCrop", false, false); + FrontPlateCenter = FbxPropertyT.StaticInit(this, + "FrontPlateCenter", false, false); + FrontPlateKeepRatio = FbxPropertyT.StaticInit(this, + "FrontPlateKeepRatio", false, false); + ShowFrontplate = FbxPropertyT.StaticInit(this, + "ShowFrontplate", false, false); + FrontPlaneOffsetX = FbxPropertyT.StaticInit(this, + "FrontPlaneOffsetX", 0.0, false); + FrontPlaneOffsetY = FbxPropertyT.StaticInit(this, + "FrontPlaneOffsetY", 0.0, false); + FrontPlaneRotation = FbxPropertyT.StaticInit(this, + "FrontPlaneRotation", 0.0, false); + FrontPlaneScaleX = FbxPropertyT.StaticInit(this, + "FrontPlaneScaleX", 0.0, false); + FrontPlaneScaleY = FbxPropertyT.StaticInit(this, + "FrontPlaneScaleY", 0.0, false); + ForegroundTexture = FbxPropertyT.StaticInit(this, + "Foreground Texture", null, default, false); + ForegroundOpacity = FbxPropertyT.StaticInit(this, + "Foreground Opacity", 0.0, false); + DisplaySafeArea = FbxPropertyT.StaticInit(this, + "DisplaySafeArea", false, false); + DisplaySafeAreaOnRender = FbxPropertyT.StaticInit(this, + "DisplaySafeAreaOnRender", false, false); + SafeAreaDisplayStyle = FbxPropertyT.StaticInit( + this, "SafeAreaDisplayStyle", null, default, false); + SafeAreaAspectRatio = FbxPropertyT.StaticInit(this, + "SafeAreaAspectRatio", 0.0, false); + Use2DMagnifierZoom = FbxPropertyT.StaticInit(this, + "Use2DMagnifierZoom", false, false); + _2DMagnifierZoom = FbxPropertyT.StaticInit(this, + "2D Magnifier Zoom", 0.0, false); + _2DMagnifierX = FbxPropertyT.StaticInit(this, + "2D Magnifier X", 0.0, false); + _2DMagnifierY = FbxPropertyT.StaticInit(this, + "2D Magnifier Y", 0.0, false); + ProjectionType = FbxPropertyT.StaticInit(this, + "CameraProjectionType", null, default, false); + OrthoZoom = FbxPropertyT.StaticInit(this, "OrthoZoom", + 0.0, false); + UseRealTimeDOFAndAA = FbxPropertyT.StaticInit(this, + "UseRealTimeDOFAndAA", false, false); + UseDepthOfField = FbxPropertyT.StaticInit(this, + "UseDepthOfField", false, false); + FocusSource = FbxPropertyT.StaticInit(this, + "FocusSource", null, default, false); + FocusAngle = FbxPropertyT.StaticInit(this, "FocusAngle", + 0.0, false); + FocusDistance = FbxPropertyT.StaticInit(this, + "FocusDistance", 0.0, false); + UseAntialiasing = FbxPropertyT.StaticInit(this, + "UseAntialiasing", false, false); + AntialiasingIntensity = FbxPropertyT.StaticInit(this, + "AntialiasingIntensity", 0.0, false); + AntialiasingMethod = FbxPropertyT.StaticInit( + this, "AntialiasingMethod", null, default, false); + UseAccumulationBuffer = FbxPropertyT.StaticInit(this, + "UseAccumulationBuffer", false, false); + FrameSamplingCount = FbxPropertyT.StaticInit(this, + "FrameSamplingCount", 0, false); + FrameSamplingType = FbxPropertyT.StaticInit(this, + "FrameSamplingType", null, default, false); } #region implemented abstract members of NodeAttribute @@ -145,111 +253,117 @@ public void Reset() #region Public Attributes - public FbxPropertyT Position = new FbxPropertyT ("Position"); - public FbxPropertyT UpVector = new FbxPropertyT ("UpVector"); - public FbxPropertyT InterestPosition = new FbxPropertyT ("InterestPosition"); - public FbxPropertyT Roll = new FbxPropertyT ("Roll"); - public FbxPropertyT OpticalCenterX = new FbxPropertyT ("OpticalCenterX"); - public FbxPropertyT OpticalCenterY = new FbxPropertyT ("OpticalCenterY"); - public FbxPropertyT BackgroundColor = new FbxPropertyT ("BackgroundColor"); - public FbxPropertyT TurnTable = new FbxPropertyT ("TurnTable"); - public FbxPropertyT DisplayTurnTableIcon = new FbxPropertyT ("DisplayTurnTableIcon"); - public FbxPropertyT UseMotionBlur = new FbxPropertyT ("UseMotionBlur"); - public FbxPropertyT UseRealTimeMotionBlur = new FbxPropertyT ("UseRealTimeMotionBlur"); - public FbxPropertyT MotionBlurIntensity = new FbxPropertyT ("Motion Blur Intensity"); - public FbxPropertyT AspectRatioMode = new FbxPropertyT ("AspectRatioMode"); - public FbxPropertyT AspectWidth = new FbxPropertyT ("AspectWidth"); - public FbxPropertyT AspectHeight = new FbxPropertyT ("AspectHeight"); - public FbxPropertyT PixelAspectRatio = new FbxPropertyT ("PixelAspectRatio"); - public FbxPropertyT ApertureMode = new FbxPropertyT ("ApertureMode"); - public FbxPropertyT GateFit = new FbxPropertyT ("GateFit"); - public FbxPropertyT FieldOfView = new FbxPropertyT ("FieldOfView"); - public FbxPropertyT FieldOfViewX = new FbxPropertyT ("FieldOfViewX"); - public FbxPropertyT FieldOfViewY = new FbxPropertyT ("FieldOfViewY"); - public FbxPropertyT FocalLength = new FbxPropertyT ("FocalLength"); - public FbxPropertyT CameraFormat = new FbxPropertyT ("CameraFormat"); - public FbxPropertyT UseFrameColor = new FbxPropertyT ("UseFrameColor"); - public FbxPropertyT FrameColor = new FbxPropertyT ("FrameColor"); - public FbxPropertyT ShowName = new FbxPropertyT ("ShowName"); - public FbxPropertyT ShowInfoOnMoving = new FbxPropertyT ("ShowInfoOnMoving"); - public FbxPropertyT ShowGrid = new FbxPropertyT ("ShowGrid"); - public FbxPropertyT ShowOpticalCenter = new FbxPropertyT ("ShowOpticalCenter"); - public FbxPropertyT ShowAzimut = new FbxPropertyT ("ShowAzimut"); - public FbxPropertyT ShowTimeCode = new FbxPropertyT ("ShowTimeCode"); - public FbxPropertyT ShowAudio = new FbxPropertyT ("ShowAudio"); - public FbxPropertyT AudioColor = new FbxPropertyT ("AudioColor"); - public FbxPropertyT NearPlane = new FbxPropertyT ("NearPlane"); - public FbxPropertyT FarPlane = new FbxPropertyT ("FarPlane"); - public FbxPropertyT AutoComputeClipPlanes = new FbxPropertyT ("AutoComputeClipPanes"); - public FbxPropertyT FilmWidth = new FbxPropertyT ("FilmWidth"); - public FbxPropertyT FilmHeight = new FbxPropertyT ("FilmHeight"); - public FbxPropertyT FilmAspectRatio = new FbxPropertyT ("FilmAspectRatio"); - public FbxPropertyT FilmSqueezeRatio = new FbxPropertyT ("FilmSqueezeRatio"); - public FbxPropertyT FilmFormat = new FbxPropertyT ("FilmFormatIndex"); - public FbxPropertyT FilmOffsetX = new FbxPropertyT ("FilmOffsetX"); - public FbxPropertyT FilmOffsetY = new FbxPropertyT ("FilmOffsetY"); - public FbxPropertyT PreScale = new FbxPropertyT ("PreScale"); - public FbxPropertyT FilmTranslateX = new FbxPropertyT ("FilmTranslateX"); - public FbxPropertyT FilmTranslateY = new FbxPropertyT ("FilmTranslateY"); - public FbxPropertyT FilmRollPivotX = new FbxPropertyT ("FilmRollPivotX"); - public FbxPropertyT FilmRollPivotY = new FbxPropertyT ("FilmRollPivotY"); - public FbxPropertyT FilmRollValue = new FbxPropertyT ("FilmRollValue"); - public FbxPropertyT FilmRollOrder = new FbxPropertyT ("FilmRollOrder"); - public FbxPropertyT ViewCameraToLookAt = new FbxPropertyT ("ViewCameraToLookAt"); - public FbxPropertyT ViewFrustumNearFarPlane = new FbxPropertyT ("ViewFrustumNearFarPlane"); - public FbxPropertyT ViewFrustumBackPlaneMode = new FbxPropertyT ("ViewFrustumBackPlaneMode"); - public FbxPropertyT BackPlaneDistance = new FbxPropertyT ("BackPlaneDistance"); - public FbxPropertyT BackPlaneDistanceMode = new FbxPropertyT("BackPlaneDistanceMode"); - public FbxPropertyT ViewFrustumFrontPlaneMode = new FbxPropertyT ("ViewFrustumFrontPlaneMode"); - public FbxPropertyT FrontPlaneDistance = new FbxPropertyT ("FrontPlaneDistance"); - public FbxPropertyT FrontPlaneDistanceMode = new FbxPropertyT("FrontPlaneDistanceMode"); - public FbxPropertyT LockMode = new FbxPropertyT ("LockMode"); - public FbxPropertyT LockInterestNavigation = new FbxPropertyT ("LockInterestNavigation"); - public FbxPropertyT BackPlateFitImage = new FbxPropertyT ("BackPlateFitImage"); - public FbxPropertyT BackPlateCrop = new FbxPropertyT ("BackPlateCrop"); - public FbxPropertyT BackPlateCenter = new FbxPropertyT ("BackPlateCenter"); - public FbxPropertyT BackPlateKeepRatio = new FbxPropertyT ("BackPlateKeepRatio"); - public FbxPropertyT BackgroundAlphaTreshold = new FbxPropertyT ("BackgroundAlphaTreshold"); - public FbxPropertyT BackPlaneOffsetX = new FbxPropertyT ("BackPlaneOffsetX"); - public FbxPropertyT BackPlaneOffsetY = new FbxPropertyT ("BackPlaneOffsetY"); - public FbxPropertyT BackPlaneRotation = new FbxPropertyT ("BackPlaneRotation"); - public FbxPropertyT BackPlaneScaleX = new FbxPropertyT ("BackPlaneScaleX"); - public FbxPropertyT BackPlaneScaleY = new FbxPropertyT ("BackPlaneScaleY"); - public FbxPropertyT ShowBackplate = new FbxPropertyT ("ShowBackplate"); - public FbxPropertyT BackgroundTexture = new FbxPropertyT ("Background Texture"); - public FbxPropertyT FrontPlateFitImage = new FbxPropertyT ("FrontPlateFitImage"); - public FbxPropertyT FrontPlateCrop = new FbxPropertyT ("FrontPlateCrop"); - public FbxPropertyT FrontPlateCenter = new FbxPropertyT ("FrontPlateCenter"); - public FbxPropertyT FrontPlateKeepRatio = new FbxPropertyT ("FrontPlateKeepRatio"); - public FbxPropertyT ShowFrontplate = new FbxPropertyT ("ShowFrontplate"); - public FbxPropertyT FrontPlaneOffsetX = new FbxPropertyT ("FrontPlaneOffsetX"); - public FbxPropertyT FrontPlaneOffsetY = new FbxPropertyT ("FrontPlaneOffsetY"); - public FbxPropertyT FrontPlaneRotation = new FbxPropertyT ("FrontPlaneRotation"); - public FbxPropertyT FrontPlaneScaleX = new FbxPropertyT ("FrontPlaneScaleX"); - public FbxPropertyT FrontPlaneScaleY = new FbxPropertyT ("FrontPlaneScaleY"); - public FbxPropertyT ForegroundTexture = new FbxPropertyT ("Foreground Texture"); - public FbxPropertyT ForegroundOpacity = new FbxPropertyT ("Foreground Opacity"); - public FbxPropertyT DisplaySafeArea = new FbxPropertyT ("DisplaySafeArea"); - public FbxPropertyT DisplaySafeAreaOnRender = new FbxPropertyT ("DisplaySafeAreaOnRender"); - public FbxPropertyT SafeAreaDisplayStyle = new FbxPropertyT ("SafeAreaDisplayStyle"); - public FbxPropertyT SafeAreaAspectRatio = new FbxPropertyT ("SafeAreaAspectRatio"); - public FbxPropertyT Use2DMagnifierZoom = new FbxPropertyT ("Use2DMagnifierZoom"); - public FbxPropertyT _2DMagnifierZoom = new FbxPropertyT ("2D Magnifier Zoom"); - public FbxPropertyT _2DMagnifierX = new FbxPropertyT ("2D Magnifier X"); - public FbxPropertyT _2DMagnifierY = new FbxPropertyT ("2D Magnifier Y"); - public FbxPropertyT ProjectionType = new FbxPropertyT ("CameraProjectionType"); - public FbxPropertyT OrthoZoom = new FbxPropertyT ("OrthoZoom"); - public FbxPropertyT UseRealTimeDOFAndAA = new FbxPropertyT ("UseRealTimeDOFAndAA"); - public FbxPropertyT UseDepthOfField = new FbxPropertyT ("UseDepthOfField"); - public FbxPropertyT FocusSource = new FbxPropertyT ("FocusSource"); - public FbxPropertyT FocusAngle = new FbxPropertyT ("FocusAngle"); - public FbxPropertyT FocusDistance = new FbxPropertyT ("FocusDistance"); - public FbxPropertyT UseAntialiasing = new FbxPropertyT ("UseAntialiasing"); - public FbxPropertyT AntialiasingIntensity = new FbxPropertyT ("AntialiasingIntensity"); - public FbxPropertyT AntialiasingMethod = new FbxPropertyT ("AntialiasingMethod"); - public FbxPropertyT UseAccumulationBuffer = new FbxPropertyT ("UseAccumulationBuffer"); - public FbxPropertyT FrameSamplingCount = new FbxPropertyT ("FrameSamplingCount"); - public FbxPropertyT FrameSamplingType = new FbxPropertyT ("FrameSamplingType"); + public FbxPropertyT Position; + public FbxPropertyT UpVector; + public FbxPropertyT InterestPosition; + public FbxPropertyT Roll; + public FbxPropertyT OpticalCenterX; + public FbxPropertyT OpticalCenterY; + public FbxPropertyT BackgroundColor; + public FbxPropertyT TurnTable; + public FbxPropertyT DisplayTurnTableIcon; + public FbxPropertyT UseMotionBlur; + public FbxPropertyT UseRealTimeMotionBlur; + public FbxPropertyT MotionBlurIntensity; + public FbxPropertyT AspectRatioMode; + public FbxPropertyT AspectWidth; + public FbxPropertyT AspectHeight; + public FbxPropertyT PixelAspectRatio; + public FbxPropertyT ApertureMode; + public FbxPropertyT GateFit; + public FbxPropertyT FieldOfView; + public FbxPropertyT FieldOfViewX; + public FbxPropertyT FieldOfViewY; + public FbxPropertyT FocalLength; + public FbxPropertyT CameraFormat; + public FbxPropertyT UseFrameColor; + public FbxPropertyT FrameColor; + public FbxPropertyT ShowName; + public FbxPropertyT ShowInfoOnMoving; + public FbxPropertyT ShowGrid; + public FbxPropertyT ShowOpticalCenter; + public FbxPropertyT ShowAzimut; + public FbxPropertyT ShowTimeCode; + public FbxPropertyT ShowAudio; + public FbxPropertyT AudioColor; + public FbxPropertyT NearPlane; + public FbxPropertyT FarPlane; + public FbxPropertyT AutoComputeClipPlanes; + public FbxPropertyT FilmWidth; + public FbxPropertyT FilmHeight; + public FbxPropertyT FilmAspectRatio; + public FbxPropertyT FilmSqueezeRatio; + public FbxPropertyT FilmFormat; + public FbxPropertyT FilmOffsetX; + public FbxPropertyT FilmOffsetY; + public FbxPropertyT PreScale; + public FbxPropertyT FilmTranslateX; + public FbxPropertyT FilmTranslateY; + public FbxPropertyT FilmRollPivotX; + public FbxPropertyT FilmRollPivotY; + public FbxPropertyT FilmRollValue; + public FbxPropertyT FilmRollOrder; + public FbxPropertyT ViewCameraToLookAt; + public FbxPropertyT ViewFrustumNearFarPlane; + + public FbxPropertyT + ViewFrustumBackPlaneMode; + + public FbxPropertyT BackPlaneDistance; + public FbxPropertyT BackPlaneDistanceMode; + + public FbxPropertyT + ViewFrustumFrontPlaneMode; + + public FbxPropertyT FrontPlaneDistance; + public FbxPropertyT FrontPlaneDistanceMode; + public FbxPropertyT LockMode; + public FbxPropertyT LockInterestNavigation; + public FbxPropertyT BackPlateFitImage; + public FbxPropertyT BackPlateCrop; + public FbxPropertyT BackPlateCenter; + public FbxPropertyT BackPlateKeepRatio; + public FbxPropertyT BackgroundAlphaTreshold; + public FbxPropertyT BackPlaneOffsetX; + public FbxPropertyT BackPlaneOffsetY; + public FbxPropertyT BackPlaneRotation; + public FbxPropertyT BackPlaneScaleX; + public FbxPropertyT BackPlaneScaleY; + public FbxPropertyT ShowBackplate; + public FbxPropertyT BackgroundTexture; + public FbxPropertyT FrontPlateFitImage; + public FbxPropertyT FrontPlateCrop; + public FbxPropertyT FrontPlateCenter; + public FbxPropertyT FrontPlateKeepRatio; + public FbxPropertyT ShowFrontplate; + public FbxPropertyT FrontPlaneOffsetX; + public FbxPropertyT FrontPlaneOffsetY; + public FbxPropertyT FrontPlaneRotation; + public FbxPropertyT FrontPlaneScaleX; + public FbxPropertyT FrontPlaneScaleY; + public FbxPropertyT ForegroundTexture; + public FbxPropertyT ForegroundOpacity; + public FbxPropertyT DisplaySafeArea; + public FbxPropertyT DisplaySafeAreaOnRender; + public FbxPropertyT SafeAreaDisplayStyle; + public FbxPropertyT SafeAreaAspectRatio; + public FbxPropertyT Use2DMagnifierZoom; + public FbxPropertyT _2DMagnifierZoom; + public FbxPropertyT _2DMagnifierX; + public FbxPropertyT _2DMagnifierY; + public FbxPropertyT ProjectionType; + public FbxPropertyT OrthoZoom; + public FbxPropertyT UseRealTimeDOFAndAA; + public FbxPropertyT UseDepthOfField; + public FbxPropertyT FocusSource; + public FbxPropertyT FocusAngle; + public FbxPropertyT FocusDistance; + public FbxPropertyT UseAntialiasing; + public FbxPropertyT AntialiasingIntensity; + public FbxPropertyT AntialiasingMethod; + public FbxPropertyT UseAccumulationBuffer; + public FbxPropertyT FrameSamplingCount; + public FbxPropertyT FrameSamplingType; #endregion diff --git a/FbxSharp/FbxCluster.cs b/FbxSharp/FbxCluster.cs index f8ddb8f..86a02f3 100644 --- a/FbxSharp/FbxCluster.cs +++ b/FbxSharp/FbxCluster.cs @@ -141,14 +141,16 @@ public FbxMatrix GetTransformLinkMatrix(FbxMatrix pMatrix) return TransformLink; } + public FbxMatrix transformAssociateModelMatrix = FbxMatrix.Identity; + public void SetTransformAssociateModelMatrix(FbxMatrix pMatrix) { - throw new NotImplementedException(); + transformAssociateModelMatrix = pMatrix; } public FbxMatrix GetTransformAssociateModelMatrix(FbxMatrix pMatrix) { - throw new NotImplementedException(); + return transformAssociateModelMatrix; } public void SetTransformParentMatrix(FbxMatrix pMatrix) diff --git a/FbxSharp/FbxColor.cs b/FbxSharp/FbxColor.cs index 83b145e..f056e3d 100644 --- a/FbxSharp/FbxColor.cs +++ b/FbxSharp/FbxColor.cs @@ -38,6 +38,11 @@ public FbxColor(FbxVector4 pRGBA) public readonly double Blue; public readonly double Alpha; + public double mRed => Red; + public double mGreen => Green; + public double mBlue => Blue; + public double mAlpha => Alpha; + public override string ToString() { return string.Format("{{R:{0} G:{1} B:{2} A:{3}}}", Red, Green, Blue, Alpha); diff --git a/FbxSharp/FbxConnection.cs b/FbxSharp/FbxConnection.cs index 426e1ec..304625c 100644 --- a/FbxSharp/FbxConnection.cs +++ b/FbxSharp/FbxConnection.cs @@ -15,6 +15,7 @@ public enum EType Data, LinkType, Default, + eDefault = Default, Unidirectional, } } diff --git a/FbxSharp/FbxDataType.cs b/FbxSharp/FbxDataType.cs new file mode 100644 index 0000000..b389eb7 --- /dev/null +++ b/FbxSharp/FbxDataType.cs @@ -0,0 +1,184 @@ +using System; + +namespace FbxSharp; + +public class FbxDataType +{ + #region Public Member Functions + + // public FbxDataType operator= ( FbxDataType pDataType) => throw new NotImplementedException(); + + + private readonly bool valid; + public bool Valid() => valid; + + public bool Is(FbxDataType pDataType) => + throw new NotImplementedException(); + + private EFbxType fbxType; + + [DeviationFromSdk( + "Original name conflicts with built-in method on base class")] + public EFbxType GetFbxType() => fbxType; + + [NotSdk] + public Type GetDotnetType() + { + return fbxType.ToDotnetType(); + } + + private string name; + public string GetName() => name; + + public FbxPropertyHandle GetTypeInfoHandle() => + throw new NotImplementedException(); + + #endregion + + #region Static Public Member Functions + + public static FbxDataType Create(string pName, EFbxType pType, + bool valid = true) => + new(pName, pType, valid); + + public static FbxDataType Create(string pName, FbxDataType pDataType) => + Create(pName, pDataType.GetFbxType()); + + #endregion + + #region Constructor and Destructor + + public FbxDataType() + : this("", EFbxType.eFbxUndefined) + { + } + + public FbxDataType(FbxDataType pDataType) + : this(pDataType.GetName(), pDataType.GetFbxType()) + { + } + + void Destroy() => throw new NotImplementedException(); + + public FbxDataType(FbxPropertyHandle pTypeInfoHandle) + : this(pTypeInfoHandle.GetName(), pTypeInfoHandle.GetFbxType()) + { + } + + // ~FbxDataType() + // { + // } + + [NotSdk] + public FbxDataType(string name, EFbxType fbxType, bool valid = true) + { + this.name = name; + this.fbxType = fbxType; + this.valid = valid; + } + + #endregion + + #region boolean operation + + // public static bool operator ==(FbxDataType pDataType) + // { + // } + // + // public static bool operator !=(FbxDataType pDataType) + // { + // } + + #endregion + + /// + /// Get the FbxDataType object associated with the given EFbxType enum + /// value. + /// + /// + /// + [DeviationFromSdk( + "FBXSDK_DLL const FbxDataType& FbxGetDataTypeFromEnum(" + + "const EFbxType pType);", + "Function in global namespace converted to static method")] + public static FbxDataType FbxGetDataTypeFromEnum(EFbxType pType) + { + switch (pType) + { + case EFbxType.eFbxUndefined: + return FbxDataTypes.FbxUndefinedDT; + case EFbxType.eFbxChar: + return FbxDataTypes.FbxCharDT; + case EFbxType.eFbxUChar: + return FbxDataTypes.FbxUCharDT; + case EFbxType.eFbxShort: + return FbxDataTypes.FbxShortDT; + case EFbxType.eFbxUShort: + return FbxDataTypes.FbxUShortDT; + case EFbxType.eFbxUInt: + return FbxDataTypes.FbxUIntDT; + case EFbxType.eFbxLongLong: + return FbxDataTypes.FbxLongLongDT; + case EFbxType.eFbxULongLong: + return FbxDataTypes.FbxULongLongDT; + case EFbxType.eFbxHalfFloat: + return FbxDataTypes.FbxHalfFloatDT; + case EFbxType.eFbxBool: + return FbxDataTypes.FbxBoolDT; + case EFbxType.eFbxInt: + return FbxDataTypes.FbxIntDT; + case EFbxType.eFbxFloat: + return FbxDataTypes.FbxFloatDT; + case EFbxType.eFbxDouble: + return FbxDataTypes.FbxDoubleDT; + case EFbxType.eFbxDouble2: + return FbxDataTypes.FbxDouble2DT; + case EFbxType.eFbxDouble3: + return FbxDataTypes.FbxDouble3DT; + case EFbxType.eFbxDouble4: + return FbxDataTypes.FbxDouble4DT; + case EFbxType.eFbxDouble4x4: + return FbxDataTypes.FbxDouble4x4DT; + case EFbxType.eFbxEnum: + return FbxDataTypes.FbxEnumDT; + case EFbxType.eFbxEnumM: + return FbxDataTypes.FbxEnumDT; + case EFbxType.eFbxString: + return FbxDataTypes.FbxStringDT; + case EFbxType.eFbxTime: + return FbxDataTypes.FbxTimeDT; + case EFbxType.eFbxReference: + return FbxDataTypes.FbxReferenceDT; + case EFbxType.eFbxBlob: + return FbxDataTypes.FbxBlobDT; + case EFbxType.eFbxDistance: + return FbxDataTypes.FbxDistanceDT; + case EFbxType.eFbxDateTime: + return FbxDataTypes.FbxDateTimeDT; + default: + throw new ArgumentOutOfRangeException(nameof(pType), pType, null); + } + } + + /// + /// Get the data type name used by iO operations. + /// + /// This is only used during I/O operations. It is not the same as the + /// data type's actual name. + /// + /// + /// + /// + [DeviationFromSdk( + "FBXSDK_DLL const char* FbxGetDataTypeNameForIO(" + + "const FbxDataType& pDataType)", + "Function in global namespace converted to static method")] + public static string FbxGetDataTypeNameForIO(FbxDataType pDataType) => + throw new NotImplementedException(); + + [NotSdk] + public override string ToString() + { + return $"FbxDataType(\"{name}\")"; + } +} diff --git a/FbxSharp/FbxDataTypes.cs b/FbxSharp/FbxDataTypes.cs new file mode 100644 index 0000000..890384b --- /dev/null +++ b/FbxSharp/FbxDataTypes.cs @@ -0,0 +1,375 @@ +namespace FbxSharp; + +public static class FbxDataTypes +{ + #region Basic Data Types + + public static readonly FbxDataType FbxUndefinedDT = + FbxDataType.Create("", EFbxType.eFbxUndefined, false); + + public static readonly FbxDataType FbxBoolDT = + FbxDataType.Create("Bool", EFbxType.eFbxBool); + + public static readonly FbxDataType FbxCharDT = + FbxDataType.Create("Byte", EFbxType.eFbxChar); + + public static readonly FbxDataType FbxUCharDT = + FbxDataType.Create("UByte", EFbxType.eFbxUChar); + + public static readonly FbxDataType FbxShortDT = + FbxDataType.Create("Short", EFbxType.eFbxShort); + + public static readonly FbxDataType FbxUShortDT = + FbxDataType.Create("UShort", EFbxType.eFbxUShort); + + public static readonly FbxDataType FbxIntDT = + FbxDataType.Create("Integer", EFbxType.eFbxInt); + + public static readonly FbxDataType FbxUIntDT = + FbxDataType.Create("UInteger", EFbxType.eFbxUInt); + + public static readonly FbxDataType FbxLongLongDT = + FbxDataType.Create("LongLong", EFbxType.eFbxLongLong); + + public static readonly FbxDataType FbxULongLongDT = + FbxDataType.Create("ULongLong", EFbxType.eFbxULongLong); + + public static readonly FbxDataType FbxFloatDT = + FbxDataType.Create("Float", EFbxType.eFbxFloat); + + public static readonly FbxDataType FbxHalfFloatDT = + FbxDataType.Create("HalfFloat", EFbxType.eFbxHalfFloat); + + public static readonly FbxDataType FbxDoubleDT = + FbxDataType.Create("Number", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxDouble2DT = + FbxDataType.Create("Vector2", EFbxType.eFbxDouble2); + + public static readonly FbxDataType FbxDouble3DT = + FbxDataType.Create("Vector", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxDouble4DT = + FbxDataType.Create("Vector4", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxDouble4x4DT = + FbxDataType.Create("Matrix", EFbxType.eFbxDouble4x4); + + public static readonly FbxDataType FbxEnumDT = + FbxDataType.Create("Enum", EFbxType.eFbxEnum); + + public static readonly FbxDataType FbxStringDT = + FbxDataType.Create("KString", EFbxType.eFbxString); + + public static readonly FbxDataType FbxTimeDT = + FbxDataType.Create("Time", EFbxType.eFbxTime); + + public static readonly FbxDataType FbxReferenceDT = + FbxDataType.Create("Reference", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxBlobDT = + FbxDataType.Create("Blob", EFbxType.eFbxBlob); + + public static readonly FbxDataType FbxDistanceDT = + FbxDataType.Create("Distance", EFbxType.eFbxDistance); + + public static readonly FbxDataType FbxDateTimeDT = + FbxDataType.Create("DateTime", EFbxType.eFbxDateTime); + + #endregion + + #region Extended Data Types + + public static readonly FbxDataType FbxColor3DT = + FbxDataType.Create("Color", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxColor4DT = + FbxDataType.Create("ColorAndAlpha", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxCompoundDT = + FbxDataType.Create("Compound", EFbxType.eFbxUndefined); + + public static readonly FbxDataType FbxReferenceObjectDT = + FbxDataType.Create("object", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxReferencePropertyDT = + FbxDataType.Create("ReferenceProperty", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxVisibilityDT = + FbxDataType.Create("Visibility", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxVisibilityInheritanceDT = + FbxDataType.Create("Visibility Inheritance", EFbxType.eFbxBool); + + public static readonly FbxDataType FbxUrlDT = + FbxDataType.Create("Url", EFbxType.eFbxString); + + public static readonly FbxDataType FbxXRefUrlDT = + FbxDataType.Create("XRefUrl", EFbxType.eFbxString); + + #endregion + + #region Transform Data Types + + public static readonly FbxDataType FbxTranslationDT = + FbxDataType.Create("Translation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxRotationDT = + FbxDataType.Create("Rotation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxScalingDT = + FbxDataType.Create("Scaling", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxQuaternionDT = + FbxDataType.Create("Quaternion", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxLocalTranslationDT = + FbxDataType.Create("Lcl Translation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxLocalRotationDT = + FbxDataType.Create("Lcl Rotation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxLocalScalingDT = + FbxDataType.Create("Lcl Scaling", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxLocalQuaternionDT = + FbxDataType.Create("Lcl Quaternion", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxTransformMatrixDT = + FbxDataType.Create("Matrix Transformation", EFbxType.eFbxDouble4x4); + + public static readonly FbxDataType FbxTranslationMatrixDT = + FbxDataType.Create("Matrix Translation", EFbxType.eFbxDouble4x4); + + public static readonly FbxDataType FbxRotationMatrixDT = + FbxDataType.Create("Matrix Rotation", EFbxType.eFbxDouble4x4); + + public static readonly FbxDataType FbxScalingMatrixDT = + FbxDataType.Create("Matrix Scaling", EFbxType.eFbxDouble4x4); + + #endregion + + + #region Material Data Types + + public static readonly FbxDataType FbxMaterialEmissiveDT = + FbxDataType.Create("Emissive", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialEmissiveFactorDT = + FbxDataType.Create("EmissiveFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialAmbientDT = + FbxDataType.Create("Ambient", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialAmbientFactorDT = + FbxDataType.Create("AmbientFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialDiffuseDT = + FbxDataType.Create("Diffuse", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialDiffuseFactorDT = + FbxDataType.Create("DiffuseFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialBumpDT = + FbxDataType.Create("Bump", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialNormalMapDT = + FbxDataType.Create("NormalMap", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialTransparentColorDT = + FbxDataType.Create("Transparent", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialTransparencyFactorDT = + FbxDataType.Create("TransparencyFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialSpecularDT = + FbxDataType.Create("Specular", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialSpecularFactorDT = + FbxDataType.Create("SpecularFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialShininessDT = + FbxDataType.Create("Shininess", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialReflectionDT = + FbxDataType.Create("Reflection", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialReflectionFactorDT = + FbxDataType.Create("ReflectionFactor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialDisplacementDT = + FbxDataType.Create("Displacement", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialVectorDisplacementDT = + FbxDataType.Create("VectorDisplacement", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxMaterialCommonFactorDT = + FbxDataType.Create("Unknown Factor", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxMaterialCommonTextureDT = + FbxDataType.Create("Unknown texture", EFbxType.eFbxDouble3); + + #endregion + + + #region Layer Element Data Types + + public static readonly FbxDataType FbxLayerElementUndefinedDT = + FbxDataType.Create("LayerElementUndefined", EFbxType.eFbxUndefined); + + public static readonly FbxDataType FbxLayerElementNormalDT = + FbxDataType.Create("LayerElementNormal", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxLayerElementBinormalDT = + FbxDataType.Create("LayerElementBinormal", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxLayerElementTangentDT = + FbxDataType.Create("LayerElementTangent", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxLayerElementMaterialDT = + FbxDataType.Create("LayerElementMaterial", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxLayerElementTextureDT = + FbxDataType.Create("LayerElementTexture", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxLayerElementPolygonGroupDT = + FbxDataType.Create("LayerElementPolygonGroup", EFbxType.eFbxInt); + + public static readonly FbxDataType FbxLayerElementUVDT = + FbxDataType.Create("LayerElementUV", EFbxType.eFbxDouble2); + + public static readonly FbxDataType FbxLayerElementVertexColorDT = + FbxDataType.Create("LayerElementVertexColor", EFbxType.eFbxDouble4); + + public static readonly FbxDataType FbxLayerElementSmoothingDT = + FbxDataType.Create("LayerElementSmoothing", EFbxType.eFbxInt); + + public static readonly FbxDataType FbxLayerElementCreaseDT = + FbxDataType.Create("LayerElementCrease", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxLayerElementHoleDT = + FbxDataType.Create("LayerElementHole", EFbxType.eFbxBool); + + public static readonly FbxDataType FbxLayerElementUserDataDT = + FbxDataType.Create("LayerElementUserData", EFbxType.eFbxReference); + + public static readonly FbxDataType FbxLayerElementVisibilityDT = + FbxDataType.Create("LayerElementVisibility", EFbxType.eFbxBool); + + #endregion + + + #region I/O Specialized Data Types + + public static readonly FbxDataType FbxAliasDT = + FbxDataType.Create("Alias", EFbxType.eFbxEnum); + + public static readonly FbxDataType FbxPresetsDT = + FbxDataType.Create("Presets", EFbxType.eFbxEnum); + + public static readonly FbxDataType FbxStatisticsDT = + FbxDataType.Create("Statistics", EFbxType.eFbxString); + + public static readonly FbxDataType FbxTextLineDT = + FbxDataType.Create("TextLine", EFbxType.eFbxString); + + public static readonly FbxDataType FbxUnitsDT = + FbxDataType.Create("Units", EFbxType.eFbxString); + + public static readonly FbxDataType FbxWarningDT = + FbxDataType.Create("Warning", EFbxType.eFbxString); + + public static readonly FbxDataType FbxWebDT = + FbxDataType.Create("Web", EFbxType.eFbxString); + + #endregion + + + #region External Support Data Types + + public static readonly FbxDataType FbxActionDT = + FbxDataType.Create("Action", EFbxType.eFbxBool); + + public static readonly FbxDataType FbxCameraIndexDT = + FbxDataType.Create("Camera Index", EFbxType.eFbxInt); + + public static readonly FbxDataType FbxCharPtrDT = + FbxDataType.Create("charptr", EFbxType.eFbxString); + + public static readonly FbxDataType FbxConeAngleDT = + FbxDataType.Create("Cone angle", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxEventDT = + FbxDataType.Create("event", EFbxType.eFbxUndefined); + + public static readonly FbxDataType FbxFieldOfViewDT = + FbxDataType.Create("FieldOfView", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxFieldOfViewXDT = + FbxDataType.Create("FieldOfViewX", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxFieldOfViewYDT = + FbxDataType.Create("FieldOfViewY", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxFogDT = + FbxDataType.Create("Fog", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxHSBDT = + FbxDataType.Create("HSB", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxIKReachTranslationDT = + FbxDataType.Create("IK Reach Translation", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxIKReachRotationDT = + FbxDataType.Create("IK Reach Rotation", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxIntensityDT = + FbxDataType.Create("Intensity", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxLookAtDT = + FbxDataType.Create("Look at", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxOcclusionDT = + FbxDataType.Create("Occlusion", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxOpticalCenterXDT = + FbxDataType.Create("OpticalCenterX", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxOpticalCenterYDT = + FbxDataType.Create("OpticalCenterY", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxOrientationDT = + FbxDataType.Create("Orientation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxRealDT = + FbxDataType.Create("Real", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxRollDT = + FbxDataType.Create("Roll", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxScalingUVDT = + FbxDataType.Create("Scaling UV", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxShapeDT = + FbxDataType.Create("Shape", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxStringListDT = + FbxDataType.Create("stringlist", EFbxType.eFbxEnumM); + + public static readonly FbxDataType FbxTextureRotationDT = + FbxDataType.Create("TextureRotation", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxTimeCodeDT = + FbxDataType.Create("TimeCode", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxTimeWarpDT = + FbxDataType.Create("TimeWarp", EFbxType.eFbxDouble); + + public static readonly FbxDataType FbxTranslationUVDT = + FbxDataType.Create("Translation UV", EFbxType.eFbxDouble3); + + public static readonly FbxDataType FbxWeightDT = + FbxDataType.Create("Weight", EFbxType.eFbxDouble); + + #endregion +} diff --git a/FbxSharp/FbxDateTime.cs b/FbxSharp/FbxDateTime.cs new file mode 100644 index 0000000..a5a2386 --- /dev/null +++ b/FbxSharp/FbxDateTime.cs @@ -0,0 +1,79 @@ +using System; + +namespace FbxSharp; + +public struct FbxDateTime +{ + #region Public Member Functions + + public void Clear() => throw new NotImplementedException(); + + public bool isValid() => throw new NotImplementedException(); + + #endregion + + #region Static Public Member Functions + + public static FbxDateTime currentDateTimeGMT() => + throw new NotImplementedException(); + + #endregion + + #region Constructors + + public FbxDateTime() : + this(0, 0, 0, 0, 0, 0) + { + } + + public FbxDateTime(int pDay, int pMonth, int pYear, int pHour, int pMin, + int pSec, int pMillisecond = 0) + { + setDate(pDay, pMonth, pYear); + setTime(pHour, pMin, pSec, pMillisecond); + } + + #endregion + + #region Boolean operation + + // public bool operator ==(const FbxDateTime &pRHS) + // public bool operator !=(const FbxDateTime &pRHS) + + #endregion + + #region Access + + public void setDate(int pDay, int pMonth, int pYear) + { + Year = pYear; + Month = pMonth; + Day = pDay; + } + + public void setTime(int pHour, int pMin, int pSec, int pMillisecond = 0) + { + Hour = pHour; + Minute = pMin; + Second = pSec; + Millisecond = pMillisecond; + } + + public int Year { get; private set; } + public int Month { get; private set; } + public int Day { get; private set; } + public int Hour { get; private set; } + public int Minute { get; private set; } + public int Second { get; private set; } + public int Millisecond { get; private set; } + + #endregion + + #region Operation with string + + public string toString() => ToString(); + + public bool fromString(string s) => throw new NotImplementedException(); + + #endregion +} diff --git a/FbxSharp/FbxDocument.cs b/FbxSharp/FbxDocument.cs index 9fb05c4..ef55f18 100644 --- a/FbxSharp/FbxDocument.cs +++ b/FbxSharp/FbxDocument.cs @@ -4,24 +4,155 @@ namespace FbxSharp { public class FbxDocument : FbxCollection { - public FbxDocument(string name="") + public FbxDocument(string name = "") : base(name) { - this.Properties.Add(Roots); - this.Properties.Add(ActiveAnimStackName); + Roots = FbxPropertyT.StaticInit(this, "SourceObject", + null, null, false); + ActiveAnimStackName = FbxPropertyT.StaticInit(this, + "ActiveAnimStackName", "", false); } + #region Public Types + + // typedef FbxCollection ParentClass + + #endregion + + #region Public Member Functions + + // public override FbxClassId GetClassId() => + // throw new NotImplementedException(); + + #endregion + + #region Static Public Member Functions + + static FbxDocument Create( /*FbxManager *pManager,*/ string pName) => + throw new NotImplementedException(); + + static FbxDocument Create(FbxObject pContainer, string pName) => + throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + // private static FbxClassId ClassId + + #endregion + + #region Protected Member Functions + + // virtual ~FbxDocument(); + // FbxDocument(FbxManager pManager, string pName); + + #endregion + + #region Static Protected Member Functions + + // static FbxDocument Allocate( /*FbxManager pManager,*/ string pName, FbxDocument pFrom) + + #endregion + #region Properties - public readonly FbxPropertyT Roots = new FbxPropertyT("SourceObject"); + public readonly FbxPropertyT Roots; + + #endregion + + #region Document Member Manager + + // public override void Clear() => throw new NotImplementedException(); + + public void AddRootMember(FbxObject pMember) => + throw new NotImplementedException(); + + public void RootRootRemoveMember(FbxObject pMember) => + throw new NotImplementedException(); + + public T FindRootMember(char pName) => + throw new NotImplementedException(); + + public int GetRootMemberCount() => throw new NotImplementedException(); + + public int GetRootMemberCount() => + throw new NotImplementedException(); + + public int GetRootMemberCount(FbxCriteria pCriteria) => + throw new NotImplementedException(); + + public FbxObject GetRootMember(int pIndex = 0) => + throw new NotImplementedException(); + + + public T GetRootMember(int pIndex = 0) => + throw new NotImplementedException(); + + public FbxObject GetRootMember(FbxCriteria pCriteria, int pIndex = 0) => + throw new NotImplementedException(); + + public virtual bool IsRootMember(FbxObject pMember) => + throw new NotImplementedException(); + + #endregion + + #region Document information + + private FbxDocumentInfo documentInfo = FbxDocumentInfo.Create(""); + public FbxDocumentInfo GetDocumentInfo() => documentInfo; + + public void SetDocumentInfo(FbxDocumentInfo pSceneInfo) => + documentInfo = pSceneInfo; + + #endregion + + #region Offloading management + + // public void SetPeripheral(FbxPeripheral pPeripheral); + // public override FbxPeripheral GetPeripheral(); + + public int UnloadContent(FbxStatus pStatus = null) => + throw new NotImplementedException(); + + public int LoadContent(FbxStatus pStatus = null) => + throw new NotImplementedException(); + + #endregion + + #region Referencing management + + // int GetReferencingDocuments( + // FbxArray pReferencingDocuments) => + // throw new NotImplementedException(); + // + // int GetReferencingObjects(FbxDocument pFromDoc, + // FbxArray pReferencingObjects) => + // throw new NotImplementedException(); + // + // int GetReferencedDocuments( + // FbxArray pReferencedDocuments) => + // throw new NotImplementedException(); + // + // int GetReferencedObjects(const FbxDocument pToDoc, + // FbxArray< FbxObject > pReferencedObjects) => throw new + // NotImplementedException(); + // + // FbxString GetPathToRootDocument() => + // throw new NotImplementedException(); + // + // void GetDocumentPathToRootDocument(FbxArray pDocumentPath, + // bool pFirstCall = true) => throw new NotImplementedException(); + // + // bool IsARootDocument() => throw new NotImplementedException(); #endregion #region Animation Stack Management - public readonly FbxPropertyT ActiveAnimStackName = new FbxPropertyT("ActiveAnimStackName"); + public readonly FbxPropertyT ActiveAnimStackName; - bool CreateAnimStack(string pName/*, FbxStatus *pStatus=NULL*/) + bool CreateAnimStack(string pName /*, FbxStatus *pStatus=NULL*/) { throw new NotImplementedException(); } @@ -37,6 +168,14 @@ void FillAnimStackNameArray(string[] pNameArray) } #endregion + + #region Animation Stack Information Management + + // public bool SetTakeInfo(FbxTakeInfo pTakeInfo) => + // throw new NotImplementedException(); + // public FbxTakeInfo GetTakeInfo(string pTakeName) => + // throw new NotImplementedException(); + + #endregion } } - diff --git a/FbxSharp/FbxDocumentInfo.cs b/FbxSharp/FbxDocumentInfo.cs new file mode 100644 index 0000000..52c3918 --- /dev/null +++ b/FbxSharp/FbxDocumentInfo.cs @@ -0,0 +1,161 @@ +using System; + +namespace FbxSharp; + +public class FbxDocumentInfo : FbxObject +{ + #region Public Types + + // typedef FbxObject ParentClass + + #endregion + + #region Public Member Functions + + // public override FbxClassId GetClassId() => + // throw new NotImplementedException(); + + public void Clear() => throw new NotImplementedException(); + + #region Scene Thumbnail. + + // public FbxThumbnail GetSceneThumbnail() => + // throw new NotImplementedException(); + + // public void SetSceneThumbnail(FbxThumbnail pSceneThumbnail) => + // throw new NotImplementedException(); + + #endregion + + #endregion + + #region Static Public Member Functions + + public static FbxDocumentInfo Create( /*FbxManager pManager,*/ + string pName) + { + return new FbxDocumentInfo(pName); + } + + public static FbxDocumentInfo Create(FbxObject pContainer, string pName) => + throw new NotImplementedException(); + + #endregion + + #region Public Attributes + + #region Public properties + + public FbxPropertyT LastSavedUrl; + public FbxPropertyT Url; + public FbxProperty Original; + public FbxPropertyT Original_ApplicationVendor; + public FbxPropertyT Original_ApplicationName; + public FbxPropertyT Original_ApplicationVersion; + + public FbxPropertyT Original_FileName; + + public FbxPropertyT Original_DateTime_GMT; + public FbxProperty LastSaved; + public FbxPropertyT LastSaved_ApplicationVendor; + public FbxPropertyT LastSaved_ApplicationName; + + public FbxPropertyT LastSaved_ApplicationVersion; + + public FbxPropertyT LastSaved_DateTime_GMT; + public FbxPropertyT EmbeddedUrl; + + #endregion + + #region User-defined summary data. + + public string mTitle; + public string mSubject; + public string mAuthor; + public string mKeywords; + public string mRevision; + public string mComment; + + #endregion + + #endregion + + #region Static Public Attributes + + // public static FbxClassId ClassId + + #endregion + + #region Protected Member Functions + + // protected virtual ~FbxDocumentInfo() + + protected FbxDocumentInfo( /*FbxManager pManager,*/ string pName) + : base(pName) + { + LastSavedUrl = (FbxPropertyT)FbxProperty.Create(RootProperty, + FbxDataTypes.FbxUrlDT, "DocumentUrl"); + LastSavedUrl.Set(""); + Url = (FbxPropertyT)FbxProperty.Create(RootProperty, + FbxDataTypes.FbxUrlDT, "SrcDocumentUrl"); + Url.Set(""); + + Original = FbxProperty.Create(RootProperty, FbxDataTypes.FbxCompoundDT, + "Original"); + Original.Set(""); + Original_ApplicationVendor = + (FbxPropertyT)FbxProperty.Create(Original, + FbxDataTypes.FbxStringDT, "ApplicationVendor"); + Original_ApplicationVendor.Set(""); + Original_ApplicationName = + (FbxPropertyT)FbxProperty.Create(Original, + FbxDataTypes.FbxStringDT, "ApplicationName"); + Original_ApplicationName.Set(""); + Original_ApplicationVersion = + (FbxPropertyT)FbxProperty.Create(Original, + FbxDataTypes.FbxStringDT, "ApplicationVersion"); + Original_ApplicationVersion.Set(""); + Original_FileName = (FbxPropertyT)FbxProperty.Create(Original, + FbxDataTypes.FbxStringDT, "FileName"); + Original_FileName.Set(""); + Original_DateTime_GMT = + (FbxPropertyT)FbxProperty.Create(Original, + FbxDataTypes.FbxDateTimeDT, "DateTime_GMT"); + // Original_DateTime_GMT.Set(); + + LastSaved = FbxProperty.Create(RootProperty, + FbxDataTypes.FbxCompoundDT, "LastSaved"); + LastSaved.Set(""); + LastSaved_ApplicationVendor = + (FbxPropertyT)FbxProperty.Create(LastSaved, + FbxDataTypes.FbxStringDT, "ApplicationVendor"); + LastSaved_ApplicationVendor.Set(""); + LastSaved_ApplicationName = + (FbxPropertyT)FbxProperty.Create(LastSaved, + FbxDataTypes.FbxStringDT, "ApplicationName"); + LastSaved_ApplicationName.Set(""); + LastSaved_ApplicationVersion = + (FbxPropertyT)FbxProperty.Create(LastSaved, + FbxDataTypes.FbxStringDT, "ApplicationVersion"); + LastSaved_ApplicationVersion.Set(""); + LastSaved_DateTime_GMT = + (FbxPropertyT)FbxProperty.Create(LastSaved, + FbxDataTypes.FbxDateTimeDT, "DateTime_GMT"); + // LastSaved_DateTime_GMT.Set(); + + EmbeddedUrl = (FbxPropertyT)FbxProperty.Create(RootProperty, + FbxDataTypes.FbxUrlDT, "DocumentEmbeddedUrl"); + EmbeddedUrl.Set(""); + + var sceneThumbnailProp = FbxProperty.Create(RootProperty, + FbxDataTypes.FbxReferenceObjectDT, "SceneThumbnail"); + } + + #endregion + + #region Static Protected Member Functions + + // static FbxDocumentInfo Allocate( /*FbxManager pManager,*/ string pName, FbxDocumentInfo pFrom) + + #endregion +} diff --git a/FbxSharp/FbxGeometryBase.cs b/FbxSharp/FbxGeometryBase.cs index 237db04..b3534da 100644 --- a/FbxSharp/FbxGeometryBase.cs +++ b/FbxSharp/FbxGeometryBase.cs @@ -4,14 +4,19 @@ namespace FbxSharp { public abstract class FbxGeometryBase : FbxLayerContainer { - protected FbxGeometryBase(string name="") + protected FbxGeometryBase(string name = "") : base(name) { - this.Properties.Add(PrimaryVisibility); - this.Properties.Add(CastShadow); - this.Properties.Add(ReceiveShadow); - this.Properties.Add(BBoxMin); - this.Properties.Add(BBoxMax); + PrimaryVisibility = FbxPropertyT.StaticInit(this, + "Primary Visibility", false, false); + CastShadow = FbxPropertyT.StaticInit(this, "Casts Shadows", + false, false); + ReceiveShadow = FbxPropertyT.StaticInit(this, + "Receive Shadows", false, false); + BBoxMin = FbxPropertyT.StaticInit(this, "BBoxMin", + FbxVector3.Zero, false); + BBoxMax = FbxPropertyT.StaticInit(this, "BBoxMax", + FbxVector3.Zero, false); } #region Control Points, Normals, Binormals and Tangent Management @@ -77,11 +82,11 @@ public virtual FbxVector4[] GetControlPoints(/*FbxStatus pStatus=null*/) #region Public and Fast Access Properties - public readonly FbxPropertyT PrimaryVisibility = new FbxPropertyT( "Primary Visibility"); - public readonly FbxPropertyT CastShadow = new FbxPropertyT( "Casts Shadows"); - public readonly FbxPropertyT ReceiveShadow = new FbxPropertyT( "Receive Shadows"); - public readonly FbxPropertyT BBoxMin = new FbxPropertyT("BBoxMin"); - public readonly FbxPropertyT BBoxMax = new FbxPropertyT("BBoxMax"); + public readonly FbxPropertyT PrimaryVisibility; + public readonly FbxPropertyT CastShadow; + public readonly FbxPropertyT ReceiveShadow; + public readonly FbxPropertyT BBoxMin; + public readonly FbxPropertyT BBoxMax; public void ComputeBBox() { diff --git a/FbxSharp/FbxGlobalSettings.cs b/FbxSharp/FbxGlobalSettings.cs index ae8e2d4..514d43d 100644 --- a/FbxSharp/FbxGlobalSettings.cs +++ b/FbxSharp/FbxGlobalSettings.cs @@ -4,7 +4,259 @@ namespace FbxSharp { public class FbxGlobalSettings : FbxObject { - // TODO: Fill in - } -} + #region Classes + + public struct TimeMarker + { + } + + #endregion + + #region Public Types + + // typedef FbxObject ParentClass + + #endregion + + #region Public Member Functions + + public virtual FbxClassId GetClassId() /*override*/ => + throw new NotImplementedException(); + + public void SetOriginalUpAxis(FbxAxisSystem pAxisSystem) => + throw new NotImplementedException(); + + public int GetOriginalUpAxis() => OriginalUpAxis.Get(); + + #endregion + + #region Static Public Member Functions + + public static FbxGlobalSettings Create( /*FbxManager pManager,*/ string pName) => + throw new NotImplementedException(); + + public static FbxGlobalSettings Create(FbxObject pContainer, string pName) => + throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + public static FbxClassId ClassId => + throw new NotImplementedException(); + + #endregion + + #region Protected Member Functions + + public virtual void Dispose() => + // ~FbxGlobalSettings + throw new NotImplementedException(); + + [NotSdk] + public FbxGlobalSettings() + : this("") + { + } + + public FbxGlobalSettings( /*FbxManager pManager,*/ string pName) + : base(pName) + { + UpAxis = FbxPropertyT.StaticInit(this, "UpAxis", (int)FbxAxisSystem.EUpVector.eXAxis, false); + UpAxisSign = FbxPropertyT.StaticInit(this, "UpAxisSign", 1, false); + FrontAxis = FbxPropertyT.StaticInit(this, "FrontAxis", (int)FbxAxisSystem.EFrontVector.eParityOdd, false); + FrontAxisSign = FbxPropertyT.StaticInit(this, "FrontAxisSign", 1, false); + CoordAxis = FbxPropertyT.StaticInit(this, "CoordAxis", (int)FbxAxisSystem.ECoordSystem.eRightHanded, false); + CoordAxisSign = FbxPropertyT.StaticInit(this, "CoordAxisSign", 1, false); + OriginalUpAxis = FbxPropertyT.StaticInit(this, "OriginalUpAxis", -1, false); + OriginalUpAxisSign = FbxPropertyT.StaticInit(this, "OriginalUpAxisSign", 1, false); + UnitScaleFactor = FbxPropertyT.StaticInit(this, "UnitScaleFactor", 1, false); + OriginalUnitScaleFactor = FbxPropertyT.StaticInit(this, "OriginalUnitScaleFactor", 1, false); + AmbientColor = FbxPropertyT.StaticInit(this, "AmbientColor", new FbxColor(0,0,0), false); + DefaultCamera = FbxPropertyT.StaticInit(this, "DefaultCamera", "Producer Perspective", false); + TimeMode = FbxPropertyTEnum.StaticInit(this, "TimeMode", (int)FbxTime.EMode.eDefaultMode); + TimeProtocol = FbxPropertyTEnum.StaticInit(this, "TimeProtocol", (int)FbxTime.EProtocol.eDefaultProtocol); + SnapOnFrameMode = FbxPropertyTEnum.StaticInit(this, "SnapOnFrameMode", (int)FbxGlobalSettings.ESnapOnFrameMode.eNoSnap); + TimeSpanStart = FbxPropertyT.StaticInit(this, "TimeSpanStart", new FbxTime(0), false); + TimeSpanStop = FbxPropertyT.StaticInit(this, "TimeSpanStop", new FbxTime(FbxTimeCode.FBXSDK_TC_LEGACY_SECOND), false); + CustomFrameRate = FbxPropertyT.StaticInit(this, "CustomFrameRate", -1, false); + TimeMarkerP = FbxPropertyT.StaticInit(this, "TimeMarker", null, false); + CurrentTimeMarker = FbxPropertyT.StaticInit(this, "CurrentTimeMarker", -1, false); + } + + #endregion + + [NotSdk] public readonly FbxPropertyT UpAxis; + [NotSdk] public readonly FbxPropertyT UpAxisSign; + [NotSdk] public readonly FbxPropertyT FrontAxis; + [NotSdk] public readonly FbxPropertyT FrontAxisSign; + [NotSdk] public readonly FbxPropertyT CoordAxis; + [NotSdk] public readonly FbxPropertyT CoordAxisSign; + [NotSdk] public readonly FbxPropertyT OriginalUpAxis; + [NotSdk] public readonly FbxPropertyT OriginalUpAxisSign; + [NotSdk] public readonly FbxPropertyT UnitScaleFactor; + [NotSdk] public readonly FbxPropertyT OriginalUnitScaleFactor; + [NotSdk] public readonly FbxPropertyT AmbientColor; + [NotSdk] public readonly FbxPropertyT DefaultCamera; + [NotSdk] public readonly FbxPropertyTEnum TimeMode; + [NotSdk] public readonly FbxPropertyTEnum TimeProtocol; + [NotSdk] public readonly FbxPropertyTEnum SnapOnFrameMode; + [NotSdk] public readonly FbxPropertyT TimeSpanStart; + [NotSdk] public readonly FbxPropertyT TimeSpanStop; + [NotSdk] public readonly FbxPropertyT CustomFrameRate; + [NotSdk] public readonly FbxPropertyT TimeMarkerP; + [NotSdk] public readonly FbxPropertyT CurrentTimeMarker; + private FbxSystemUnit systemUnit; + + + #region Static Protected Member Functions + + public static FbxGlobalSettings Allocate( /*FbxManager pManager,*/ string pName, FbxGlobalSettings pFrom) => + throw new NotImplementedException(); + + #endregion + + #region Axis system + + public void SetAxisSystem(FbxAxisSystem pAxisSystem) => + throw new NotImplementedException(); + + public FbxAxisSystem GetAxisSystem() => + new FbxAxisSystem(); + + #endregion + + #region System Units + + public void SetSystemUnit(FbxSystemUnit pOther) => + throw new NotImplementedException(); + + public FbxSystemUnit GetSystemUnit() => FbxSystemUnit.cm; + + public void SetOriginalSystemUnit(FbxSystemUnit pOther) => + throw new NotImplementedException(); + + public FbxSystemUnit GetOriginalSystemUnit() => FbxSystemUnit.cm; + #endregion + + #region Light Settings + + public void SetAmbientColor(FbxColor pAmbientColor) => + AmbientColor.Set(pAmbientColor); + + public FbxColor GetAmbientColor() => AmbientColor.Get(); + + #endregion + + #region Camera Settings + + public bool SetDefaultCamera(string pCameraName) + { + DefaultCamera.Set(pCameraName); + return true; + } + + public string GetDefaultCamera() => DefaultCamera.Get(); + + #endregion + + #region Time Settings + + public enum ESnapOnFrameMode + { + eNoSnap, + eSnapOnFrame, + ePlayOnFrame, + eSnapAndPlayOnFrame + } + + public void SetTimeMode(FbxTime.EMode pTimeMode) => + TimeMode.Set((int)pTimeMode); + + public FbxTime.EMode GetTimeMode() + { + var mode = (FbxTime.EMode)TimeMode.Get(); + if (mode == FbxTime.EMode.eDefaultMode) + return FbxTime.EMode.eFrames30; + return mode; + } + + public void SetTimeProtocol(FbxTime.EProtocol pTimeProtocol) => + throw new NotImplementedException(); + + public FbxTime.EProtocol GetTimeProtocol() + { + var value = (FbxTime.EProtocol)TimeProtocol.Get(); + if (value == FbxTime.EProtocol.eDefaultProtocol) + return FbxTime.EProtocol.eFrameCount; + return value; + } + + public void SetSnapOnFrameMode(ESnapOnFrameMode pSnapOnFrameMode) => + SnapOnFrameMode.Set((int)pSnapOnFrameMode); + + public ESnapOnFrameMode GetSnapOnFrameMode() => + (ESnapOnFrameMode)SnapOnFrameMode.Get(); + + public void SetTimelineDefaultTimeSpan(FbxTimeSpan pTimeSpan) => + throw new NotImplementedException(); + + [DeviationFromSdk("out parameter instead of reference")] + public void GetTimelineDefaultTimeSpan(out FbxTimeSpan pTimeSpan) + { + pTimeSpan = new FbxTimeSpan(new FbxTime(0), + new FbxTime(FbxTimeCode.FBXSDK_TC_LEGACY_SECOND)); + } + + public void SetCustomFrameRate(double pCustomFrameRate) => + throw new NotImplementedException(); + + public double GetCustomFrameRate() => CustomFrameRate.Get(); + + #endregion + + #region Time Markers + + public int GetTimeMarkerCount() => 0; + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public TimeMarker GetTimeMarker(int pIndex) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public TimeMarker GetTimeMarker(int pIndex, ref FbxStatus pStatus) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public void AddTimeMarker(TimeMarker pTimeMarker) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public void AddTimeMarker(TimeMarker pTimeMarker, ref FbxStatus pStatus) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public void ReplaceTimeMarker(int pIndex, TimeMarker pTimeMarker) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public void ReplaceTimeMarker(int pIndex, TimeMarker pTimeMarker, ref FbxStatus pStatus) => + throw new NotImplementedException(); + + public void RemoveAllTimeMarkers() => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public bool SetCurrentTimeMarker(int pIndex) => + throw new NotImplementedException(); + + [DeviationFromSdk("two overloads in lieu of null default pointer value")] + public bool SetCurrentTimeMarker(int pIndex, ref FbxStatus pStatus) => + throw new NotImplementedException(); + + public int GetCurrentTimeMarker() => -1; + + #endregion + } +} \ No newline at end of file diff --git a/FbxSharp/FbxIO.cs b/FbxSharp/FbxIO.cs new file mode 100644 index 0000000..9e2fd79 --- /dev/null +++ b/FbxSharp/FbxIO.cs @@ -0,0 +1,11 @@ +using System; + +namespace FbxSharp; + +public class FbxIO +{ + public FbxIO() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/FbxSharp/FbxIOBase.cs b/FbxSharp/FbxIOBase.cs index 4a9f220..b27a628 100644 --- a/FbxSharp/FbxIOBase.cs +++ b/FbxSharp/FbxIOBase.cs @@ -2,26 +2,60 @@ namespace FbxSharp { - public class FbxIOBase : FbxObject + /// + /// Base class for FBX file importer and exporter. + /// + public abstract class FbxIOBase : FbxObject { - public FbxIOBase() - { - } + #region Public Types -// public virtual bool Initialize(string pFilename, int pFileFormat=-1, FbxIOSettings pIOSettings=null) -// { -// throw new NotImplementedException(); -// } + //typedef FbxObject ParentClass - public virtual string GetFilename() - { + #endregion + + #region Public Member Functions + + // virtual FbxClassId GetClassId () const override + public abstract bool Initialize(string pFileName, int pFileFormat = -1, + FbxIOSettings pIOSettings = null); + + public abstract string GetFileName(); + + public abstract FbxStatus GetStatus(); + + #endregion + + #region Static Public Member Functions + + public static FbxIOBase Create(string pName) => + throw new NotImplementedException(); + + public static FbxIOBase Create(FbxObject pContainer, string pName) => throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + // static FbxClassId ClassId + + #endregion + + #region Protected Member Functions + + // virtual ~FbxIOBase() + + protected FbxIOBase(string pName) + : base(pName) + { } -// public FbxStatus& GetStatus() -// { -// throw new NotImplementedException(); -// } + #endregion + + #region Static Protected Member Functions + + // static FbxIOBase* Allocate(FbxManager* pManager, const char* pName, const FbxIOBase* pFrom) + + #endregion } } - diff --git a/FbxSharp/FbxIODefaultRenderResolution.cs b/FbxSharp/FbxIODefaultRenderResolution.cs new file mode 100644 index 0000000..02f6d1d --- /dev/null +++ b/FbxSharp/FbxIODefaultRenderResolution.cs @@ -0,0 +1,10 @@ +namespace FbxSharp; + +public class FbxIODefaultRenderResolution +{ + public bool mIsOK; + public string mCameraName = ""; // FbxString + public string mResolutionMode = ""; // FbxString + public double mResolutionW; + public double mResolutionH; +} \ No newline at end of file diff --git a/FbxSharp/FbxIOFileHeaderInfo.cs b/FbxSharp/FbxIOFileHeaderInfo.cs new file mode 100644 index 0000000..fb6385e --- /dev/null +++ b/FbxSharp/FbxIOFileHeaderInfo.cs @@ -0,0 +1,27 @@ +using System; + +namespace FbxSharp; + +public class FbxIOFileHeaderInfo +{ + public FbxIODefaultRenderResolution mDefaultRenderResolution = new(); + + public bool mBinary; + + public virtual void Reset() + { + throw new NotImplementedException(); + } + + public virtual bool ReadExtendedHeaderInformation(FbxIO file) + { + throw new NotImplementedException(); + } + + public int mFileVersion; + public bool mCreationTimeStampPresent; + public FbxLocalTime mCreationTimeStamp = new(); + public string mCreator = ""; // FbxString + public bool mIOPlugin; + public bool mPLE; +} \ No newline at end of file diff --git a/FbxSharp/FbxIOSettings.cs b/FbxSharp/FbxIOSettings.cs new file mode 100644 index 0000000..d90f401 --- /dev/null +++ b/FbxSharp/FbxIOSettings.cs @@ -0,0 +1,855 @@ +using System; + +namespace FbxSharp; + +public class FbxIOSettings : FbxObject +{ + #region Public Types + + public enum ELanguage + { + eENU = 0, + eDEU = 1, + eFRA = 2, + eJPN = 3, + eKOR = 4, + eCHS = 5, + ePTB = 6, + eLanguageCount = 7, + } + + #endregion + + #region Public Member Functions + + public virtual FbxClassId GetClassId() + { + throw new NotImplementedException(); + } + + public FbxProperty AddPropertyGroup(string pName, FbxDataType pDataType, + string pLabel = "") => + AddPropertyGroup(RootProperty, pName, pDataType, pLabel); + + public FbxProperty AddPropertyGroup(FbxProperty pParentProperty, + string pName, FbxDataType pDataType = null, string pLabel = "", + bool pVisible = true, bool pSavable = true, bool pEnabled = true) + { + pParentProperty ??= RootProperty; + var prop = FbxProperty.Create(pParentProperty,pDataType,pName); + if (prop is FbxPropertyT propt) + propt.Set(""); + prop.SetLabel(pLabel); + return prop; + } + + public FbxProperty AddProperty(FbxProperty pParentProperty, string pName, + FbxDataType pDataType = null, string pLabel = "", + object pValue = null, bool pVisible = true, bool pSavable = true, + bool pEnabled = true) + { + pParentProperty ??= RootProperty; + var prop = FbxProperty.Create(pParentProperty, pDataType, pName); + prop.SetLabel(pLabel); + if (pValue != null) + prop.Set(pValue); + return prop; + } + + public FbxProperty AddPropertyMinMax(FbxProperty pParentProperty, + string pName, FbxDataType pDataType = null, string pLabel = "", + object pValue = null, double? pMinValue = null, + double? pMaxValue = null, bool pVisible = true, bool pSavable = true, + bool pEnabled = true) => + throw new NotImplementedException(); + + public FbxProperty GetProperty(string pName) + { + if (pName == FbxIOSettingsPath.IOSROOT) + return RootProperty; + + var p2 = FindPropertyHierarchical(pName); + if (p2 != null) + return p2; + + return FbxProperty.NotValid; + } + + public FbxProperty GetProperty(FbxProperty pParentProperty, string pName) + { + throw new NotImplementedException(); + } + + public bool GetBoolProp(string pName, bool pDefValue) + { + throw new NotImplementedException(); + } + + public void SetBoolProp(string pName, bool pValue) + { + throw new NotImplementedException(); + } + + public double GetDoubleProp(string pName, double pDefValue) + { + throw new NotImplementedException(); + } + + public void SetDoubleProp(string pName, double pValue) + { + throw new NotImplementedException(); + } + + public int GetIntProp(string pName, int pDefValue) + { + throw new NotImplementedException(); + } + + public void SetIntProp(string pName, int pValue) + { + throw new NotImplementedException(); + } + + public FbxTime GetTimeProp(string pName, FbxTime pDefValue) + { + throw new NotImplementedException(); + } + + public void SetTimeProp(string pName, FbxTime pValue) + { + throw new NotImplementedException(); + } + + // public bool SetFlag(string pName, FbxPropertyFlags.EFlags propFlag, bool pValue) + // { + // } + + public string GetStringProp(string pName, string pDefValue) + { + throw new NotImplementedException(); + } + + public void SetStringProp(string pName, string pValue) + { + throw new NotImplementedException(); + } + + #endregion + + #region Enum Properties + + public string GetEnumProp(string pName, string pDefValue) => + throw new NotImplementedException(); + + public int GetEnumProp(string pName, int pDefValue) => + throw new NotImplementedException(); + + public int GetEnumIndex(string pName, string pValue) => + throw new NotImplementedException(); + + public void SetEnumProp(string pName, string pValue) => + throw new NotImplementedException(); + + public void SetEnumProp(string pName, int pValue) => + throw new NotImplementedException(); + + public void RemoveEnumPropValue(string pName, string pValue) => + throw new NotImplementedException(); + + public void EmptyEnumProp(string pName) => + throw new NotImplementedException(); + + public bool IsEnumExist(FbxProperty pProp, string enumString) => + throw new NotImplementedException(); + + public int GetEnumIndex(FbxProperty pProp, string enumString, + bool pNoCase = false) => throw new NotImplementedException(); + + #endregion + + #region XML Serialization Function + + public virtual bool ReadXMLFile(string path) => + throw new NotImplementedException(); + + public virtual bool WriteXMLFile(string path) => + throw new NotImplementedException(); + + public bool WriteXmlPropToFile(string pFullPath, string propPath) => + throw new NotImplementedException(); + + #endregion + + #region Static Public Member Functions + + static FbxIOSettings Create( /*Manager pManager,*/ string pName) => + throw new NotImplementedException(); + + static FbxIOSettings Create(FbxObject pContainer, string pName) => + throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + public static FbxClassId ClassId; + + #endregion + + #region Protected Member Functions + + // protected virtual ~FbxIOSettings() => new NotImplementedException(); + + [DeviationFromSdk( + "protected FbxIOSettings(FbxManager *pManager, const char *pName) ")] + public FbxIOSettings( /*FbxManager pManager,*/ string pName) + : base(pName) + { + FbxProperty prop0, prop1, prop2, prop3, prop4, prop5, prop6; + prop0 = RootProperty; + + prop1 = AddPropertyGroup(prop0, "Import", FbxDataTypes.FbxStringDT); + prop1.Set(""); + prop2 = AddPropertyGroup(prop1, "FirstTimeRunNotice", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "FirstTimeRunNotice", FbxDataTypes.FbxStringDT); + prop3.Set("*** Welcome! ***"); + prop2 = AddPropertyGroup(prop1, "PlugInGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "PlugInUIWidth", FbxDataTypes.FbxIntDT); + prop3.Set(500); + prop3 = AddProperty(prop2, "PlugInUIHeight", FbxDataTypes.FbxIntDT); + prop3.Set(500); + prop3 = AddProperty(prop2, "PlugInUIXpos", FbxDataTypes.FbxIntDT); + prop3.Set(100); + prop3 = AddProperty(prop2, "PlugInUIYpos", FbxDataTypes.FbxIntDT); + prop3.Set(100); + prop3 = AddProperty(prop2, "PresetSelected", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddProperty(prop2, "UILIndex", FbxDataTypes.FbxEnumDT); + prop3.Set(0); + prop3.AddEnumValue("ENU"); + prop3.AddEnumValue("DEU"); + prop3.AddEnumValue("FRA"); + prop3.AddEnumValue("JPN"); + prop3.AddEnumValue("KOR"); + prop3.AddEnumValue("CHS"); + prop3.AddEnumValue("PTB"); + prop3 = AddProperty(prop2, "PluginProductFamily", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop2 = AddPropertyGroup(prop1, "PresetsGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "Presets", FbxDataTypes.FbxEnumDT); + prop3.Set(0); + prop2 = AddPropertyGroup(prop1, "StatisticsGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "Statistics", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop2 = AddPropertyGroup(prop1, "IncludeGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "MergeMode", FbxDataTypes.FbxEnumDT); + prop3.Set(1); + prop3.AddEnumValue("Add"); + prop3.AddEnumValue("Add and update animation"); + prop3.AddEnumValue("Update animation"); + prop3 = AddProperty(prop2, "MergeModeDescription", FbxDataTypes.FbxStringDT); + prop3.Set("---"); + prop3 = AddProperty(prop2, "OneClickMerge", FbxDataTypes.FbxBoolDT); + prop3.Set(false); + prop3 = AddProperty(prop2, "OneClickMergeTexture", FbxDataTypes.FbxBoolDT); + prop3.Set(false); + prop3 = AddProperty(prop2, "Geometry", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddPropertyGroup(prop2, "Animation", FbxDataTypes.FbxBoolDT); + prop3.Set(true); + prop4 = AddPropertyGroup(prop3, "ExtraGrp", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "Take", FbxDataTypes.FbxEnumDT); + prop5.Set(-1); + prop5 = AddProperty(prop4, "KeepFrameRate", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "TimeLine", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "TimeLineSpan", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "BakeAnimationLayers", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Markers", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "Deformation", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop5 = AddProperty(prop4, "Skins", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "UseMatrixFromPose", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "SamplingPanel", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "SamplingRateSelector", FbxDataTypes.FbxEnumDT); + prop5.Set(0); + prop5.AddEnumValue("Scene"); + prop5.AddEnumValue("File"); + prop5.AddEnumValue("Custom"); + prop5 = AddProperty(prop4, "CurveFilterSamplingRate", FbxDataTypes.FbxDoubleDT); + prop5.Set(30.000000); + prop4 = AddProperty(prop3, "CurveFilter", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop3 = AddPropertyGroup(prop2, "CameraGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Camera", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "LightGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Light", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddProperty(prop2, "Audio", FbxDataTypes.FbxBoolDT); + prop3.Set(true); + prop3 = AddPropertyGroup(prop2, "EmbedTexture", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "ExtractFolder", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop2 = AddPropertyGroup(prop1, "AdvOptGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddPropertyGroup(prop2, "UnitsGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "ScaleConversion", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "TotalUnitsScale", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddProperty(prop3, "DynamicScaleConversion", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "UnitsSelector", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue("Millimeters"); + prop4.AddEnumValue("Centimeters"); + prop4.AddEnumValue("Decimeters"); + prop4.AddEnumValue("Meters"); + prop4.AddEnumValue("Kilometers"); + prop4.AddEnumValue("Inches"); + prop4.AddEnumValue("Feet"); + prop4.AddEnumValue("Yards"); + prop4.AddEnumValue("Miles"); + prop4 = AddProperty(prop3, "MasterScale", FbxDataTypes.FbxDoubleDT); + prop4.Set(1.000000); + prop4 = AddProperty(prop3, "UnitsScale", FbxDataTypes.FbxDoubleDT); + prop4.Set(1.000000); + prop3 = AddPropertyGroup(prop2, "AxisConvGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "AxisConversion", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "AutoAxis", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "UI", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "ShowWarningsManager", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "GenerateLogData", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "PluginVersionsURL", FbxDataTypes.FbxStringDT); + prop4.Set( + "http://download.autodesk.com/us/fbx/versions/fbxversion.xml"); + prop4 = AddProperty(prop3, "ShowUIMode", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "Cache", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "CacheSize", FbxDataTypes.FbxIntDT); + prop4.Set(8); + prop3 = AddPropertyGroup(prop2, "FileFormat", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddPropertyGroup(prop3, "Fbx", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "Current_Take_Name", FbxDataTypes.FbxStringDT); + prop5.Set(""); + prop5 = AddProperty(prop4, "Model", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementNormal", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementBinormal", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementTangent", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementVertexColor", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementPolygroup", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementSmoothing", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementUserData", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementVisibility", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementEdgeCrease", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementVertexCrease", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "LayerElementHole", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Texture", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Material", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Link", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Shape", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Gobo", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Audio", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Animation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Character", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Global_Settings", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Pivot", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Merge_Layer_and_Timewarp", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "Template", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "Constraint", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "ExtractEmbeddedData", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "CalculateLegacyShapeNormal", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Password_Enable", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "Password", FbxDataTypes.FbxStringDT); + prop5.Set(""); + prop5 = AddProperty(prop4, "Model_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "Device_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "Character_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "Actor_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "Constraint_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "Media_Count", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "RelaxedFbxCheck", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "KeepProducerCamSrcObj", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "Obj", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "ReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "Max_3ds", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "ReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Texture", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Material", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Animation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Mesh", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Light", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Camera", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "AmbientLight", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Rescaling", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Filter", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Smoothgroup", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "Motion_Base", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionStart", FbxDataTypes.FbxTimeDT); + prop5.Set(new FbxTime(0L)); + prop5 = AddProperty(prop4, "MotionFrameCount", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "MotionFrameRate", FbxDataTypes.FbxDoubleDT); + prop5.Set(0.000000); + prop5 = AddProperty(prop4, "MotionActorPrefix", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionRenameDuplicateNames", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionExactZeroAsOccluded", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionSetOccludedToLastValidPos", + FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionAsOpticalSegments", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionASFSceneOwned", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionUpAxisUsedInFile", FbxDataTypes.FbxIntDT); + prop5.Set(3); + prop4 = AddPropertyGroup(prop3, "Biovision_BVH", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionCreateReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "MotionAnalysis_HTR", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionCreateReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseTInOffset", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseRInPrerotation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddProperty(prop3, "MotionAnalysis_TRC", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddPropertyGroup(prop3, "Acclaim_ASF", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionCreateReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionDummyNodes", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionLimits", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseTInOffset", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseRInPrerotation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "Acclaim_AMC", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionCreateReferenceNode", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionDummyNodes", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionLimits", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseTInOffset", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionBaseRInPrerotation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop3 = AddPropertyGroup(prop2, "Dxf", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "WeldVertices", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "ObjectDerivation", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue("By layer"); + prop4.AddEnumValue("By entity"); + prop4.AddEnumValue("By block"); + prop4 = AddProperty(prop3, "ReferenceNode", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop2 = AddPropertyGroup(prop1, "FBXExtentionsSDK", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "FBXExtentionsSDKWarning", FbxDataTypes.FbxStringDT); + prop3.Set("Add your custom properties here."); + prop1 = AddPropertyGroup(prop0, "Export", FbxDataTypes.FbxStringDT); + prop1.Set(""); + prop2 = AddPropertyGroup(prop1, "FirstTimeRunNotice", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "FirstTimeRunNotice", FbxDataTypes.FbxStringDT); + prop3.Set("*** Welcome! ***"); + prop2 = AddPropertyGroup(prop1, "PlugInGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "PlugInUIWidth", FbxDataTypes.FbxIntDT); + prop3.Set(500); + prop3 = AddProperty(prop2, "PlugInUIHeight", FbxDataTypes.FbxIntDT); + prop3.Set(500); + prop3 = AddProperty(prop2, "PlugInUIXpos", FbxDataTypes.FbxIntDT); + prop3.Set(100); + prop3 = AddProperty(prop2, "PlugInUIYpos", FbxDataTypes.FbxIntDT); + prop3.Set(100); + prop3 = AddProperty(prop2, "UILIndex", FbxDataTypes.FbxEnumDT); + prop3.Set(0); + prop3.AddEnumValue("ENU"); + prop3.AddEnumValue("DEU"); + prop3.AddEnumValue("FRA"); + prop3.AddEnumValue("JPN"); + prop3.AddEnumValue("KOR"); + prop3.AddEnumValue("CHS"); + prop3.AddEnumValue("PTB"); + prop3 = AddProperty(prop2, "PluginProductFamily", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddProperty(prop2, "PresetSelected", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddProperty(prop2, "UseTmpFilePeripheral", FbxDataTypes.FbxBoolDT); + prop3.Set(false); + prop2 = AddPropertyGroup(prop1, "PresetsGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "Presets", FbxDataTypes.FbxEnumDT); + prop3.Set(0); + prop2 = AddPropertyGroup(prop1, "StatisticsGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "Statistics", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop2 = AddPropertyGroup(prop1, "IncludeGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "Geometry", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddPropertyGroup(prop2, "Animation", FbxDataTypes.FbxBoolDT); + prop3.Set(true); + prop4 = AddPropertyGroup(prop3, "ExtraGrp", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "UseSceneName", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "RemoveSingleKey", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "BakeComplexAnimation", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop5 = AddProperty(prop4, "BakeFrameStart", FbxDataTypes.FbxIntDT); + prop5.Set(1); + prop5 = AddProperty(prop4, "BakeFrameEnd", FbxDataTypes.FbxIntDT); + prop5.Set(200); + prop5 = AddProperty(prop4, "BakeFrameStep", FbxDataTypes.FbxIntDT); + prop5.Set(1); + prop5 = AddProperty(prop4, "ResampleAnimationCurves", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "BakeFrameStartNoReset", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "BakeFrameEndNoReset", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "BakeFrameStepNoReset", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "Deformation", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop5 = AddProperty(prop4, "Skins", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "CurveFilter", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop5 = AddPropertyGroup(prop4, "CurveFilterApplyCstKeyRed", + FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop6 = AddProperty(prop5, "CurveFilterSamplingRate", FbxDataTypes.FbxDoubleDT); + prop6.Set(30.000000); + prop6 = AddProperty(prop5, "CurveFilterCstKeyRedTPrec", FbxDataTypes.FbxDoubleDT); + prop6.Set(0.000090); + prop6 = AddProperty(prop5, "CurveFilterCstKeyRedRPrec", FbxDataTypes.FbxDoubleDT); + prop6.Set(0.009000); + prop6 = AddProperty(prop5, "CurveFilterCstKeyRedSPrec", FbxDataTypes.FbxDoubleDT); + prop6.Set(0.004000); + prop6 = AddProperty(prop5, "CurveFilterCstKeyRedOPrec", FbxDataTypes.FbxDoubleDT); + prop6.Set(0.009000); + prop6 = AddProperty(prop5, "AutoTangentsOnly", FbxDataTypes.FbxBoolDT); + prop6.Set(true); + prop3 = AddPropertyGroup(prop2, "CameraGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Camera", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "LightGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Light", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddProperty(prop2, "Audio", FbxDataTypes.FbxBoolDT); + prop3.Set(true); + prop3 = AddPropertyGroup(prop2, "EmbedTextureGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "EmbedTexture", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop3 = AddProperty(prop2, "BindPose", FbxDataTypes.FbxBoolDT); + prop3.Set(true); + prop3 = AddProperty(prop2, "PivotToNulls", FbxDataTypes.FbxBoolDT); + prop3.Set(false); + prop2 = AddPropertyGroup(prop1, "AdvOptGrp", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddPropertyGroup(prop2, "UnitsGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "TotalUnitsScale", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddProperty(prop3, "DynamicScaleConversion", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "UnitsSelector", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4 = AddProperty(prop3, "UnitsScale", FbxDataTypes.FbxDoubleDT); + prop4.Set(1.000000); + prop4 = AddProperty(prop3, "MasterScale", FbxDataTypes.FbxDoubleDT); + prop4.Set(1.000000); + prop3 = AddProperty(prop2, "AxisConvGrp", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop3 = AddPropertyGroup(prop2, "UI", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "ShowWarningsManager", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "GenerateLogData", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "PluginVersionsURL", FbxDataTypes.FbxStringDT); + prop4.Set( + "http://download.autodesk.com/us/fbx/versions/fbxversion.xml"); + prop4 = AddProperty(prop3, "ShowUIMode", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "Cache", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "CacheSize", FbxDataTypes.FbxIntDT); + prop4.Set(8); + prop3 = AddPropertyGroup(prop2, "FileFormat", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddPropertyGroup(prop3, "Obj", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "Triangulate", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "Deformation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "Motion_Base", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionStart", FbxDataTypes.FbxTimeDT); + prop5.Set(new FbxTime(0L)); + prop5 = AddProperty(prop4, "MotionFrameCount", FbxDataTypes.FbxIntDT); + prop5.Set(0); + prop5 = AddProperty(prop4, "MotionFromGlobalPosition", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionFrameRate", FbxDataTypes.FbxDoubleDT); + prop5.Set(30.000000); + prop5 = AddProperty(prop4, "MotionGapsAsValidData", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "MotionC3DRealFormat", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop5 = AddProperty(prop4, "MotionASFSceneOwned", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddPropertyGroup(prop3, "Biovision_BVH", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionTranslation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop4 = AddProperty(prop3, "MotionAnalysis_HTR", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddProperty(prop3, "MotionAnalysis_TRC", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddPropertyGroup(prop3, "Acclaim_ASF", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionTranslation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionFrameRateUsed", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionFrameRange", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionWriteDefaultAsBaseTR", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop4 = AddPropertyGroup(prop3, "Acclaim_AMC", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop5 = AddProperty(prop4, "MotionTranslation", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionFrameRateUsed", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionFrameRange", FbxDataTypes.FbxBoolDT); + prop5.Set(true); + prop5 = AddProperty(prop4, "MotionWriteDefaultAsBaseTR", FbxDataTypes.FbxBoolDT); + prop5.Set(false); + prop3 = AddPropertyGroup(prop2, "Fbx", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "AsciiFbx", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue("Binary"); + prop4.AddEnumValue("ASCII"); + prop4 = AddProperty(prop3, "ExportFileVersion", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue("FBX202000"); + prop4.AddEnumValue("FBX201900"); + prop4.AddEnumValue("FBX201800"); + prop4.AddEnumValue("FBX201600"); + prop4.AddEnumValue("FBX201400"); + prop4.AddEnumValue("FBX201300"); + prop4.AddEnumValue("FBX201200"); + prop4.AddEnumValue("FBX201100"); + prop4.AddEnumValue("FBX201000"); + prop4.AddEnumValue("FBX200900"); + prop4.AddEnumValue("FBX200611"); + prop4 = AddProperty(prop3, "VersionsUIAlias", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue("FBX 2020"); + prop4.AddEnumValue("FBX 2019"); + prop4.AddEnumValue("FBX 2018"); + prop4.AddEnumValue("FBX 2016/2017"); + prop4.AddEnumValue("FBX 2014/2015"); + prop4.AddEnumValue("FBX 2013"); + prop4.AddEnumValue("FBX 2012"); + prop4.AddEnumValue("FBX 2011"); + prop4.AddEnumValue("FBX 2010"); + prop4.AddEnumValue("FBX 2009"); + prop4.AddEnumValue("FBX 2006"); + prop4 = AddProperty(prop3, "VersionsCompDescriptions", FbxDataTypes.FbxEnumDT); + prop4.Set(0); + prop4.AddEnumValue( + "Compatible with Autodesk 2020 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2019 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2018 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2016/2017 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2014/2015 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2013 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2012 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2011 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2010 applications/FBX plug-ins and " + + "MotionBuilder 2009"); + prop4.AddEnumValue( + "Compatible with Autodesk 2009 applications/FBX plug-ins"); + prop4.AddEnumValue( + "Compatible with Autodesk 2006 FBX plug-ins and MotionBuilder " + + "7.5, 7.0 and 6.0"); + prop4 = AddProperty(prop3, "Model", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Texture", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Material", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Shape", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Gobo", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Audio", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Animation", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Character", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Global_Settings", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Pivot", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Template", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop4 = AddProperty(prop3, "Constraint", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "EMBEDDED", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop4 = AddProperty(prop3, "Password_Enable", FbxDataTypes.FbxBoolDT); + prop4.Set(false); + prop4 = AddProperty(prop3, "Password", FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop4 = AddProperty(prop3, "COLLAPSE EXTERNALS", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Compress_Arrays", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Compress_Level", FbxDataTypes.FbxIntDT); + prop4.Set(1); + prop4 = AddProperty(prop3, "Compress_Minsize", FbxDataTypes.FbxIntDT); + prop4.Set(1024); + prop4 = AddProperty(prop3, "Embedded_Skipped_Properties", + FbxDataTypes.FbxStringDT); + prop4.Set(""); + prop3 = AddPropertyGroup(prop2, "Dxf", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Deformation", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "Triangulate", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop3 = AddPropertyGroup(prop2, "Collada", FbxDataTypes.FbxStringDT); + prop3.Set(""); + prop4 = AddProperty(prop3, "Triangulate", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "SingleMatrix", FbxDataTypes.FbxBoolDT); + prop4.Set(true); + prop4 = AddProperty(prop3, "FrameRate", FbxDataTypes.FbxDoubleDT); + prop4.Set(30.000000); + prop2 = AddPropertyGroup(prop1, "FBXExtentionsSDK", FbxDataTypes.FbxStringDT); + prop2.Set(""); + prop3 = AddProperty(prop2, "FBXExtentionsSDKWarning", FbxDataTypes.FbxStringDT); + prop3.Set("Add your custom properties here."); + } + + #endregion + + #region Static Protected MemberFunctions + + // static FbxIOSettings * Allocate (FbxManager *pManager, const char *pName, const FbxIOSettings *pFrom) + + #endregion +} diff --git a/FbxSharp/FbxIOSettingsPath.cs b/FbxSharp/FbxIOSettingsPath.cs new file mode 100644 index 0000000..49254ad --- /dev/null +++ b/FbxSharp/FbxIOSettingsPath.cs @@ -0,0 +1,1371 @@ +namespace FbxSharp; + +[NotSdk] +public static class FbxIOSettingsPath +{ + public const string IOSROOT = "IOSRoot"; + public const string IOSN_EXPORT = "Export"; + public const string IOSN_IMPORT = "Import"; + public const string IOSN_PLUGIN_GRP = "PlugInGrp"; + public const string IOSN_PLUGIN_UI_WIDTH = "PlugInUIWidth"; + public const string IOSN_PLUGIN_UI_HEIGHT = "PlugInUIHeight"; + public const string IOSN_PLUGIN_VERSIONS_URL = "PluginVersionsURL"; + public const string IOSN_PI_VERSION = "PIVersion"; + public const string IOSN_PRESET_SELECTED = "PresetSelected"; + public const string IOSN_PRESETS_GRP = "PresetsGrp"; + public const string IOSN_STATISTICS_GRP = "StatisticsGrp"; + public const string IOSN_UNITS_GRP = "UnitsGrp"; + public const string IOSN_INCLUDE_GRP = "IncludeGrp"; + public const string IOSN_ADV_OPT_GRP = "AdvOptGrp"; + public const string IOSN_AXISCONV_GRP = "AxisConvGrp"; + public const string IOSN_CAMERA_GRP = "CameraGrp"; + public const string IOSN_LIGHT_GRP = "LightGrp"; + public const string IOSN_EXTRA_GRP = "ExtraGrp"; + public const string IOSN_CONSTRAINTS_GRP = "ConstraintsGrp"; + public const string IOSN_INPUTCONNECTIONS_GRP = "InputConnectionsGrp"; + public const string IOSN_INFORMATION_GRP = "InformationGrp"; + public const string IOSN_UP_AXIS = "UpAxis"; + public const string IOSN_UP_AXIS_MAX = "UpAxisMax"; + public const string IOSN_ZUPROTATION_MAX = "ZUProtation_max"; + public const string IOSN_AXISCONVERSION = "AxisConversion"; + public const string IOSN_AUTO_AXIS = "AutoAxis"; + public const string IOSN_FILE_UP_AXIS = "FileUpAxis"; + public const string IOSN_PRESETS = "Presets"; + public const string IOSN_STATISTICS = "Statistics"; + public const string IOSN_UNITS_SCALE = "UnitsScale"; + public const string IOSN_TOTAL_UNITS_SCALE_TB = "TotalUnitsScale"; + public const string IOSN_SCALECONVERSION = "ScaleConversion"; + public const string IOSN_MASTERSCALE = "MasterScale"; + public const string IOSN_DYN_SCALE_CONVERSION = "DynamicScaleConversion"; + public const string IOSN_UNITSELECTOR = "UnitsSelector"; + + /// + /// Not defined in the SDK. The value here is a best guess. + /// + [NotSdk] public const string IOSN_UNITS_TB = "Units"; + + /// + /// Not defined in the SDK. The value here is a best guess. + /// + [NotSdk] public const string IOSN_SAMPLINGFRAMERATE = "SamplingFrameRate"; + + public const string IOSN_AUDIO = "Audio"; + public const string IOSN_ANIMATION = "Animation"; + public const string IOSN_GEOMETRY = "Geometry"; + public const string IOSN_DEFORMATION = "Deformation"; + public const string IOSN_MARKERS = "Markers"; + public const string IOSN_CHARACTER = "Character"; + public const string IOSN_CHARACTER_AS_MAYA_HIK = "CharacterAsMayaHIK"; + public const string IOSN_CHARACTER_TYPE = "CharacterType"; + public const string IOSN_CHARACTER_TYPE_DESC = "CharacterTypeDesc"; + public const string IOSN_SETLOCKEDATTRIB = "LockedAttribute"; + public const string IOSN_TRIANGULATE = "Triangulate"; + public const string IOSN_MRCUSTOMATTRIBUTES = "MRCustomAttributes"; + public const string IOSN_MESHPRIMITIVE = "MeshPrimitive"; + public const string IOSN_MESHTRIANGLE = "MeshTriangle"; + public const string IOSN_MESHPOLY = "MeshPoly"; + public const string IOSN_NURB = "Nurb"; + public const string IOSN_PATCH = "Patch"; + public const string IOSN_BIP2FBX = "Bip2Fbx"; + public const string IOSN_ASCIIFBX = "AsciiFbx"; + public const string IOSN_TAKE = "Take"; + + public const string IOSN_GEOMETRYMESHPRIMITIVEAS = + "GeometryMeshPrimitiveAs"; + + public const string IOSN_GEOMETRYMESHTRIANGLEAS = "GeometryMeshTriangleAs"; + public const string IOSN_GEOMETRYMESHPOLYAS = "GeometryMeshPolyAs"; + public const string IOSN_GEOMETRYNURBSAS = "GeometryNurbsAs"; + public const string IOSN_GEOMETRYNURBSSURFACEAS = "GeometryNurbsSurfaceAs"; + public const string IOSN_GEOMETRYPATCHAS = "GeometryPatchAs"; + public const string IOSN_TANGENTS_BINORMALS = "TangentsandBinormals"; + public const string IOSN_SMOOTH_MESH = "SmoothMesh"; + public const string IOSN_SELECTION_SET = "SelectionSet"; + public const string IOSN_ANIMATIONONLY = "AnimationOnly"; + public const string IOSN_SELECTIONONLY = "SelectionOnly"; + public const string IOSN_BONE = "Bone"; + public const string IOSN_BONEWIDTHHEIGHTLOCK = "BoneWidthHeightLock"; + public const string IOSN_BONEASDUMMY = "BoneAsDummy"; + public const string IOSN_BONEMAX4BONEWIDTH = "Max4BoneWidth"; + public const string IOSN_BONEMAX4BONEHEIGHT = "Max4BoneHeight"; + public const string IOSN_BONEMAX4BONETAPER = "Max4BoneTaper"; + public const string IOSN_REMOVE_SINGLE_KEY = "RemoveSingleKey"; + public const string IOSN_CURVE_FILTER = "CurveFilter"; + public const string IOSN_CONSTRAINT = "Constraint"; + public const string IOSN_UI = "UI"; + public const string IOSN_SHOW_UI_MODE = "ShowUIMode"; + public const string IOSN_SHOW_WARNINGS_MANAGER = "ShowWarningsManager"; + public const string IOSN_GENERATE_LOG_DATA = "GenerateLogData"; + public const string IOSN_PERF_GRP = "Performance"; + public const string IOSN_REMOVEBADPOLYSFROMMESH = "RemoveBadPolysFromMesh"; + public const string IOSN_META_DATA = "MetaData"; + public const string IOSN_CACHE_GRP = "Cache"; + public const string IOSN_CACHE_SIZE = "CacheSize"; + public const string IOSN_MERGE_MODE = "MergeMode"; + public const string IOSN_MERGE_MODE_DESCRIPTION = "MergeModeDescription"; + public const string IOSN_ONE_CLICK_MERGE = "OneClickMerge"; + public const string IOSN_ONE_CLICK_MERGE_TEXTURE = "OneClickMergeTexture"; + public const string IOSN_SAMPLINGPANEL = "SamplingPanel"; + public const string IOSN_FILE_FORMAT = "FileFormat"; + public const string IOSN_FBX = "Fbx"; + public const string IOSN_DXF = "Dxf"; + public const string IOSN_OBJ = "Obj"; + public const string IOSN_3DS = "Max_3ds"; + public const string IOSN_COLLADA = "Collada"; + public const string IOSN_MOTION_BASE = "Motion_Base"; + public const string IOSN_BIOVISION_BVH = "Biovision_BVH"; + public const string IOSN_MOTIONANALYSIS_HTR = "MotionAnalysis_HTR"; + public const string IOSN_MOTIONANALYSIS_TRC = "MotionAnalysis_TRC"; + public const string IOSN_ACCLAIM_ASF = "Acclaim_ASF"; + public const string IOSN_ACCLAIM_AMC = "Acclaim_AMC"; + public const string IOSN_VICON_C3D = "Vicon_C3D"; + public const string IOSN_SKINS = "Skins"; + public const string IOSN_POINTCACHE = "PointCache"; + public const string IOSN_QUATERNION = "Quaternion"; + public const string IOSN_NAMETAKE = "UseSceneName"; + public const string IOSN_SHAPE = "Shape"; + public const string IOSN_SHAPEATTRIBUTES = "ShapeAttributes"; + public const string IOSN_SHAPEATTRIBUTE_VALUES = "ShapeAttributesValues"; + public const string IOSN_LIGHT = "Light"; + public const string IOSN_LIGHTATTENUATION = "LightAttenuation"; + public const string IOSN_CAMERA = "Camera"; + public const string IOSN_VIEW_CUBE = "ViewCube"; + public const string IOSN_BINDPOSE = "BindPose"; + public const string IOSN_EMBEDTEXTURE_GRP = "EmbedTextureGrp"; + public const string IOSN_EMBEDTEXTURE = "EmbedTexture"; + public const string IOSN_EMBEDDED_FOLDER = "ExtractFolder"; + public const string IOSN_CONVERTTOTIFF = "Convert_2Tiff"; + public const string IOSN_UNLOCK_NORMALS = "UnlockNormals"; + public const string IOSN_CREASE = "Crease"; + public const string IOSN_FINESTSUBDIVLEVEL = "FinestSubdivLevel"; + public const string IOSN_BAKEANIMATIONLAYERS = "BakeAnimationLayers"; + public const string IOSN_BAKECOMPLEXANIMATION = "BakeComplexAnimation"; + public const string IOSN_BAKEFRAMESTART = "BakeFrameStart"; + public const string IOSN_BAKEFRAMEEND = "BakeFrameEnd"; + public const string IOSN_BAKEFRAMESTEP = "BakeFrameStep"; + public const string IOSN_BAKEFRAMESTARTNORESET = "BakeFrameStartNoReset"; + public const string IOSN_BAKEFRAMEENDNORESET = "BakeFrameEndNoReset"; + public const string IOSN_BAKEFRAMESTEPNORESET = "BakeFrameStepNoReset"; + public const string IOSN_USEMATRIXFROMPOSE = "UseMatrixFromPose"; + public const string IOSN_NULLSTOPIVOT = "NullsToPivot"; + public const string IOSN_PIVOTTONULLS = "PivotToNulls"; + public const string IOSN_GEOMNORMALPERPOLY = "GeomNormalPerPoly"; + public const string IOSN_MAXBONEASBONE = "MaxBoneAsBone"; + public const string IOSN_MAXNURBSSTEP = "MaxNurbsStep"; + public const string IOSN_PROTECTDRIVENKEYS = "ProtectDrivenKeys"; + public const string IOSN_DEFORMNULLSASJOINTS = "DeformNullsAsJoints"; + public const string IOSN_ENVIRONMENT = "Environment"; + public const string IOSN_SAMPLINGRATESELECTOR = "SamplingRateSelector"; + public const string IOSN_SAMPLINGRATE = "CurveFilterSamplingRate"; + public const string IOSN_APPLYCSTKEYRED = "CurveFilterApplyCstKeyRed"; + public const string IOSN_CSTKEYREDTPREC = "CurveFilterCstKeyRedTPrec"; + public const string IOSN_CSTKEYREDRPREC = "CurveFilterCstKeyRedRPrec"; + public const string IOSN_CSTKEYREDSPREC = "CurveFilterCstKeyRedSPrec"; + public const string IOSN_CSTKEYREDOPREC = "CurveFilterCstKeyRedOPrec"; + public const string IOSN_APPLYKEYREDUCE = "CurveFilterApplyKeyReduce"; + public const string IOSN_KEYREDUCEPREC = "CurveFilterKeyReducePrec"; + public const string IOSN_APPLYKEYSONFRM = "CurveFilterApplyKeysOnFrm"; + public const string IOSN_APPLYKEYSYNC = "CurveFilterApplyKeySync"; + public const string IOSN_APPLYUNROLL = "CurveFilterApplyUnroll"; + public const string IOSN_UNROLLPREC = "CurveFilterUnrollPrec"; + public const string IOSN_UNROLLPATH = "CurveFilterUnrollPath"; + public const string IOSN_UNROLLFORCEAUTO = "CurveFilterUnrollForceAuto"; + public const string IOSN_AUTOTANGENTSONLY = "AutoTangentsOnly"; + public const string IOSN_SMOOTHING_GROUPS = "SmoothingGroups"; + public const string IOSN_HARDEDGES = "HardEdges"; + public const string IOSN_EXP_HARDEDGES = "expHardEdges"; + public const string IOSN_BLINDDATA = "BlindData"; + public const string IOSN_INPUTCONNECTIONS = "InputConnections"; + public const string IOSN_INSTANCES = "Instances"; + public const string IOSN_REFERENCES = "References"; + public const string IOSN_CONTAINEROBJECTS = "ContainerObjects"; + public const string IOSN_BYPASSRRSINHERITANCE = "BypassRrsInheritance"; + public const string IOSN_FORCEWEIGHTNORMALIZE = "ForceWeightNormalize"; + public const string IOSN_SHAPEANIMATION = "ShapeAnimation"; + public const string IOSN_SMOOTHKEYASUSER = "SmoothKeyAsUser"; + public const string IOSN_SCALEFACTOR = "ScaleFactor"; + public const string IOSN_AXISCONVERSIONMETHOD = "AxisConversionMethod"; + public const string IOSN_UPAXIS = "UpAxis"; + + public const string IOSN_SELECTIONSETNAMEASPOINTCACHE = + "SelectionSetNameAsPointCache"; + + public const string IOSN_KEEPFRAMERATE = "KeepFrameRate"; + + public const string IOSN_ATTENUATIONASINTENSITYCURVE = + "AttenuationAsIntensityCurve"; + + public const string IOSN_RESAMPLE_ANIMATION_CURVES = + "ResampleAnimationCurves"; + + public const string IOSN_TIMELINE = "TimeLine"; + public const string IOSN_TIMELINE_SPAN = "TimeLineSpan"; + public const string IOSN_BUTTON_WEB_UPDATE = "WebUpdateButton"; + public const string IOSN_BUTTON_EDIT = "EditButton"; + public const string IOSN_BUTTON_OK = "OKButton"; + public const string IOSN_BUTTON_CANCEL = "CancelButton"; + public const string IOSN_MENU_EDIT_PRESET = "EditPresetMenu"; + public const string IOSN_MENU_SAVE_PRESET = "SavePresetMenu"; + public const string IOSN_UIL = "UILIndex"; + public const string IOSN_PLUGIN_PRODUCT_FAMILY = "PluginProductFamily"; + public const string IOSN_PLUGIN_UI_XPOS = "PlugInUIXpos"; + public const string IOSN_PLUGIN_UI_YPOS = "PlugInUIYpos"; + public const string IOSN_FBX_EXTENTIONS_SDK = "FBXExtentionsSDK"; + + public const string IOSN_FBX_EXTENTIONS_SDK_WARNING = + "FBXExtentionsSDKWarning"; + + public const string IOSN_COLLADA_FRAME_COUNT = "FrameCount"; + public const string IOSN_COLLADA_START = "Start"; + public const string IOSN_COLLADA_TAKE_NAME = "TakeName"; + public const string IOSN_COLLADA_TRIANGULATE = "Triangulate"; + public const string IOSN_COLLADA_SINGLEMATRIX = "SingleMatrix"; + public const string IOSN_COLLADA_FRAME_RATE = "FrameRate"; + public const string IOSN_DXF_TRIANGULATE = "Triangulate"; + public const string IOSN_DXF_DEFORMATION = "Deformation"; + public const string IOSN_DXF_WELD_VERTICES = "WeldVertices"; + public const string IOSN_DXF_OBJECT_DERIVATION = "ObjectDerivation"; + public const string IOSN_DXF_REFERENCE_NODE = "ReferenceNode"; + public const string IOSN_OBJ_REFERENCE_NODE = "ReferenceNode"; + public const string IOSN_OBJ_TRIANGULATE = "Triangulate"; + public const string IOSN_OBJ_DEFORMATION = "Deformation"; + public const string IOSN_3DS_REFERENCENODE = "ReferenceNode"; + public const string IOSN_3DS_TEXTURE = "Texture"; + public const string IOSN_3DS_MATERIAL = "Material"; + public const string IOSN_3DS_ANIMATION = "Animation"; + public const string IOSN_3DS_MESH = "Mesh"; + public const string IOSN_3DS_LIGHT = "Light"; + public const string IOSN_3DS_CAMERA = "Camera"; + public const string IOSN_3DS_AMBIENT_LIGHT = "AmbientLight"; + public const string IOSN_3DS_RESCALING = "Rescaling"; + public const string IOSN_3DS_FILTER = "Filter"; + public const string IOSN_3DS_SMOOTHGROUP = "Smoothgroup"; + public const string IOSN_3DS_TAKE_NAME = "TakeName"; + public const string IOSN_3DS_TEXUVBYPOLY = "TexuvbyPoly"; + public const string IOSN_ZOOMEXTENTS = "ZoomExtents"; + public const string IOSN_GLOBAL_AMBIENT_COLOR = "GlobalAmbientColor"; + public const string IOSN_EDGE_ORIENTATION = "PreserveEdgeOrientation"; + public const string IOSN_VERSIONS_UI_ALIAS = "VersionsUIAlias"; + + public const string IOSN_VERSIONS_COMP_DESCRIPTIONS = + "VersionsCompDescriptions"; + + public const string IOSN_MODEL_COUNT = "Model_Count"; + public const string IOSN_DEVICE_COUNT = "Device_Count"; + public const string IOSN_CHARACTER_COUNT = "Character_Count"; + public const string IOSN_ACTOR_COUNT = "Actor_Count"; + public const string IOSN_CONSTRAINT_COUNT = "Constraint_Count"; + public const string IOSN_MEDIA_COUNT = "Media_Count"; + public const string IOSN_TEMPLATE = "Template"; + public const string IOSN_PIVOT = "Pivot"; + public const string IOSN_GLOBAL_SETTINGS = "Global_Settings"; + + public const string IOSN_MERGE_LAYER_AND_TIMEWARP = + "Merge_Layer_and_Timewarp"; + + public const string IOSN_GOBO = "Gobo"; + public const string IOSN_LINK = "Link"; + public const string IOSN_MATERIAL = "Material"; + public const string IOSN_TEXTURE = "Texture"; + public const string IOSN_MODEL = "Model"; + public const string IOSN_NORMAL = "LayerElementNormal"; + public const string IOSN_BINORMAL = "LayerElementBinormal"; + public const string IOSN_TANGENT = "LayerElementTangent"; + public const string IOSN_VERTEXCOLOR = "LayerElementVertexColor"; + public const string IOSN_POLYGROUP = "LayerElementPolygroup"; + public const string IOSN_SMOOTHING = "LayerElementSmoothing"; + public const string IOSN_USERDATA = "LayerElementUserData"; + public const string IOSN_VISIBILITY = "LayerElementVisibility"; + public const string IOSN_EDGECREASE = "LayerElementEdgeCrease"; + public const string IOSN_VERTEXCREASE = "LayerElementVertexCrease"; + public const string IOSN_HOLE = "LayerElementHole"; + public const string IOSN_EMBEDDED = "EMBEDDED"; + public const string IOSN_PASSWORD = "Password"; + public const string IOSN_PASSWORD_ENABLE = "Password_Enable"; + public const string IOSN_CURRENT_TAKE_NAME = "Current_Take_Name"; + public const string IOSN_COLLAPSE_EXTERNALS = "COLLAPSE EXTERNALS"; + public const string IOSN_COMPRESS_ARRAYS = "Compress_Arrays"; + public const string IOSN_COMPRESS_LEVEL = "Compress_Level"; + public const string IOSN_COMPRESS_MINSIZE = "Compress_Minsize"; + + public const string IOSN_EMBEDDED_PROPERTIES_SKIP = + "Embedded_Skipped_Properties"; + + public const string IOSN_EXPORT_FILE_VERSION = "ExportFileVersion"; + public const string IOSN_SHOW_UI_WARNING = "ShowUIWarning"; + public const string IOSN_ADD_MATERIAL_TO_EDIT = "AddMaterialToEdit"; + public const string IOSN_ENABLE_TEX_DISPLAY = "EnableTexDisplay"; + + public const string IOSN_PREFERED_ENVELOPPE_SYSTEM = + "kImportPreferedEnveloppeSystem"; + + public const string IOSN_FIRST_TIME_RUN_NOTICE = "FirstTimeRunNotice"; + public const string IOSN_EXTRACT_EMBEDDED_DATA = "ExtractEmbeddedData"; + + public const string IOSN_CALCULATE_LEGACY_SHAPE_NORMAL = + "CalculateLegacyShapeNormal"; + + public const string IOSN_USETMPFILEPERIPHERAL = "UseTmpFilePeripheral"; + public const string IOSN_CONSTRUCTIONHISTORY = "ConstructionHistory"; + public const string IOSN_RELAXED_FBX_CHECK = "RelaxedFbxCheck"; + public const string IOSN_KEEP_PRODUCER_CAM_SRCOBJ = "KeepProducerCamSrcObj"; + + public const string IMP_PRESETS = + IOSN_IMPORT + "|" + IOSN_PRESETS_GRP + "|" + IOSN_PRESETS; + + public const string IMP_STATISTICS = + IOSN_IMPORT + "|" + IOSN_STATISTICS_GRP + "|" + IOSN_STATISTICS; + + public const string IMP_STATISTICS_GRP = + IOSN_IMPORT + "|" + IOSN_STATISTICS_GRP; + + public const string IMP_PRESETS_GRP = IOSN_IMPORT + "|" + IOSN_PRESETS_GRP; + public const string IMP_PLUGIN_GRP = IOSN_IMPORT + "|" + IOSN_PLUGIN_GRP; + public const string IMP_INCLUDE_GRP = IOSN_IMPORT + "|" + IOSN_INCLUDE_GRP; + public const string IMP_ADV_OPT_GRP = IOSN_IMPORT + "|" + IOSN_ADV_OPT_GRP; + + public const string IMP_FBX_EXT_SDK_GRP = + IOSN_IMPORT + "|" + IOSN_FBX_EXTENTIONS_SDK; + + public const string IMP_FIRST_TIME_RUN_NOTICE_GRP = + IOSN_IMPORT + "|" + IOSN_FIRST_TIME_RUN_NOTICE; + + public const string IMP_INFORMATION_GRP = + IOSN_IMPORT + "|" + IOSN_INFORMATION_GRP; + + public const string IMP_FIRST_TIME_RUN_NOTICE = + IMP_FIRST_TIME_RUN_NOTICE_GRP + "|" + IOSN_FIRST_TIME_RUN_NOTICE; + + public const string IMP_GEOMETRY = IMP_INCLUDE_GRP + "|" + IOSN_GEOMETRY; + public const string IMP_AUDIO = IMP_INCLUDE_GRP + "|" + IOSN_AUDIO; + public const string IMP_ANIMATION = IMP_INCLUDE_GRP + "|" + IOSN_ANIMATION; + + public const string IMP_SETLOCKEDATTRIB = + IMP_INCLUDE_GRP + "|" + IOSN_SETLOCKEDATTRIB; + + public const string IMP_MERGE_MODE = + IMP_INCLUDE_GRP + "|" + IOSN_MERGE_MODE; + + public const string IMP_MERGE_MODE_DESCRIPTION = + IMP_INCLUDE_GRP + "|" + IOSN_MERGE_MODE_DESCRIPTION; + + public const string IMP_ONE_CLICK_MERGE = + IMP_INCLUDE_GRP + "|" + IOSN_ONE_CLICK_MERGE; + + public const string IMP_ONE_CLICK_MERGE_TEXTURE = + IMP_INCLUDE_GRP + "|" + IOSN_ONE_CLICK_MERGE_TEXTURE; + + public const string IMP_ADD_MATERIAL_TO_EDIT = + IMP_INCLUDE_GRP + "|" + IOSN_ADD_MATERIAL_TO_EDIT; + + public const string IMP_ENABLE_TEX_DISPLAY = + IMP_INCLUDE_GRP + "|" + IOSN_ENABLE_TEX_DISPLAY; + + public const string IMP_PREFERED_ENVELOPPE_SYSTEM = + IMP_INCLUDE_GRP + "|" + IOSN_PREFERED_ENVELOPPE_SYSTEM; + + public const string IMP_CAMERA_GRP = + IMP_INCLUDE_GRP + "|" + IOSN_CAMERA_GRP; + + public const string IMP_LIGHT_GRP = IMP_INCLUDE_GRP + "|" + IOSN_LIGHT_GRP; + + public const string IMP_EMBEDDED_GRP = + IMP_INCLUDE_GRP + "|" + IOSN_EMBEDTEXTURE; + + public const string IMP_EXTRACT_FOLDER = + IMP_EMBEDDED_GRP + "|" + IOSN_EMBEDDED_FOLDER; + + public const string IMP_LIGHT = IMP_LIGHT_GRP + "|" + IOSN_LIGHT; + + public const string IMP_ENVIRONMENT = + IMP_LIGHT_GRP + "|" + IOSN_ENVIRONMENT; + + public const string IMP_CAMERA = IMP_CAMERA_GRP + "|" + IOSN_CAMERA; + public const string IMP_VIEW_CUBE = IMP_INCLUDE_GRP + "|" + IOSN_VIEW_CUBE; + + public const string IMP_ZOOMEXTENTS = + IMP_INCLUDE_GRP + "|" + IOSN_ZOOMEXTENTS; + + public const string IMP_GLOBAL_AMBIENT_COLOR = + IMP_LIGHT_GRP + "|" + IOSN_GLOBAL_AMBIENT_COLOR; + + public const string IMP_CURVEFILTERS = + IMP_ANIMATION + "|" + IOSN_CURVE_FILTER; + + public const string IMP_SAMPLINGPANEL = + IMP_ANIMATION + "|" + IOSN_SAMPLINGPANEL; + + public const string IMP_DEFORMATION = + IMP_ANIMATION + "|" + IOSN_DEFORMATION; + + public const string IMP_BONE = IMP_ANIMATION + "|" + IOSN_BONE; + + public const string IMP_ATTENUATIONASINTENSITYCURVE = + IMP_ANIMATION + "|" + IOSN_ATTENUATIONASINTENSITYCURVE; + + public const string IMP_EXTRA_GRP = IMP_ANIMATION + "|" + IOSN_EXTRA_GRP; + public const string IMP_TAKE = IMP_EXTRA_GRP + "|" + IOSN_TAKE; + + public const string IMP_KEEPFRAMERATE = + IMP_EXTRA_GRP + "|" + IOSN_KEEPFRAMERATE; + + public const string IMP_TIMELINE = IMP_EXTRA_GRP + "|" + IOSN_TIMELINE; + + public const string IMP_TIMELINE_SPAN = + IMP_EXTRA_GRP + "|" + IOSN_TIMELINE_SPAN; + + public const string IMP_BAKEANIMATIONLAYERS = + IMP_EXTRA_GRP + "|" + IOSN_BAKEANIMATIONLAYERS; + + public const string IMP_MARKERS = IMP_EXTRA_GRP + "|" + IOSN_MARKERS; + public const string IMP_QUATERNION = IMP_EXTRA_GRP + "|" + IOSN_QUATERNION; + + public const string IMP_PROTECTDRIVENKEYS = + IMP_EXTRA_GRP + "|" + IOSN_PROTECTDRIVENKEYS; + + public const string IMP_DEFORMNULLSASJOINTS = + IMP_EXTRA_GRP + "|" + IOSN_DEFORMNULLSASJOINTS; + + public const string IMP_NULLSTOPIVOT = + IMP_EXTRA_GRP + "|" + IOSN_NULLSTOPIVOT; + + public const string IMP_POINTCACHE = IMP_EXTRA_GRP + "|" + IOSN_POINTCACHE; + + public const string IMP_SHAPEANIMATION = + IMP_EXTRA_GRP + "|" + IOSN_SHAPEANIMATION; + + public const string IMP_CONSTRAINTS_GRP = + IMP_ANIMATION + "|" + IOSN_CONSTRAINTS_GRP; + + public const string IMP_CONSTRAINT = + IMP_CONSTRAINTS_GRP + "|" + IOSN_CONSTRAINT; + + public const string IMP_CHARACTER = + IMP_CONSTRAINTS_GRP + "|" + IOSN_CHARACTER; + + public const string IMP_CHARACTER_AS_MAYA_HIK = + IMP_CONSTRAINTS_GRP + "|" + IOSN_CHARACTER_AS_MAYA_HIK; + + public const string IMP_CHARACTER_TYPE = + IMP_CONSTRAINTS_GRP + "|" + IOSN_CHARACTER_TYPE; + + public const string IMP_SAMPLINGRATESELECTOR = + IMP_SAMPLINGPANEL + "|" + IOSN_SAMPLINGRATESELECTOR; + + public const string IMP_SAMPLINGRATE = + IMP_SAMPLINGPANEL + "|" + IOSN_SAMPLINGRATE; + + public const string IMP_UNITS_GRP = IMP_ADV_OPT_GRP + "|" + IOSN_UNITS_GRP; + + public const string IMP_AXISCONV_GRP = + IMP_ADV_OPT_GRP + "|" + IOSN_AXISCONV_GRP; + + public const string IMP_CACHE_GRP = IMP_ADV_OPT_GRP + "|" + IOSN_CACHE_GRP; + public const string IMP_UI = IMP_ADV_OPT_GRP + "|" + IOSN_UI; + + public const string IMP_FILEFORMAT = + IMP_ADV_OPT_GRP + "|" + IOSN_FILE_FORMAT; + + public const string IMP_PERF_GRP = IMP_ADV_OPT_GRP + "|" + IOSN_PERF_GRP; + + public const string IMP_REMOVEBADPOLYSFROMMESH = + IMP_PERF_GRP + "|" + IOSN_REMOVEBADPOLYSFROMMESH; + + public const string IMP_META_DATA = IMP_PERF_GRP + "|" + IOSN_META_DATA; + + public const string IMP_FBX_EXTENTIONS_SDK_WARNING = + IMP_FBX_EXT_SDK_GRP + "|" + IOSN_FBX_EXTENTIONS_SDK_WARNING; + + public const string IMP_SCALECONVERSION = + IMP_UNITS_GRP + "|" + IOSN_SCALECONVERSION; + + public const string IMP_UNITS_TB = IMP_UNITS_GRP + "|" + IOSN_UNITS_TB; + + public const string IMP_MASTERSCALE = + IMP_UNITS_GRP + "|" + IOSN_MASTERSCALE; + + public const string IMP_UNITS_SCALE = + IMP_UNITS_GRP + "|" + IOSN_UNITS_SCALE; + + public const string IMP_DYN_SCALE_CONVERSION = + IMP_UNITS_GRP + "|" + IOSN_DYN_SCALE_CONVERSION; + + public const string IMP_UNITSELECTOR = + IMP_UNITS_GRP + "|" + IOSN_UNITSELECTOR; + + public const string IMP_TOTAL_UNITS_SCALE_TB = + IMP_UNITS_GRP + "|" + IOSN_TOTAL_UNITS_SCALE_TB; + + public const string IMP_SHOW_UI_MODE = IMP_UI + "|" + IOSN_SHOW_UI_MODE; + + public const string IMP_SHOW_UI_WARNING = + IMP_UI + "|" + IOSN_SHOW_UI_WARNING; + + public const string IMP_SHOW_WARNINGS_MANAGER = + IMP_UI + "|" + IOSN_SHOW_WARNINGS_MANAGER; + + public const string IMP_GENERATE_LOG_DATA = + IMP_UI + "|" + IOSN_GENERATE_LOG_DATA; + + public const string IMP_PLUGIN_VERSIONS_URL = + IMP_UI + "|" + IOSN_PLUGIN_VERSIONS_URL; + + public const string IMP_DXF = IMP_ADV_OPT_GRP + "|" + IOSN_DXF; + public const string IMP_FBX = IMP_FILEFORMAT + "|" + IOSN_FBX; + public const string IMP_OBJ = IMP_FILEFORMAT + "|" + IOSN_OBJ; + public const string IMP_3DS = IMP_FILEFORMAT + "|" + IOSN_3DS; + + public const string IMP_MOTION_BASE = + IMP_FILEFORMAT + "|" + IOSN_MOTION_BASE; + + public const string IMP_BIOVISION_BVH = + IMP_FILEFORMAT + "|" + IOSN_BIOVISION_BVH; + + public const string IMP_MOTIONANALYSIS_HTR = + IMP_FILEFORMAT + "|" + IOSN_MOTIONANALYSIS_HTR; + + public const string IMP_ACCLAIM_ASF = + IMP_FILEFORMAT + "|" + IOSN_ACCLAIM_ASF; + + public const string IMP_ACCLAIM_AMC = + IMP_FILEFORMAT + "|" + IOSN_ACCLAIM_AMC; + + public const string IMP_UNLOCK_NORMALS = + IMP_GEOMETRY + "|" + IOSN_UNLOCK_NORMALS; + + public const string IMP_CREASE = IMP_GEOMETRY + "|" + IOSN_CREASE; + + public const string IMP_SMOOTHING_GROUPS = + IMP_GEOMETRY + "|" + IOSN_SMOOTHING_GROUPS; + + public const string IMP_HARDEDGES = IMP_GEOMETRY + "|" + IOSN_HARDEDGES; + public const string IMP_BLINDDATA = IMP_GEOMETRY + "|" + IOSN_BLINDDATA; + + public const string IMP_BONE_WIDTHHEIGHTLOCK = + IMP_BONE + "|" + IOSN_BONEWIDTHHEIGHTLOCK; + + public const string IMP_BONEASDUMMY = IMP_BONE + "|" + IOSN_BONEASDUMMY; + + public const string IMP_BONEMAX4BONEWIDTH = + IMP_BONE + "|" + IOSN_BONEMAX4BONEWIDTH; + + public const string IMP_BONEMAX4BONEHEIGHT = + IMP_BONE + "|" + IOSN_BONEMAX4BONEHEIGHT; + + public const string IMP_BONEMAX4BONETAPER = + IMP_BONE + "|" + IOSN_BONEMAX4BONETAPER; + + public const string IMP_SHAPE = IMP_DEFORMATION + "|" + IOSN_SHAPE; + public const string IMP_SKINS = IMP_DEFORMATION + "|" + IOSN_SKINS; + + public const string IMP_USEMATRIXFROMPOSE = + IMP_DEFORMATION + "|" + IOSN_USEMATRIXFROMPOSE; + + public const string IMP_FORCEWEIGHTNORMALIZE = + IMP_DEFORMATION + "|" + IOSN_FORCEWEIGHTNORMALIZE; + + public const string IMP_APPLYCSTKEYRED = + IMP_CURVEFILTERS + "|" + IOSN_APPLYCSTKEYRED; + + public const string IMP_CSTKEYREDTPREC = + IMP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDTPREC; + + public const string IMP_CSTKEYREDRPREC = + IMP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDRPREC; + + public const string IMP_CSTKEYREDSPREC = + IMP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDSPREC; + + public const string IMP_CSTKEYREDOPREC = + IMP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDOPREC; + + public const string IMP_AUTOTANGENTSONLY = + IMP_APPLYCSTKEYRED + "|" + IOSN_AUTOTANGENTSONLY; + + public const string IMP_APPLYKEYREDUCE = + IMP_CURVEFILTERS + "|" + IOSN_APPLYKEYREDUCE; + + public const string IMP_KEYREDUCEPREC = + IMP_APPLYKEYREDUCE + "|" + IOSN_KEYREDUCEPREC; + + public const string IMP_APPLYKEYSONFRM = + IMP_APPLYKEYREDUCE + "|" + IOSN_APPLYKEYSONFRM; + + public const string IMP_APPLYKEYSYNC = + IMP_APPLYKEYREDUCE + "|" + IOSN_APPLYKEYSYNC; + + public const string IMP_APPLYUNROLL = + IMP_CURVEFILTERS + "|" + IOSN_APPLYUNROLL; + + public const string IMP_UNROLLPREC = + IMP_APPLYUNROLL + "|" + IOSN_UNROLLPREC; + + public const string IMP_UNROLLPATH = + IMP_APPLYUNROLL + "|" + IOSN_UNROLLPATH; + + public const string IMP_UNROLLFORCEAUTO = + IMP_APPLYUNROLL + "|" + IOSN_UNROLLFORCEAUTO; + + public const string IMP_UP_AXIS = IMP_AXISCONV_GRP + "|" + IOSN_UP_AXIS; + + public const string IMP_UP_AXIS_MAX = + IMP_AXISCONV_GRP + "|" + IOSN_UP_AXIS_MAX; + + public const string IMP_ZUPROTATION_MAX = + IMP_AXISCONV_GRP + "|" + IOSN_ZUPROTATION_MAX; + + public const string IMP_AXISCONVERSION = + IMP_AXISCONV_GRP + "|" + IOSN_AXISCONVERSION; + + public const string IMP_AUTO_AXIS = IMP_AXISCONV_GRP + "|" + IOSN_AUTO_AXIS; + + public const string IMP_FILE_UP_AXIS = + IMP_AXISCONV_GRP + "|" + IOSN_FILE_UP_AXIS; + + public const string IMP_CACHE_SIZE = IMP_CACHE_GRP + "|" + IOSN_CACHE_SIZE; + + public const string IMP_PLUGIN_UI_WIDTH = + IMP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_WIDTH; + + public const string IMP_PLUGIN_UI_HEIGHT = + IMP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_HEIGHT; + + public const string IMP_PRESET_SELECTED = + IMP_PLUGIN_GRP + "|" + IOSN_PRESET_SELECTED; + + public const string IMP_UIL = IMP_PLUGIN_GRP + "|" + IOSN_UIL; + + public const string IMP_PLUGIN_PRODUCT_FAMILY = + IMP_PLUGIN_GRP + "|" + IOSN_PLUGIN_PRODUCT_FAMILY; + + public const string IMP_PLUGIN_UI_XPOS = + IMP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_XPOS; + + public const string IMP_PLUGIN_UI_YPOS = + IMP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_YPOS; + + public const string IMP_DXF_WELD_VERTICES = + IMP_DXF + "|" + IOSN_DXF_WELD_VERTICES; + + public const string IMP_DXF_OBJECT_DERIVATION = + IMP_DXF + "|" + IOSN_DXF_OBJECT_DERIVATION; + + public const string IMP_DXF_REFERENCE_NODE = + IMP_DXF + "|" + IOSN_DXF_REFERENCE_NODE; + + public const string IMP_OBJ_REFERENCE_NODE = + IMP_OBJ + "|" + IOSN_OBJ_REFERENCE_NODE; + + public const string IMP_3DS_REFERENCENODE = + IMP_3DS + "|" + IOSN_3DS_REFERENCENODE; + + public const string IMP_3DS_TEXTURE = IMP_3DS + "|" + IOSN_3DS_TEXTURE; + public const string IMP_3DS_MATERIAL = IMP_3DS + "|" + IOSN_3DS_MATERIAL; + public const string IMP_3DS_ANIMATION = IMP_3DS + "|" + IOSN_3DS_ANIMATION; + public const string IMP_3DS_MESH = IMP_3DS + "|" + IOSN_3DS_MESH; + public const string IMP_3DS_LIGHT = IMP_3DS + "|" + IOSN_3DS_LIGHT; + public const string IMP_3DS_CAMERA = IMP_3DS + "|" + IOSN_3DS_CAMERA; + + public const string IMP_3DS_AMBIENT_LIGHT = + IMP_3DS + "|" + IOSN_3DS_AMBIENT_LIGHT; + + public const string IMP_3DS_RESCALING = IMP_3DS + "|" + IOSN_3DS_RESCALING; + public const string IMP_3DS_FILTER = IMP_3DS + "|" + IOSN_3DS_FILTER; + + public const string IMP_3DS_SMOOTHGROUP = + IMP_3DS + "|" + IOSN_3DS_SMOOTHGROUP; + + public const string IMP_FBX_MODEL_COUNT = IMP_FBX + "|" + IOSN_MODEL_COUNT; + + public const string IMP_FBX_DEVICE_COUNT = + IMP_FBX + "|" + IOSN_DEVICE_COUNT; + + public const string IMP_FBX_CHARACTER_COUNT = + IMP_FBX + "|" + IOSN_CHARACTER_COUNT; + + public const string IMP_FBX_ACTOR_COUNT = IMP_FBX + "|" + IOSN_ACTOR_COUNT; + + public const string IMP_FBX_CONSTRAINT_COUNT = + IMP_FBX + "|" + IOSN_CONSTRAINT_COUNT; + + public const string IMP_FBX_MEDIA_COUNT = IMP_FBX + "|" + IOSN_MEDIA_COUNT; + public const string IMP_FBX_TEMPLATE = IMP_FBX + "|" + IOSN_TEMPLATE; + public const string IMP_FBX_PIVOT = IMP_FBX + "|" + IOSN_PIVOT; + + public const string IMP_FBX_GLOBAL_SETTINGS = + IMP_FBX + "|" + IOSN_GLOBAL_SETTINGS; + + public const string IMP_FBX_CHARACTER = IMP_FBX + "|" + IOSN_CHARACTER; + public const string IMP_FBX_CONSTRAINT = IMP_FBX + "|" + IOSN_CONSTRAINT; + + public const string IMP_FBX_MERGE_LAYER_AND_TIMEWARP = + IMP_FBX + "|" + IOSN_MERGE_LAYER_AND_TIMEWARP; + + public const string IMP_FBX_GOBO = IMP_FBX + "|" + IOSN_GOBO; + public const string IMP_FBX_SHAPE = IMP_FBX + "|" + IOSN_SHAPE; + public const string IMP_FBX_LINK = IMP_FBX + "|" + IOSN_LINK; + public const string IMP_FBX_MATERIAL = IMP_FBX + "|" + IOSN_MATERIAL; + public const string IMP_FBX_TEXTURE = IMP_FBX + "|" + IOSN_TEXTURE; + public const string IMP_FBX_MODEL = IMP_FBX + "|" + IOSN_MODEL; + public const string IMP_FBX_AUDIO = IMP_FBX + "|" + IOSN_AUDIO; + public const string IMP_FBX_ANIMATION = IMP_FBX + "|" + IOSN_ANIMATION; + public const string IMP_FBX_PASSWORD = IMP_FBX + "|" + IOSN_PASSWORD; + + public const string IMP_FBX_PASSWORD_ENABLE = + IMP_FBX + "|" + IOSN_PASSWORD_ENABLE; + + public const string IMP_FBX_CURRENT_TAKE_NAME = + IMP_FBX + "|" + IOSN_CURRENT_TAKE_NAME; + + public const string IMP_FBX_EXTRACT_EMBEDDED_DATA = + IMP_FBX + "|" + IOSN_EXTRACT_EMBEDDED_DATA; + + public const string IMP_FBX_CALCULATE_LEGACY_SHAPE_NORMAL = + IMP_FBX + "|" + IOSN_CALCULATE_LEGACY_SHAPE_NORMAL; + + public const string IMP_FBX_NORMAL = IMP_FBX + "|" + IOSN_NORMAL; + public const string IMP_FBX_BINORMAL = IMP_FBX + "|" + IOSN_BINORMAL; + public const string IMP_FBX_TANGENT = IMP_FBX + "|" + IOSN_TANGENT; + public const string IMP_FBX_VERTEXCOLOR = IMP_FBX + "|" + IOSN_VERTEXCOLOR; + public const string IMP_FBX_POLYGROUP = IMP_FBX + "|" + IOSN_POLYGROUP; + public const string IMP_FBX_SMOOTHING = IMP_FBX + "|" + IOSN_SMOOTHING; + public const string IMP_FBX_USERDATA = IMP_FBX + "|" + IOSN_USERDATA; + public const string IMP_FBX_VISIBILITY = IMP_FBX + "|" + IOSN_VISIBILITY; + public const string IMP_FBX_EDGECREASE = IMP_FBX + "|" + IOSN_EDGECREASE; + + public const string IMP_FBX_VERTEXCREASE = + IMP_FBX + "|" + IOSN_VERTEXCREASE; + + public const string IMP_FBX_HOLE = IMP_FBX + "|" + IOSN_HOLE; + + public const string IMP_RELAXED_FBX_CHECK = + IMP_FBX + "|" + IOSN_RELAXED_FBX_CHECK; + + public const string IMP_KEEP_PRODUCER_CAM_SRCOBJ = + IMP_FBX + "|" + IOSN_KEEP_PRODUCER_CAM_SRCOBJ; + + public const string IMP_BUTTON_WEB_UPDATE = + IMP_INFORMATION_GRP + "|" + IOSN_BUTTON_WEB_UPDATE; + + public const string IMP_PI_VERSION = + IMP_INFORMATION_GRP + "|" + IOSN_PI_VERSION; + + public const string EXP_STATISTICS_GRP = + IOSN_EXPORT + "|" + IOSN_STATISTICS_GRP; + + public const string EXP_ADV_OPT_GRP = IOSN_EXPORT + "|" + IOSN_ADV_OPT_GRP; + public const string EXP_PRESETS_GRP = IOSN_EXPORT + "|" + IOSN_PRESETS_GRP; + + public const string EXP_STATISTICS = + IOSN_EXPORT + "|" + IOSN_STATISTICS_GRP + "|" + IOSN_STATISTICS; + + public const string EXP_FIRST_TIME_RUN_NOTICE_GRP = + IOSN_EXPORT + "|" + IOSN_FIRST_TIME_RUN_NOTICE; + + public const string EXP_INFORMATION_GRP = + IOSN_EXPORT + "|" + IOSN_INFORMATION_GRP; + + public const string EXP_PLUGIN_GRP = IOSN_EXPORT + "|" + IOSN_PLUGIN_GRP; + public const string EXP_INCLUDE_GRP = IOSN_EXPORT + "|" + IOSN_INCLUDE_GRP; + + public const string EXP_FBX_EXT_SDK_GRP = + IOSN_EXPORT + "|" + IOSN_FBX_EXTENTIONS_SDK; + + public const string EXP_UNITS_GRP = EXP_ADV_OPT_GRP + "|" + IOSN_UNITS_GRP; + + public const string EXP_FILEFORMAT = + EXP_ADV_OPT_GRP + "|" + IOSN_FILE_FORMAT; + + public const string EXP_AXISCONV_GRP = + EXP_ADV_OPT_GRP + "|" + IOSN_AXISCONV_GRP; + + public const string EXP_CACHE_GRP = EXP_ADV_OPT_GRP + "|" + IOSN_CACHE_GRP; + public const string EXP_UI = EXP_ADV_OPT_GRP + "|" + IOSN_UI; + + public const string EXP_FBX_EXTENTIONS_SDK_WARNING = + EXP_FBX_EXT_SDK_GRP + "|" + IOSN_FBX_EXTENTIONS_SDK_WARNING; + + public const string EXP_FIRST_TIME_RUN_NOTICE = + EXP_FIRST_TIME_RUN_NOTICE_GRP + "|" + IOSN_FIRST_TIME_RUN_NOTICE; + + public const string EXP_SCALEFACTOR = + EXP_AXISCONV_GRP + "|" + IOSN_SCALEFACTOR; + + public const string EXP_AXISCONVERSIONMETHOD = + EXP_AXISCONV_GRP + "|" + IOSN_AXISCONVERSIONMETHOD; + + public const string EXP_UPAXIS = EXP_AXISCONV_GRP + "|" + IOSN_UPAXIS; + + public const string EXP_UNITS_SCALE = + EXP_UNITS_GRP + "|" + IOSN_UNITS_SCALE; + + public const string EXP_MASTERSCALE = + EXP_UNITS_GRP + "|" + IOSN_MASTERSCALE; + + public const string EXP_DYN_SCALE_CONVERSION = + EXP_UNITS_GRP + "|" + IOSN_DYN_SCALE_CONVERSION; + + public const string EXP_UNITSELECTOR = + EXP_UNITS_GRP + "|" + IOSN_UNITSELECTOR; + + public const string EXP_TOTAL_UNITS_SCALE_TB = + EXP_UNITS_GRP + "|" + IOSN_TOTAL_UNITS_SCALE_TB; + + public const string EXP_SHOW_UI_MODE = EXP_UI + "|" + IOSN_SHOW_UI_MODE; + + public const string EXP_SHOW_UI_WARNING = + EXP_UI + "|" + IOSN_SHOW_UI_WARNING; + + public const string EXP_SHOW_WARNINGS_MANAGER = + EXP_UI + "|" + IOSN_SHOW_WARNINGS_MANAGER; + + public const string EXP_GENERATE_LOG_DATA = + EXP_UI + "|" + IOSN_GENERATE_LOG_DATA; + + public const string EXP_PLUGIN_VERSIONS_URL = + EXP_UI + "|" + IOSN_PLUGIN_VERSIONS_URL; + + public const string EXP_PRESETS = EXP_PRESETS_GRP + "|" + IOSN_PRESETS; + + public const string EXP_CAMERA_GRP = + EXP_INCLUDE_GRP + "|" + IOSN_CAMERA_GRP; + + public const string EXP_LIGHT_GRP = EXP_INCLUDE_GRP + "|" + IOSN_LIGHT_GRP; + public const string EXP_GEOMETRY = EXP_INCLUDE_GRP + "|" + IOSN_GEOMETRY; + public const string EXP_AUDIO = EXP_INCLUDE_GRP + "|" + IOSN_AUDIO; + public const string EXP_ANIMATION = EXP_INCLUDE_GRP + "|" + IOSN_ANIMATION; + + public const string EXP_PIVOTTONULLS = + EXP_INCLUDE_GRP + "|" + IOSN_PIVOTTONULLS; + + public const string EXP_LIGHT = EXP_LIGHT_GRP + "|" + IOSN_LIGHT; + + public const string EXP_LIGHTATTENUATION = + EXP_INCLUDE_GRP + "|" + IOSN_LIGHTATTENUATION; + + public const string EXP_ENVIRONMENT = + EXP_LIGHT_GRP + "|" + IOSN_ENVIRONMENT; + + public const string EXP_CAMERA = EXP_CAMERA_GRP + "|" + IOSN_CAMERA; + public const string EXP_BINDPOSE = EXP_INCLUDE_GRP + "|" + IOSN_BINDPOSE; + + public const string EXP_SELECTIONONLY = + EXP_INCLUDE_GRP + "|" + IOSN_SELECTIONONLY; + + public const string EXP_INPUTCONNECTIONS_GRP = + EXP_INCLUDE_GRP + "|" + IOSN_INPUTCONNECTIONS_GRP; + + public const string EXP_INPUTCONNECTIONS = + EXP_INPUTCONNECTIONS_GRP + "|" + IOSN_INPUTCONNECTIONS; + + public const string EXP_BYPASSRRSINHERITANCE = + EXP_INCLUDE_GRP + "|" + IOSN_BYPASSRRSINHERITANCE; + + public const string EXP_EMBEDTEXTURE_GRP = + EXP_INCLUDE_GRP + "|" + IOSN_EMBEDTEXTURE_GRP; + + public const string EXP_EMBEDTEXTURE = + EXP_EMBEDTEXTURE_GRP + "|" + IOSN_EMBEDTEXTURE; + + public const string EXP_CONVERTTOTIFF = + EXP_EMBEDTEXTURE + "|" + IOSN_CONVERTTOTIFF; + + public const string EXP_CURVEFILTERS = + EXP_ANIMATION + "|" + IOSN_CURVE_FILTER; + + public const string EXP_DEFORMATION = + EXP_ANIMATION + "|" + IOSN_DEFORMATION; + + public const string EXP_BAKECOMPLEXANIMATION = + EXP_ANIMATION + "|" + IOSN_BAKECOMPLEXANIMATION; + + public const string EXP_BONE = EXP_ANIMATION + "|" + IOSN_BONE; + + public const string EXP_SAMPLINGFRAMERATE = + EXP_ANIMATION + "|" + IOSN_SAMPLINGFRAMERATE; + + public const string EXP_POINTCACHE = EXP_ANIMATION + "|" + IOSN_POINTCACHE; + + public const string EXP_SMOOTHKEYASUSER = + EXP_ANIMATION + "|" + IOSN_SMOOTHKEYASUSER; + + public const string EXP_EXTRA_GRP = EXP_ANIMATION + "|" + IOSN_EXTRA_GRP; + + public const string EXP_REMOVE_SINGLE_KEY = + EXP_EXTRA_GRP + "|" + IOSN_REMOVE_SINGLE_KEY; + + public const string EXP_NAMETAKE = EXP_EXTRA_GRP + "|" + IOSN_NAMETAKE; + public const string EXP_QUATERNION = EXP_EXTRA_GRP + "|" + IOSN_QUATERNION; + + public const string EXP_CONSTRAINTS_GRP = + EXP_ANIMATION + "|" + IOSN_CONSTRAINTS_GRP; + + public const string EXP_CONSTRAINT = + EXP_CONSTRAINTS_GRP + "|" + IOSN_CONSTRAINT; + + public const string EXP_CHARACTER = + EXP_CONSTRAINTS_GRP + "|" + IOSN_CHARACTER; + + public const string EXP_MRCUSTOMATTRIBUTES = + EXP_GEOMETRY + "|" + IOSN_MRCUSTOMATTRIBUTES; + + public const string EXP_MESHPRIMITIVE = + EXP_GEOMETRY + "|" + IOSN_MESHPRIMITIVE; + + public const string EXP_MESHTRIANGLE = + EXP_GEOMETRY + "|" + IOSN_MESHTRIANGLE; + + public const string EXP_MESHPOLY = EXP_GEOMETRY + "|" + IOSN_MESHPOLY; + public const string EXP_NURB = EXP_GEOMETRY + "|" + IOSN_NURB; + public const string EXP_PATCH = EXP_GEOMETRY + "|" + IOSN_PATCH; + public const string EXP_BIP2FBX = EXP_GEOMETRY + "|" + IOSN_BIP2FBX; + + public const string EXP_GEOMNORMALPERPOLY = + EXP_GEOMETRY + "|" + IOSN_GEOMNORMALPERPOLY; + + public const string EXP_TANGENTSPACE = + EXP_GEOMETRY + "|" + IOSN_TANGENTS_BINORMALS; + + public const string EXP_SMOOTHMESH = EXP_GEOMETRY + "|" + IOSN_SMOOTH_MESH; + + public const string EXP_SELECTIONSET = + EXP_GEOMETRY + "|" + IOSN_SELECTION_SET; + + public const string EXP_FINESTSUBDIVLEVEL = + EXP_GEOMETRY + "|" + IOSN_FINESTSUBDIVLEVEL; + + public const string EXP_MAXBONEASBONE = + EXP_GEOMETRY + "|" + IOSN_MAXBONEASBONE; + + public const string EXP_MAXNURBSSTEP = + EXP_GEOMETRY + "|" + IOSN_MAXNURBSSTEP; + + public const string EXP_CREASE = EXP_GEOMETRY + "|" + IOSN_CREASE; + public const string EXP_BLINDDATA = EXP_GEOMETRY + "|" + IOSN_BLINDDATA; + + public const string EXP_NURBSSURFACEAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYNURBSSURFACEAS; + + public const string EXP_SMOOTHING_GROUPS = + EXP_GEOMETRY + "|" + IOSN_SMOOTHING_GROUPS; + + public const string EXP_HARDEDGES = EXP_GEOMETRY + "|" + IOSN_EXP_HARDEDGES; + + public const string EXP_ANIMATIONONLY = + EXP_GEOMETRY + "|" + IOSN_ANIMATIONONLY; + + public const string EXP_INSTANCES = EXP_GEOMETRY + "|" + IOSN_INSTANCES; + + public const string EXP_CONTAINEROBJECTS = + EXP_GEOMETRY + "|" + IOSN_CONTAINEROBJECTS; + + public const string EXP_TRIANGULATE = EXP_GEOMETRY + "|" + IOSN_TRIANGULATE; + + public const string EXP_EDGE_ORIENTATION = + EXP_GEOMETRY + "|" + IOSN_EDGE_ORIENTATION; + + public const string EXP_SELECTIONSETNAMEASPOINTCACHE = + EXP_POINTCACHE + "|" + IOSN_SELECTIONSETNAMEASPOINTCACHE; + + public const string EXP_GEOMETRYMESHPRIMITIVEAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYMESHPRIMITIVEAS; + + public const string EXP_GEOMETRYMESHTRIANGLEAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYMESHTRIANGLEAS; + + public const string EXP_GEOMETRYMESHPOLYAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYMESHPOLYAS; + + public const string EXP_GEOMETRYNURBSAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYNURBSAS; + + public const string EXP_GEOMETRYPATCHAS = + EXP_GEOMETRY + "|" + IOSN_GEOMETRYPATCHAS; + + public const string EXP_BAKEFRAMESTART = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMESTART; + + public const string EXP_BAKEFRAMEEND = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMEEND; + + public const string EXP_BAKEFRAMESTEP = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMESTEP; + + public const string EXP_BAKE_RESAMPLE_ANIMATION_CURVES = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_RESAMPLE_ANIMATION_CURVES; + + public const string EXP_BAKEFRAMESTARTNORESET = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMESTARTNORESET; + + public const string EXP_BAKEFRAMEENDNORESET = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMEENDNORESET; + + public const string EXP_BAKEFRAMESTEPNORESET = + EXP_BAKECOMPLEXANIMATION + "|" + IOSN_BAKEFRAMESTEPNORESET; + + public const string EXP_FBX = EXP_ADV_OPT_GRP + "|" + IOSN_FBX; + public const string EXP_DXF = EXP_ADV_OPT_GRP + "|" + IOSN_DXF; + public const string EXP_COLLADA = EXP_ADV_OPT_GRP + "|" + IOSN_COLLADA; + public const string EXP_OBJ = EXP_FILEFORMAT + "|" + IOSN_OBJ; + public const string EXP_3DS = EXP_FILEFORMAT + "|" + IOSN_3DS; + + public const string EXP_MOTION_BASE = + EXP_FILEFORMAT + "|" + IOSN_MOTION_BASE; + + public const string EXP_BIOVISION_BVH = + EXP_FILEFORMAT + "|" + IOSN_BIOVISION_BVH; + + public const string EXP_ACCLAIM_ASF = + EXP_FILEFORMAT + "|" + IOSN_ACCLAIM_ASF; + + public const string EXP_ACCLAIM_AMC = + EXP_FILEFORMAT + "|" + IOSN_ACCLAIM_AMC; + + public const string EXP_ASCIIFBX = EXP_FBX + "|" + IOSN_ASCIIFBX; + public const string EXP_CACHE_SIZE = EXP_CACHE_GRP + "|" + IOSN_CACHE_SIZE; + public const string EXP_SHAPE = EXP_DEFORMATION + "|" + IOSN_SHAPE; + + public const string EXP_SHAPEATTRIBUTES = + EXP_DEFORMATION + "|" + IOSN_SHAPEATTRIBUTES; + + public const string EXP_SHAPEATTRIBUTESVALUES = + EXP_SHAPEATTRIBUTES + "|" + IOSN_SHAPEATTRIBUTE_VALUES; + + public const string EXP_SKINS = EXP_DEFORMATION + "|" + IOSN_SKINS; + + public const string EXP_APPLYCSTKEYRED = + EXP_CURVEFILTERS + "|" + IOSN_APPLYCSTKEYRED; + + public const string EXP_SAMPLINGRATE = + EXP_APPLYCSTKEYRED + "|" + IOSN_SAMPLINGRATE; + + public const string EXP_CSTKEYREDTPREC = + EXP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDTPREC; + + public const string EXP_CSTKEYREDRPREC = + EXP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDRPREC; + + public const string EXP_CSTKEYREDSPREC = + EXP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDSPREC; + + public const string EXP_CSTKEYREDOPREC = + EXP_APPLYCSTKEYRED + "|" + IOSN_CSTKEYREDOPREC; + + public const string EXP_AUTOTANGENTSONLY = + EXP_APPLYCSTKEYRED + "|" + IOSN_AUTOTANGENTSONLY; + + public const string EXP_APPLYKEYREDUCE = + EXP_CURVEFILTERS + "|" + IOSN_APPLYKEYREDUCE; + + public const string EXP_KEYREDUCEPREC = + EXP_APPLYKEYREDUCE + "|" + IOSN_KEYREDUCEPREC; + + public const string EXP_APPLYKEYSONFRM = + EXP_APPLYKEYREDUCE + "|" + IOSN_APPLYKEYSONFRM; + + public const string EXP_APPLYKEYSYNC = + EXP_APPLYKEYREDUCE + "|" + IOSN_APPLYKEYSYNC; + + public const string EXP_APPLYUNROLL = + EXP_CURVEFILTERS + "|" + IOSN_APPLYUNROLL; + + public const string EXP_UNROLLPREC = + EXP_APPLYUNROLL + "|" + IOSN_UNROLLPREC; + + public const string EXP_UNROLLPATH = + EXP_APPLYUNROLL + "|" + IOSN_UNROLLPATH; + + public const string EXP_UNROLLFORCEAUTO = + EXP_APPLYUNROLL + "|" + IOSN_UNROLLFORCEAUTO; + + public const string EXP_PLUGIN_UI_WIDTH = + EXP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_WIDTH; + + public const string EXP_PLUGIN_UI_HEIGHT = + EXP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_HEIGHT; + + public const string EXP_PRESET_SELECTED = + EXP_PLUGIN_GRP + "|" + IOSN_PRESET_SELECTED; + + public const string EXP_UIL = EXP_PLUGIN_GRP + "|" + IOSN_UIL; + + public const string EXP_PLUGIN_PRODUCT_FAMILY = + EXP_PLUGIN_GRP + "|" + IOSN_PLUGIN_PRODUCT_FAMILY; + + public const string EXP_PLUGIN_UI_XPOS = + EXP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_XPOS; + + public const string EXP_PLUGIN_UI_YPOS = + EXP_PLUGIN_GRP + "|" + IOSN_PLUGIN_UI_YPOS; + + public const string EXP_BUTTON_WEB_UPDATE = + EXP_INFORMATION_GRP + "|" + IOSN_BUTTON_WEB_UPDATE; + + public const string EXP_PI_VERSION = + EXP_INFORMATION_GRP + "|" + IOSN_PI_VERSION; + + public const string EXP_BUTTON_EDIT = + EXP_PLUGIN_GRP + "|" + IOSN_BUTTON_EDIT; + + public const string EXP_BUTTON_OK = EXP_PLUGIN_GRP + "|" + IOSN_BUTTON_OK; + + public const string EXP_BUTTON_CANCEL = + EXP_PLUGIN_GRP + "|" + IOSN_BUTTON_CANCEL; + + public const string EXP_MENU_EDIT_PRESET = + EXP_PLUGIN_GRP + "|" + IOSN_MENU_EDIT_PRESET; + + public const string EXP_MENU_SAVE_PRESET = + EXP_PLUGIN_GRP + "|" + IOSN_MENU_SAVE_PRESET; + + public const string EXP_USETMPFILEPERIPHERAL = + EXP_PLUGIN_GRP + "|" + IOSN_USETMPFILEPERIPHERAL; + + public const string EXP_CONSTRUCTIONHISTORY = + EXP_PLUGIN_GRP + "|" + IOSN_CONSTRUCTIONHISTORY; + + public const string EXP_COLLADA_TRIANGULATE = + EXP_COLLADA + "|" + IOSN_COLLADA_TRIANGULATE; + + public const string EXP_COLLADA_SINGLEMATRIX = + EXP_COLLADA + "|" + IOSN_COLLADA_SINGLEMATRIX; + + public const string EXP_COLLADA_FRAME_RATE = + EXP_COLLADA + "|" + IOSN_COLLADA_FRAME_RATE; + + public const string EXP_DXF_TRIANGULATE = + EXP_DXF + "|" + IOSN_DXF_TRIANGULATE; + + public const string EXP_DXF_DEFORMATION = + EXP_DXF + "|" + IOSN_DXF_DEFORMATION; + + public const string EXP_OBJ_TRIANGULATE = + EXP_OBJ + "|" + IOSN_OBJ_TRIANGULATE; + + public const string EXP_OBJ_DEFORMATION = + EXP_OBJ + "|" + IOSN_OBJ_DEFORMATION; + + public const string EXP_3DS_REFERENCENODE = + EXP_3DS + "|" + IOSN_3DS_REFERENCENODE; + + public const string EXP_3DS_TEXTURE = EXP_3DS + "|" + IOSN_3DS_TEXTURE; + public const string EXP_3DS_MATERIAL = EXP_3DS + "|" + IOSN_3DS_MATERIAL; + public const string EXP_3DS_ANIMATION = EXP_3DS + "|" + IOSN_3DS_ANIMATION; + public const string EXP_3DS_MESH = EXP_3DS + "|" + IOSN_3DS_MESH; + public const string EXP_3DS_LIGHT = EXP_3DS + "|" + IOSN_3DS_LIGHT; + public const string EXP_3DS_CAMERA = EXP_3DS + "|" + IOSN_3DS_CAMERA; + + public const string EXP_3DS_AMBIENT_LIGHT = + EXP_3DS + "|" + IOSN_3DS_AMBIENT_LIGHT; + + public const string EXP_3DS_RESCALING = EXP_3DS + "|" + IOSN_3DS_RESCALING; + + public const string EXP_3DS_TEXUVBYPOLY = + EXP_3DS + "|" + IOSN_3DS_TEXUVBYPOLY; + + public const string EXP_FBX_TEMPLATE = EXP_FBX + "|" + IOSN_TEMPLATE; + public const string EXP_FBX_PIVOT = EXP_FBX + "|" + IOSN_PIVOT; + + public const string EXP_FBX_GLOBAL_SETTINGS = + EXP_FBX + "|" + IOSN_GLOBAL_SETTINGS; + + public const string EXP_FBX_CHARACTER = EXP_FBX + "|" + IOSN_CHARACTER; + public const string EXP_FBX_CONSTRAINT = EXP_FBX + "|" + IOSN_CONSTRAINT; + public const string EXP_FBX_GOBO = EXP_FBX + "|" + IOSN_GOBO; + public const string EXP_FBX_SHAPE = EXP_FBX + "|" + IOSN_SHAPE; + public const string EXP_FBX_MATERIAL = EXP_FBX + "|" + IOSN_MATERIAL; + public const string EXP_FBX_TEXTURE = EXP_FBX + "|" + IOSN_TEXTURE; + public const string EXP_FBX_MODEL = EXP_FBX + "|" + IOSN_MODEL; + public const string EXP_FBX_AUDIO = EXP_FBX + "|" + IOSN_AUDIO; + public const string EXP_FBX_ANIMATION = EXP_FBX + "|" + IOSN_ANIMATION; + public const string EXP_FBX_EMBEDDED = EXP_FBX + "|" + IOSN_EMBEDDED; + public const string EXP_FBX_PASSWORD = EXP_FBX + "|" + IOSN_PASSWORD; + + public const string EXP_FBX_PASSWORD_ENABLE = + EXP_FBX + "|" + IOSN_PASSWORD_ENABLE; + + public const string EXP_FBX_COLLAPSE_EXTERNALS = + EXP_FBX + "|" + IOSN_COLLAPSE_EXTERNALS; + + public const string EXP_FBX_COMPRESS_ARRAYS = + EXP_FBX + "|" + IOSN_COMPRESS_ARRAYS; + + public const string EXP_FBX_COMPRESS_LEVEL = + EXP_FBX + "|" + IOSN_COMPRESS_LEVEL; + + public const string EXP_FBX_COMPRESS_MINSIZE = + EXP_FBX + "|" + IOSN_COMPRESS_MINSIZE; + + public const string EXP_FBX_EMBEDDED_PROPERTIES_SKIP = + EXP_FBX + "|" + IOSN_EMBEDDED_PROPERTIES_SKIP; + + public const string EXP_FBX_EXPORT_FILE_VERSION = + EXP_FBX + "|" + IOSN_EXPORT_FILE_VERSION; + + public const string IOSN_MOTION_START = "MotionStart"; + public const string IOSN_MOTION_FRAME_COUNT = "MotionFrameCount"; + public const string IOSN_MOTION_FRAME_RATE = "MotionFrameRate"; + public const string IOSN_MOTION_ACTOR_PREFIX = "MotionActorPrefix"; + + public const string IOSN_MOTION_RENAME_DUPLICATE_NAMES = + "MotionRenameDuplicateNames"; + + public const string IOSN_MOTION_EXACT_ZERO_AS_OCCLUDED = + "MotionExactZeroAsOccluded"; + + public const string IOSN_MOTION_SET_OCCLUDED_TO_LAST_VALID_POSITION = + "MotionSetOccludedToLastValidPos"; + + public const string IOSN_MOTION_AS_OPTICAL_SEGMENTS = + "MotionAsOpticalSegments"; + + public const string IOSN_MOTION_ASF_SCENE_OWNED = "MotionASFSceneOwned"; + + public const string IOSN_MOTION_MOTION_FROM_GLOBAL_POSITION = + "MotionFromGlobalPosition"; + + public const string IOSN_MOTION_GAPS_AS_VALID_DATA = + "MotionGapsAsValidData"; + + public const string IOSN_MOTION_C3D_REAL_FORMAT = "MotionC3DRealFormat"; + + public const string IOSN_MOTION_CREATE_REFERENCE_NODE = + "MotionCreateReferenceNode"; + + public const string IOSN_MOTION_TRANSLATION = "MotionTranslation"; + public const string IOSN_MOTION_BASE_T_IN_OFFSET = "MotionBaseTInOffset"; + + public const string IOSN_MOTION_BASE_R_IN_PREROTATION = + "MotionBaseRInPrerotation"; + + public const string IOSN_MOTION_DUMMY_NODES = "MotionDummyNodes"; + public const string IOSN_MOTION_LIMITS = "MotionLimits"; + public const string IOSN_MOTION_FRAME_RATE_USED = "MotionFrameRateUsed"; + public const string IOSN_MOTION_FRAME_RANGE = "MotionFrameRange"; + + public const string IOSN_MOTION_WRITE_DEFAULT_AS_BASE_TR = + "MotionWriteDefaultAsBaseTR"; + + public const string IOSN_MOTION_UP_AXIS_USED_IN_FILE = + "MotionUpAxisUsedInFile"; + + public const string IMP_MOB_START = + IMP_MOTION_BASE + "|" + IOSN_MOTION_START; + + public const string IMP_MOB_FRAME_COUNT = + IMP_MOTION_BASE + "|" + IOSN_MOTION_FRAME_COUNT; + + public const string IMP_MOB_FRAME_RATE = + IMP_MOTION_BASE + "|" + IOSN_MOTION_FRAME_RATE; + + public const string IMP_MOB_ACTOR_PREFIX = + IMP_MOTION_BASE + "|" + IOSN_MOTION_ACTOR_PREFIX; + + public const string IMP_MOB_RENAME_DUPLICATE_NAMES = + IMP_MOTION_BASE + "|" + IOSN_MOTION_RENAME_DUPLICATE_NAMES; + + public const string IMP_MOB_EXACT_ZERO_AS_OCCLUDED = + IMP_MOTION_BASE + "|" + IOSN_MOTION_EXACT_ZERO_AS_OCCLUDED; + + public const string IMP_MOB_SET_OCCLUDED_TO_LAST_VALID_POSITION = + IMP_MOTION_BASE + "|" + IOSN_MOTION_SET_OCCLUDED_TO_LAST_VALID_POSITION; + + public const string IMP_MOB_AS_OPTICAL_SEGMENTS = + IMP_MOTION_BASE + "|" + IOSN_MOTION_AS_OPTICAL_SEGMENTS; + + public const string IMP_MOB_ASF_SCENE_OWNED = + IMP_MOTION_BASE + "|" + IOSN_MOTION_ASF_SCENE_OWNED; + + public const string IMP_MOB_UP_AXIS_USED_IN_FILE = + IMP_MOTION_BASE + "|" + IOSN_MOTION_UP_AXIS_USED_IN_FILE; + + public const string IMP_ACCLAIM_AMC_CREATE_REFERENCE_NODE = + IMP_ACCLAIM_AMC + "|" + IOSN_MOTION_CREATE_REFERENCE_NODE; + + public const string IMP_ACCLAIM_AMC_MOTION_BASE_T_IN_OFFSET = + IMP_ACCLAIM_AMC + "|" + IOSN_MOTION_BASE_T_IN_OFFSET; + + public const string IMP_ACCLAIM_AMC_MOTION_BASE_R_IN_PREROTATION = + IMP_ACCLAIM_AMC + "|" + IOSN_MOTION_BASE_R_IN_PREROTATION; + + public const string IMP_ACCLAIM_AMC_DUMMY_NODES = + IMP_ACCLAIM_AMC + "|" + IOSN_MOTION_DUMMY_NODES; + + public const string IMP_ACCLAIM_AMC_MOTION_LIMITS = + IMP_ACCLAIM_AMC + "|" + IOSN_MOTION_LIMITS; + + public const string IMP_ACCLAIM_ASF_CREATE_REFERENCE_NODE = + IMP_ACCLAIM_ASF + "|" + IOSN_MOTION_CREATE_REFERENCE_NODE; + + public const string IMP_ACCLAIM_ASF_MOTION_BASE_T_IN_OFFSET = + IMP_ACCLAIM_ASF + "|" + IOSN_MOTION_BASE_T_IN_OFFSET; + + public const string IMP_ACCLAIM_ASF_MOTION_BASE_R_IN_PREROTATION = + IMP_ACCLAIM_ASF + "|" + IOSN_MOTION_BASE_R_IN_PREROTATION; + + public const string IMP_ACCLAIM_ASF_DUMMY_NODES = + IMP_ACCLAIM_ASF + "|" + IOSN_MOTION_DUMMY_NODES; + + public const string IMP_ACCLAIM_ASF_MOTION_LIMITS = + IMP_ACCLAIM_ASF + "|" + IOSN_MOTION_LIMITS; + + public const string IMP_BIOVISION_BVH_CREATE_REFERENCE_NODE = + IMP_BIOVISION_BVH + "|" + IOSN_MOTION_CREATE_REFERENCE_NODE; + + public const string IMP_MOTIONANALYSIS_HTR_CREATE_REFERENCE_NODE = + IMP_MOTIONANALYSIS_HTR + "|" + IOSN_MOTION_CREATE_REFERENCE_NODE; + + public const string IMP_MOTIONANALYSIS_HTR_MOTION_BASE_T_IN_OFFSET = + IMP_MOTIONANALYSIS_HTR + "|" + IOSN_MOTION_BASE_T_IN_OFFSET; + + public const string IMP_MOTIONANALYSIS_HTR_MOTION_BASE_R_IN_PREROTATION = + IMP_MOTIONANALYSIS_HTR + "|" + IOSN_MOTION_BASE_R_IN_PREROTATION; + + public const string EXP_MOB_START = + EXP_MOTION_BASE + "|" + IOSN_MOTION_START; + + public const string EXP_MOB_FRAME_COUNT = + EXP_MOTION_BASE + "|" + IOSN_MOTION_FRAME_COUNT; + + public const string EXP_MOB_FROM_GLOBAL_POSITION = EXP_MOTION_BASE + "|" + + IOSN_MOTION_MOTION_FROM_GLOBAL_POSITION; + + public const string EXP_MOB_FRAME_RATE = + EXP_MOTION_BASE + "|" + IOSN_MOTION_FRAME_RATE; + + public const string EXP_MOB_GAPS_AS_VALID_DATA = + EXP_MOTION_BASE + "|" + IOSN_MOTION_GAPS_AS_VALID_DATA; + + public const string EXP_MOB_C3D_REAL_FORMAT = + EXP_MOTION_BASE + "|" + IOSN_MOTION_C3D_REAL_FORMAT; + + public const string EXP_MOB_ASF_SCENE_OWNED = + EXP_MOTION_BASE + "|" + IOSN_MOTION_ASF_SCENE_OWNED; + + public const string EXP_ACCLAIM_AMC_MOTION_TRANSLATION = + EXP_ACCLAIM_AMC + "|" + IOSN_MOTION_TRANSLATION; + + public const string EXP_ACCLAIM_AMC_FRAME_RATE_USED = + EXP_ACCLAIM_AMC + "|" + IOSN_MOTION_FRAME_RATE_USED; + + public const string EXP_ACCLAIM_AMC_FRAME_RANGE = + EXP_ACCLAIM_AMC + "|" + IOSN_MOTION_FRAME_RANGE; + + public const string EXP_ACCLAIM_AMC_WRITE_DEFAULT_AS_BASE_TR = + EXP_ACCLAIM_AMC + "|" + IOSN_MOTION_WRITE_DEFAULT_AS_BASE_TR; + + public const string EXP_ACCLAIM_ASF_MOTION_TRANSLATION = + EXP_ACCLAIM_ASF + "|" + IOSN_MOTION_TRANSLATION; + + public const string EXP_ACCLAIM_ASF_FRAME_RATE_USED = + EXP_ACCLAIM_ASF + "|" + IOSN_MOTION_FRAME_RATE_USED; + + public const string EXP_ACCLAIM_ASF_FRAME_RANGE = + EXP_ACCLAIM_ASF + "|" + IOSN_MOTION_FRAME_RANGE; + + public const string EXP_ACCLAIM_ASF_WRITE_DEFAULT_AS_BASE_TR = + EXP_ACCLAIM_ASF + "|" + IOSN_MOTION_WRITE_DEFAULT_AS_BASE_TR; + + public const string EXP_BIOVISION_BVH_MOTION_TRANSLATION = + EXP_BIOVISION_BVH + "|" + IOSN_MOTION_TRANSLATION; +} \ No newline at end of file diff --git a/FbxSharp/FbxImporter.cs b/FbxSharp/FbxImporter.cs index bf63b00..e2eb7ae 100644 --- a/FbxSharp/FbxImporter.cs +++ b/FbxSharp/FbxImporter.cs @@ -1,40 +1,258 @@ using System; +using System.Buffers.Binary; +using System.Collections.Generic; using System.IO; +using System.Text; namespace FbxSharp { public class FbxImporter : FbxIOBase { public FbxImporter(string name = null) + : base(name) { - Name = name; } public string Name; - //public bool Initialize(string pFileName /*, int pFileFormat = -1, FbxIOSettings*pIOSettings = null*/) - //{ - // throw new NotImplementedException(); - //} + private string initializedFilename = null; + private FbxStatus currentStatus = new(); - //public bool Import(Document pDocument /*, bool pNonBlocking=false*/) - //{ - // throw new NotImplementedException(); - //} + static bool ArraysEqual(byte[] a1, int offset1, byte[] a2, int offset2, + int count) + { + for (var i = 0; i < count; i++) + if (a1[offset1 + i] != a2[offset2 + i]) + return false; + return true; + } - public FbxScene Import(string filename) + public override string GetFileName() => initializedFilename; + + public override bool Initialize(string fileName, int fileFormat = -1, + FbxIOSettings ioSettings = null) + { + if (ioSettings == null) + ioSettings = new FbxIOSettings("IOSRoot"); + + initializedFilename = fileName; + this.ioSettings = ioSettings; + + fileHeaderInfo = GetFileHeaderInfo(initializedFilename); + + currentStatus = new FbxStatus() + { + }; + return true; + } + + [NotSdk] + public static FbxIOFileHeaderInfo GetFileHeaderInfo(string fileName) { - using (var reader = new StreamReader(filename)) + // open the file + var fhi = new FbxIOFileHeaderInfo(); + ParseObject po; + using (var fs = File.OpenRead(fileName)) { - var parser = new Parser(new Tokenizer(reader, filename:filename)); - var converter = new Converter(); + // determine if it's ascii or binary + var buffer = new byte[4096]; // TODO: buffer overflow + int count = fs.Read(buffer, 0, 20); + if (count < 20) + throw new InvalidOperationException(); + var binaryHeader = + Encoding.ASCII.GetBytes("Kaydara FBX Binary "); + if (buffer[0] == ';') + fhi.mBinary = false; + else if (ArraysEqual(buffer, 0, binaryHeader, 0, 20)) + fhi.mBinary = true; + else + throw new InvalidOperationException( + "Can't determine if it's ascii or binary"); + + // determine the file format version + // ascii major/minor/patch versions start at offset 6, "a.b.c" + // format version XXXX is in .FBXHeaderExtension.FBXVersion + // binary file format: + // header 20 bytes + // header null-terminator 1 byte 0x00 + // reserved/unknown 2 bytes 0x1a 0x00 + // format version 4 bytes little endian uint32 + // 6100 = 0x17d4 + // 7100 = 0x1bbc + // 7200 = 0x1c20 + // 7300 = 0x1c84 + // 7400 = 0x1ce8 + // 7500 = 0x1d4c + // 7700 = 0x1e14 + if (fhi.mBinary) + { + count = fs.Read(buffer, 20, 7); + if (count != 7) + throw new InvalidOperationException("Unexpected EOF"); + if (buffer[20] != 0) + throw new InvalidOperationException("Bad magic number"); + if (buffer[21] != 0x1a) + throw new InvalidOperationException("Bad magic number"); + if (buffer[22] != 0) + throw new InvalidOperationException("Bad magic number"); + int value = + BinaryPrimitives.ReadInt32LittleEndian( + new Span(buffer, 23, 4)); + fhi.mFileVersion = value; - var pobjects = parser.ReadFile(); - var scene = converter.ConvertScene(pobjects); + var parser = BinaryParser.FromFileVersion( + fhi.mFileVersion, fs, fileName); + po = parser.ReadObject(); + } + else + { + fs.Seek(0, SeekOrigin.Begin); + var reader = new StreamReader(fs, Encoding.ASCII); + var t = new Tokenizer(reader); + var parser = new Parser(t); - return scene; + po = parser.ReadObject(); + } } + + if (po == null) + throw new InvalidOperationException( + "No object read from file"); + if (po.Name != "FBXHeaderExtension") + throw new InvalidOperationException( + $"Expected FBXHeaderExtension object, " + + $"got {po.Name}"); + + var prop = po.FindPropertyByName("FBXHeaderVersion"); + if (prop == null) + throw new InvalidOperationException( + "No FBXHeaderVersion found"); + int fbxHeaderVersion = prop.GetIntValue(); + + prop = po.FindPropertyByName("FBXVersion"); + if (prop == null) + throw new InvalidOperationException( + "No FBXVersion found"); + fhi.mFileVersion = prop.GetIntValue(); + + prop = po.FindPropertyByName("CreationTimeStamp"); + if (prop != null) + { + var lt = new FbxLocalTime(); + fhi.mCreationTimeStampPresent = true; + var prop2 = prop.FindPropertyByName("Version"); + prop2 = prop.FindPropertyByName("Year"); + lt.mYear = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Month"); + lt.mMonth = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Day"); + lt.mDay = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Hour"); + lt.mHour = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Minute"); + lt.mMinute = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Second"); + lt.mSecond = prop2.GetIntValue(); + prop2 = prop.FindPropertyByName("Millisecond"); + lt.mMillisecond = prop2.GetIntValue(); + + fhi.mCreationTimeStamp = lt; + } + + prop = po.FindPropertyByName("Creator"); + fhi.mCreator = prop.GetStringValue(); + + return fhi; + } + + public bool Import(FbxDocument document, bool pNonBlocking = false) + { + if (pNonBlocking) + throw new NotImplementedException(); + + using var stream = File.Open(initializedFilename, FileMode.Open); + List pobjects; + if (fileHeaderInfo.mBinary) + { + stream.Seek(27, SeekOrigin.Begin); + var parser = BinaryParser.FromFileVersion( + fileHeaderInfo.mFileVersion, stream, initializedFilename); + pobjects = parser.ReadFile(); + } + else + { + using var reader = new StreamReader(stream); + var parser = new Parser(new Tokenizer(reader, + filename: initializedFilename)); + pobjects = parser.ReadFile(); + } + + var converter = new Converter(); + converter.ConvertScene(pobjects, (FbxScene)document); + return true; + } + + [NotSdk] + public FbxScene Import(string filename) + { + var success = Initialize(filename); + if (!success) + throw new InvalidOperationException("Failed to initialize"); + var scene = new FbxScene("Scene"); + success = Import(scene); + if (!success) + throw new InvalidOperationException("Failed to import"); + return scene; + } + + public bool IsFBX() + { + // TODO: this should return a value after initialization + return false; + } + + public int GetFileFormat() + { + // TODO: this should return a value after initialization + return -1; + } + + public bool IsImporting(out bool importResult) + { + importResult = false; + return false; + } + + public float GetProgress(object param) + { + return 0; + } + + public void GetFileVersion(out int major, out int minor, + out int revision) + { + major = (fileHeaderInfo.mFileVersion / 1000) % 10; + minor = (fileHeaderInfo.mFileVersion / 100) % 10; + revision = (fileHeaderInfo.mFileVersion / 10) % 10; + } + + private FbxIOFileHeaderInfo fileHeaderInfo = new(); + + public FbxIOFileHeaderInfo GetFileHeaderInfo() + { + return fileHeaderInfo; + } + + private FbxIOSettings ioSettings; + + public FbxIOSettings GetIOSettings() + { + return ioSettings; + } + + public override FbxStatus GetStatus() + { + return currentStatus; } } } - diff --git a/FbxSharp/FbxLight.cs b/FbxSharp/FbxLight.cs index ed51efa..a40ff16 100644 --- a/FbxSharp/FbxLight.cs +++ b/FbxSharp/FbxLight.cs @@ -4,36 +4,60 @@ namespace FbxSharp { public class FbxLight : FbxNodeAttribute { - public FbxLight(string name="") + public FbxLight(string name = "") : base(name) { - Properties.Add(LightType); - Properties.Add(CastLight); - Properties.Add(DrawVolumetricLight); - Properties.Add(DrawGroundProjection); - Properties.Add(DrawFrontFacingVolumetricLight); - Properties.Add(Color); - Properties.Add(Intensity); - Properties.Add(InnerAngle); - Properties.Add(OuterAngle); - Properties.Add(Fog); - Properties.Add(DecayType); - Properties.Add(DecayStart); - Properties.Add(FileName); - Properties.Add(EnableNearAttenuation); - Properties.Add(NearAttenuationStart); - Properties.Add(NearAttenuationEnd); - Properties.Add(EnableFarAttenuation); - Properties.Add(FarAttenuationStart); - Properties.Add(FarAttenuationEnd); - Properties.Add(CastShadows); - Properties.Add(ShadowColor); - Properties.Add(AreaLightShape); - Properties.Add(LeftBarnDoor); - Properties.Add(RightBarnDoor); - Properties.Add(TopBarnDoor); - Properties.Add(BottomBarnDoor); - Properties.Add(EnableBarnDoor); + LightType = FbxPropertyT.StaticInit(this, "LightType", + default, false); + CastLight = FbxPropertyT.StaticInit(this, + "CastLightOnObject", false, false); + DrawVolumetricLight = FbxPropertyT.StaticInit(this, + "DrawVolumetricLight", false, false); + DrawGroundProjection = FbxPropertyT.StaticInit(this, + "DrawGroundProjection", false, false); + DrawFrontFacingVolumetricLight = FbxPropertyT.StaticInit( + this, "DrawFrontFacingVolumetricLight", false, false); + Intensity = FbxPropertyT.StaticInit(this, "Intensity", + 0.0, false); + InnerAngle = FbxPropertyT.StaticInit(this, "InnerAngle", + 0.0, false); + OuterAngle = FbxPropertyT.StaticInit(this, "OuterAngle", + 0.0, false); + Fog = FbxPropertyT.StaticInit(this, "Fog", 0.0, false); + DecayType = FbxPropertyT.StaticInit(this, "DecayType", + default, false); + DecayStart = FbxPropertyT.StaticInit(this, "DecayStart", + 0.0, false); + FileName = FbxPropertyT.StaticInit(this, "FileName", "", + false); + EnableNearAttenuation = FbxPropertyT.StaticInit(this, + "EnableNearAttenuation", false, false); + NearAttenuationStart = FbxPropertyT.StaticInit(this, + "NearAttenuationStart", 0.0, false); + NearAttenuationEnd = FbxPropertyT.StaticInit(this, + "NearAttenuationEnd", 0.0, false); + EnableFarAttenuation = FbxPropertyT.StaticInit(this, + "EnableFarAttenuation", false, false); + FarAttenuationStart = FbxPropertyT.StaticInit(this, + "FarAttenuationStart", 0.0, false); + FarAttenuationEnd = FbxPropertyT.StaticInit(this, + "FarAttenuationEnd", 0.0, false); + CastShadows = FbxPropertyT.StaticInit(this, "CastShadows", + false, false); + ShadowColor = FbxPropertyT.StaticInit(this, + "ShadowColor", FbxVector3.Zero, false); + AreaLightShape = FbxPropertyT.StaticInit(this, + "AreaLightShape", default, false); + LeftBarnDoor = FbxPropertyT.StaticInit(this, + "LeftBarnDoor", 0f, false); + RightBarnDoor = FbxPropertyT.StaticInit(this, + "RightBarnDoor", 0f, false); + TopBarnDoor = FbxPropertyT.StaticInit(this, "TopBarnDoor", + 0f, false); + BottomBarnDoor = FbxPropertyT.StaticInit(this, + "BottomBarnDoor", 0f, false); + EnableBarnDoor = FbxPropertyT.StaticInit(this, + "EnableBarnDoor", false, false); } #region implemented abstract members of NodeAttribute @@ -85,32 +109,32 @@ public FbxTexture GetShadowTexture() #region Properties - public FbxPropertyT LightType = new FbxPropertyT ("LightType"); - public FbxPropertyT CastLight = new FbxPropertyT ("CastLightOnObject"); - public FbxPropertyT DrawVolumetricLight = new FbxPropertyT ("DrawVolumetricLight"); - public FbxPropertyT DrawGroundProjection = new FbxPropertyT ("DrawGroundProjection"); - public FbxPropertyT DrawFrontFacingVolumetricLight = new FbxPropertyT ("DrawFrontFacingVolumetricLight"); - public FbxPropertyT Intensity = new FbxPropertyT ("Intensity"); - public FbxPropertyT InnerAngle = new FbxPropertyT ("InnerAngle"); - public FbxPropertyT OuterAngle = new FbxPropertyT ("OuterAngle"); - public FbxPropertyT Fog = new FbxPropertyT ("Fog"); - public FbxPropertyT DecayType = new FbxPropertyT ("DecayType"); - public FbxPropertyT DecayStart = new FbxPropertyT ("DecayStart"); - public FbxPropertyT FileName = new FbxPropertyT ("FileName"); - public FbxPropertyT EnableNearAttenuation = new FbxPropertyT ("EnableNearAttenuation"); - public FbxPropertyT NearAttenuationStart = new FbxPropertyT ("NearAttenuationStart"); - public FbxPropertyT NearAttenuationEnd = new FbxPropertyT ("NearAttenuationEnd"); - public FbxPropertyT EnableFarAttenuation = new FbxPropertyT ("EnableFarAttenuation"); - public FbxPropertyT FarAttenuationStart = new FbxPropertyT ("FarAttenuationStart"); - public FbxPropertyT FarAttenuationEnd = new FbxPropertyT ("FarAttenuationEnd"); - public FbxPropertyT CastShadows = new FbxPropertyT ("CastShadows"); - public FbxPropertyT ShadowColor = new FbxPropertyT ("ShadowColor"); - public FbxPropertyT AreaLightShape = new FbxPropertyT("AreaLightShape"); - public FbxPropertyT LeftBarnDoor = new FbxPropertyT ("LeftBarnDoor"); - public FbxPropertyT RightBarnDoor = new FbxPropertyT ("RightBarnDoor"); - public FbxPropertyT TopBarnDoor = new FbxPropertyT ("TopBarnDoor"); - public FbxPropertyT BottomBarnDoor = new FbxPropertyT ("BottomBarnDoor"); - public FbxPropertyT EnableBarnDoor = new FbxPropertyT ("EnableBarnDoor"); + public FbxPropertyT LightType; + public FbxPropertyT CastLight; + public FbxPropertyT DrawVolumetricLight; + public FbxPropertyT DrawGroundProjection; + public FbxPropertyT DrawFrontFacingVolumetricLight; + public FbxPropertyT Intensity; + public FbxPropertyT InnerAngle; + public FbxPropertyT OuterAngle; + public FbxPropertyT Fog; + public FbxPropertyT DecayType; + public FbxPropertyT DecayStart; + public FbxPropertyT FileName; + public FbxPropertyT EnableNearAttenuation; + public FbxPropertyT NearAttenuationStart; + public FbxPropertyT NearAttenuationEnd; + public FbxPropertyT EnableFarAttenuation; + public FbxPropertyT FarAttenuationStart; + public FbxPropertyT FarAttenuationEnd; + public FbxPropertyT CastShadows; + public FbxPropertyT ShadowColor; + public FbxPropertyT AreaLightShape; + public FbxPropertyT LeftBarnDoor; + public FbxPropertyT RightBarnDoor; + public FbxPropertyT TopBarnDoor; + public FbxPropertyT BottomBarnDoor; + public FbxPropertyT EnableBarnDoor; #endregion } diff --git a/FbxSharp/FbxLocalTime.cs b/FbxSharp/FbxLocalTime.cs new file mode 100644 index 0000000..3016b09 --- /dev/null +++ b/FbxSharp/FbxLocalTime.cs @@ -0,0 +1,12 @@ +namespace FbxSharp; + +public class FbxLocalTime +{ + public int mYear; + public int mMonth; + public int mDay; + public int mHour; + public int mMinute; + public int mSecond; + public int mMillisecond; +} \ No newline at end of file diff --git a/FbxSharp/FbxNode.cs b/FbxSharp/FbxNode.cs index 2da153a..d07ecd3 100644 --- a/FbxSharp/FbxNode.cs +++ b/FbxSharp/FbxNode.cs @@ -6,84 +6,154 @@ namespace FbxSharp { public class FbxNode : FbxObject { - public FbxNode(string name="") - { - this.Properties.AddRange( - new FbxProperty[] { - LclTranslation, - LclRotation, - LclScaling, - Visibility, - VisibilityInheritance, - QuaternionInterpolate, - RotationOffset, - RotationPivot, - ScalingOffset, - ScalingPivot, - TranslationActive, - TranslationMin, - TranslationMax, - TranslationMinX, - TranslationMinY, - TranslationMinZ, - TranslationMaxX, - TranslationMaxY, - TranslationMaxZ, - RotationOrder, - RotationSpaceForLimitOnly, - RotationStiffnessX, - RotationStiffnessY, - RotationStiffnessZ, - AxisLen, - PreRotation, - PostRotation, - RotationActive, - RotationMin, - RotationMax, - RotationMinX, - RotationMinY, - RotationMinZ, - RotationMaxX, - RotationMaxY, - RotationMaxZ, - InheritType, - ScalingActive, - ScalingMin, - ScalingMax, - ScalingMinX, - ScalingMinY, - ScalingMinZ, - ScalingMaxX, - ScalingMaxY, - ScalingMaxZ, - GeometricTranslation, - GeometricRotation, - GeometricScaling, - MinDampRangeX, - MinDampRangeY, - MinDampRangeZ, - MaxDampRangeX, - MaxDampRangeY, - MaxDampRangeZ, - MinDampStrengthX, - MinDampStrengthY, - MinDampStrengthZ, - MaxDampStrengthX, - MaxDampStrengthY, - MaxDampStrengthZ, - PreferedAngleX, - PreferedAngleY, - PreferedAngleZ, - LookAtProperty, - UpVectorProperty, - Show, - NegativePercentShapeSupport, - DefaultAttributeIndex, - Freeze, - LODBox}); + public FbxNode(string name = "") + { + LclTranslation = FbxPropertyT.StaticInit(this, + "Lcl Translation", FbxVector3.Zero, false); + LclRotation = FbxPropertyT.StaticInit(this, + "Lcl Rotation", FbxVector3.Zero, false); + LclScaling = FbxPropertyT.StaticInit(this, + "Lcl Scaling", FbxVector3.One, false); + Visibility = FbxPropertyT.StaticInit(this, "Visibility", + 0.0, false); + VisibilityInheritance = FbxPropertyT.StaticInit(this, + "Visibility Inheritance", false, false); + QuaternionInterpolate = + FbxPropertyT.StaticInit(this, + "QuaternionInterpolate", default, false); + RotationOffset = FbxPropertyT.StaticInit(this, + "RotationOffset", FbxVector3.Zero, false); + RotationPivot = FbxPropertyT.StaticInit(this, + "RotationPivot", FbxVector3.Zero, false); + ScalingOffset = FbxPropertyT.StaticInit(this, + "ScalingOffset", FbxVector3.Zero, false); + ScalingPivot = FbxPropertyT.StaticInit(this, + "ScalingPivot", FbxVector3.Zero, false); + TranslationActive = FbxPropertyT.StaticInit(this, + "TranslationActive", false, false); + TranslationMin = FbxPropertyT.StaticInit(this, + "TranslationMin", FbxVector3.Zero, false); + TranslationMax = FbxPropertyT.StaticInit(this, + "TranslationMax", FbxVector3.Zero, false); + TranslationMinX = FbxPropertyT.StaticInit(this, + "TranslationMinX", false, false); + TranslationMinY = FbxPropertyT.StaticInit(this, + "TranslationMinY", false, false); + TranslationMinZ = FbxPropertyT.StaticInit(this, + "TranslationMinZ", false, false); + TranslationMaxX = FbxPropertyT.StaticInit(this, + "TranslationMaxX", false, false); + TranslationMaxY = FbxPropertyT.StaticInit(this, + "TranslationMaxY", false, false); + TranslationMaxZ = FbxPropertyT.StaticInit(this, + "TranslationMaxZ", false, false); + RotationOrder = FbxPropertyT.StaticInit(this, + "RotationOrder", default, false); + RotationSpaceForLimitOnly = FbxPropertyT.StaticInit(this, + "RotationSpaceForLimitOnly", false, false); + RotationStiffnessX = FbxPropertyT.StaticInit(this, + "RotationStiffnessX", 0.0, false); + RotationStiffnessY = FbxPropertyT.StaticInit(this, + "RotationStiffnessY", 0.0, false); + RotationStiffnessZ = FbxPropertyT.StaticInit(this, + "RotationStiffnessZ", 0.0, false); + AxisLen = FbxPropertyT.StaticInit(this, "AxisLen", 0.0, + false); + PreRotation = FbxPropertyT.StaticInit(this, + "PreRotation", FbxVector3.Zero, false); + PostRotation = FbxPropertyT.StaticInit(this, + "PostRotation", FbxVector3.Zero, false); + RotationActive = FbxPropertyT.StaticInit(this, + "RotationActive", false, false); + RotationMin = FbxPropertyT.StaticInit(this, + "RotationMin", FbxVector3.Zero, false); + RotationMax = FbxPropertyT.StaticInit(this, + "RotationMax", FbxVector3.Zero, false); + RotationMinX = FbxPropertyT.StaticInit(this, "RotationMinX", + false, false); + RotationMinY = FbxPropertyT.StaticInit(this, "RotationMinY", + false, false); + RotationMinZ = FbxPropertyT.StaticInit(this, "RotationMinZ", + false, false); + RotationMaxX = FbxPropertyT.StaticInit(this, "RotationMaxX", + false, false); + RotationMaxY = FbxPropertyT.StaticInit(this, "RotationMaxY", + false, false); + RotationMaxZ = FbxPropertyT.StaticInit(this, "RotationMaxZ", + false, false); + InheritType = FbxPropertyT.StaticInit( + this, "InheritType", default, false); + ScalingActive = FbxPropertyT.StaticInit(this, + "ScalingActive", false, false); + ScalingMin = FbxPropertyT.StaticInit(this, + "ScalingMin", FbxVector3.Zero, false); + ScalingMax = FbxPropertyT.StaticInit(this, + "ScalingMax", FbxVector3.Zero, false); + ScalingMinX = FbxPropertyT.StaticInit(this, "ScalingMinX", + false, false); + ScalingMinY = FbxPropertyT.StaticInit(this, "ScalingMinY", + false, false); + ScalingMinZ = FbxPropertyT.StaticInit(this, "ScalingMinZ", + false, false); + ScalingMaxX = FbxPropertyT.StaticInit(this, "ScalingMaxX", + false, false); + ScalingMaxY = FbxPropertyT.StaticInit(this, "ScalingMaxY", + false, false); + ScalingMaxZ = FbxPropertyT.StaticInit(this, "ScalingMaxZ", + false, false); + GeometricTranslation = FbxPropertyT.StaticInit(this, + "GeometricTranslation", FbxVector3.Zero, false); + GeometricRotation = FbxPropertyT.StaticInit(this, + "GeometricRotation", FbxVector3.Zero, false); + GeometricScaling = FbxPropertyT.StaticInit(this, + "GeometricScaling", FbxVector3.Zero, false); + MinDampRangeX = FbxPropertyT.StaticInit(this, + "MinDampRangeX", 0.0, false); + MinDampRangeY = FbxPropertyT.StaticInit(this, + "MinDampRangeY", 0.0, false); + MinDampRangeZ = FbxPropertyT.StaticInit(this, + "MinDampRangeZ", 0.0, false); + MaxDampRangeX = FbxPropertyT.StaticInit(this, + "MaxDampRangeX", 0.0, false); + MaxDampRangeY = FbxPropertyT.StaticInit(this, + "MaxDampRangeY", 0.0, false); + MaxDampRangeZ = FbxPropertyT.StaticInit(this, + "MaxDampRangeZ", 0.0, false); + MinDampStrengthX = FbxPropertyT.StaticInit(this, + "MinDampStrengthX", 0.0, false); + MinDampStrengthY = FbxPropertyT.StaticInit(this, + "MinDampStrengthY", 0.0, false); + MinDampStrengthZ = FbxPropertyT.StaticInit(this, + "MinDampStrengthZ", 0.0, false); + MaxDampStrengthX = FbxPropertyT.StaticInit(this, + "MaxDampStrengthX", 0.0, false); + MaxDampStrengthY = FbxPropertyT.StaticInit(this, + "MaxDampStrengthY", 0.0, false); + MaxDampStrengthZ = FbxPropertyT.StaticInit(this, + "MaxDampStrengthZ", 0.0, false); + PreferedAngleX = FbxPropertyT.StaticInit(this, + "PreferedAngleX", 0.0, false); + PreferedAngleY = FbxPropertyT.StaticInit(this, + "PreferedAngleY", 0.0, false); + PreferedAngleZ = FbxPropertyT.StaticInit(this, + "PreferedAngleZ", 0.0, false); + LookAtProperty = FbxPropertyT.StaticInit(this, + "LookAtProperty", null, false); + UpVectorProperty = FbxPropertyT.StaticInit(this, + "UpVectorProperty", null, false); + Show = FbxPropertyT.StaticInit(this, "Show", false, false); + NegativePercentShapeSupport = FbxPropertyT.StaticInit(this, + "NegativePercentShapeSupport", false, false); + DefaultAttributeIndex = FbxPropertyT.StaticInit(this, + "DefaultAttributeIndex", 0, false); + Freeze = FbxPropertyT.StaticInit(this, "Freeze", false, + false); + LODBox = FbxPropertyT.StaticInit(this, "LODBox", false, + false); DefaultAttributeIndex.Set(-1); - nodeAttributes = SrcObjects.CreateCollectionView(); + nodeAttributes = + SrcObjects.CreateCollectionView(); Materials = SrcObjects.CreateCollectionView(); } @@ -349,77 +419,77 @@ public int GetMaterialIndex(string pName) #region Public and Fast Access Properties - public FbxPropertyT LclTranslation = new FbxPropertyT("Lcl Translation"); - public FbxPropertyT LclRotation = new FbxPropertyT("Lcl Rotation"); - public FbxPropertyT LclScaling = new FbxPropertyT("Lcl Scaling", FbxVector3.One); - public FbxPropertyT Visibility = new FbxPropertyT("Visibility"); - public FbxPropertyT VisibilityInheritance = new FbxPropertyT("Visibility Inheritance"); - public FbxPropertyT QuaternionInterpolate = new FbxPropertyT("QuaternionInterpolate"); - public FbxPropertyT RotationOffset = new FbxPropertyT("RotationOffset"); - public FbxPropertyT RotationPivot = new FbxPropertyT("RotationPivot"); - public FbxPropertyT ScalingOffset = new FbxPropertyT("ScalingOffset"); - public FbxPropertyT ScalingPivot = new FbxPropertyT("ScalingPivot"); - public FbxPropertyT TranslationActive = new FbxPropertyT("TranslationActive"); - public FbxPropertyT TranslationMin = new FbxPropertyT("TranslationMin"); - public FbxPropertyT TranslationMax = new FbxPropertyT("TranslationMax"); - public FbxPropertyT TranslationMinX = new FbxPropertyT("TranslationMinX"); - public FbxPropertyT TranslationMinY = new FbxPropertyT("TranslationMinY"); - public FbxPropertyT TranslationMinZ = new FbxPropertyT("TranslationMinZ"); - public FbxPropertyT TranslationMaxX = new FbxPropertyT("TranslationMaxX"); - public FbxPropertyT TranslationMaxY = new FbxPropertyT("TranslationMaxY"); - public FbxPropertyT TranslationMaxZ = new FbxPropertyT("TranslationMaxZ"); - public FbxPropertyT RotationOrder = new FbxPropertyT("RotationOrder"); - public FbxPropertyT RotationSpaceForLimitOnly = new FbxPropertyT("RotationSpaceForLimitOnly"); - public FbxPropertyT RotationStiffnessX = new FbxPropertyT("RotationStiffnessX"); - public FbxPropertyT RotationStiffnessY = new FbxPropertyT("RotationStiffnessY"); - public FbxPropertyT RotationStiffnessZ = new FbxPropertyT("RotationStiffnessZ"); - public FbxPropertyT AxisLen = new FbxPropertyT("AxisLen"); - public FbxPropertyT PreRotation = new FbxPropertyT("PreRotation"); - public FbxPropertyT PostRotation = new FbxPropertyT("PostRotation"); - public FbxPropertyT RotationActive = new FbxPropertyT("RotationActive"); - public FbxPropertyT RotationMin = new FbxPropertyT("RotationMin"); - public FbxPropertyT RotationMax = new FbxPropertyT("RotationMax"); - public FbxPropertyT RotationMinX = new FbxPropertyT("RotationMinX"); - public FbxPropertyT RotationMinY = new FbxPropertyT("RotationMinY"); - public FbxPropertyT RotationMinZ = new FbxPropertyT("RotationMinZ"); - public FbxPropertyT RotationMaxX = new FbxPropertyT("RotationMaxX"); - public FbxPropertyT RotationMaxY = new FbxPropertyT("RotationMaxY"); - public FbxPropertyT RotationMaxZ = new FbxPropertyT("RotationMaxZ"); - public FbxPropertyT InheritType = new FbxPropertyT("InheritType"); - public FbxPropertyT ScalingActive = new FbxPropertyT("ScalingActive"); - public FbxPropertyT ScalingMin = new FbxPropertyT("ScalingMin"); - public FbxPropertyT ScalingMax = new FbxPropertyT("ScalingMax"); - public FbxPropertyT ScalingMinX = new FbxPropertyT("ScalingMinX"); - public FbxPropertyT ScalingMinY = new FbxPropertyT("ScalingMinY"); - public FbxPropertyT ScalingMinZ = new FbxPropertyT("ScalingMinZ"); - public FbxPropertyT ScalingMaxX = new FbxPropertyT("ScalingMaxX"); - public FbxPropertyT ScalingMaxY = new FbxPropertyT("ScalingMaxY"); - public FbxPropertyT ScalingMaxZ = new FbxPropertyT("ScalingMaxZ"); - public FbxPropertyT GeometricTranslation = new FbxPropertyT("GeometricTranslation"); - public FbxPropertyT GeometricRotation = new FbxPropertyT("GeometricRotation"); - public FbxPropertyT GeometricScaling = new FbxPropertyT("GeometricScaling"); - public FbxPropertyT MinDampRangeX = new FbxPropertyT("MinDampRangeX"); - public FbxPropertyT MinDampRangeY = new FbxPropertyT("MinDampRangeY"); - public FbxPropertyT MinDampRangeZ = new FbxPropertyT("MinDampRangeZ"); - public FbxPropertyT MaxDampRangeX = new FbxPropertyT("MaxDampRangeX"); - public FbxPropertyT MaxDampRangeY = new FbxPropertyT("MaxDampRangeY"); - public FbxPropertyT MaxDampRangeZ = new FbxPropertyT("MaxDampRangeZ"); - public FbxPropertyT MinDampStrengthX = new FbxPropertyT("MinDampStrengthX"); - public FbxPropertyT MinDampStrengthY = new FbxPropertyT("MinDampStrengthY"); - public FbxPropertyT MinDampStrengthZ = new FbxPropertyT("MinDampStrengthZ"); - public FbxPropertyT MaxDampStrengthX = new FbxPropertyT("MaxDampStrengthX"); - public FbxPropertyT MaxDampStrengthY = new FbxPropertyT("MaxDampStrengthY"); - public FbxPropertyT MaxDampStrengthZ = new FbxPropertyT("MaxDampStrengthZ"); - public FbxPropertyT PreferedAngleX = new FbxPropertyT("PreferedAngleX"); - public FbxPropertyT PreferedAngleY = new FbxPropertyT("PreferedAngleY"); - public FbxPropertyT PreferedAngleZ = new FbxPropertyT("PreferedAngleZ"); - public FbxPropertyT LookAtProperty = new FbxPropertyT("LookAtProperty"); - public FbxPropertyT UpVectorProperty = new FbxPropertyT("UpVectorProperty"); - public FbxPropertyT Show = new FbxPropertyT("Show"); - public FbxPropertyT NegativePercentShapeSupport = new FbxPropertyT("NegativePercentShapeSupport"); - public FbxPropertyT DefaultAttributeIndex = new FbxPropertyT("DefaultAttributeIndex"); - public FbxPropertyT Freeze = new FbxPropertyT("Freeze"); - public FbxPropertyT LODBox = new FbxPropertyT("LODBox"); + public FbxPropertyT LclTranslation; + public FbxPropertyT LclRotation; + public FbxPropertyT LclScaling; + public FbxPropertyT Visibility; + public FbxPropertyT VisibilityInheritance; + public FbxPropertyT QuaternionInterpolate; + public FbxPropertyT RotationOffset; + public FbxPropertyT RotationPivot; + public FbxPropertyT ScalingOffset; + public FbxPropertyT ScalingPivot; + public FbxPropertyT TranslationActive; + public FbxPropertyT TranslationMin; + public FbxPropertyT TranslationMax; + public FbxPropertyT TranslationMinX; + public FbxPropertyT TranslationMinY; + public FbxPropertyT TranslationMinZ; + public FbxPropertyT TranslationMaxX; + public FbxPropertyT TranslationMaxY; + public FbxPropertyT TranslationMaxZ; + public FbxPropertyT RotationOrder; + public FbxPropertyT RotationSpaceForLimitOnly; + public FbxPropertyT RotationStiffnessX; + public FbxPropertyT RotationStiffnessY; + public FbxPropertyT RotationStiffnessZ; + public FbxPropertyT AxisLen; + public FbxPropertyT PreRotation; + public FbxPropertyT PostRotation; + public FbxPropertyT RotationActive; + public FbxPropertyT RotationMin; + public FbxPropertyT RotationMax; + public FbxPropertyT RotationMinX; + public FbxPropertyT RotationMinY; + public FbxPropertyT RotationMinZ; + public FbxPropertyT RotationMaxX; + public FbxPropertyT RotationMaxY; + public FbxPropertyT RotationMaxZ; + public FbxPropertyT InheritType; + public FbxPropertyT ScalingActive; + public FbxPropertyT ScalingMin; + public FbxPropertyT ScalingMax; + public FbxPropertyT ScalingMinX; + public FbxPropertyT ScalingMinY; + public FbxPropertyT ScalingMinZ; + public FbxPropertyT ScalingMaxX; + public FbxPropertyT ScalingMaxY; + public FbxPropertyT ScalingMaxZ; + public FbxPropertyT GeometricTranslation; + public FbxPropertyT GeometricRotation; + public FbxPropertyT GeometricScaling; + public FbxPropertyT MinDampRangeX; + public FbxPropertyT MinDampRangeY; + public FbxPropertyT MinDampRangeZ; + public FbxPropertyT MaxDampRangeX; + public FbxPropertyT MaxDampRangeY; + public FbxPropertyT MaxDampRangeZ; + public FbxPropertyT MinDampStrengthX; + public FbxPropertyT MinDampStrengthY; + public FbxPropertyT MinDampStrengthZ; + public FbxPropertyT MaxDampStrengthX; + public FbxPropertyT MaxDampStrengthY; + public FbxPropertyT MaxDampStrengthZ; + public FbxPropertyT PreferedAngleX; + public FbxPropertyT PreferedAngleY; + public FbxPropertyT PreferedAngleZ; + public FbxPropertyT LookAtProperty; + public FbxPropertyT UpVectorProperty; + public FbxPropertyT Show; + public FbxPropertyT NegativePercentShapeSupport; + public FbxPropertyT DefaultAttributeIndex; + public FbxPropertyT Freeze; + public FbxPropertyT LODBox; #endregion diff --git a/FbxSharp/FbxNodeAttribute.cs b/FbxSharp/FbxNodeAttribute.cs index f01bd86..68c75c3 100644 --- a/FbxSharp/FbxNodeAttribute.cs +++ b/FbxSharp/FbxNodeAttribute.cs @@ -4,10 +4,11 @@ namespace FbxSharp { public abstract class FbxNodeAttribute : FbxObject { - protected FbxNodeAttribute(string name="") + protected FbxNodeAttribute(string name = "") : base(name) { - this.Properties.Add(Color); + Color = FbxPropertyT.StaticInit(this, "Color", + FbxVector3.Zero, false); } public enum EAttributeType @@ -60,7 +61,7 @@ public FbxNode GetNode(int pIndex=0) #region Public Attributes - public readonly FbxPropertyT Color = new FbxPropertyT("Color"); + public readonly FbxPropertyT Color; #endregion diff --git a/FbxSharp/FbxNull.cs b/FbxSharp/FbxNull.cs index 64f96ed..88a3d0f 100644 --- a/FbxSharp/FbxNull.cs +++ b/FbxSharp/FbxNull.cs @@ -2,13 +2,77 @@ namespace FbxSharp { + /// + /// This node attribute contains the properties of a null node. + /// public class FbxNull : FbxNodeAttribute { - public FbxNull(string name="") + public FbxNull(string name = "") + : base(name) { + Size = FbxPropertyT.StaticInit(this, "Size", sDefaultSize, + false); + Look = FbxPropertyT.StaticInit(this, "Look", sDefaultLook, + false); } - public override EAttributeType AttributeType { get { return EAttributeType.Null; } } + + #region Public Member Functions + + // TODO: + // public override FbxClassId GetClassId() => new FbxClassId(); + + // TODO: + // public override FbxNodeAttribute.EAttributeType GetAttributeType() => + // EAttributeType.Null; + + [NotSdk] + public override EAttributeType AttributeType => EAttributeType.Null; + + public void Reset() + { + Size.Set(sDefaultSize); + Look.Set(sDefaultLook); + } + + #endregion + + #region Public Attributes + + public readonly FbxPropertyT Size; + public readonly FbxPropertyT Look; + + #endregion + + #region Null Node Properties + + public enum ELook + { + eNone, + eCross, + } + + public double GetSizeDefaultValue() + { + return sDefaultSize; + } + + #endregion + + #region Property Names + + public static readonly string sSize = "Size"; + public static readonly string sLook = "Look"; + + #endregion + + #region Property Default Values + + public static readonly double sDefaultSize = 100; + + public static readonly ELook sDefaultLook = ELook.eCross; + + #endregion } } diff --git a/FbxSharp/FbxObject.cs b/FbxSharp/FbxObject.cs index 31a15c7..190f904 100644 --- a/FbxSharp/FbxObject.cs +++ b/FbxSharp/FbxObject.cs @@ -8,11 +8,17 @@ public class FbxObject : FbxEmitter { static ulong __uniqueId = 0; + static FbxObject() + { + classRootProperty = new FbxPropertyRoot(null); + } + public FbxObject(String name="") { SetInitialName(name ?? ""); - Properties = new FbxObjectPropertyCollection(this); + RootProperty = new FbxPropertyRoot(this); + SrcObjects = new ObjectSrcObjectCollection(this); DstObjects = new ObjectDstObjectCollection(this); @@ -394,72 +400,55 @@ public T FindDstObject(FbxCriteria pCriteria, string pName, int pStartIndex=0 #region Property Management - public readonly FbxObjectPropertyCollection Properties; - + [NotSdk] public readonly ObjectSrcPropertyCollection SrcProperties; + [NotSdk] public readonly ObjectDstPropertyCollection DstProperties; public FbxProperty GetFirstProperty() { - if (Properties.Count == 0) return null; + if (RootProperty.Children.Count == 0) + return FbxProperty.NotValid; - return Properties[0]; + return RootProperty.Children[0]; } public FbxProperty GetNextProperty(FbxProperty pProperty) { - if (!Properties.Contains(pProperty)) return null; + if (!RootProperty.Children.Contains(pProperty)) + return FbxProperty.NotValid; - var index = Properties.IndexOf(pProperty); - if (index + 1 >= Properties.Count) return null; + var index = RootProperty.Children.IndexOf(pProperty); + if (index + 1 >= RootProperty.Children.Count) + return FbxProperty.NotValid; if (index < 0) return null; - return Properties[index + 1]; + return RootProperty.Children[index + 1]; } public FbxProperty GetPropertyByIndex(int index) { - return Properties[index]; + return RootProperty.Children[index]; } - public FbxProperty FindProperty(string pName, bool pCaseSensitive=true) - { - return Properties.FirstOrDefault(p => string.Compare(p.Name, pName, ignoreCase: !pCaseSensitive) == 0); - } + public FbxProperty FindProperty(string pName, + bool pCaseSensitive = true) => + RootProperty.Find(pName, pCaseSensitive); - //public Property FindProperty(string pName, FbxDataType pDataType, bool pCaseSensitive=true) - public FbxProperty FindProperty(string pName, Type pDataType, bool pCaseSensitive=true) - { - return FindProperty(prop => - string.Compare(prop.Name, pName, ignoreCase: !pCaseSensitive) == 0 && - prop.PropertyDataType == pDataType); - } + public FbxProperty FindProperty(string pName, FbxDataType pDataType, + bool pCaseSensitive = true) => + RootProperty.Find(pName, pDataType, pCaseSensitive); - public FbxProperty FindProperty(Func predicate) - { - return FindProperties(predicate).FirstOrDefault(); - } + public FbxProperty FindPropertyHierarchical(string pName, + bool pCaseSensitive = true) => + RootProperty.FindHierarchical(pName, pCaseSensitive); - public IEnumerable FindProperties(Func predicate) - { - return Properties.Where(predicate); - } - - public FbxProperty FindPropertyHierarchical(string pName, bool pCaseSensitive=true) - { - throw new NotImplementedException(); - } + public FbxProperty FindPropertyHierarchical(string pName, + FbxDataType pDataType, bool pCaseSensitive = true) => + RootProperty.FindHierarchical(pName, pDataType, pCaseSensitive); - //public Property FindPropertyHierarchical(string pName, FbxDataType pDataType, bool pCaseSensitive=true) - //{ - // throw new NotImplementedException(); - //} - - readonly static FbxPropertyT classRootProperty = new FbxPropertyT(); - public FbxProperty GetClassRootProperty() - { - return classRootProperty; - } + private static readonly FbxProperty classRootProperty; + public FbxProperty GetClassRootProperty() => classRootProperty; public bool ConnectSrcProperty(FbxProperty pProperty) { @@ -531,19 +520,11 @@ public FbxProperty FindDstProperty(string pName, int pStartIndex=0) throw new NotImplementedException(); } - public FbxProperty CreateProperty(string name, Type type) - { - var concreteType = typeof(FbxPropertyT<>).MakeGenericType(type); - var prop = (FbxProperty)Activator.CreateInstance(concreteType, (object)name); - Properties.Add(prop); - return prop; - } - #endregion #region Public Attributes - public readonly FbxProperty RootProperty = new FbxPropertyT(); + public readonly FbxProperty RootProperty; #endregion diff --git a/FbxSharp/FbxObjectPropertyCollection.cs b/FbxSharp/FbxObjectPropertyCollection.cs deleted file mode 100644 index e9b1720..0000000 --- a/FbxSharp/FbxObjectPropertyCollection.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace FbxSharp -{ - public class FbxObjectPropertyCollection : IList - { - // An ordered collection of Property objects - - public FbxObjectPropertyCollection(FbxObject container) - { - _container = container; - } - - public void AddRange(params FbxProperty [] items) - { - AddRange((IEnumerable)items); - } - - public void AddRange(IEnumerable items) - { - foreach (FbxProperty item in items) - { - Add(item); - } - } - - public void RemoveRange(params FbxProperty [] items) - { - RemoveRange((IEnumerable)items); - } - - public void RemoveRange(IEnumerable items) - { - foreach (FbxProperty item in items) - { - Remove(item); - } - } - - //ICollection - public virtual void Add(FbxProperty item) - { - if (!Contains(item)) - { - _list.Add(item); - item.ParentFbxObject = _container; - } - } - - public virtual bool Contains(FbxProperty item) - { - return _list.Contains(item); - } - - public virtual bool Remove(FbxProperty item) - { - if (Contains(item)) - { - bool ret = _list.Remove(item); - item.ParentFbxObject = null; - return ret; - } - - return false; - } - - public virtual void Clear() - { - FbxProperty [] array = new FbxProperty[Count]; - - CopyTo(array, 0); - - foreach (FbxProperty item in array) - { - Remove(item); - } - - _list.Clear(); - } - - public virtual void CopyTo(FbxProperty [] array, int arrayIndex) - { - _list.CopyTo(array, arrayIndex); - } - - public List.Enumerator GetEnumerator() - { - return _list.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - //IList - public virtual int IndexOf(FbxProperty item) - { - return _list.IndexOf(item); - } - - public virtual void Insert(int index, FbxProperty item) - { - if (Contains(item)) - { - if (IndexOf(item) < index) - { - index--; - } - - Remove(item); - } - - item.ParentFbxObject = null; - _list.Insert(index, item); - item.ParentFbxObject = _container; - } - - public virtual void RemoveAt(int index) - { - Remove(this[index]); - } - - //ICollection - public virtual int Count { - get { return _list.Count; } - } - - public virtual bool IsReadOnly { - get { return (_list as ICollection).IsReadOnly; } - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - //IList - public virtual FbxProperty this [int index] { - get { return _list[index]; } - set { - RemoveAt(index); - Insert(index, value); - } - } - - private FbxObject _container; - private List _list = new List(); - } -} diff --git a/FbxSharp/FbxProperty.cs b/FbxSharp/FbxProperty.cs index 634a06c..39bf72b 100644 --- a/FbxSharp/FbxProperty.cs +++ b/FbxSharp/FbxProperty.cs @@ -1,49 +1,444 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; namespace FbxSharp { public abstract class FbxProperty { + [NotSdk] + public class NotValidT + { + } + + [NotSdk] + public static readonly FbxProperty NotValid = + FbxPropertyT.StaticInit((FbxProperty)null, null, null, + null, false); + + [NotSdk] static FbxProperty() { AddConverter(typeof(FbxVector4), typeof(FbxVector3), (v4) => ((FbxVector4)v4).ToVector3()); AddConverter(typeof(FbxVector3), typeof(FbxVector4), (v3) => ((FbxVector3)v3).ToVector4()); + AddConverter(typeof(FbxColor), typeof(FbxVector3), c0 => + { + var c = (FbxColor)c0; + return new FbxVector3(c.Red, c.Green, c.Blue); + }); + AddConverter(typeof(long), typeof(int), value => (int)(((long)value) & 0xffffffff)); + AddConverter(typeof(bool), typeof(double), value => (bool)value ? 1d : 0d); + } + + [NotSdk] + public override string ToString() + { + return string.Format("{0}: {1}", Name, GetValue()); + } + + #region Public Member Functions + + public bool CopyValue(FbxProperty pProperty) => + throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + public static string sHierarchicalSeparator = "|"; + + #endregion + + #region Constructor and Destructor + + [DeviationFromSdk( + "static FbxProperty Create(" + + "const FbxProperty &pCompoundProperty, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxProperty pCompoundProperty, + FbxDataType pDataType, string pName, string pLabel = "", + bool pCheckForDup = true) => + Create(pCompoundProperty, pDataType, pName, pLabel, + pCheckForDup, out _); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "const FbxProperty &pCompoundProperty, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxProperty pCompoundProperty, + FbxDataType pDataType, string pName, out bool pWasFound) => + Create(pCompoundProperty, pDataType, pName, "", + true, out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "const FbxProperty &pCompoundProperty, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxProperty pCompoundProperty, + FbxDataType pDataType, string pName, bool pCheckForDup, + out bool pWasFound) => + Create(pCompoundProperty, pDataType, pName, "", + pCheckForDup, out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "const FbxProperty &pCompoundProperty, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxProperty pCompoundProperty, + FbxDataType pDataType, string pName, string pLabel, + out bool pWasFound) => + Create(pCompoundProperty, pDataType, pName, pLabel, + true, out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "const FbxProperty &pCompoundProperty, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxProperty pCompoundProperty, + FbxDataType pDataType, string pName, string pLabel, + bool pCheckForDup, out bool pWasFound) + { + var prop = FromFbxDataType(pCompoundProperty, pDataType, pName, default); + prop.SetLabel(pLabel); + prop.SetParent(pCompoundProperty); + pWasFound = false; + return prop; + } + + [DeviationFromSdk( + "static FbxProperty Create(" + + "FbxObject *pObject, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxObject pObject, + FbxDataType pDataType, string pName, string pLabel = "", + bool pCheckForDup = true) => + Create(pObject, pDataType, pName, pLabel, pCheckForDup, + out _); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "FbxObject *pObject, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxObject pObject, + FbxDataType pDataType, string pName, out bool pWasFound) => + Create(pObject, pDataType, pName, "", true, + out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "FbxObject *pObject, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxObject pObject, + FbxDataType pDataType, string pName, string pLabel, + out bool pWasFound) => + Create(pObject, pDataType, pName, pLabel, true, + out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "FbxObject *pObject, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxObject pObject, + FbxDataType pDataType, string pName, bool pCheckForDup, + out bool pWasFound) => + Create(pObject, pDataType, pName, "", pCheckForDup, + out pWasFound); + + [DeviationFromSdk( + "static FbxProperty Create(" + + "FbxObject *pObject, " + + "const FbxDataType &pDataType, " + + "const char *pName, " + + "const char *pLabel=\"\", " + + "bool pCheckForDup=true, " + + "bool *pWasFound=((void *) 0))")] + public static FbxProperty Create(FbxObject pObject, + FbxDataType pDataType, string pName, string pLabel, + bool pCheckForDup, out bool pWasFound) + { + var prop = FromFbxDataType(pObject.RootProperty, pDataType, + pName); + prop.SetLabel(pLabel); + pWasFound = false; + return prop; + } + + public static FbxProperty CreateFrom(FbxProperty pCompoundProperty, + FbxProperty pFromProperty, bool pCheckForDup = true) => + throw new NotImplementedException(); + + public static FbxProperty CreateFrom(FbxObject pObject, + FbxProperty pFromProperty, bool pCheckForDup = true) => + throw new NotImplementedException(); + + public void Destroy() => throw new NotImplementedException(); + + public void DestroyRecursively() => throw new NotImplementedException(); + + public void DestroyChildren() => throw new NotImplementedException(); + + public FbxProperty() => throw new NotImplementedException(); + + public FbxProperty(FbxProperty pProperty) => + throw new NotImplementedException(); + + public FbxProperty(FbxPropertyHandle pPropertyHandle) => + throw new NotImplementedException(); + + [NotSdk] + protected FbxProperty(string name, EFbxType fbxType) + : this(name, FbxDataType.FbxGetDataTypeFromEnum(fbxType)) + { } - protected FbxProperty(string name) + [NotSdk] + protected FbxProperty(string name, FbxDataType dataType) { Name = name; + fbxDataType = dataType; Children = new PropertyChildrenCollection(this); SrcObjects = new PropertySrcObjectCollection(this); DstObjects = new PropertyDstObjectCollection(this); } - public override string ToString() + [NotSdk] + protected static FbxProperty FromFbxDataType(FbxProperty parent, + FbxDataType dataType, string name) { - return string.Format("{0}: {1}", Name, GetValue()); + switch (dataType.GetFbxType()) + { + case EFbxType.eFbxChar: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxUChar: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxShort: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxUShort: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxUInt: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxLongLong: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxULongLong: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxHalfFloat: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxBool: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxInt: + return FbxPropertyT.StaticInit(parent, name, dataType, + default); + case EFbxType.eFbxFloat: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxDouble: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxDouble2: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxDouble3: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxDouble4: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxDouble4x4: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + + case EFbxType.eFbxEnum: + case EFbxType.eFbxEnumM: + return new FbxPropertyTEnum(name); + + case EFbxType.eFbxString: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxTime: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + case EFbxType.eFbxReference: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + + case EFbxType.eFbxBlob: + case EFbxType.eFbxDistance: + throw new NotImplementedException(); + + case EFbxType.eFbxDateTime: + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + + case EFbxType.eFbxUndefined: + // TODO: FbxPropertyTUndefined + return FbxPropertyT.StaticInit(parent, name, + dataType, default); + + case EFbxType.eFbxTypeCount: + default: + throw new ArgumentOutOfRangeException( + paramName: nameof(dataType), dataType, null); + } } - #region Static Public Attributes + [NotSdk] + protected static FbxProperty FromFbxDataType(FbxProperty parent, + FbxDataType dataType, string name, object value) + { + switch (dataType.GetFbxType()) + { + case EFbxType.eFbxChar: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (char)value); + case EFbxType.eFbxUChar: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (byte)value); + case EFbxType.eFbxShort: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (short)value); + case EFbxType.eFbxUShort: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (ushort)value); + case EFbxType.eFbxUInt: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (uint)value); + case EFbxType.eFbxLongLong: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (long)value); + case EFbxType.eFbxULongLong: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (ulong)value); + case EFbxType.eFbxHalfFloat: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (Half)value); + case EFbxType.eFbxBool: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : (bool)value); + case EFbxType.eFbxInt: + return FbxPropertyT.StaticInit(parent, name, dataType, + value == null ? default : value == null ? default : (int)value); + case EFbxType.eFbxFloat: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (float)value); + case EFbxType.eFbxDouble: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (double)value); + case EFbxType.eFbxDouble2: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxVector2)value); + case EFbxType.eFbxDouble3: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxVector3)value); + case EFbxType.eFbxDouble4: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxVector4)value); + case EFbxType.eFbxDouble4x4: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxMatrix)value); + + case EFbxType.eFbxEnum: + case EFbxType.eFbxEnumM: + return new FbxPropertyTEnum(name); + + case EFbxType.eFbxString: + return FbxPropertyT.StaticInit(parent, name, + dataType, (string)value ); + case EFbxType.eFbxTime: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxTime)value); + case EFbxType.eFbxReference: + return FbxPropertyT.StaticInit(parent, name, + dataType,(FbxObject)value); + + case EFbxType.eFbxBlob: + case EFbxType.eFbxDistance: + throw new NotImplementedException(); + + case EFbxType.eFbxDateTime: + return FbxPropertyT.StaticInit(parent, name, + dataType, value == null ? default : (FbxDateTime)value); + + case EFbxType.eFbxUndefined: + // TODO: FbxPropertyTUndefined + return FbxPropertyT.StaticInit(parent, name, + dataType, (object)value); + + case EFbxType.eFbxTypeCount: + default: + throw new ArgumentOutOfRangeException( + paramName: nameof(dataType), dataType, null); + } + } - public static string sHierarchicalSeparator = "|"; + ~FbxProperty() + { + // Note: C# finalizers are not the same thing as C++ destructors. + } - #endregion + # endregion #region Property Identification - public string Name { get; protected set; } + [NotSdk] public string Name { get; } - public abstract Type PropertyDataType { get; } - public Type GetPropertyDataType() - { - return PropertyDataType; - } - //public Object FbxObject { get; protected set; } + [NotSdk] + public Type PropertyDataType => + GetPropertyDataType().GetFbxType().ToDotnetType(); + + private readonly FbxDataType fbxDataType; + public FbxDataType GetPropertyDataType() => fbxDataType; - //FbxDataType GetPropertyDataType() + [NotSdk] + public abstract Type GetDotnetType(); + + //public Object FbxObject { get; protected set; } public string GetName() { @@ -52,51 +447,121 @@ public string GetName() public string GetHierarchicalName() { - throw new NotImplementedException(); + var names = new List(); + var p = this; + names.Add(p.GetName()); + while (p.GetParent() != null && + p.GetParent().IsValid() && + !p.GetParent().IsRoot()) + { + p = p.GetParent(); + names.Insert(0, p.GetName()); + } + + var sb = new StringBuilder(); + var first = true; + foreach (var name in names) + { + if (!first) + sb.Append(sHierarchicalSeparator); + first = false; + sb.Append(name); + } + + return sb.ToString(); } + private string label; public string GetLabel(bool pReturnNameIfEmpty = true) { - throw new NotImplementedException(); + return label ?? ""; } public void SetLabel(string pLabel) { - throw new NotImplementedException(); + label = pLabel ?? ""; } - private FbxObject _parentFbxObject; - public FbxObject ParentFbxObject + public virtual FbxObject GetFbxObject() { - get { return _parentFbxObject; } - set - { - if (value != _parentFbxObject) - { - if (_parentFbxObject != null) - { - _parentFbxObject.Properties.Remove(this); - } + var parent = GetParent(); + if (parent != null && parent.IsValid()) + return GetParent().GetFbxObject(); + return null; + } - _parentFbxObject = value; + #endregion - if (_parentFbxObject != null) - { - _parentFbxObject.Properties.Add(this); - } - } - } - } - public FbxObject GetFbxObject() - { - return ParentFbxObject; - } + #region User data + + public void SetUserTag(int pTag) => throw new NotImplementedException(); + public int GetUserTag() => throw new NotImplementedException(); + + public void SetUserDataPtr(object pUserData) => + throw new NotImplementedException(); + + public object GetUserDataPtr() => throw new NotImplementedException(); + + #endregion + + #region Property Flags. + + public void ModifyFlag(FbxPropertyFlags.EFlags pFlag, bool pValue) => + throw new NotImplementedException(); + + public bool GetFlag(FbxPropertyFlags.EFlags pFlag) => + throw new NotImplementedException(); + + public FbxPropertyFlags.EFlags GetFlags() => + throw new NotImplementedException(); + + public FbxPropertyFlags.EInheritType GetFlagInheritType( + FbxPropertyFlags.EFlags pFlag) => + throw new NotImplementedException(); + + public bool SetFlagInheritType(FbxPropertyFlags.EFlags pFlag, + FbxPropertyFlags.EInheritType pType) => + throw new NotImplementedException(); + + public bool ModifiedFlag(FbxPropertyFlags.EFlags pFlag) => + throw new NotImplementedException(); + + #endregion + + #region Assignment and comparison operators + + // public FbxProperty operator= (FbxProperty pProperty) => + // throw new NotImplementedException(); + // + // public bool operator ==(FbxProperty &pProperty) => + // throw new NotImplementedException(); + // + // public bool operator !=(FbxProperty &pProperty) => + // throw new NotImplementedException(); + // + // public bool operator <(FbxProperty &pProperty) => + // throw new NotImplementedException(); + // + // public bool operator >(FbxProperty &pProperty) => + // throw new NotImplementedException(); + // + // public bool operator ==(int pValue) => + // throw new NotImplementedException(); + // + // public bool operator !=(int pValue) => + // throw new NotImplementedException(); + + public bool CompareValue(FbxProperty pProperty) => + throw new NotImplementedException(); #endregion #region Value Management - public static readonly Dictionary, Func> Converters = new Dictionary, Func>(); + public static readonly + Dictionary, Func> Converters = + new(); + [NotSdk] public static void AddConverter(Type from, Type to, Func converter) { Converters.Add(new Tuple(from, to), converter); @@ -122,13 +587,16 @@ public virtual bool Set(T pValue) throw new NotImplementedException(); } - public virtual bool Set(object value) + [DeviationFromSdk("change parameter type to object from void*")] + protected virtual bool Set(object pValue, EFbxType pValueType, bool pCheckForValueEquality=true) { throw new NotImplementedException(); } public virtual bool IsValid() { + if (this == FbxProperty.NotValid) + return false; return true; } @@ -149,6 +617,49 @@ public bool Modified() #endregion + #region Property Limits. + + public bool SupportSetLimitAsDouble() => + throw new NotImplementedException(); + + public bool SetMinLimit(double pMin) => + throw new NotImplementedException(); + + public bool HasMinLimit() => throw new NotImplementedException(); + public double GetMinLimit() => throw new NotImplementedException(); + public bool HasMaxLimit() => throw new NotImplementedException(); + + public bool SetMaxLimit(double pMax) => + throw new NotImplementedException(); + + public double GetMaxLimit() => throw new NotImplementedException(); + + public bool SetLimits(double pMin, double pMax) => + throw new NotImplementedException(); + + #endregion + + #region Enum and property list + + public virtual int AddEnumValue(string pStringValue) => + throw new NotImplementedException(); + + public virtual void InsertEnumValue(int pIndex, string pStringValue) => + throw new NotImplementedException(); + + public virtual int GetEnumCount() => throw new NotImplementedException(); + + public virtual void SetEnumValue(int pIndex, string pStringValue) => + throw new NotImplementedException(); + + public virtual void RemoveEnumValue(int pIndex) => + throw new NotImplementedException(); + + public virtual string GetEnumValue(int pIndex) => + throw new NotImplementedException(); + + #endregion + #region Hierarchical Properties private FbxProperty _parentProperty; @@ -176,10 +687,7 @@ public FbxProperty ParentProperty public readonly PropertyChildrenCollection Children; - public bool IsRoot() - { - return (ParentProperty == null); - } + public virtual bool IsRoot() => false; public bool IsChildOf(FbxProperty pParent) { @@ -201,62 +709,100 @@ public bool IsDescendentOf(FbxProperty pAncestor) public FbxProperty GetParent() { - return ParentProperty; + return ParentProperty ?? NotValid; } - public /*FBX_DEPRECATED*/ bool SetParent(FbxProperty pOther) + [NotSdk] + public void SetParent(FbxProperty pOther) { - //throw new NotImplementedException(); - //ParentProperty = pOther; - return false; + ParentProperty = pOther; } public FbxProperty GetChild() { - return Children.FirstOrDefault(); + return Children.FirstOrDefault() ?? NotValid; } public FbxProperty GetSibling() { - if (GetParent() == null) return null; + if (GetParent() == null) return NotValid; - return GetParent().GetNextDescendent(this); + return GetParent().GetNextDescendent(this) ?? NotValid; } public FbxProperty GetFirstDescendent() { - return Children.FirstOrDefault(); + return Children.FirstOrDefault() ?? NotValid; } public FbxProperty GetNextDescendent(FbxProperty pProperty) { - if (pProperty.ParentProperty != this) return null; + if (pProperty.ParentProperty != this) + return NotValid; var index = Children.IndexOf(pProperty); - if (index + 1 >= Children.Count) return null; + if (index + 1 >= Children.Count) + return NotValid; - return Children[index + 1]; + return Children[index + 1] ?? NotValid; } - public FbxProperty Find(string pName, bool pCaseSensitive = true) + public FbxProperty Find(string pName, bool pCaseSensitive = true) => + Find(pName, null, pCaseSensitive); + + public FbxProperty Find(string pName, FbxDataType pDataType, bool pCaseSensitive=true) { - throw new NotImplementedException(); + foreach (var child in Children) + { + // TODO: case-insensitive + if (child.Name == pName) + return child; + } + + return NotValid; } - //public Property Find(string pName, FbxDataType &pDataType, bool pCaseSensitive=true) - //{ - // throw new NotImplementedException(); - //} + public FbxProperty FindHierarchical(string pName, + bool pCaseSensitive = true) + { + var nameComponents = pName.Split(sHierarchicalSeparator); + return FindHierarchical(nameComponents, 0, null, pCaseSensitive); + } - public FbxProperty FindHierarchical(string pName, bool pCaseSensitive = true) + public FbxProperty FindHierarchical(string pName, + FbxDataType pDataType, bool pCaseSensitive = true) { - throw new NotImplementedException(); + var nameComponents = pName.Split(sHierarchicalSeparator); + return FindHierarchical(nameComponents, 0, pDataType, pCaseSensitive); } - //public Property FindHierarchical(string pName, FbxDataType &pDataType, bool pCaseSensitive=true) - //{ - // throw new NotImplementedException(); - //} + [NotSdk] + protected FbxProperty FindHierarchical( + string[] nameComponents, int index, + FbxDataType pDataType=null, bool pCaseSensitive = true) + { + foreach (var child in Children) + { + // TODO: case-insensitive + if (child.Name == nameComponents[index]) + { + if (index < nameComponents.Length - 1) + return child.FindHierarchical(nameComponents, index + 1, + pDataType, pCaseSensitive); + + if (pDataType != null) + { + if (child.IsValid() && + child.GetPropertyDataType() == pDataType) + return child; + } + else + return child; + } + } + + return NotValid; + } #endregion @@ -339,8 +885,10 @@ public FbxAnimCurveNode CreateCurveNode(FbxAnimLayer pAnimLayer) public FbxAnimCurveNode GetCurveNode(bool pCreate=false) { - if (this.ParentFbxObject == null || this.ParentFbxObject.Scene == null) return null; - var stack = this.ParentFbxObject.Scene.GetCurrentAnimationStack(); + var obj = GetFbxObject(); + if (obj?.Scene == null) + return null; + var stack = obj.Scene.GetCurrentAnimationStack(); return GetCurveNode(stack); } diff --git a/FbxSharp/FbxPropertyFlags.cs b/FbxSharp/FbxPropertyFlags.cs index 1da04bb..99e580a 100644 --- a/FbxSharp/FbxPropertyFlags.cs +++ b/FbxSharp/FbxPropertyFlags.cs @@ -2,14 +2,95 @@ namespace FbxSharp { - public static class FbxPropertyFlags + public class FbxPropertyFlags { + #region Public Types + public enum EInheritType { eOverride, eInherit, eDeleted, } + + public enum EFlags + { + eNone = 0, + eStatic = 1 << 0, + eAnimatable = 1 << 1, + eAnimated = 1 << 2, + eImported = 1 << 3, + eUserDefined = 1 << 4, + eHidden = 1 << 5, + eNotSavable = 1 << 6, + eLockedMember0 = 1 << 7, + eLockedMember1 = 1 << 8, + eLockedMember2 = 1 << 9, + eLockedMember3 = 1 << 10, + + eLockedAll = eLockedMember0 | eLockedMember1 | eLockedMember2 | + eLockedMember3, + eMutedMember0 = 1 << 11, + eMutedMember1 = 1 << 12, + eMutedMember2 = 1 << 13, + eMutedMember3 = 1 << 14, + + eMutedAll = eMutedMember0 | eMutedMember1 | eMutedMember2 | + eMutedMember3, + eUIDisabled = 1 << 15, + eUIGroup = 1 << 16, + eUIBoolGroup = 1 << 17, + eUIExpanded = 1 << 18, + eUINoCaption = 1 << 19, + eUIPanel = 1 << 20, + eUILeftLabel = 1 << 21, + eUIHidden = 1 << 22, + + eCtrlFlags = eStatic | eAnimatable | eAnimated | eImported | + eUserDefined | eHidden | eNotSavable | eLockedAll | + eMutedAll, + + eUIFlags = eUIDisabled | eUIGroup | eUIBoolGroup | eUIExpanded | + eUINoCaption | eUIPanel | eUILeftLabel | eUIHidden, + eAllFlags = eCtrlFlags | eUIFlags, + eFlagCount = 23 + } + + #endregion + + #region Public Member Functions + + public bool SetFlags(FbxPropertyFlags.EFlags pMask, + FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + public FbxPropertyFlags.EFlags GetFlags() => + throw new NotImplementedException(); + + public FbxPropertyFlags.EFlags GetMergedFlags( + FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + public bool ModifyFlags(FbxPropertyFlags.EFlags pFlags, bool pValue) => + throw new NotImplementedException(); + + public FbxPropertyFlags.EInheritType GetFlagsInheritType( + FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + public bool SetMask(FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + public bool UnsetMask(FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + public FbxPropertyFlags.EFlags GetMask() => + throw new NotImplementedException(); + + public bool Equal(FbxPropertyFlags pOther, + FbxPropertyFlags.EFlags pFlags) => + throw new NotImplementedException(); + + #endregion } } - diff --git a/FbxSharp/FbxPropertyHandle.cs b/FbxSharp/FbxPropertyHandle.cs new file mode 100644 index 0000000..9dbe898 --- /dev/null +++ b/FbxSharp/FbxPropertyHandle.cs @@ -0,0 +1,308 @@ +using System; + +namespace FbxSharp; + +public class FbxPropertyHandle +{ + #region Public Member Functions + + #region Assignment and basic info + + // public FbxPropertyHandle operator= (FbxPropertyHandle pHandle) => + // throw new NotImplementedException(); + // public bool operator ==(FbxPropertyHandle pHandle) => + // throw new NotImplementedException(); + // public bool operator !=(FbxPropertyHandle pHandle) => + // throw new NotImplementedException(); + // public bool operator <(FbxPropertyHandle pHandle) => + // throw new NotImplementedException(); + // public bool operator >(FbxPropertyHandle pHandle) => + // throw new NotImplementedException(); + + public bool Is(FbxPropertyHandle pHandle) => + throw new NotImplementedException(); + + public bool Valid() => throw new NotImplementedException(); + public string GetName() => throw new NotImplementedException(); + public string GetLabel() => throw new NotImplementedException(); + public bool SetLabel(string pLabel) => throw new NotImplementedException(); + [DeviationFromSdk( + "Original name conflicts with built-in method on base class")] + public EFbxType GetFbxType() => throw new NotImplementedException(); + + public FbxPropertyHandle GetTypeInfo() => + throw new NotImplementedException(); + + public FbxPropertyFlags.EFlags GetFlags() => + throw new NotImplementedException(); + + public FbxPropertyFlags.EInheritType GetFlagsInheritType( + FbxPropertyFlags.EFlags pFlags, bool pCheckReferences) => + throw new NotImplementedException(); + + public bool ModifyFlags(FbxPropertyFlags.EFlags pFlags, bool pValue) => + throw new NotImplementedException(); + + public bool SetFlagsInheritType(FbxPropertyFlags.EFlags pFlags, + FbxPropertyFlags.EInheritType pType) => + throw new NotImplementedException(); + + public object GetUserData() => throw new NotImplementedException(); + + public bool SetUserData(object pUserData) => + throw new NotImplementedException(); + + public int GetUserTag() => throw new NotImplementedException(); + + public bool SetUserTag(int pUserData) => + throw new NotImplementedException(); + + #endregion + + #region Enum management + + public int AddEnumValue(string pStringValue) => + throw new NotImplementedException(); + + public void InsertEnumValue(int pIndex, string pStringValue) => + throw new NotImplementedException(); + + public int GetEnumCount() => throw new NotImplementedException(); + + public void SetEnumValue(int pIndex, string pStringValue) => + throw new NotImplementedException(); + + public void RemoveEnumValue(int pIndex) => + throw new NotImplementedException(); + + public string GetEnumValue(int pIndex) => + throw new NotImplementedException(); + + #endregion + + #region Child and Struct management + + public void BeginCreateOrFindProperty() => + throw new NotImplementedException(); + + public void EndCreateOrFindProperty() => + throw new NotImplementedException(); + + public bool IsRoot() => throw new NotImplementedException(); + + public bool IsChildOf(FbxPropertyHandle pParent) => + throw new NotImplementedException(); + + public bool IsDescendentOf(FbxPropertyHandle pParent) => + throw new NotImplementedException(); + + public bool SetParent(FbxPropertyHandle pOther) => + throw new NotImplementedException(); + + public FbxPropertyHandle Add(string pName, FbxPropertyHandle pTypeInfo) => + throw new NotImplementedException(); + + public FbxPropertyHandle GetParent() => + throw new NotImplementedException(); + + public FbxPropertyHandle GetChild() => throw new NotImplementedException(); + + public FbxPropertyHandle GetSibling() => + throw new NotImplementedException(); + + public FbxPropertyHandle GetFirstDescendent() => + throw new NotImplementedException(); + + public FbxPropertyHandle GetNextDescendent(FbxPropertyHandle pHandle) => + throw new NotImplementedException(); + + public FbxPropertyHandle Find(string pName, bool pCaseSensitive) => + throw new NotImplementedException(); + + public FbxPropertyHandle Find(string pName, FbxPropertyHandle pTypeInfo, + bool pCaseSensitive) => throw new NotImplementedException(); + + public FbxPropertyHandle Find(string pName, string pChildrenSeparator, + bool pCaseSensitive) => throw new NotImplementedException(); + + public FbxPropertyHandle Find(string pName, string pChildrenSeparator, + FbxPropertyHandle pTypeInfo, bool pCaseSensitive) => + throw new NotImplementedException(); + + #endregion + + #region Connection management + + public bool ConnectSrc(FbxPropertyHandle pSrc, + FbxConnection.EType pType = FbxConnection.EType.Default) => + throw new NotImplementedException(); + + // public int GetSrcCount(FbxConnectionPointFilter pFilter = null) => + // throw new NotImplementedException(); + + // public FbxPropertyHandle GetSrc(FbxConnectionPointFilter pFilter = null, + // int pIndex = 0) => throw new NotImplementedException(); + + public bool DisconnectSrc(FbxPropertyHandle pSrc) => + throw new NotImplementedException(); + + public bool IsConnectedSrc(FbxPropertyHandle pSrc) => + throw new NotImplementedException(); + + public bool ConnectDst(FbxPropertyHandle pDst, + FbxConnection.EType pType = FbxConnection.EType.eDefault) => + throw new NotImplementedException(); + + // public int GetDstCount(FbxConnectionPointFilter pFilter = null) => + // throw new NotImplementedException(); + + // public FbxPropertyHandle GetDst(FbxConnectionPointFilter pFilter = null, + // int pIndex = 0) => throw new NotImplementedException(); + + public bool DisconnectDst(FbxPropertyHandle pDst) => + throw new NotImplementedException(); + + public bool IsConnectedDst(FbxPropertyHandle pDst) => + throw new NotImplementedException(); + + public void ClearConnectCache() => throw new NotImplementedException(); + public void WipeAllConnections() => throw new NotImplementedException(); + + #endregion + + #region Limits Functions + + public bool HasMin() => throw new NotImplementedException(); + + public bool GetMin(object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetMin(object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetMin(T pValue) => throw new NotImplementedException(); + public T GetMin(out T pFBX_TYPE) => throw new NotImplementedException(); + public bool HasSoftMin() => throw new NotImplementedException(); + + public bool GetSoftMin(out object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetSoftMin(object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetSoftMin(T pValue) => throw new NotImplementedException(); + + public T GetSoftMin(out T pFBX_TYPE) => + throw new NotImplementedException(); + + public bool HasMax() => throw new NotImplementedException(); + + public bool GetMax(out object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetMax(object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetMax(T pValue) => throw new NotImplementedException(); + public T GetMax(out T pFBX_TYPE) => throw new NotImplementedException(); + public bool HasSoftMax() => throw new NotImplementedException(); + + public bool GetSoftMax(out object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetSoftMax(object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool SetSoftMax(T pValue) => throw new NotImplementedException(); + + public T GetSoftMax(out T pFBX_TYPE) => + throw new NotImplementedException(); + + #endregion + + #region Value + + public FbxPropertyFlags.EInheritType GetValueInheritType( + bool pCheckReferences) => + throw new NotImplementedException(); + + public bool SetValueInheritType(FbxPropertyFlags.EInheritType pType) => + throw new NotImplementedException(); + + public bool GetDefaultValue(out object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool Get(out object pValue, EFbxType pValueType) => + throw new NotImplementedException(); + + public bool Set(object pValue, EFbxType pValueType, + bool pCheckValueEquality) => + throw new NotImplementedException(); + + public bool Set(T pValue) => throw new NotImplementedException(); + public T Get(out T pFBX_TYPE) => throw new NotImplementedException(); + + #endregion + + #region Page settings + + public void SetPageDataPtr(object pData) => + throw new NotImplementedException(); + + public object GetPageDataPtr() => throw new NotImplementedException(); + + #endregion + + #region Page Internal Entry Management + + public bool PushPropertiesToParentInstance() => + throw new NotImplementedException(); + + #endregion + + #region Reference Management + + public bool IsAReferenceTo() => throw new NotImplementedException(); + public object GetReferenceTo() => throw new NotImplementedException(); + public bool IsReferencedBy() => throw new NotImplementedException(); + + public int GetReferencedByCount() => throw new NotImplementedException(); + + // FBX_DEPRECATED object GetReferencedBy (int pIndex) + + // TODO: int GetReferencedBy(FbxArray pReferencedBy) => + // throw new NotImplementedException(); + + #endregion + + #endregion + + #region Constructor and Destructor + + public static FbxPropertyHandle Create() => + throw new NotImplementedException(); + + public static FbxPropertyHandle Create(FbxPropertyHandle pInstanceOf) => + throw new NotImplementedException(); + + public static FbxPropertyHandle Create(string pName, + EFbxType pType = EFbxType.eFbxUndefined) => + throw new NotImplementedException(); + + public static FbxPropertyHandle + Create(string pName, FbxPropertyHandle pTypeInfo) => + throw new NotImplementedException(); + + public bool Destroy() => throw new NotImplementedException(); + public FbxPropertyHandle() => throw new NotImplementedException(); + + public FbxPropertyHandle(FbxPropertyHandle pAddress) => + throw new NotImplementedException(); + + ~FbxPropertyHandle() => throw new NotImplementedException(); + + // TODO: public FbxPropertyHandle(FbxPropertyPage pPage, FbxInt pId = 0) => + // throw new NotImplementedException(); + + #endregion +} \ No newline at end of file diff --git a/FbxSharp/FbxPropertyRoot.cs b/FbxSharp/FbxPropertyRoot.cs new file mode 100644 index 0000000..02163ab --- /dev/null +++ b/FbxSharp/FbxPropertyRoot.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +namespace FbxSharp; + +/// +/// A kind of specialization of FbxProperty for root properties +/// +[NotSdk] +public class FbxPropertyRoot(FbxObject parent) + : FbxProperty("", EFbxType.eFbxUndefined) +{ + public override Type GetDotnetType() => typeof(void); + + public override bool IsRoot() => true; + + public override FbxObject GetFbxObject() => parent; +} \ No newline at end of file diff --git a/FbxSharp/FbxPropertyT.cs b/FbxSharp/FbxPropertyT.cs index b6502e7..c0a479b 100644 --- a/FbxSharp/FbxPropertyT.cs +++ b/FbxSharp/FbxPropertyT.cs @@ -4,24 +4,66 @@ namespace FbxSharp { public class FbxPropertyT : FbxProperty { - public FbxPropertyT(string name="") - : base(name) + #region Public Types + + // typedef T ValueType + + #endregion + + #region Static Initialization + + [DeviationFromSdk(notes: "Changed return type to generic to " + + "avoid type casts.")] + public static FbxPropertyT StaticInit(FbxObject pObject, + string pName, + T pValue, bool pForceSet, + FbxPropertyFlags.EFlags pFlags = FbxPropertyFlags.EFlags.eNone) => + StaticInit(pObject.RootProperty, pName, null, pValue, pForceSet, + pFlags); + + [DeviationFromSdk(notes: "Changed return type to generic to " + + "avoid type casts.")] + public static FbxPropertyT StaticInit(FbxObject pObject, + string pName, FbxDataType pDataType, T pValue, bool pForceSet, + FbxPropertyFlags.EFlags pFlags = FbxPropertyFlags.EFlags.eNone) => + StaticInit(pObject.RootProperty, pName, pDataType, pValue, + pForceSet, pFlags); + + [DeviationFromSdk(notes: "Changed return type to generic to " + + "avoid type casts.")] + public static FbxPropertyT StaticInit(FbxProperty pCompound, + string pName, FbxDataType pDataType, T pValue, + bool pForceSet = true, + FbxPropertyFlags.EFlags pFlags = FbxPropertyFlags.EFlags.eNone) { + var prop = new FbxPropertyT(pName, pDataType); + prop.SetParent(pCompound); + if (pValue != null) + prop.Set(pValue); + return prop; } - public FbxPropertyT(string name, T initialValue) - : base(name) + + #endregion + + protected FbxPropertyT(string name="", FbxDataType dataType = null, + T initialValue = default) + : base( + name, + dataType ?? FbxDataType.FbxGetDataTypeFromEnum( + typeof(T).ToFbxType())) { Value = initialValue; } - public override Type PropertyDataType { get { return typeof(T); } } + public override Type GetDotnetType() => typeof(T); public T Value { get; set; } //FbxPropertyT & Set (const T &pValue) - public void Set(T value) + public FbxPropertyT Set(T value) { Value = value; + return this; } public T Get() @@ -31,6 +73,11 @@ public T Get() public override U Get() { + if (Value is U uValue) + return uValue; + if (Value == null) + return default; + if (!(Value is U)) { var tuple = new Tuple(typeof(T), typeof(U)); @@ -51,7 +98,13 @@ public override object GetValue() return Value; } - public override bool Set(U value) + public override bool Set(U pValue) + { + return Set(pValue, typeof(U).ToFbxType()); + } + + public /*override*/ bool Set(U value, int x) + where U :T { // if U can be assigned to a prop/field of type T, // then do so @@ -59,26 +112,57 @@ public override bool Set(U value) // then use that // else // throw - if ((typeof(U).IsAssignableFrom(typeof(T)))) + + return Set(value, typeof(U).ToFbxType()); + + throw new InvalidCastException(); // maybe find a better exception to throw + } + + [DeviationFromSdk("change parameter type to object from void*")] + protected override bool Set(object pValue, EFbxType pValueType, bool pCheckForValueEquality=true) + { + var actualType = pValue.GetType(); + if (typeof(T).IsAssignableFrom(actualType)) { - Value = (T)(object)value; + Value = (T)pValue; return true; } - var tuple = new Tuple(typeof(U), typeof(T)); - if (Converters.ContainsKey(tuple)) + if (typeof(T).IsEnum) { - var converter = Converters[tuple]; - Value = (T)converter(value); - return true; + object v = null; + if (actualType == typeof(long)) + v = (T)Enum.ToObject(typeof(T), (long)(object)pValue); + else if (actualType == typeof(ulong)) + v = (T)Enum.ToObject(typeof(T), (ulong)(object)pValue); + else if (actualType == typeof(int)) + v = (T)Enum.ToObject(typeof(T), (int)(object)pValue); + else if (actualType == typeof(uint)) + v = (T)Enum.ToObject(typeof(T), (uint)(object)pValue); + else if (actualType == typeof(short)) + v = (T)Enum.ToObject(typeof(T), (short)(object)pValue); + else if (actualType == typeof(ushort)) + v = (T)Enum.ToObject(typeof(T), (ushort)(object)pValue); + else if (actualType == typeof(byte)) + v = (T)Enum.ToObject(typeof(T), (byte)(object)pValue); + else if (actualType == typeof(sbyte)) + v = (T)Enum.ToObject(typeof(T), (sbyte)(object)pValue); + if (v != null) + { + Value = (T)v; + return true; + } } - throw new InvalidCastException(); // maybe find a better exception to throw - } + var tuple = new Tuple(actualType, typeof(T)); + if (Converters.TryGetValue(tuple, out var converter)) + { + Value = (T)converter(pValue); + return true; + } - public override bool Set(object value) - { - return Set(value); + throw new NotImplementedException(); + // return Set(pValue); } } } diff --git a/FbxSharp/FbxPropertyTEnum.cs b/FbxSharp/FbxPropertyTEnum.cs new file mode 100644 index 0000000..3a23ae0 --- /dev/null +++ b/FbxSharp/FbxPropertyTEnum.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; + +namespace FbxSharp; + +/// +/// A kind of specialization of FbxPropertyT for eFbxEnum +/// +[NotSdk] +public class FbxPropertyTEnum : FbxProperty +{ + public FbxPropertyTEnum(string name="") + : base(name, EFbxType.eFbxEnum) + { + } + public FbxPropertyTEnum(string name, int initialValue) + : base(name, EFbxType.eFbxEnum) + { + Value = initialValue; + } + + public static FbxPropertyTEnum StaticInit(FbxObject pObject, + string pName, int pValue) => + StaticInit(pObject.RootProperty, pName, pValue); + public static FbxPropertyTEnum StaticInit(FbxProperty pCompound, + string pName, int pValue) + { + var prop = new FbxPropertyTEnum(pName, pValue); + prop.SetParent(pCompound); + return prop; + } + + public override Type GetDotnetType() => typeof(int); + + public int Value { get; set; } + + //FbxPropertyT & Set (const T &pValue) + public void Set(int value) + { + Value = value; + } + + public int Get() + { + return Value; + } + + public override U Get() + { + if (!(Value is U)) + { + var tuple = new Tuple(typeof(int), typeof(U)); + if (Converters.ContainsKey(tuple)) + { + var converter = Converters[tuple]; + return (U)converter(Value); + } + + throw new InvalidCastException(); // maybe find a better exception to throw + } + + return (U)(object)Value; + } + + public override object GetValue() + { + return Value; + } + + public override bool Set(U value) + { + // if U can be assigned to a prop/field of type T, + // then do so + // else if there is a converter available + // then use that + // else + // throw + var actualType = value.GetType(); + if ((typeof(int).IsAssignableFrom(actualType))) + { + Value = (int)(object)value; + return true; + } + + var tuple = new Tuple(actualType, typeof(int)); + if (Converters.ContainsKey(tuple)) + { + var converter = Converters[tuple]; + Value = (int)converter(value); + return true; + } + + throw new InvalidCastException(); // maybe find a better exception to throw + } + + public /*override*/ bool Set(object value) + { + var actualType = value.GetType(); + if (typeof(int).IsAssignableFrom(actualType)) + { + Value = (int)value; + return true; + } + + if (typeof(long).IsAssignableFrom(actualType)) + { + Value = Convert.ToInt32((long)value); + return true; + } + + if (typeof(int).IsEnum) + { + object v = null; + if (actualType == typeof(long)) + v = (int)Enum.ToObject(typeof(int), (long)(object)value); + else if (actualType == typeof(ulong)) + v = (int)Enum.ToObject(typeof(int), (ulong)(object)value); + else if (actualType == typeof(int)) + v = (int)Enum.ToObject(typeof(int), (int)(object)value); + else if (actualType == typeof(uint)) + v = (int)Enum.ToObject(typeof(int), (uint)(object)value); + else if (actualType == typeof(short)) + v = (int)Enum.ToObject(typeof(int), (short)(object)value); + else if (actualType == typeof(ushort)) + v = (int)Enum.ToObject(typeof(int), (ushort)(object)value); + else if (actualType == typeof(byte)) + v = (int)Enum.ToObject(typeof(int), (byte)(object)value); + else if (actualType == typeof(sbyte)) + v = (int)Enum.ToObject(typeof(int), (sbyte)(object)value); + if (v != null) + { + Value = (int)v; + return true; + } + } + + var tuple = new Tuple(actualType, typeof(int)); + if (Converters.TryGetValue(tuple, out Func converter)) + { + Value = (int)converter(value); + return true; + } + + throw new NotImplementedException(); + // return Set(value); + } + + #region Enum and property list + + private readonly List enumValues = []; + + public override int AddEnumValue(string pStringValue) + { + enumValues.Add(pStringValue); + return enumValues.Count - 1; + } + + public override void InsertEnumValue(int pIndex, string pStringValue) + { + enumValues.Insert(pIndex, pStringValue); + } + + public override int GetEnumCount() + { + return enumValues.Count; + } + + public override void SetEnumValue(int pIndex, string pStringValue) + { + enumValues[pIndex] = pStringValue; + } + + public override void RemoveEnumValue(int pIndex) + { + enumValues.RemoveAt(pIndex); + } + + public override string GetEnumValue(int pIndex) + { + return enumValues[pIndex]; + } + + #endregion +} \ No newline at end of file diff --git a/FbxSharp/FbxScene.cs b/FbxSharp/FbxScene.cs index 431eb4a..8ffb911 100644 --- a/FbxSharp/FbxScene.cs +++ b/FbxSharp/FbxScene.cs @@ -35,7 +35,7 @@ public override void ConnectSrcObject(FbxObject fbxObject/*, Connection.EType ty this.ConnectSrcObject(srcobj); } - foreach (FbxProperty prop in fbxObject.Properties) + foreach (var prop in fbxObject.RootProperty.Children) { foreach (var srcobj in prop.SrcObjects) { diff --git a/FbxSharp/FbxSkeleton.cs b/FbxSharp/FbxSkeleton.cs index db7cbb4..67201ed 100644 --- a/FbxSharp/FbxSkeleton.cs +++ b/FbxSharp/FbxSkeleton.cs @@ -4,6 +4,15 @@ namespace FbxSharp { public class FbxSkeleton : FbxNodeAttribute { + public FbxSkeleton(string name = "") + : base(name) + { + Size = FbxPropertyT.StaticInit( + this, "Size", 0, false); + LimbLength = FbxPropertyT.StaticInit( + this, "LimbLength", 0, false); + } + public override EAttributeType AttributeType { get { return EAttributeType.Skeleton; } } public void Reset() @@ -59,8 +68,8 @@ public FbxColor LimbNodeColor public const double sDefaultSize = 100; public const double sDefaultLimbLength = 1; - public readonly FbxPropertyT Size = new FbxPropertyT("Size"); - public readonly FbxPropertyT LimbLength = new FbxPropertyT("LimbLength"); + public readonly FbxPropertyT Size; + public readonly FbxPropertyT LimbLength; #endregion } diff --git a/FbxSharp/FbxStatus.cs b/FbxSharp/FbxStatus.cs new file mode 100644 index 0000000..58d6f7b --- /dev/null +++ b/FbxSharp/FbxStatus.cs @@ -0,0 +1,102 @@ +using System; + +namespace FbxSharp; + +public class FbxStatus +{ + public enum EStatusCode + { + eSuccess = 0, + eFailure = 1, + eInsufficientMemory = 2, + eInvalidParameter = 3, + eIndexOutOfRange = 4, + ePasswordError = 5, + eInvalidFileVersion = 6, + eInvalidFile = 7, + eSceneCheckFail = 8, + } + + public FbxStatus() + { + } + + public FbxStatus(EStatusCode pCode) + { + } + + // public FbxStatus (const FbxStatus &rhs){ + // } + // + // public FbxStatus & operator= (const FbxStatus &rhs) + // public FbxStatus & operator+= (const FbxStatus &rhs) + // public bool operator== (const FbxStatus &rhs) const + // public bool operator== (const EStatusCode pCode) const + // public bool operator!= (const FbxStatus &rhs) const + // public bool operator!= (const EStatusCode rhs) const + // public operator bool () const + + private EStatusCode code; + private bool isError = false; + public bool Error() + { + return isError; + } + + public void Clear() + { + throw new NotImplementedException(); + } + + public EStatusCode GetCode() + { + return code; + } + + public void SetCode(EStatusCode rhs) + { + throw new NotImplementedException(); + } + + public void SetCode(EStatusCode rhs, string pErrorMsg, params object[] vararg) + { + throw new NotImplementedException(); + } + + public string GetErrorString() + { + switch (code) + { + case EStatusCode.eSuccess: + return ""; + case EStatusCode.eFailure: + return "eFailure"; + case EStatusCode.eInsufficientMemory: + return "eInsufficientMemory"; + case EStatusCode.eInvalidParameter: + return "eInvalidParameter"; + case EStatusCode.eIndexOutOfRange: + return "eIndexOutOfRange"; + case EStatusCode.ePasswordError: + return "ePasswordError"; + case EStatusCode.eInvalidFileVersion: + return "eInvalidFileVersion"; + case EStatusCode.eInvalidFile: + return "eInvalidFile"; + case EStatusCode.eSceneCheckFail: + return "eSceneCheckFail"; + default: + throw new ArgumentOutOfRangeException(); + } + } + + public bool KeepErrorStringHistory(bool pState) + { + throw new NotImplementedException(); + } + + // public void GetErrorStringHistory(FbxArray pHistory) + // { + // throw new NotImplementedException(); + // } +} \ No newline at end of file diff --git a/FbxSharp/FbxSurfaceLambert.cs b/FbxSharp/FbxSurfaceLambert.cs index f44e9cd..7d83727 100644 --- a/FbxSharp/FbxSurfaceLambert.cs +++ b/FbxSharp/FbxSurfaceLambert.cs @@ -4,46 +4,58 @@ namespace FbxSharp { public class FbxSurfaceLambert : FbxSurfaceMaterial { - public FbxSurfaceLambert(string name="") + public FbxSurfaceLambert(string name = "") : base(name) { - this.Properties.AddRange( - new FbxProperty[] { - Emissive, - EmissiveFactor, - Ambient, - AmbientFactor, - Diffuse, - DiffuseFactor, - NormalMap, - Bump, - BumpFactor, - TransparentColor, - TransparencyFactor, - DisplacementColor, - DisplacementFactor, - VectorDisplacementColor, - VectorDisplacementFactor, - }); + Emissive = FbxPropertyT.StaticInit(this, + "EmissiveColor", FbxVector3.Zero, false); + EmissiveFactor = FbxPropertyT.StaticInit(this, + "EmissiveFactor", 0.0, false); + Ambient = FbxPropertyT.StaticInit(this, + "AmbientColor", FbxVector3.Zero, false); + AmbientFactor = FbxPropertyT.StaticInit(this, + "AmbientFactor", 0.0, false); + Diffuse = FbxPropertyT.StaticInit(this, + "DiffuseColor", FbxVector3.Zero, false); + DiffuseFactor = FbxPropertyT.StaticInit(this, + "DiffuseFactor", 0.0, false); + NormalMap = FbxPropertyT.StaticInit(this, "NormalMap", + FbxVector3.Zero, false); + Bump = FbxPropertyT.StaticInit(this, "Bump", + FbxVector3.Zero, false); + BumpFactor = FbxPropertyT.StaticInit(this, "BumpFactor", + 0.0, false); + TransparentColor = FbxPropertyT.StaticInit(this, + "TransparentColor", FbxVector3.Zero, false); + TransparencyFactor = FbxPropertyT.StaticInit(this, + "TransparencyFactor", 0.0, false); + DisplacementColor = FbxPropertyT.StaticInit(this, + "DisplacementColor", FbxVector3.Zero, false); + DisplacementFactor = FbxPropertyT.StaticInit(this, + "DisplacementFactor", 0.0, false); + VectorDisplacementColor = FbxPropertyT.StaticInit( + this, "VectorDisplacementColor", FbxVector3.Zero, false); + VectorDisplacementFactor = FbxPropertyT.StaticInit(this, + "VectorDisplacementFactor", 0.0, false); } #region Material properties - public readonly FbxPropertyT Emissive = new FbxPropertyT("EmissiveColor"); - public readonly FbxPropertyT EmissiveFactor = new FbxPropertyT("EmissiveFactor"); - public readonly FbxPropertyT Ambient = new FbxPropertyT("AmbientColor"); - public readonly FbxPropertyT AmbientFactor = new FbxPropertyT("AmbientFactor"); - public readonly FbxPropertyT Diffuse = new FbxPropertyT("DiffuseColor"); - public readonly FbxPropertyT DiffuseFactor = new FbxPropertyT("DiffuseFactor"); - public readonly FbxPropertyT NormalMap = new FbxPropertyT("NormalMap"); - public readonly FbxPropertyT Bump = new FbxPropertyT("Bump"); - public readonly FbxPropertyT BumpFactor = new FbxPropertyT("BumpFactor"); - public readonly FbxPropertyT TransparentColor = new FbxPropertyT("TransparentColor"); - public readonly FbxPropertyT TransparencyFactor = new FbxPropertyT("TransparencyFactor"); - public readonly FbxPropertyT DisplacementColor = new FbxPropertyT("DisplacementColor"); - public readonly FbxPropertyT DisplacementFactor = new FbxPropertyT("DisplacementFactor"); - public readonly FbxPropertyT VectorDisplacementColor = new FbxPropertyT("VectorDisplacementColor"); - public readonly FbxPropertyT VectorDisplacementFactor = new FbxPropertyT("VectorDisplacementFactor"); + public readonly FbxPropertyT Emissive; + public readonly FbxPropertyT EmissiveFactor; + public readonly FbxPropertyT Ambient; + public readonly FbxPropertyT AmbientFactor; + public readonly FbxPropertyT Diffuse; + public readonly FbxPropertyT DiffuseFactor; + public readonly FbxPropertyT NormalMap; + public readonly FbxPropertyT Bump; + public readonly FbxPropertyT BumpFactor; + public readonly FbxPropertyT TransparentColor; + public readonly FbxPropertyT TransparencyFactor; + public readonly FbxPropertyT DisplacementColor; + public readonly FbxPropertyT DisplacementFactor; + public readonly FbxPropertyT VectorDisplacementColor; + public readonly FbxPropertyT VectorDisplacementFactor; #endregion } diff --git a/FbxSharp/FbxSurfaceMaterial.cs b/FbxSharp/FbxSurfaceMaterial.cs index 331a65e..6784f50 100644 --- a/FbxSharp/FbxSurfaceMaterial.cs +++ b/FbxSharp/FbxSurfaceMaterial.cs @@ -6,17 +6,19 @@ namespace FbxSharp { public abstract class FbxSurfaceMaterial : FbxObject { - protected FbxSurfaceMaterial(string name="") + protected FbxSurfaceMaterial(string name = "") : base(name) { - this.Properties.Add(ShadingModel); - this.Properties.Add(MultiLayer); + ShadingModel = FbxPropertyT.StaticInit(this, + "ShadingModel", "", false); + MultiLayer = FbxPropertyT.StaticInit(this, "MultiLayer", + false, false); } #region Material Properties - public readonly FbxPropertyT ShadingModel = new FbxPropertyT("ShadingModel"); - public readonly FbxPropertyT MultiLayer = new FbxPropertyT("MultiLayer"); + public readonly FbxPropertyT ShadingModel; + public readonly FbxPropertyT MultiLayer; #endregion diff --git a/FbxSharp/FbxSurfacePhong.cs b/FbxSharp/FbxSurfacePhong.cs index 790885d..7477567 100644 --- a/FbxSharp/FbxSurfacePhong.cs +++ b/FbxSharp/FbxSurfacePhong.cs @@ -4,26 +4,28 @@ namespace FbxSharp { public class FbxSurfacePhong : FbxSurfaceLambert { - public FbxSurfacePhong(string name="") + public FbxSurfacePhong(string name = "") : base(name) { - this.Properties.AddRange( - new FbxProperty[] { - Specular, - SpecularFactor, - Shininess, - Reflection, - ReflectionFactor, - }); + Specular = FbxPropertyT.StaticInit(this, + "SpecularColor", FbxVector3.Zero, false); + SpecularFactor = FbxPropertyT.StaticInit(this, + "SpecularFactor", 0.0, false); + Shininess = FbxPropertyT.StaticInit(this, + "ShininessExponent", 0.0, false); + Reflection = FbxPropertyT.StaticInit(this, + "ReflectionColor", FbxVector3.Zero, false); + ReflectionFactor = FbxPropertyT.StaticInit(this, + "ReflectionFactor", 0.0, false); } #region Material properties - public readonly FbxPropertyT Specular = new FbxPropertyT("SpecularColor"); - public readonly FbxPropertyT SpecularFactor = new FbxPropertyT("SpecularFactor"); - public readonly FbxPropertyT Shininess = new FbxPropertyT("ShininessExponent"); - public readonly FbxPropertyT Reflection = new FbxPropertyT("ReflectionColor"); - public readonly FbxPropertyT ReflectionFactor = new FbxPropertyT("ReflectionFactor"); + public readonly FbxPropertyT Specular; + public readonly FbxPropertyT SpecularFactor; + public readonly FbxPropertyT Shininess; + public readonly FbxPropertyT Reflection; + public readonly FbxPropertyT ReflectionFactor; #endregion } diff --git a/FbxSharp/FbxSystemUnit.cs b/FbxSharp/FbxSystemUnit.cs new file mode 100644 index 0000000..4ca26ff --- /dev/null +++ b/FbxSharp/FbxSystemUnit.cs @@ -0,0 +1,117 @@ +using System; +using System.Diagnostics; + +namespace FbxSharp; + +public class FbxSystemUnit +{ + #region Classes + + public class ConversionOptions + { + } + + #endregion + + #region Public Member Functions + + public FbxSystemUnit() + : this(1) + { + } + + public FbxSystemUnit(double pScaleFactor, double pMultiplier = 1.0) + { + scaleFactor = pScaleFactor; + multiplier = pMultiplier; + } + + // public ~FbxSystemUnit ()=>throw new NotImplementedException(); + + [DeviationFromSdk("C# doesn't allow non-null default value for pOptions")] + public void ConvertScene(FbxScene pScene) => ConvertScene(pScene, DefaultConversionOptions); + + [DeviationFromSdk("C# doesn't allow non-null default value for pOptions")] + public void ConvertScene(FbxScene pScene, ConversionOptions pOptions) => throw new NotImplementedException(); + + [DeviationFromSdk("C# doesn't allow non-null default value for pOptions")] + public void ConvertChildren(FbxNode pRoot, FbxSystemUnit pSrcUnit) => + ConvertChildren(pRoot, pSrcUnit, DefaultConversionOptions); + + [DeviationFromSdk("C# doesn't allow non-null default value for pOptions")] + public void ConvertChildren(FbxNode pRoot, FbxSystemUnit pSrcUnit, ConversionOptions pOptions) => + throw new NotImplementedException(); + + public void ConvertScene(FbxScene pScene, FbxNode pFbxRoot) => + ConvertScene(pScene, pFbxRoot, DefaultConversionOptions); + + public void ConvertScene(FbxScene pScene, FbxNode pFbxRoot, ConversionOptions pOptions) => + throw new NotImplementedException(); + + public double GetScaleFactor() => scaleFactor; + + public string GetScaleFactorAsString(bool pAbbreviated = true) + { + switch (scaleFactor) + { + case 0.1: return "mm"; + case 1: return "cm"; + case 10: return "dm"; + case 100: return "m"; + case 100000: return "km"; + case 2.54: return "in"; + case 30.48: return "ft"; + case 91.44: return "yd"; + case 160934.4: return "mi"; + } + + return "un"; + } + + public string GetScaleFactorAsString_Plurial() + { + switch (scaleFactor) + { + case 0.1: return "Millimeters"; + case 1: return "Centimeters"; + case 10: return "Decimeters"; + case 100: return "Meters"; + case 100000: return "Kilometers"; + case 2.54: return "Inches"; + case 30.48: return "Feet"; + case 91.44: return "Yards"; + case 160934.4: return "Miles"; + } + + return "un"; + } + + public double GetMultiplier() => multiplier; + + // public bool operator== (FbxSystemUnit &pOther)=>throw new NotImplementedException(); + // public bool operator!= (FbxSystemUnit &pOther)=>throw new NotImplementedException(); + // public FbxSystemUnit & operator= (FbxSystemUnit &pSystemUnit)=>throw new NotImplementedException(); + public double GetConversionFactorTo(FbxSystemUnit pTarget) => throw new NotImplementedException(); + public double GetConversionFactorFrom(FbxSystemUnit pSource) => throw new NotImplementedException(); + + #endregion + + #region Static Public Attributes + + public static FbxSystemUnit mm = new FbxSystemUnit(0.1); + public static FbxSystemUnit dm = new FbxSystemUnit(10); + public static FbxSystemUnit cm = new FbxSystemUnit(); + public static FbxSystemUnit m = new FbxSystemUnit(100); + public static FbxSystemUnit km = new FbxSystemUnit(100000); + public static FbxSystemUnit Inch = new FbxSystemUnit(2.54); + public static FbxSystemUnit Foot = new FbxSystemUnit(30.48); + public static FbxSystemUnit Mile = new FbxSystemUnit(160934.4); + public static FbxSystemUnit Yard = new FbxSystemUnit(91.44); + public static FbxSystemUnit sPredefinedUnits = mm; + public static ConversionOptions DefaultConversionOptions = new ConversionOptions(); + + #endregion + + private double scaleFactor; + private double multiplier; +} \ No newline at end of file diff --git a/FbxSharp/FbxTime.cs b/FbxSharp/FbxTime.cs index 2064f5b..c4d7384 100644 --- a/FbxSharp/FbxTime.cs +++ b/FbxSharp/FbxTime.cs @@ -7,14 +7,51 @@ public struct FbxTime public static readonly FbxTime Infinite = new FbxTime(0x7fffffffffffffffL); public static readonly FbxTime Zero = new FbxTime(0); - public const long UnitsPerSecond = 141120000L; + #region Public Member Functions - public const long FBXSDK_TC_MILLISECOND = 141120L; - public const long FBXSDK_TC_SECOND = 141120000L; - public const long FBXSDK_TC_LEGACY_MILLISECOND = 46186158L; + public FbxTime(long time) + { + Value = time; + } + + #endregion + + public long Value; + + #region Static Public Member Functions + + public static long GetOneFrameValue(EMode pTimeMode = EMode.eDefaultMode) + { + switch (pTimeMode) + { + case EMode.eDefaultMode: return 4704000L; + case EMode.eFrames120: return 1176000L; + case EMode.eFrames100: return 1411200L; + case EMode.eFrames60: return 2352000L; + case EMode.eFrames50: return 2822400L; + case EMode.eFrames48: return 2940000L; + case EMode.eFrames30: return 4704000L; + case EMode.eFrames30Drop: return 0L; + case EMode.eNTSCDropFrame: return 4708704L; + case EMode.eNTSCFullFrame: return 4708704L; + case EMode.ePAL: return 5644800L; + case EMode.eFrames24: return 5880000L; + case EMode.eFrames1000: return 141120L; + case EMode.eFilmFullFrame: return 5885880L; + case EMode.eCustom: return 11289600L; + case EMode.eFrames96: return 1470000L; + case EMode.eFrames72: return 1960000L; + case EMode.eFrames59dot94: return 2354352L; + case EMode.eFrames119dot88: return 1177176L; + case EMode.eModesCount: return 0L; + } + + throw new ArgumentOutOfRangeException(nameof(pTimeMode)); + } + + #endregion - public const int FBXSDK_TC_STANDARD_DEFINITION = 0; - public const int FBXSDK_TC_LEGACY_DEFINITION = 127; + #region Time Modes and Protocols public enum EMode { @@ -40,12 +77,15 @@ public enum EMode eModesCount } - public FbxTime(long time) + public enum EProtocol { - Value = time; + eSMPTE, + eFrameCount, + eDefaultProtocol, } - public long Value; + public static void SetGlobalTimeMode(EMode mode) => + throw new NotImplementedException(); public static EMode GetGlobalTimeMode() { @@ -53,42 +93,184 @@ public static EMode GetGlobalTimeMode() return EMode.eFrames30; } + public static void SetGlobalTimeProtocol(EProtocol pTimeProtocol) => + throw new NotImplementedException(); + + public static EProtocol GetGlobalTimeProtocol() => + // TODO: make this mutable + EProtocol.eFrameCount; + + public static double GetFrameRate(EMode pTimeMode) + { + switch (pTimeMode) + { + case EMode.eDefaultMode: return 30.0; + case EMode.eFrames120: return 120.0; + case EMode.eFrames100: return 100.0; + case EMode.eFrames60: return 60.0; + case EMode.eFrames50: return 50.0; + case EMode.eFrames48: return 48.0; + case EMode.eFrames30: return 30.0; + case EMode.eFrames30Drop: return 0.0; + case EMode.eNTSCDropFrame: + // 0x403df853e2556b28 + return 29.970029970029969490497023798525333404541015625; + case EMode.eNTSCFullFrame: + // 0x403df853e2556b28 + return 29.970029970029969490497023798525333404541015625; + case EMode.ePAL: return 25.0; + case EMode.eFrames24: return 24.0; + case EMode.eFrames1000: return 1000.0; + case EMode.eFilmFullFrame: + // 0x4037f9dcb5112287 + return 23.976023976023977724025826319120824337005615234375; + case EMode.eCustom: return 12.5; + case EMode.eFrames96: return 96.0; + case EMode.eFrames72: return 72.0; + case EMode.eFrames59dot94: + // 0x404df853e2556b28 + return 59.94005994005993898099404759705066680908203125; + case EMode.eFrames119dot88: + // 0x405df853e2556b28 + return 119.8801198801198779619880951941013336181640625; + case EMode.eModesCount: return 0.0; + } + + throw new ArgumentOutOfRangeException(nameof(pTimeMode)); + } + + public static EMode ConvertFrameRateToTimeMode(double pFrameRate, double pPrecision = 0.00000001) + { + if (pFrameRate <= 0) return EMode.eFrames30Drop; + if (Math.Abs(pFrameRate - 120.0) <= pPrecision) return EMode.eFrames120; + if (Math.Abs(pFrameRate - 100.0) <= pPrecision) return EMode.eFrames100; + if (Math.Abs(pFrameRate - 60.0) <= pPrecision) return EMode.eFrames60; + if (Math.Abs(pFrameRate - 50.0) <= pPrecision) return EMode.eFrames50; + if (Math.Abs(pFrameRate - 48.0) <= pPrecision) return EMode.eFrames48; + if (Math.Abs(pFrameRate - 30.0) <= pPrecision) return EMode.eFrames30; + if (Math.Abs(pFrameRate - 29.970029970029969490497023798525333404541015625) <= pPrecision) return EMode.eNTSCDropFrame; + if (Math.Abs(pFrameRate - 25.0) <= pPrecision) return EMode.ePAL; + if (Math.Abs(pFrameRate - 24.0) <= pPrecision) return EMode.eFrames24; + if (Math.Abs(pFrameRate - 1000.0) <= pPrecision) return EMode.eFrames1000; + if (Math.Abs(pFrameRate - 23.976023976023977724025826319120824337005615234375) <= pPrecision) return EMode.eFilmFullFrame; + if (Math.Abs(pFrameRate - 12.5) <= pPrecision) return EMode.eCustom; + if (Math.Abs(pFrameRate - 96.0) <= pPrecision) return EMode.eFrames96; + if (Math.Abs(pFrameRate - 72.0) <= pPrecision) return EMode.eFrames72; + if (Math.Abs(pFrameRate - 59.94005994005993898099404759705066680908203125) <= pPrecision) return EMode.eFrames59dot94; + if (Math.Abs(pFrameRate - 119.8801198801198779619880951941013336181640625) <= pPrecision) return EMode.eFrames119dot88; + + return EMode.eDefaultMode; + } + + #endregion + + #region Time Conversion + + public enum EElement + { + eHours, + eMinutes, + eSeconds, + eFrames, + eField, + eResidual + } + + public void Set(long pTime) => + Value = pTime; + public long Get() { return Value; } + public long SetMilliSeconds(long pMilliSeconds) => + throw new NotImplementedException(); + public long GetMilliSeconds() { - return Value / FBXSDK_TC_MILLISECOND; + return Value / FbxTimeCode.FBXSDK_TC_MILLISECOND; } - public double GetSecondDouble() - { - return Value / (double)UnitsPerSecond; - } + + public void SetSecondDouble(double pTime) => + throw new NotImplementedException(); + + public double GetSecondDouble() => + Value / (double)FbxTimeCode.FBXSDK_TC_LEGACY_SECOND; + + public void SetTime(int pHour, int pMinute, int pSecond, int pFrame = 0, int pField = 0, + EMode pTimeMode = EMode.eDefaultMode) => + throw new NotImplementedException(); + + public void SetTime(int pHour, int pMinute, int pSecond, int pFrame, int pField, int pResidual, + EMode pTimeMode) => + throw new NotImplementedException(); + + public bool GetTime(ref int pHour, ref int pMinute, ref int pSecond, ref int pFrame, ref int pField, + ref int pResidual, EMode pTimeMode = + EMode.eDefaultMode) /*const*/ => + throw new NotImplementedException(); + + public FbxTime GetFramedTime(bool pRound = true) /*const*/ => + throw new NotImplementedException(); + + public void SetFrame(long pFrames, EMode pTimeMode = EMode.eDefaultMode) => + throw new NotImplementedException(); + + public void SetFramePrecise(double pFrames, EMode pTimeMode = EMode.eDefaultMode) => + throw new NotImplementedException(); + + public int GetHourCount() /*const*/ => + (int)(Value / FbxTimeCode.FBXSDK_TC_SECOND / 3600); + + public int GetMinuteCount() /*const*/ => (int)(Value / FbxTimeCode.FBXSDK_TC_SECOND / 60); public int GetSecondCount() { - return (int)(Value / UnitsPerSecond); + return (int)(Value / FbxTimeCode.FBXSDK_TC_LEGACY_SECOND); } - public long GetFrameCount(EMode pTimeMode = EMode.eDefaultMode) + public long GetFrameCount(EMode pTimeMode = EMode.eDefaultMode) /*const*/ { // TODO: take time mode into account - return Value / (FBXSDK_TC_SECOND / 30); + return Value / (FbxTimeCode.FBXSDK_TC_SECOND / 30); } - public double GetFrameCountPrecise(EMode pTimeMode = EMode.eDefaultMode) + public double GetFrameCountPrecise(EMode pTimeMode = EMode.eDefaultMode) /*const*/ { // TODO: take time mode into account - return Value / (double)(FBXSDK_TC_SECOND / 30); + return Value / (double)(FbxTimeCode.FBXSDK_TC_SECOND / 30); } - public long GetFieldCount(EMode pTimeMode = EMode.eDefaultMode) + public long GetFieldCount(EMode pTimeMode = EMode.eDefaultMode) /*const*/ { // TODO: take time mode into account - return Value / (FBXSDK_TC_SECOND / 60); + return Value / (FbxTimeCode.FBXSDK_TC_SECOND / 60); } + + public int GetResidual(EMode pTimeMode = EMode.eDefaultMode) /*const*/ => + throw new NotImplementedException(); + + public char GetFrameSeparator(EMode pTimeMode = EMode.eDefaultMode) /*const*/ => + throw new NotImplementedException(); + + public string GetTimeString(string pTimeString, /*const*/ ushort pTimeStringSize, int pInfo = 5, + EMode pTimeMode = EMode.eDefaultMode, EProtocol pTimeFormat = EProtocol.eDefaultProtocol) /*const*/ => + throw new NotImplementedException(); + + public string GetTimeString(EElement pStart = EElement.eHours, EElement pEnd = EElement.eResidual, + EMode pTimeMode = EMode.eDefaultMode, + EProtocol pTimeFormat = EProtocol.eDefaultProtocol) /*const*/ => + throw new NotImplementedException(); + + public bool SetTimeString(string pTime, EMode pTimeMode = EMode.eDefaultMode, + EProtocol pTimeFormat = EProtocol.eDefaultProtocol) => + throw new NotImplementedException(); + + public static bool IsDropFrame(EMode pTimeMode = EMode.eDefaultMode) => + throw new NotImplementedException(); + + #endregion } } diff --git a/FbxSharp/FbxTimeCode.cs b/FbxSharp/FbxTimeCode.cs new file mode 100644 index 0000000..0088236 --- /dev/null +++ b/FbxSharp/FbxTimeCode.cs @@ -0,0 +1,52 @@ +using System; + +namespace FbxSharp +{ + public struct FbxTimeCode + { + public const long FBXSDK_TC_ZERO = 0; + public const long FBXSDK_TC_EPSILON = 1; + public const long FBXSDK_TC_MINFINITY = -0x7fffffffffffffff; + public const long FBXSDK_TC_INFINITY = 0x7fffffffffffffff; + public const long FBXSDK_TC_FIX_DEN = 100000000; + public const long FBXSDK_TC_LEGACY_MILLISECOND = 46186158; + public const long FBXSDK_TC_LEGACY_SECOND = FBXSDK_TC_LEGACY_MILLISECOND * 1000; + public const long FBXSDK_TC_MILLISECOND = 141120; + public const long FBXSDK_TC_SECOND = FBXSDK_TC_MILLISECOND * 1000; + public const long FBXSDK_TC_MINUTE = FBXSDK_TC_SECOND * 60; + public const long FBXSDK_TC_HOUR = FBXSDK_TC_MINUTE * 60; + public const long FBXSDK_TC_DAY = FBXSDK_TC_HOUR * 24; + public const long FBXSDK_TC_NTSC_FIELD = FBXSDK_TC_SECOND / 30 / 2; + public const long FBXSDK_TC_NTSC_FRAME = FBXSDK_TC_SECOND / 30; + public const long FBXSDK_TC_MNTSC_FIELD = FBXSDK_TC_MNTSC_FRAME / 2; + public const long FBXSDK_TC_MNTSC_FRAME = FBXSDK_TC_SECOND / 30 * 1001 / 1000; + public const long FBXSDK_TC_MNTSC_2_FRAMES = FBXSDK_TC_MNTSC_FRAME * 2; + public const long FBXSDK_TC_MNTSC_30_FRAMES = FBXSDK_TC_MNTSC_FRAME * 30; + public const long FBXSDK_TC_MNTSC_1798_FRAMES = FBXSDK_TC_MNTSC_FRAME * 1798; + public const long FBXSDK_TC_MNTSC_1800_FRAMES = FBXSDK_TC_MNTSC_FRAME * 1800; + public const long FBXSDK_TC_MNTSC_17982_FRAMES = FBXSDK_TC_MNTSC_FRAME * 17982; + public const long FBXSDK_TC_MNTSC_107892_FRAMES = FBXSDK_TC_MNTSC_FRAME * 107892; + public const long FBXSDK_TC_MNTSC_108000_FRAMES = FBXSDK_TC_MNTSC_FRAME * 108000; + public const long FBXSDK_TC_MNTSC_1_SECOND = FBXSDK_TC_MNTSC_FRAME * 30; + public const long FBXSDK_TC_MNTSC_1_MINUTE = FBXSDK_TC_MNTSC_1_SECOND * 60; + public const long FBXSDK_TC_MNTSC_1_HOUR = FBXSDK_TC_MNTSC_1_SECOND * 3600; + public const ulong FBXSDK_TC_MNTSC_NUM = FBXSDK_TC_FIX_DEN * 1000 * 30 / 1001; + public const long FBXSDK_TC_MNTSC_DEN = FBXSDK_TC_FIX_DEN; + public const long FBXSDK_TC_PAL_FIELD = FBXSDK_TC_SECOND / 25 / 2; + public const long FBXSDK_TC_PAL_FRAME = FBXSDK_TC_SECOND / 25; + public const long FBXSDK_TC_FILM_FRAME = FBXSDK_TC_SECOND / 24; + public const long FBXSDK_TC_MFILM_FIELD = FBXSDK_TC_MFILM_FRAME / 2; + public const long FBXSDK_TC_MFILM_FRAME = FBXSDK_TC_SECOND / 24 * 1001 / 1000; + public const long FBXSDK_TC_MFILM_1_SECOND = FBXSDK_TC_MFILM_FRAME * 24; + public const long FBXSDK_TC_MFILM_1_MINUTE = FBXSDK_TC_MFILM_1_SECOND * 60; + public const long FBXSDK_TC_MFILM_1_HOUR = FBXSDK_TC_MFILM_1_SECOND * 3600; + public const ulong FBXSDK_TC_MFILM_NUM = FBXSDK_TC_FIX_DEN * 1000 * 24 / 1001; + public const long FBXSDK_TC_MFILM_DEN = FBXSDK_TC_FIX_DEN; + + // #define FBXSDK_TC_REM(quot, num, den) ((quot) = (num) / (den), (quot) * (den)) + // #define FBXSDK_TC_HOUR_REM(quot, num, den) ((quot) = ((num - (-FbxLongLong(num < 0) & (den - 1))) / (den)), (quot) * (den)) + + public const int FBXSDK_TC_LEGACY_DEFINITION = 127; + public const int FBXSDK_TC_STANDARD_DEFINITION = 0; + } +} diff --git a/FbxSharp/FbxTimeSpan.cs b/FbxSharp/FbxTimeSpan.cs index e994c82..fa763a6 100644 --- a/FbxSharp/FbxTimeSpan.cs +++ b/FbxSharp/FbxTimeSpan.cs @@ -7,6 +7,10 @@ public struct FbxTimeSpan public FbxTime Start; public FbxTime Stop; + #region Public Member Functions + + // Deviation from SDK: no zero-parameter constructor + public FbxTimeSpan(FbxTime pStart, FbxTime pStop) { Start = pStart; @@ -41,17 +45,18 @@ public FbxTime GetStop() public FbxTime GetDuration() { - throw new NotImplementedException(); + return new FbxTime(GetStop().Get() - GetStart().Get()); } public FbxTime GetSignedDuration() { - throw new NotImplementedException(); + return new FbxTime(GetStop().Get() - GetStart().Get()); } public int GetDirection() { - throw new NotImplementedException(); + if (GetStop().Get() >= GetStart().Get()) return 1; + return -1; } public bool IsInside(FbxTime pTime) @@ -63,5 +68,7 @@ public bool IsInside(FbxTime pTime) //public bool operator!=(FbxTimeSpan &pTime) //public bool operator==(FbxTimeSpan &pTime) //public void UnionAssignment(FbxTimeSpan &pSpan, int pDirection=FBXSDK_TIME_FORWARD) + + #endregion } } diff --git a/FbxSharp/IConverter.cs b/FbxSharp/IConverter.cs index 8c0a3ae..62e2508 100644 --- a/FbxSharp/IConverter.cs +++ b/FbxSharp/IConverter.cs @@ -6,7 +6,8 @@ namespace FbxSharp { public interface IConverter { - FbxScene ConvertScene(List parsedObjects); + FbxScene ConvertScene(List parsedObjects, + FbxScene scene = null); } } diff --git a/FbxSharp/InputLocation.cs b/FbxSharp/InputLocation.cs index fae633c..c809a41 100644 --- a/FbxSharp/InputLocation.cs +++ b/FbxSharp/InputLocation.cs @@ -9,18 +9,19 @@ public InputLocation(int line, int column, int index, string filename) Line = line; Column = column; Index = index; - Filename = filename; + Filename = filename; } public readonly int Line; public readonly int Column; public readonly int Index; - public readonly string Filename; + public readonly string Filename; public override string ToString() { + if (Index > 0) + return string.Format("{0}[{1} 0x{1:x}]", Filename, Index); return string.Format("{0}:{1},{2}", Filename, Line, Column); } } } - diff --git a/FbxSharp/NotSdkAttribute.cs b/FbxSharp/NotSdkAttribute.cs new file mode 100644 index 0000000..505bd10 --- /dev/null +++ b/FbxSharp/NotSdkAttribute.cs @@ -0,0 +1,22 @@ +using System; + +namespace FbxSharp; + +/// +/// An attribute that indicates that a certain class, struct, method, or +/// property is not found in the FBX SDK, and is included for convenience. +/// +[AttributeUsage( + AttributeTargets.Class | + AttributeTargets.Constructor | + AttributeTargets.Delegate | + AttributeTargets.Enum | + AttributeTargets.Event | // Note: There are no events in C++ + AttributeTargets.Field | + AttributeTargets.GenericParameter | + AttributeTargets.Interface | + AttributeTargets.Method | + AttributeTargets.Parameter | + AttributeTargets.Property | + AttributeTargets.Struct)] +public class NotSdkAttribute : Attribute; diff --git a/FbxSharp/Number.cs b/FbxSharp/Number.cs index 0aa7eb1..c04cd9b 100644 --- a/FbxSharp/Number.cs +++ b/FbxSharp/Number.cs @@ -3,7 +3,7 @@ namespace FbxSharp { - public struct Number + public readonly struct Number : IEquatable { public Number(string str) { @@ -29,6 +29,20 @@ public Number(string str) } } + public Number(long value) + { + StringRepresentation = value.ToString(); + AsDouble = (double)value; + AsLong = value; + } + + public Number(double value) + { + StringRepresentation = value.ToString(); + AsDouble = value; + AsLong = (long)value; + } + public readonly string StringRepresentation; public readonly double? AsDouble; public readonly long? AsLong; @@ -44,6 +58,49 @@ public override string ToString() return AsDouble.Value.ToString(); } } + + public override bool Equals(object obj) + { + var n = new Number(1); + if (obj is Number number) + n = number; + return obj switch + { + Number => Equals(n), + sbyte sb => AsLong.HasValue && AsLong.Value.Equals(sb), + byte b => AsLong.HasValue && AsLong.Value.Equals(b), + short s => AsLong.HasValue && AsLong.Value.Equals(s), + ushort us => AsLong.HasValue && AsLong.Value.Equals(us), + int i => AsLong.HasValue && AsLong.Value.Equals(i), + uint ui => AsLong.HasValue && AsLong.Value.Equals(ui), + long l => AsLong.HasValue && AsLong.Value.Equals(l), + ulong ul => AsLong.HasValue && ul <= long.MaxValue && + AsLong.Value.Equals((long)ul), + float f => AsDouble.HasValue && AsDouble.Equals((double)f), + double d => AsDouble.HasValue && AsDouble.Equals(d), + string s => StringRepresentation != null && + StringRepresentation == s, + _ => false + }; + } + + public bool Equals(Number n) + { + if (AsDouble.HasValue && n.AsDouble.HasValue) + return AsDouble.Value.Equals(n.AsDouble.Value) && + StringRepresentation == n.StringRepresentation; + if (AsLong.HasValue && n.AsLong.HasValue) + return AsLong.Value.Equals(n.AsLong.Value) && + StringRepresentation == n.StringRepresentation; + if (!AsDouble.HasValue && !n.AsDouble.HasValue && + !AsLong.HasValue && !n.AsLong.HasValue) + return StringRepresentation == n.StringRepresentation; + return false; + } + + public override int GetHashCode() => + HashCode.Combine(StringRepresentation, AsLong, AsDouble); + + public static implicit operator Number(int i) => new Number(i); } } - diff --git a/FbxSharp/ObjectPrinter.cs b/FbxSharp/ObjectPrinter.cs index c6cd0ec..02aea55 100644 --- a/FbxSharp/ObjectPrinter.cs +++ b/FbxSharp/ObjectPrinter.cs @@ -9,6 +9,8 @@ public partial class ObjectPrinter { public static string quote(string s) { + if (s == null) + return "<>"; // TODO: hex escape sequences return "\"" + s.Replace("\r", "\\r").Replace("\n", "\\n").Replace("\t", "\\t") + "\""; } @@ -23,7 +25,7 @@ public static string PrintPropertyID(FbxProperty prop) string.Format("{0} . {1} : {2}", PrintObjectID(pobj), quote(prop.GetName()), - prop.PropertyDataType.FullName); + prop.GetPropertyDataType().GetFbxType()); } public static string PrintObjectID(FbxObject obj) @@ -41,14 +43,29 @@ public void _PrintFbxObject(FbxObject obj, TextWriter writer) { writer.WriteLine("${0}", PrintObjectID(obj)); // extra $ for easy text search writer.WriteLine(" Name = {0}", quote(obj.GetName())); + + writer.WriteLine(" GetNameWithoutNameSpacePrefix = {0}", quote(obj.GetNameWithoutNameSpacePrefix())); + writer.WriteLine(" GetNameWithNameSpacePrefix = {0}", quote(obj.GetNameWithNameSpacePrefix())); + writer.WriteLine(" GetInitialName = {0}", quote(obj.GetInitialName())); + writer.WriteLine(" GetNameSpaceOnly = {0}", quote(obj.GetNameSpaceOnly())); + var namespaces = obj.GetNameSpaceArray(':'); + writer.WriteLine(" GetNameSpaceArray ({0})", namespaces.Length); + int i; + for (i = 0; i < namespaces.Length; i++) + { + var ns = namespaces[i]; + writer.WriteLine(" # {0} {1}", i,quote(ns)); + } + writer.WriteLine(" GetNameOnly = {0}", quote(obj.GetNameOnly())); + writer.WriteLine(" GetNameSpacePrefix = {0}", quote(obj.GetNameSpacePrefix())); + writer.WriteLine(" ClassId = {0}", obj.GetType().Name/*obj.GetRuntimeClassId().GetName()*/); writer.WriteLine(" UniqueId = {0}", obj.GetUniqueID()); writer.WriteLine(" GetScene() = {0}", PrintObjectID(obj.GetScene())); -// writer.Write(" GetDocument() = {0}", PrintObjectID(obj.GetDocument())); -// writer.Write(" GetRootDocument() = {0}", PrintObjectID(obj.GetRootDocument())); + // writer.WriteLine(" GetDocument() = {0}", PrintObjectID(obj.GetDocument())); + // writer.WriteLine(" GetRootDocument() = {0}", PrintObjectID(obj.GetRootDocument())); writer.WriteLine(" SrcObjectCount = {0}", obj.GetSrcObjectCount()); - int i; for (i = 0; i < obj.GetSrcObjectCount(); i++) { FbxObject srcObj = obj.GetSrcObject(i); @@ -125,6 +142,11 @@ public void PrintObjectGraph(FbxObject obj, TextWriter writer) writer.WriteLine(); + writer.WriteLine("================"); + writer.WriteLine("FbxTime.GetGlobalTimeMode(): {0}", FbxTime.GetGlobalTimeMode()); + writer.WriteLine("FbxTime.GetGlobalTimeProtocol(): {0}", FbxTime.GetGlobalTimeProtocol()); + writer.WriteLine("================"); + objs.Sort(sort_by_id); foreach (var o in objs) @@ -178,10 +200,10 @@ public void PrintProperty(FbxProperty prop, TextWriter writer, bool indent=false string prefix = indent ? " " : " "; writer.WriteLine("{0}Name = {1}", prefix, prop.GetName()); - var type = prop.GetPropertyDataType(); - writer.WriteLine("{0}Type = {1}", prefix, type.GetName()); -// writer.WriteLine("{0}HierName = {1}", prefix, prop.GetHierarchicalName()); -// writer.WriteLine("{0}Label = {1}", prefix, prop.GetLabel()); + var type = prop.GetPropertyDataType().GetFbxType(); + writer.WriteLine("{0}Type = {1}", prefix, type); + writer.WriteLine("{0}HierName = {1}", prefix, prop.GetHierarchicalName()); + writer.WriteLine("{0}Label = {1}", prefix, prop.GetLabel()); // char n[1024]; int i; @@ -209,144 +231,100 @@ public void PrintProperty(FbxProperty prop, TextWriter writer, bool indent=false bool printValue = true; -// switch (type.GetType()) -// { -// case eFbxUndefined: -// printValue = false; -// break; -// case eFbxChar: - if (type == typeof(sbyte)) - { - ch = prop.Get(); - sb.AppendFormat("%i ('%c')", (int)ch, ch); - } -// break; -// case eFbxUChar: - if (type == typeof(byte)) - { - uch = prop.Get(); - sb.AppendFormat("%i ('%c')", (uint)uch, uch); - } -// break; -// case eFbxShort: - if (type == typeof(short)) - { - sh = prop.Get(); - sb.AppendFormat("%i", (int)sh); - } -// break; -// case eFbxUShort: - if (type == typeof(ushort)) - { - ush = prop.Get(); - sb.AppendFormat("%ui", (uint)ush); - } -// break; -// case eFbxUInt: - if (type == typeof(uint)) - { - ui = prop.Get(); - sb.AppendFormat("%ui", ui); - } -// break; -// case eFbxLongLong: - if (type == typeof(long)) - { - ll = prop.Get(); - sb.AppendFormat("%lli", ll); - } -// break; -// case eFbxULongLong: - if (type == typeof(ulong)) - { - ull = prop.Get(); - sb.AppendFormat("%llu", ull); - } -// break; -// case eFbxHalfFloat: -// printValue = false; -// break; -// case eFbxBool: - if (type == typeof(bool)) - { - b = prop.Get(); - if (b) - sb.AppendFormat("true"); - else - sb.AppendFormat("false"); - } -// break; -// case eFbxInt: - if (type == typeof(int)) - { - i = prop.Get(); - sb.AppendFormat("%i", i); - } -// break; -// case eFbxFloat: - if (type == typeof(float)) - { - f = prop.Get(); - sb.AppendFormat("%f", f); - } -// break; -// case eFbxDouble: - if (type == typeof(double)) - { - d = prop.Get(); - sb.AppendFormat("{0}", d); - } -// break; -// case eFbxDouble2: - if (type == typeof(FbxVector2)) - { - v2 = prop.Get(); - sb.AppendFormat("{0}, {1}", v2.X, v2.Y); - } -// break; -// case eFbxDouble3: - if (type == typeof(FbxVector3)) - { - v3 = prop.Get(); - sb.AppendFormat("{0}, {1}, {2}", v3.X, v3.Y, v3.Z); - } -// break; -// case eFbxDouble4: - if (type == typeof(FbxVector4)) - { - v4 = prop.Get(); - sb.AppendFormat("{0}, {1}, {2}, {3}", v4.X, v4.Y, v4.Z, v4.W); - } -// break; -// case eFbxDouble4x4: -// case eFbxEnum: -// printValue = false; -// break; -// case eFbxString: - if (type == typeof(string)) - { - fstr = prop.Get(); - sb.Append(quote(fstr)); - } -// break; -// case eFbxTime: - if (type == typeof(FbxTime)) - { - t = prop.Get(); - sb.AppendFormat("{0}", t); - } -// break; -// case eFbxReference: + switch (type) + { + case EFbxType.eFbxUndefined: + printValue = false; + break; + case EFbxType.eFbxChar: + ch = ((FbxPropertyT)prop).Get(); + sb.AppendFormat("%i ('%c')", (int)ch, ch); + break; + case EFbxType.eFbxUChar: + uch = prop.Get(); + sb.AppendFormat("%i ('%c')", (uint)uch, uch); + break; + case EFbxType.eFbxShort: + sh = prop.Get(); + sb.AppendFormat("%i", (int)sh); + break; + case EFbxType.eFbxUShort: + ush = prop.Get(); + sb.AppendFormat("%ui", (uint)ush); + break; + case EFbxType.eFbxUInt: + ui = prop.Get(); + sb.AppendFormat("%ui", ui); + break; + case EFbxType.eFbxLongLong: + ll = prop.Get(); + sb.AppendFormat("%lli", ll); + break; + case EFbxType.eFbxULongLong: + ull = prop.Get(); + sb.AppendFormat("%llu", ull); + break; + case EFbxType.eFbxHalfFloat: + printValue = false; + break; + case EFbxType.eFbxBool: + b = prop.Get(); + if (b) + sb.AppendFormat("true"); + else + sb.AppendFormat("false"); + break; + case EFbxType.eFbxInt: + i = prop.Get(); + sb.AppendFormat("%i", i); + break; + case EFbxType.eFbxFloat: + f = prop.Get(); + sb.AppendFormat("%f", f); + break; + case EFbxType.eFbxDouble: + d = prop.Get(); + sb.AppendFormat("{0}", d); + break; + case EFbxType.eFbxDouble2: + v2 = prop.Get(); + sb.AppendFormat("{0}, {1}", v2.X, v2.Y); + break; + case EFbxType.eFbxDouble3: + v3 = prop.Get(); + sb.AppendFormat("{0}, {1}, {2}", v3.X, v3.Y, v3.Z); + break; + case EFbxType.eFbxDouble4: + v4 = prop.Get(); + sb.AppendFormat("{0}, {1}, {2}, {3}", v4.X, v4.Y, v4.Z, + v4.W); + break; + case EFbxType.eFbxDouble4x4: + printValue = false; + break; + case EFbxType.eFbxEnum: + sb.AppendFormat("{0}", prop.GetValue()); + break; + case EFbxType.eFbxString: + fstr = prop.Get(); + sb.Append(quote(fstr)); + break; + case EFbxType.eFbxTime: + t = prop.Get(); + sb.AppendFormat("{0}", t); + break; + case EFbxType.eFbxReference: // FbxObject* obj; // obj = prop.Get(); // cout << prefix << ".Value = " << obj.GetRuntimeClassId().GetName() << ", uid=" << obj.GetUniqueID() << endl; // break; -// case eFbxBlob: -// case eFbxDistance: -// case eFbxDateTime: -// case eFbxTypeCount: -// printValue = false; -// break; + case EFbxType.eFbxBlob: + case EFbxType.eFbxDistance: + case EFbxType.eFbxDateTime: + case EFbxType.eFbxTypeCount: + printValue = false; + break; + } if (printValue) { @@ -366,22 +344,22 @@ public void PrintProperty(FbxProperty prop, TextWriter writer, bool indent=false FbxObject dstObj = prop.GetDstObject(i); writer.WriteLine("{0} #{1} {2}", prefix , i, PrintObjectID(dstObj)); } -// writer.WriteLine("{0}{1}{2}", prefix , "SrcPropertyCount = " , prop.GetSrcPropertyCount() ); -// for (i = 0; i < prop.GetSrcPropertyCount(); i++) -// { -// Property prop2 = prop.GetSrcProperty(i); -// writer.Write("{0}{1}{2}", prefix , " #" , i , " "); -// PrintPropertyID(prop2); -// writer.WriteLine(); -// } -// writer.WriteLine("{0}{1}{2}", prefix , "DstPropertyCount = " , prop.GetDstPropertyCount() ); -// for (i = 0; i < prop.GetDstPropertyCount(); i++) -// { -// Property prop2 = prop.GetDstProperty(i); -// writer.Write("{0}{1}{2}", prefix , " #" , i , " "); -// PrintPropertyID(prop2); -// writer.WriteLine(); -// } + // writer.WriteLine("{0}{1}{2}", prefix , "SrcPropertyCount = " , prop.GetSrcPropertyCount() ); + // for (i = 0; i < prop.GetSrcPropertyCount(); i++) + // { + // FbxProperty prop2 = prop.GetSrcProperty(i); + // writer.Write("{0}{1}{2}", prefix , " #" , i , " "); + // PrintPropertyID(prop2); + // writer.WriteLine(); + // } + // writer.WriteLine("{0}{1}{2}", prefix , "DstPropertyCount = " , prop.GetDstPropertyCount() ); + // for (i = 0; i < prop.GetDstPropertyCount(); i++) + // { + // FbxProperty prop2 = prop.GetDstProperty(i); + // writer.Write("{0}{1}{2}", prefix , " #" , i , " "); + // PrintPropertyID(prop2); + // writer.WriteLine(); + // } } @@ -688,7 +666,6 @@ protected void _PrintFbxLight(FbxLight obj, TextWriter writer) protected void _PrintFbxNull(FbxNull obj, TextWriter writer) { - throw new NotImplementedException(); } protected void _PrintFbxSkeleton(FbxSkeleton obj, TextWriter writer) diff --git a/FbxSharp/ParseObject.cs b/FbxSharp/ParseObject.cs index 18b293a..6285364 100644 --- a/FbxSharp/ParseObject.cs +++ b/FbxSharp/ParseObject.cs @@ -4,6 +4,7 @@ namespace FbxSharp { + [NotSdk] public class ParseObject { public string Name; @@ -12,6 +13,8 @@ public class ParseObject public bool HasEmptyBlock = true; public InputLocation Location; + public BinaryParseInfo Extra = null; + public override string ToString() { var sb = new StringBuilder(); @@ -32,13 +35,15 @@ public override string ToString() sb.AppendFormat("{0} values", Values.Count); } } - if (Properties != null || HasEmptyBlock) + + if ((Properties != null && Properties.Count > 0) || HasEmptyBlock) { sb.Append(" { "); if (!HasEmptyBlock && Properties.Count > 0) { sb.AppendFormat("{0} properties", Properties.Count); } + sb.Append(" }"); } @@ -51,6 +56,52 @@ public ParseObject FindPropertyByName(string name) // no such property was found. return this.Properties.Find(p => p.Name == name); } + + public string GetStringValue(int index = 0) + { + // TODO: various checks + return (string)Values[index]; + } + + public int GetIntValue(int index = 0) + { + // TODO: various checks + var value = Values[index]; + switch (value) + { + case int i: + return i; + case Number n: + { + if (n.AsLong != null) + return (int)n.AsLong.Value; + throw new NotImplementedException(); + } + default: + { + var s = value.ToString(); + if (!int.TryParse(s, out var x)) + throw new ArgumentException( + $"Could not parse " + + $"value \"{s}\" as int"); + return x; + } + } + + throw new NotImplementedException(); + } + + public class BinaryParseInfo + { + public int nextItemOffset = 0; + public uint reserved0 = 0; + public uint numValues = 0; + public uint reserved2 = 0; + public uint numValuesBytes = 0; + public uint reserved4 = 0; + public byte namelen = 0; + public readonly List valuesTypes = []; + public readonly List valuesLengths = []; + } } } - diff --git a/FbxSharp/Tokenizer.cs b/FbxSharp/Tokenizer.cs index 567bcfd..0893986 100644 --- a/FbxSharp/Tokenizer.cs +++ b/FbxSharp/Tokenizer.cs @@ -28,10 +28,10 @@ public Tokenizer(TextReader input, bool ignoreWhitespace=true, string filename=" int index = 0; int line = 1; int column = 0; - public InputLocation CurrentLocation - { - get { return new InputLocation(index, line, column, Filename); } - } + public InputLocation CurrentLocation + { + get { return new InputLocation(index, line, column, Filename); } + } TokenType currentTokenType = TokenType.None; readonly StringBuilder newTokenChars = new StringBuilder(); InputLocation tokenLocation; diff --git a/FbxSharpTests/AnimCurveNodeTest.cs b/FbxSharpTests/AnimCurveNodeTest.cs index 1d44b4a..710af22 100644 --- a/FbxSharpTests/AnimCurveNodeTest.cs +++ b/FbxSharpTests/AnimCurveNodeTest.cs @@ -16,7 +16,7 @@ public void AnimCurveNodeTest_Create_NoChannels() var acn = new FbxAnimCurveNode(""); // then: - Assert.AreEqual(0, acn.GetChannelsCount()); + Assert.AreEqual(0, (int)acn.GetChannelsCount()); Assert.AreEqual(1, CountProperties(acn)); } @@ -27,7 +27,7 @@ public void AnimCurveNodeTest_AddChannel_TwoPropertiesOneChannel() var acn = new FbxAnimCurveNode(""); // require: - Assert.AreEqual(0, acn.GetChannelsCount()); + Assert.AreEqual(0, (int)acn.GetChannelsCount()); Assert.AreEqual(1, CountProperties(acn)); // when: @@ -35,7 +35,7 @@ public void AnimCurveNodeTest_AddChannel_TwoPropertiesOneChannel() // then: Assert.AreEqual(2, CountProperties(acn)); - Assert.AreEqual(1, acn.GetChannelsCount()); + Assert.AreEqual(1, (int)acn.GetChannelsCount()); Assert.AreEqual(0, acn.GetCurveCount(0)); var prop = acn.GetFirstProperty(); @@ -55,7 +55,7 @@ public void AnimCurveNodeTest_ConnectToChannel_AddsSrcConnection() // require: Assert.AreEqual(2, CountProperties(acn)); - Assert.AreEqual(1, acn.GetChannelsCount()); + Assert.AreEqual(1, (int)acn.GetChannelsCount()); Assert.AreEqual(0, acn.GetCurveCount(0)); // when: @@ -63,7 +63,7 @@ public void AnimCurveNodeTest_ConnectToChannel_AddsSrcConnection() // then: Assert.AreEqual(2, CountProperties(acn)); - Assert.AreEqual(1, acn.GetChannelsCount()); + Assert.AreEqual(1, (int)acn.GetChannelsCount()); Assert.AreEqual(1, acn.GetCurveCount(0)); Assert.AreEqual(1, ac.GetDstPropertyCount()); Assert.AreEqual("channel1", ac.GetDstProperty(0).GetName()); diff --git a/FbxSharpTests/AnimCurveTest.cs b/FbxSharpTests/AnimCurveTest.cs index ff1a9d5..505b114 100644 --- a/FbxSharpTests/AnimCurveTest.cs +++ b/FbxSharpTests/AnimCurveTest.cs @@ -500,5 +500,74 @@ public void FbxAnimCurve_Create_HasNamespacePrefix() // then: Assert.AreEqual("AnimCurve::", obj.GetNameSpacePrefix()); } + + [Test] + public void FbxAnimCurve_KeyGet() + { + // given: + var ac = new FbxAnimCurve("asdf"); + + // expect: + Assert.AreEqual(0, ac.KeyGetCount()); + + // when: + FbxTime time; + time = new FbxTime(100); + var key = new FbxAnimCurveKey(time, 1.5f); + int i; + i = ac.KeyAdd(time, key); + Assert.AreEqual(0, i); + + // then: + Assert.AreEqual(1, ac.KeyGetCount()); + FbxAnimCurveKey key2; + key2 = ac.KeyGet(0); + Assert.AreEqual(100L, key2.GetTime().Get()); + Assert.AreEqual(1.5f, key.GetValue()); + } + + [Test] + public void FbxAnimCurve_KeyGet_KeysAreSortedByTimeValue() + { + // given: + var ac = new FbxAnimCurve("asdf"); + FbxTime time; + time = new FbxTime(0); + var key1 = new FbxAnimCurveKey(time, 0.5f); + int i; + i = ac.KeyAdd(time, key1); + Assert.AreEqual(0, i); + time = new FbxTime(2000); + var key2 = new FbxAnimCurveKey(time, 2.5f); + i = ac.KeyAdd(time, key2); + Assert.AreEqual(1, i); + + // expect: + Assert.AreEqual(2, ac.KeyGetCount()); + var key = ac.KeyGet(0); + Assert.AreEqual(0L, key.GetTime().Get()); + Assert.AreEqual(0.5f, key.GetValue()); + key = ac.KeyGet(1); + Assert.AreEqual(2000L, key.GetTime().Get()); + Assert.AreEqual(2.5f, key.GetValue()); + + // when: + time = new FbxTime(1000); + var key3 = new FbxAnimCurveKey(time, 1.5f); + i = ac.KeyAdd(time, key3); + Assert.AreEqual(1, i); + + // then: + Assert.AreEqual(3, ac.KeyGetCount()); + key = ac.KeyGet(0); + Assert.AreEqual(0L, key.GetTime().Get()); + Assert.AreEqual(0.5f, key.GetValue()); + key = ac.KeyGet(1); + Assert.AreEqual(1000L, key.GetTime().Get()); + Assert.AreEqual(1.5f, key.GetValue()); + key = ac.KeyGet(2); + Assert.AreEqual(2000L, key.GetTime().Get()); + Assert.AreEqual(2.5f, key.GetValue()); + } } } diff --git a/FbxSharpTests/BinaryParser7400Test.cs b/FbxSharpTests/BinaryParser7400Test.cs new file mode 100644 index 0000000..75988c8 --- /dev/null +++ b/FbxSharpTests/BinaryParser7400Test.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.IO; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests; + +[TestFixture] +public class BinaryParser7400Test : TestBase +{ + [Test] + public void TestReadObject() + { + // given + var filename = GetSample("empty_7b_FBX201400.fbx"); + using var fs = File.Open(filename, FileMode.Open); + fs.Seek(27, SeekOrigin.Begin); + var parser = new BinaryParser7400(fs, filename); + var pos = new List(); + + // when + var po = parser.ReadObject(); + // then + Assert.That(po, Is.Not.Null); + Assert.That(po.Name, Is.EqualTo("FBXHeaderExtension")); + Assert.That(po.Values, Is.Empty); + Assert.That(po.Properties.Count, Is.EqualTo(6)); + Assert.That(po.Properties[0].Name, Is.EqualTo("FBXHeaderVersion")); + Assert.That(po.Properties[0].Values[0].Equals(1003)); + Assert.That(po.Properties[1].Name, Is.EqualTo("FBXVersion")); + Assert.That(po.Properties[1].Values[0].Equals(7400)); + Assert.That(po.Properties[2].Name, Is.EqualTo("EncryptionType")); + Assert.That(po.Properties[2].Values[0].Equals(0)); + Assert.That(po.Properties[3].Name, Is.EqualTo("CreationTimeStamp")); + Assert.That(po.Properties[3].Values, Is.Empty); + Assert.That(po.Properties[4].Name, Is.EqualTo("Creator")); + Assert.That(po.Properties[4].Values[0], Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(po.Properties[5].Name, Is.EqualTo("SceneInfo")); + Assert.That(po.Properties[5].Values[0], Is.EqualTo("SceneInfo::GlobalInfo")); + Assert.That(po.Properties[5].Values[1], Is.EqualTo("UserData")); + } + + [Test] + public void Test_Read7300FileWith7400Parser() + { + // given + var filename = GetSample("empty_7b_FBX201300.fbx"); + using var fs = File.Open(filename, FileMode.Open); + fs.Seek(27, SeekOrigin.Begin); + var parser = new BinaryParser7400(fs, filename); + + // when + var pos = parser.ReadFile(); + // then + Assert.That(pos.Count, Is.EqualTo(11)); + } +} diff --git a/FbxSharpTests/BinaryParser7700Test.cs b/FbxSharpTests/BinaryParser7700Test.cs new file mode 100644 index 0000000..c70123f --- /dev/null +++ b/FbxSharpTests/BinaryParser7700Test.cs @@ -0,0 +1,59 @@ +using System.Collections.Generic; +using System.IO; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests; + +[TestFixture] +public class BinaryParser7700Test : TestBase +{ + [Test] + public void TestReadObject() + { + // given + var filename = GetSample("empty_7b.fbx"); + using var fs = File.Open(filename, FileMode.Open); + fs.Seek(27, SeekOrigin.Begin); + var parser = new BinaryParser7700(fs, filename); + var pos = new List(); + + // when + var po = parser.ReadObject(); + // then + Assert.That(po, Is.Not.Null); + Assert.That(po.Name, Is.EqualTo("FBXHeaderExtension")); + Assert.That(po.Values, Is.Empty); + Assert.That(po.Properties.Count, Is.EqualTo(7)); + Assert.That(po.Properties[0].Name, Is.EqualTo("FBXHeaderVersion")); + Assert.That(po.Properties[0].Values[0].Equals(1004)); + Assert.That(po.Properties[1].Name, Is.EqualTo("FBXVersion")); + Assert.That(po.Properties[1].Values[0].Equals(7700)); + Assert.That(po.Properties[2].Name, Is.EqualTo("EncryptionType")); + Assert.That(po.Properties[2].Values[0].Equals(0)); + Assert.That(po.Properties[3].Name, Is.EqualTo("CreationTimeStamp")); + Assert.That(po.Properties[3].Values, Is.Empty); + Assert.That(po.Properties[4].Name, Is.EqualTo("Creator")); + Assert.That(po.Properties[4].Values[0], Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(po.Properties[5].Name, Is.EqualTo("OtherFlags")); + Assert.That(po.Properties[5].Values, Is.Empty); + Assert.That(po.Properties[6].Name, Is.EqualTo("SceneInfo")); + Assert.That(po.Properties[6].Values[0], Is.EqualTo("SceneInfo::GlobalInfo")); + Assert.That(po.Properties[6].Values[1], Is.EqualTo("UserData")); + } + + [Test] + public void Test_Read7500FileWith7700Parser() + { + // given + var filename = GetSample("empty_7b_FBX201800.fbx"); + using var fs = File.Open(filename, FileMode.Open); + fs.Seek(27, SeekOrigin.Begin); + var parser = new BinaryParser7700(fs, filename); + + // when + var pos = parser.ReadFile(); + // then + Assert.That(pos.Count, Is.EqualTo(11)); + } +} diff --git a/FbxSharpTests/BinaryParserTest.cs b/FbxSharpTests/BinaryParserTest.cs new file mode 100644 index 0000000..f7d6652 --- /dev/null +++ b/FbxSharpTests/BinaryParserTest.cs @@ -0,0 +1,76 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests; + +[TestFixture] +public class BinaryParserTest : TestBase +{ + [Test] + public void FromFileVersion_7700_CreatesParser() + { + // when + var bp = BinaryParser.FromFileVersion(7700, null, "filename"); + + // then + Assert.That(bp, Is.Not.Null); + Assert.That(bp, Is.InstanceOf()); + } + + [Test] + public void FromFileVersion_7500_Creates7700Parser() + { + // when + var bp = BinaryParser.FromFileVersion(7500, null, "filename"); + + // then + Assert.That(bp, Is.Not.Null); + Assert.That(bp, Is.InstanceOf()); + } + + [Test] + public void FromFileVersion_7400_CreatesParser() + { + // when + var bp = BinaryParser.FromFileVersion(7400, null, "filename"); + + // then + Assert.That(bp, Is.Not.Null); + Assert.That(bp, Is.InstanceOf()); + } + + [Test] + public void FromFileVersion_7300_Creates7400Parser() + { + // when + var bp = BinaryParser.FromFileVersion(7300, null, "filename"); + + // then + Assert.That(bp, Is.Not.Null); + Assert.That(bp, Is.InstanceOf()); + } + + [Test] + [TestCase(7701)] + [TestCase(7699)] + [TestCase(7600)] + [TestCase(7200)] + [TestCase(7100)] + [TestCase(7000)] + [TestCase(6100)] + [TestCase(6000)] + public void FromFileVersion_UnsupportedVersion_Throws(int version) + { + // expect + var ex = Assert.Throws( + () => BinaryParser.FromFileVersion( + version, null, "filename")); + + // and + Assert.That(ex.Message, + Is.EqualTo( + $"Unrecognized file version: {version} " + + $"(Parameter 'fileVersion')")); + } +} diff --git a/FbxSharpTests/DeformerTest.cs b/FbxSharpTests/DeformerTest.cs index 300533d..d00a797 100644 --- a/FbxSharpTests/DeformerTest.cs +++ b/FbxSharpTests/DeformerTest.cs @@ -7,5 +7,14 @@ namespace FbxSharpTests [TestFixture] public class DeformerTest : TestBase { + [Test] + public void Deformer_Create_HasNamespacePrefix() + { + // given: + var obj = new FbxSkin("asdf"); + + // then: + Assert.AreEqual("Deformer::", obj.GetNameSpacePrefix());; + } } } diff --git a/FbxSharpTests/EFbxTypeTest.cs b/FbxSharpTests/EFbxTypeTest.cs new file mode 100644 index 0000000..fb10b79 --- /dev/null +++ b/FbxSharpTests/EFbxTypeTest.cs @@ -0,0 +1,42 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class EFbxTypeTest : TestBase + { + [Test] + public void EFbxType_IdentifiersHaveSpecificValues() + { + // expect: + Assert.That((int)EFbxType.eFbxUndefined, Is.EqualTo(0)); + Assert.That((int)EFbxType.eFbxChar, Is.EqualTo(1)); + Assert.That((int)EFbxType.eFbxUChar, Is.EqualTo(2)); + Assert.That((int)EFbxType.eFbxShort, Is.EqualTo(3)); + Assert.That((int)EFbxType.eFbxUShort, Is.EqualTo(4)); + Assert.That((int)EFbxType.eFbxUInt, Is.EqualTo(5)); + Assert.That((int)EFbxType.eFbxLongLong, Is.EqualTo(6)); + Assert.That((int)EFbxType.eFbxULongLong, Is.EqualTo(7)); + Assert.That((int)EFbxType.eFbxHalfFloat, Is.EqualTo(8)); + Assert.That((int)EFbxType.eFbxBool, Is.EqualTo(9)); + Assert.That((int)EFbxType.eFbxInt, Is.EqualTo(10)); + Assert.That((int)EFbxType.eFbxFloat, Is.EqualTo(11)); + Assert.That((int)EFbxType.eFbxDouble, Is.EqualTo(12)); + Assert.That((int)EFbxType.eFbxDouble2, Is.EqualTo(13)); + Assert.That((int)EFbxType.eFbxDouble3, Is.EqualTo(14)); + Assert.That((int)EFbxType.eFbxDouble4, Is.EqualTo(15)); + Assert.That((int)EFbxType.eFbxDouble4x4, Is.EqualTo(16)); + Assert.That((int)EFbxType.eFbxEnum, Is.EqualTo(17)); + Assert.That((int)EFbxType.eFbxEnumM, Is.EqualTo(-17)); + Assert.That((int)EFbxType.eFbxString, Is.EqualTo(18)); + Assert.That((int)EFbxType.eFbxTime, Is.EqualTo(19)); + Assert.That((int)EFbxType.eFbxReference, Is.EqualTo(20)); + Assert.That((int)EFbxType.eFbxBlob, Is.EqualTo(21)); + Assert.That((int)EFbxType.eFbxDistance, Is.EqualTo(22)); + Assert.That((int)EFbxType.eFbxDateTime, Is.EqualTo(23)); + Assert.That((int)EFbxType.eFbxTypeCount, Is.EqualTo(24)); + } + } +} diff --git a/FbxSharpTests/FbxAxisSystemTest.cs b/FbxSharpTests/FbxAxisSystemTest.cs new file mode 100644 index 0000000..2a64414 --- /dev/null +++ b/FbxSharpTests/FbxAxisSystemTest.cs @@ -0,0 +1,28 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxAxisSystemTest : TestBase + { + [Test] + public void FbxAxisSystem_Create_HasDefaults() + { + // given: + FbxAxisSystem obj; + + // when: + obj = new FbxAxisSystem(); + + // then: + var sign = 0; + Assert.That(obj.GetFrontVector(ref sign), Is.EqualTo(FbxAxisSystem.EFrontVector.eParityOdd)); + Assert.That(sign, Is.EqualTo(1)); + Assert.That(obj.GetUpVector(ref sign), Is.EqualTo(FbxAxisSystem.EUpVector.eYAxis)); + Assert.That(sign, Is.EqualTo(1)); + Assert.That(obj.GetCoorSystem(), Is.EqualTo(FbxAxisSystem.ECoordSystem.eRightHanded)); + } + } +} diff --git a/FbxSharpTests/FbxDataTypeTest.cs b/FbxSharpTests/FbxDataTypeTest.cs new file mode 100644 index 0000000..9c45c56 --- /dev/null +++ b/FbxSharpTests/FbxDataTypeTest.cs @@ -0,0 +1,81 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxDataTypeTest : TestBase + { + [Test] + public void FbxDataType_DefaultConstructor_AttributesSet() + { + // when: + var dt = FbxDataType.Create("int", EFbxType.eFbxInt); + // then: + Assert.True(dt.Valid()); + Assert.That(dt.GetName(), Is.EqualTo("int")); + Assert.That(dt.GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + } + + [Test] + public void FbxDataType_OperatorEquals_MatchesSelfButNotIdenticalObjects() + { + // when: + var dt1 = FbxDataType.Create("int", EFbxType.eFbxInt); + var dt2 = FbxDataType.Create("int", EFbxType.eFbxInt); + + // then: + Assert.True(dt1.Valid()); + Assert.True(dt2.Valid()); + Assert.That(dt2.GetName(), Is.EqualTo(dt1.GetName())); + Assert.That(dt2.GetFbxType(), Is.EqualTo(dt1.GetFbxType())); + Assert.That(dt1, Is.EqualTo(dt1)); + Assert.That(dt1, Is.EqualTo(dt1)); + Assert.True(dt1 == dt1); + Assert.True(dt2 == dt2); + Assert.False(dt1 != dt1); + Assert.False(dt2 != dt2); + Assert.That(dt1, Is.Not.EqualTo(FbxDataTypes.FbxIntDT)); + Assert.That(dt2, Is.Not.EqualTo(FbxDataTypes.FbxIntDT)); + Assert.False(FbxDataTypes.FbxIntDT == dt1); + Assert.False(FbxDataTypes.FbxIntDT == dt2); + Assert.True(FbxDataTypes.FbxIntDT != dt1); + Assert.True(FbxDataTypes.FbxIntDT != dt2); + Assert.That(dt2, Is.Not.EqualTo(dt1)); + Assert.False(dt1 == dt2); + Assert.True(dt1 != dt2); + } + + [Test] + public void FbxDataType_FbxGetDataTypeFromEnum_YieldsCorrectDataType() + { + // expect: + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxUndefined), Is.EqualTo(FbxDataTypes.FbxUndefinedDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxChar), Is.EqualTo(FbxDataTypes.FbxCharDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxUChar), Is.EqualTo(FbxDataTypes.FbxUCharDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxShort), Is.EqualTo(FbxDataTypes.FbxShortDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxUShort), Is.EqualTo(FbxDataTypes.FbxUShortDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxUInt), Is.EqualTo(FbxDataTypes.FbxUIntDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxLongLong), Is.EqualTo(FbxDataTypes.FbxLongLongDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxULongLong), Is.EqualTo(FbxDataTypes.FbxULongLongDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxHalfFloat), Is.EqualTo(FbxDataTypes.FbxHalfFloatDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxBool), Is.EqualTo(FbxDataTypes.FbxBoolDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxInt), Is.EqualTo(FbxDataTypes.FbxIntDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxFloat), Is.EqualTo(FbxDataTypes.FbxFloatDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDouble), Is.EqualTo(FbxDataTypes.FbxDoubleDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDouble2), Is.EqualTo(FbxDataTypes.FbxDouble2DT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDouble3), Is.EqualTo(FbxDataTypes.FbxDouble3DT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDouble4), Is.EqualTo(FbxDataTypes.FbxDouble4DT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDouble4x4), Is.EqualTo(FbxDataTypes.FbxDouble4x4DT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxEnum), Is.EqualTo(FbxDataTypes.FbxEnumDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxEnumM), Is.EqualTo(FbxDataTypes.FbxEnumDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxString), Is.EqualTo(FbxDataTypes.FbxStringDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxTime), Is.EqualTo(FbxDataTypes.FbxTimeDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxReference), Is.EqualTo(FbxDataTypes.FbxReferenceDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxBlob), Is.EqualTo(FbxDataTypes.FbxBlobDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDistance), Is.EqualTo(FbxDataTypes.FbxDistanceDT)); + Assert.That(FbxDataType.FbxGetDataTypeFromEnum(EFbxType.eFbxDateTime), Is.EqualTo(FbxDataTypes.FbxDateTimeDT)); + } + } +} diff --git a/FbxSharpTests/FbxDataTypesTest.cs b/FbxSharpTests/FbxDataTypesTest.cs new file mode 100644 index 0000000..d0325db --- /dev/null +++ b/FbxSharpTests/FbxDataTypesTest.cs @@ -0,0 +1,1027 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxDataTypesTest : TestBase + { + [Test] + public void FbxDataTypes_FbxUndefinedDT_HasDefaultsAndIsNotValid() + { + // expect: + Assert.False(FbxDataTypes.FbxUndefinedDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUndefined, FbxDataTypes.FbxUndefinedDT.GetFbxType()); + Assert.AreEqual("", FbxDataTypes.FbxUndefinedDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxBoolDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxBoolDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBool, FbxDataTypes.FbxBoolDT.GetFbxType()); + Assert.AreEqual("Bool", FbxDataTypes.FbxBoolDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxCharDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxCharDT.Valid()); + Assert.AreEqual(EFbxType.eFbxChar, FbxDataTypes.FbxCharDT.GetFbxType()); + Assert.AreEqual("Byte", FbxDataTypes.FbxCharDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxUCharDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxUCharDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUChar, FbxDataTypes.FbxUCharDT.GetFbxType()); + Assert.AreEqual("UByte", FbxDataTypes.FbxUCharDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxShortDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxShortDT.Valid()); + Assert.AreEqual(EFbxType.eFbxShort, FbxDataTypes.FbxShortDT.GetFbxType()); + Assert.AreEqual("Short", FbxDataTypes.FbxShortDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxUShortDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxUShortDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUShort, FbxDataTypes.FbxUShortDT.GetFbxType()); + Assert.AreEqual("UShort", FbxDataTypes.FbxUShortDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxIntDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxIntDT.Valid()); + Assert.AreEqual(EFbxType.eFbxInt, FbxDataTypes.FbxIntDT.GetFbxType()); + Assert.AreEqual("Integer", FbxDataTypes.FbxIntDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxUIntDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxUIntDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUInt, FbxDataTypes.FbxUIntDT.GetFbxType()); + Assert.AreEqual("UInteger", FbxDataTypes.FbxUIntDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLongLongDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLongLongDT.Valid()); + Assert.AreEqual(EFbxType.eFbxLongLong, FbxDataTypes.FbxLongLongDT.GetFbxType()); + Assert.AreEqual("LongLong", FbxDataTypes.FbxLongLongDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxULongLongDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxULongLongDT.Valid()); + Assert.AreEqual(EFbxType.eFbxULongLong, FbxDataTypes.FbxULongLongDT.GetFbxType()); + Assert.AreEqual("ULongLong", FbxDataTypes.FbxULongLongDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxFloatDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxFloatDT.Valid()); + Assert.AreEqual(EFbxType.eFbxFloat, FbxDataTypes.FbxFloatDT.GetFbxType()); + Assert.AreEqual("Float", FbxDataTypes.FbxFloatDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxHalfFloatDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxHalfFloatDT.Valid()); + Assert.AreEqual(EFbxType.eFbxHalfFloat, FbxDataTypes.FbxHalfFloatDT.GetFbxType()); + Assert.AreEqual("HalfFloat", FbxDataTypes.FbxHalfFloatDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDoubleDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDoubleDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxDoubleDT.GetFbxType()); + Assert.AreEqual("Number", FbxDataTypes.FbxDoubleDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDouble2DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDouble2DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble2, FbxDataTypes.FbxDouble2DT.GetFbxType()); + Assert.AreEqual("Vector2", FbxDataTypes.FbxDouble2DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDouble3DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDouble3DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxDouble3DT.GetFbxType()); + Assert.AreEqual("Vector", FbxDataTypes.FbxDouble3DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDouble4DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDouble4DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxDouble4DT.GetFbxType()); + Assert.AreEqual("Vector4", FbxDataTypes.FbxDouble4DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDouble4x4DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDouble4x4DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4x4, FbxDataTypes.FbxDouble4x4DT.GetFbxType()); + Assert.AreEqual("Matrix", FbxDataTypes.FbxDouble4x4DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxEnumDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxEnumDT.Valid()); + Assert.AreEqual(EFbxType.eFbxEnum, FbxDataTypes.FbxEnumDT.GetFbxType()); + Assert.AreEqual("Enum", FbxDataTypes.FbxEnumDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxStringDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxStringDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxStringDT.GetFbxType()); + Assert.AreEqual("KString", FbxDataTypes.FbxStringDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTimeDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTimeDT.Valid()); + Assert.AreEqual(EFbxType.eFbxTime, FbxDataTypes.FbxTimeDT.GetFbxType()); + Assert.AreEqual("Time", FbxDataTypes.FbxTimeDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxReferenceDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxReferenceDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxReferenceDT.GetFbxType()); + Assert.AreEqual("Reference", FbxDataTypes.FbxReferenceDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxBlobDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxBlobDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBlob, FbxDataTypes.FbxBlobDT.GetFbxType()); + Assert.AreEqual("Blob", FbxDataTypes.FbxBlobDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDistanceDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDistanceDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDistance, FbxDataTypes.FbxDistanceDT.GetFbxType()); + Assert.AreEqual("Distance", FbxDataTypes.FbxDistanceDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxDateTimeDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxDateTimeDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDateTime, FbxDataTypes.FbxDateTimeDT.GetFbxType()); + Assert.AreEqual("DateTime", FbxDataTypes.FbxDateTimeDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxColor3DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxColor3DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxColor3DT.GetFbxType()); + Assert.AreEqual("Color", FbxDataTypes.FbxColor3DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxColor4DT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxColor4DT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxColor4DT.GetFbxType()); + Assert.AreEqual("ColorAndAlpha", FbxDataTypes.FbxColor4DT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxCompoundDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxCompoundDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUndefined, FbxDataTypes.FbxCompoundDT.GetFbxType()); + Assert.AreEqual("Compound", FbxDataTypes.FbxCompoundDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxReferenceObjectDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxReferenceObjectDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxReferenceObjectDT.GetFbxType()); + Assert.AreEqual("object", FbxDataTypes.FbxReferenceObjectDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxReferencePropertyDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxReferencePropertyDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxReferencePropertyDT.GetFbxType()); + Assert.AreEqual("ReferenceProperty", FbxDataTypes.FbxReferencePropertyDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxVisibilityDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxVisibilityDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxVisibilityDT.GetFbxType()); + Assert.AreEqual("Visibility", FbxDataTypes.FbxVisibilityDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxVisibilityInheritanceDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxVisibilityInheritanceDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBool, FbxDataTypes.FbxVisibilityInheritanceDT.GetFbxType()); + Assert.AreEqual("Visibility Inheritance", FbxDataTypes.FbxVisibilityInheritanceDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxUrlDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxUrlDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxUrlDT.GetFbxType()); + Assert.AreEqual("Url", FbxDataTypes.FbxUrlDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxXRefUrlDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxXRefUrlDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxXRefUrlDT.GetFbxType()); + Assert.AreEqual("XRefUrl", FbxDataTypes.FbxXRefUrlDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTranslationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTranslationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxTranslationDT.GetFbxType()); + Assert.AreEqual("Translation", FbxDataTypes.FbxTranslationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxRotationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxRotationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxRotationDT.GetFbxType()); + Assert.AreEqual("Rotation", FbxDataTypes.FbxRotationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxScalingDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxScalingDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxScalingDT.GetFbxType()); + Assert.AreEqual("Scaling", FbxDataTypes.FbxScalingDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxQuaternionDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxQuaternionDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxQuaternionDT.GetFbxType()); + Assert.AreEqual("Quaternion", FbxDataTypes.FbxQuaternionDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLocalTranslationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLocalTranslationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxLocalTranslationDT.GetFbxType()); + Assert.AreEqual("Lcl Translation", FbxDataTypes.FbxLocalTranslationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLocalRotationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLocalRotationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxLocalRotationDT.GetFbxType()); + Assert.AreEqual("Lcl Rotation", FbxDataTypes.FbxLocalRotationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLocalScalingDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLocalScalingDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxLocalScalingDT.GetFbxType()); + Assert.AreEqual("Lcl Scaling", FbxDataTypes.FbxLocalScalingDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLocalQuaternionDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLocalQuaternionDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxLocalQuaternionDT.GetFbxType()); + Assert.AreEqual("Lcl Quaternion", FbxDataTypes.FbxLocalQuaternionDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTransformMatrixDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTransformMatrixDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4x4, FbxDataTypes.FbxTransformMatrixDT.GetFbxType()); + Assert.AreEqual("Matrix Transformation", FbxDataTypes.FbxTransformMatrixDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTranslationMatrixDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTranslationMatrixDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4x4, FbxDataTypes.FbxTranslationMatrixDT.GetFbxType()); + Assert.AreEqual("Matrix Translation", FbxDataTypes.FbxTranslationMatrixDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxRotationMatrixDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxRotationMatrixDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4x4, FbxDataTypes.FbxRotationMatrixDT.GetFbxType()); + Assert.AreEqual("Matrix Rotation", FbxDataTypes.FbxRotationMatrixDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxScalingMatrixDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxScalingMatrixDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4x4, FbxDataTypes.FbxScalingMatrixDT.GetFbxType()); + Assert.AreEqual("Matrix Scaling", FbxDataTypes.FbxScalingMatrixDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialEmissiveDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialEmissiveDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialEmissiveDT.GetFbxType()); + Assert.AreEqual("Emissive", FbxDataTypes.FbxMaterialEmissiveDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialEmissiveFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialEmissiveFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialEmissiveFactorDT.GetFbxType()); + Assert.AreEqual("EmissiveFactor", FbxDataTypes.FbxMaterialEmissiveFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialAmbientDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialAmbientDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialAmbientDT.GetFbxType()); + Assert.AreEqual("Ambient", FbxDataTypes.FbxMaterialAmbientDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialAmbientFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialAmbientFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialAmbientFactorDT.GetFbxType()); + Assert.AreEqual("AmbientFactor", FbxDataTypes.FbxMaterialAmbientFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialDiffuseDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialDiffuseDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialDiffuseDT.GetFbxType()); + Assert.AreEqual("Diffuse", FbxDataTypes.FbxMaterialDiffuseDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialDiffuseFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialDiffuseFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialDiffuseFactorDT.GetFbxType()); + Assert.AreEqual("DiffuseFactor", FbxDataTypes.FbxMaterialDiffuseFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialBumpDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialBumpDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialBumpDT.GetFbxType()); + Assert.AreEqual("Bump", FbxDataTypes.FbxMaterialBumpDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialNormalMapDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialNormalMapDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialNormalMapDT.GetFbxType()); + Assert.AreEqual("NormalMap", FbxDataTypes.FbxMaterialNormalMapDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialTransparentColorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialTransparentColorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialTransparentColorDT.GetFbxType()); + Assert.AreEqual("Transparent", FbxDataTypes.FbxMaterialTransparentColorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialTransparencyFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialTransparencyFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialTransparencyFactorDT.GetFbxType()); + Assert.AreEqual("TransparencyFactor", FbxDataTypes.FbxMaterialTransparencyFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialSpecularDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialSpecularDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialSpecularDT.GetFbxType()); + Assert.AreEqual("Specular", FbxDataTypes.FbxMaterialSpecularDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialSpecularFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialSpecularFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialSpecularFactorDT.GetFbxType()); + Assert.AreEqual("SpecularFactor", FbxDataTypes.FbxMaterialSpecularFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialShininessDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialShininessDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialShininessDT.GetFbxType()); + Assert.AreEqual("Shininess", FbxDataTypes.FbxMaterialShininessDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialReflectionDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialReflectionDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialReflectionDT.GetFbxType()); + Assert.AreEqual("Reflection", FbxDataTypes.FbxMaterialReflectionDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialReflectionFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialReflectionFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialReflectionFactorDT.GetFbxType()); + Assert.AreEqual("ReflectionFactor", FbxDataTypes.FbxMaterialReflectionFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialDisplacementDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialDisplacementDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialDisplacementDT.GetFbxType()); + Assert.AreEqual("Displacement", FbxDataTypes.FbxMaterialDisplacementDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialVectorDisplacementDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialVectorDisplacementDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialVectorDisplacementDT.GetFbxType()); + Assert.AreEqual("VectorDisplacement", FbxDataTypes.FbxMaterialVectorDisplacementDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialCommonFactorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialCommonFactorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxMaterialCommonFactorDT.GetFbxType()); + Assert.AreEqual("Unknown Factor", FbxDataTypes.FbxMaterialCommonFactorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxMaterialCommonTextureDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxMaterialCommonTextureDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxMaterialCommonTextureDT.GetFbxType()); + Assert.AreEqual("Unknown texture", FbxDataTypes.FbxMaterialCommonTextureDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementUndefinedDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementUndefinedDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUndefined, FbxDataTypes.FbxLayerElementUndefinedDT.GetFbxType()); + Assert.AreEqual("LayerElementUndefined", FbxDataTypes.FbxLayerElementUndefinedDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementNormalDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementNormalDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxLayerElementNormalDT.GetFbxType()); + Assert.AreEqual("LayerElementNormal", FbxDataTypes.FbxLayerElementNormalDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementBinormalDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementBinormalDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxLayerElementBinormalDT.GetFbxType()); + Assert.AreEqual("LayerElementBinormal", FbxDataTypes.FbxLayerElementBinormalDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementTangentDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementTangentDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxLayerElementTangentDT.GetFbxType()); + Assert.AreEqual("LayerElementTangent", FbxDataTypes.FbxLayerElementTangentDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementMaterialDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementMaterialDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxLayerElementMaterialDT.GetFbxType()); + Assert.AreEqual("LayerElementMaterial", FbxDataTypes.FbxLayerElementMaterialDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementTextureDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementTextureDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxLayerElementTextureDT.GetFbxType()); + Assert.AreEqual("LayerElementTexture", FbxDataTypes.FbxLayerElementTextureDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementPolygonGroupDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementPolygonGroupDT.Valid()); + Assert.AreEqual(EFbxType.eFbxInt, FbxDataTypes.FbxLayerElementPolygonGroupDT.GetFbxType()); + Assert.AreEqual("LayerElementPolygonGroup", FbxDataTypes.FbxLayerElementPolygonGroupDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementUVDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementUVDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble2, FbxDataTypes.FbxLayerElementUVDT.GetFbxType()); + Assert.AreEqual("LayerElementUV", FbxDataTypes.FbxLayerElementUVDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementVertexColorDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementVertexColorDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble4, FbxDataTypes.FbxLayerElementVertexColorDT.GetFbxType()); + Assert.AreEqual("LayerElementVertexColor", FbxDataTypes.FbxLayerElementVertexColorDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementSmoothingDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementSmoothingDT.Valid()); + Assert.AreEqual(EFbxType.eFbxInt, FbxDataTypes.FbxLayerElementSmoothingDT.GetFbxType()); + Assert.AreEqual("LayerElementSmoothing", FbxDataTypes.FbxLayerElementSmoothingDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementCreaseDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementCreaseDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxLayerElementCreaseDT.GetFbxType()); + Assert.AreEqual("LayerElementCrease", FbxDataTypes.FbxLayerElementCreaseDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementHoleDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementHoleDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBool, FbxDataTypes.FbxLayerElementHoleDT.GetFbxType()); + Assert.AreEqual("LayerElementHole", FbxDataTypes.FbxLayerElementHoleDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementUserDataDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementUserDataDT.Valid()); + Assert.AreEqual(EFbxType.eFbxReference, FbxDataTypes.FbxLayerElementUserDataDT.GetFbxType()); + Assert.AreEqual("LayerElementUserData", FbxDataTypes.FbxLayerElementUserDataDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLayerElementVisibilityDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLayerElementVisibilityDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBool, FbxDataTypes.FbxLayerElementVisibilityDT.GetFbxType()); + Assert.AreEqual("LayerElementVisibility", FbxDataTypes.FbxLayerElementVisibilityDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxAliasDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxAliasDT.Valid()); + Assert.AreEqual(EFbxType.eFbxEnum, FbxDataTypes.FbxAliasDT.GetFbxType()); + Assert.AreEqual("Alias", FbxDataTypes.FbxAliasDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxPresetsDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxPresetsDT.Valid()); + Assert.AreEqual(EFbxType.eFbxEnum, FbxDataTypes.FbxPresetsDT.GetFbxType()); + Assert.AreEqual("Presets", FbxDataTypes.FbxPresetsDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxStatisticsDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxStatisticsDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxStatisticsDT.GetFbxType()); + Assert.AreEqual("Statistics", FbxDataTypes.FbxStatisticsDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTextLineDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTextLineDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxTextLineDT.GetFbxType()); + Assert.AreEqual("TextLine", FbxDataTypes.FbxTextLineDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxUnitsDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxUnitsDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxUnitsDT.GetFbxType()); + Assert.AreEqual("Units", FbxDataTypes.FbxUnitsDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxWarningDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxWarningDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxWarningDT.GetFbxType()); + Assert.AreEqual("Warning", FbxDataTypes.FbxWarningDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxWebDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxWebDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxWebDT.GetFbxType()); + Assert.AreEqual("Web", FbxDataTypes.FbxWebDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxActionDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxActionDT.Valid()); + Assert.AreEqual(EFbxType.eFbxBool, FbxDataTypes.FbxActionDT.GetFbxType()); + Assert.AreEqual("Action", FbxDataTypes.FbxActionDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxCameraIndexDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxCameraIndexDT.Valid()); + Assert.AreEqual(EFbxType.eFbxInt, FbxDataTypes.FbxCameraIndexDT.GetFbxType()); + Assert.AreEqual("Camera Index", FbxDataTypes.FbxCameraIndexDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxCharPtrDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxCharPtrDT.Valid()); + Assert.AreEqual(EFbxType.eFbxString, FbxDataTypes.FbxCharPtrDT.GetFbxType()); + Assert.AreEqual("charptr", FbxDataTypes.FbxCharPtrDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxConeAngleDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxConeAngleDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxConeAngleDT.GetFbxType()); + Assert.AreEqual("Cone angle", FbxDataTypes.FbxConeAngleDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxEventDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxEventDT.Valid()); + Assert.AreEqual(EFbxType.eFbxUndefined, FbxDataTypes.FbxEventDT.GetFbxType()); + Assert.AreEqual("event", FbxDataTypes.FbxEventDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxFieldOfViewDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxFieldOfViewDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxFieldOfViewDT.GetFbxType()); + Assert.AreEqual("FieldOfView", FbxDataTypes.FbxFieldOfViewDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxFieldOfViewXDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxFieldOfViewXDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxFieldOfViewXDT.GetFbxType()); + Assert.AreEqual("FieldOfViewX", FbxDataTypes.FbxFieldOfViewXDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxFieldOfViewYDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxFieldOfViewYDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxFieldOfViewYDT.GetFbxType()); + Assert.AreEqual("FieldOfViewY", FbxDataTypes.FbxFieldOfViewYDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxFogDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxFogDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxFogDT.GetFbxType()); + Assert.AreEqual("Fog", FbxDataTypes.FbxFogDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxHSBDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxHSBDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxHSBDT.GetFbxType()); + Assert.AreEqual("HSB", FbxDataTypes.FbxHSBDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxIKReachTranslationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxIKReachTranslationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxIKReachTranslationDT.GetFbxType()); + Assert.AreEqual("IK Reach Translation", FbxDataTypes.FbxIKReachTranslationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxIKReachRotationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxIKReachRotationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxIKReachRotationDT.GetFbxType()); + Assert.AreEqual("IK Reach Rotation", FbxDataTypes.FbxIKReachRotationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxIntensityDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxIntensityDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxIntensityDT.GetFbxType()); + Assert.AreEqual("Intensity", FbxDataTypes.FbxIntensityDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxLookAtDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxLookAtDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxLookAtDT.GetFbxType()); + Assert.AreEqual("Look at", FbxDataTypes.FbxLookAtDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxOcclusionDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxOcclusionDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxOcclusionDT.GetFbxType()); + Assert.AreEqual("Occlusion", FbxDataTypes.FbxOcclusionDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxOpticalCenterXDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxOpticalCenterXDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxOpticalCenterXDT.GetFbxType()); + Assert.AreEqual("OpticalCenterX", FbxDataTypes.FbxOpticalCenterXDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxOpticalCenterYDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxOpticalCenterYDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxOpticalCenterYDT.GetFbxType()); + Assert.AreEqual("OpticalCenterY", FbxDataTypes.FbxOpticalCenterYDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxOrientationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxOrientationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxOrientationDT.GetFbxType()); + Assert.AreEqual("Orientation", FbxDataTypes.FbxOrientationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxRealDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxRealDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxRealDT.GetFbxType()); + Assert.AreEqual("Real", FbxDataTypes.FbxRealDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxRollDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxRollDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxRollDT.GetFbxType()); + Assert.AreEqual("Roll", FbxDataTypes.FbxRollDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxScalingUVDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxScalingUVDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxScalingUVDT.GetFbxType()); + Assert.AreEqual("Scaling UV", FbxDataTypes.FbxScalingUVDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxShapeDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxShapeDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxShapeDT.GetFbxType()); + Assert.AreEqual("Shape", FbxDataTypes.FbxShapeDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxStringListDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxStringListDT.Valid()); + Assert.AreEqual(EFbxType.eFbxEnumM, FbxDataTypes.FbxStringListDT.GetFbxType()); + Assert.AreEqual("stringlist", FbxDataTypes.FbxStringListDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTextureRotationDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTextureRotationDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxTextureRotationDT.GetFbxType()); + Assert.AreEqual("TextureRotation", FbxDataTypes.FbxTextureRotationDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTimeCodeDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTimeCodeDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxTimeCodeDT.GetFbxType()); + Assert.AreEqual("TimeCode", FbxDataTypes.FbxTimeCodeDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTimeWarpDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTimeWarpDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxTimeWarpDT.GetFbxType()); + Assert.AreEqual("TimeWarp", FbxDataTypes.FbxTimeWarpDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxTranslationUVDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxTranslationUVDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble3, FbxDataTypes.FbxTranslationUVDT.GetFbxType()); + Assert.AreEqual("Translation UV", FbxDataTypes.FbxTranslationUVDT.GetName()); + } + + [Test] + public void FbxDataTypes_FbxWeightDT_HasDefaults() + { + // expect: + Assert.True(FbxDataTypes.FbxWeightDT.Valid()); + Assert.AreEqual(EFbxType.eFbxDouble, FbxDataTypes.FbxWeightDT.GetFbxType()); + Assert.AreEqual("Weight", FbxDataTypes.FbxWeightDT.GetName()); + } + } +} diff --git a/FbxSharpTests/FbxDocumentInfoTest.cs b/FbxSharpTests/FbxDocumentInfoTest.cs new file mode 100644 index 0000000..a647ae8 --- /dev/null +++ b/FbxSharpTests/FbxDocumentInfoTest.cs @@ -0,0 +1,143 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxDocumentInfoTest : TestBase + { + [Test] + public void FbxDocumentInfo_Create_HasDefaults() + { + // given: + var dt0 = new FbxDateTime(); + FbxProperty prop; + + // when: + var docinfo = FbxDocumentInfo.Create(""); + + // then: + Assert.AreEqual(15, CountProperties(docinfo)); + + prop = docinfo.FindProperty("DocumentUrl"); + Assert.True(prop.IsValid()); + Assert.AreEqual("DocumentUrl", prop.GetName()); + Assert.AreEqual("DocumentUrl", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxUrlDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.LastSavedUrl); + + prop = docinfo.FindProperty("SrcDocumentUrl"); + Assert.True(prop.IsValid()); + Assert.AreEqual("SrcDocumentUrl", prop.GetName()); + Assert.AreEqual("SrcDocumentUrl", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxUrlDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Url); + + prop = docinfo.FindProperty("Original"); + Assert.True(prop.IsValid()); + Assert.AreEqual("Original", prop.GetName()); + Assert.AreEqual("Original", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxCompoundDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Original); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationVendor"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationVendor", prop.GetName()); + Assert.AreEqual("Original|ApplicationVendor", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Original_ApplicationVendor); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationName"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationName", prop.GetName()); + Assert.AreEqual("Original|ApplicationName", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Original_ApplicationName); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationVersion"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationVersion", prop.GetName()); + Assert.AreEqual("Original|ApplicationVersion", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Original_ApplicationVersion); + + prop = docinfo.FindPropertyHierarchical("Original|DateTime_GMT"); + Assert.True(prop.IsValid()); + Assert.AreEqual("DateTime_GMT", prop.GetName()); + Assert.AreEqual("Original|DateTime_GMT", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxDateTimeDT, prop.GetPropertyDataType()); + Assert.AreEqual(dt0, prop.Get()); + Assert.True(prop == docinfo.Original_DateTime_GMT); + + prop = docinfo.FindPropertyHierarchical("Original|FileName"); + Assert.True(prop.IsValid()); + Assert.AreEqual("FileName", prop.GetName()); + Assert.AreEqual("Original|FileName", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.Original_FileName); + + prop = docinfo.FindProperty("LastSaved"); + Assert.True(prop.IsValid()); + Assert.AreEqual("LastSaved", prop.GetName()); + Assert.AreEqual("LastSaved", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxCompoundDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.LastSaved); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationVendor"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationVendor", prop.GetName()); + Assert.AreEqual("LastSaved|ApplicationVendor", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.LastSaved_ApplicationVendor); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationName"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationName", prop.GetName()); + Assert.AreEqual("LastSaved|ApplicationName", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.LastSaved_ApplicationName); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationVersion"); + Assert.True(prop.IsValid()); + Assert.AreEqual("ApplicationVersion", prop.GetName()); + Assert.AreEqual("LastSaved|ApplicationVersion", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxStringDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.LastSaved_ApplicationVersion); + + prop = docinfo.FindPropertyHierarchical("LastSaved|DateTime_GMT"); + Assert.True(prop.IsValid()); + Assert.AreEqual("DateTime_GMT", prop.GetName()); + Assert.AreEqual("LastSaved|DateTime_GMT", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxDateTimeDT, prop.GetPropertyDataType()); + Assert.AreEqual(dt0, prop.Get()); + Assert.True(prop == docinfo.LastSaved_DateTime_GMT); + + prop = docinfo.FindProperty("DocumentEmbeddedUrl"); + Assert.True(prop.IsValid()); + Assert.AreEqual("DocumentEmbeddedUrl", prop.GetName()); + Assert.AreEqual("DocumentEmbeddedUrl", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxUrlDT, prop.GetPropertyDataType()); + Assert.AreEqual("", prop.Get()); + Assert.True(prop == docinfo.EmbeddedUrl); + + prop = docinfo.FindProperty("SceneThumbnail"); + Assert.True(prop.IsValid()); + Assert.AreEqual("SceneThumbnail", prop.GetName()); + Assert.AreEqual("SceneThumbnail", prop.GetHierarchicalName()); + Assert.AreEqual(FbxDataTypes.FbxReferenceObjectDT, prop.GetPropertyDataType()); + Assert.AreEqual(null, prop.Get()); + } + } +} diff --git a/FbxSharpTests/FbxGlobalSettingsTest.cs b/FbxSharpTests/FbxGlobalSettingsTest.cs new file mode 100644 index 0000000..4b1264a --- /dev/null +++ b/FbxSharpTests/FbxGlobalSettingsTest.cs @@ -0,0 +1,243 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxGlobalSettingsTest : TestBase + { + [Test] + public void FbxGlobalSettings_Create_HasDefaults() + { + // given: + var settings = new FbxGlobalSettings(""); + FbxProperty prop; + + // expect: + Assert.NotNull(settings); + Assert.That(settings.GetSrcObjectCount(), Is.EqualTo(0)); + Assert.That(settings.GetDstObjectCount(), Is.EqualTo(0)); + Assert.That(settings.GetSrcPropertyCount(), Is.EqualTo(0)); + Assert.That(settings.GetDstPropertyCount(), Is.EqualTo(0)); + + Assert.That(CountProperties(settings), Is.EqualTo(20)); + + prop = settings.FindProperty("UpAxis"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UpAxis")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("UpAxis")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxAxisSystem.EUpVector.eXAxis)); + + prop = settings.FindProperty("UpAxisSign"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UpAxisSign")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("UpAxisSign")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + + prop = settings.FindProperty("FrontAxis"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FrontAxis")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("FrontAxis")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxAxisSystem.EFrontVector.eParityOdd)); + + prop = settings.FindProperty("FrontAxisSign"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FrontAxisSign")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("FrontAxisSign")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + + prop = settings.FindProperty("CoordAxis"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CoordAxis")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("CoordAxis")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxAxisSystem.ECoordSystem.eRightHanded)); + + prop = settings.FindProperty("CoordAxisSign"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CoordAxisSign")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("CoordAxisSign")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + + prop = settings.FindProperty("OriginalUpAxis"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("OriginalUpAxis")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("OriginalUpAxis")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(-1)); + + prop = settings.FindProperty("OriginalUpAxisSign"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("OriginalUpAxisSign")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("OriginalUpAxisSign")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + + prop = settings.FindProperty("UnitScaleFactor"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitScaleFactor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("UnitScaleFactor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.0d)); + + prop = settings.FindProperty("OriginalUnitScaleFactor"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("OriginalUnitScaleFactor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("OriginalUnitScaleFactor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.0d)); + + prop = settings.FindProperty("AmbientColor"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AmbientColor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("AmbientColor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble3)); + var color = prop.Get(); + Assert.That(color.mRed, Is.EqualTo(0.0d)); + Assert.That(color.mGreen, Is.EqualTo(0.0d)); + Assert.That(color.mBlue, Is.EqualTo(0.0d)); + + prop = settings.FindProperty("DefaultCamera"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DefaultCamera")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("DefaultCamera")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("Producer Perspective")); + + prop = settings.FindProperty("TimeMode"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeMode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("TimeMode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EMode.eDefaultMode)); + + prop = settings.FindProperty("TimeProtocol"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeProtocol")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("TimeProtocol")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EProtocol.eDefaultProtocol)); + + prop = settings.FindProperty("SnapOnFrameMode"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SnapOnFrameMode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("SnapOnFrameMode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo((int)FbxGlobalSettings.ESnapOnFrameMode.eNoSnap)); + + prop = settings.FindProperty("TimeSpanStart"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeSpanStart")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("TimeSpanStart")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxTime)); + Assert.That(prop.Get(), Is.EqualTo(new FbxTime(0))); + + prop = settings.FindProperty("TimeSpanStop"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeSpanStop")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("TimeSpanStop")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxTime)); + Assert.That(prop.Get(), Is.EqualTo(new FbxTime(141120000L))); + + prop = settings.FindProperty("CustomFrameRate"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CustomFrameRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("CustomFrameRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(-1.0d)); + + prop = settings.FindProperty("TimeMarker"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeMarker")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("TimeMarker")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxUndefined)); + Assert.That(prop.Get(), Is.EqualTo(0.0d)); + + prop = settings.FindProperty("CurrentTimeMarker"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurrentTimeMarker")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("CurrentTimeMarker")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(-1)); + + Assert.That(settings.GetOriginalUpAxis(), Is.EqualTo(-1)); + + var a = settings.GetAxisSystem(); + var sign = 0; + Assert.That(a.GetUpVector(ref sign), Is.EqualTo(FbxAxisSystem.EUpVector.eYAxis)); + Assert.That(sign, Is.EqualTo(1)); + Assert.That(a.GetFrontVector(ref sign), Is.EqualTo(FbxAxisSystem.EFrontVector.eParityOdd)); + Assert.That(sign, Is.EqualTo(1)); + Assert.That(a.GetCoorSystem( ), Is.EqualTo(FbxAxisSystem.ECoordSystem.eRightHanded)); + + var su = settings.GetSystemUnit(); + Assert.That(su.GetMultiplier(), Is.EqualTo(1.0d)); + Assert.That(su.GetScaleFactorAsString(), Is.EqualTo("cm")); + Assert.That(su.GetScaleFactorAsString_Plurial(), Is.EqualTo("Centimeters")); + Assert.True(FbxSystemUnit.cm == su); + + su = settings.GetOriginalSystemUnit(); + Assert.That(su.GetMultiplier(), Is.EqualTo(1.0d)); + Assert.That(su.GetScaleFactorAsString(), Is.EqualTo("cm")); + Assert.That(su.GetScaleFactorAsString_Plurial(), Is.EqualTo("Centimeters")); + Assert.True(FbxSystemUnit.cm == su); + + color = settings.GetAmbientColor(); + Assert.That(color.mRed, Is.EqualTo(0.0d)); + Assert.That(color.mGreen, Is.EqualTo(0.0d)); + Assert.That(color.mBlue, Is.EqualTo(0.0d)); + + Assert.That(settings.GetDefaultCamera(), Is.EqualTo("Producer Perspective")); + + Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames30)); + Assert.That(settings.GetTimeProtocol(), Is.EqualTo(FbxTime.EProtocol.eFrameCount)); + Assert.That(settings.GetSnapOnFrameMode(), Is.EqualTo(FbxGlobalSettings.ESnapOnFrameMode.eNoSnap)); + FbxTimeSpan ts; + settings.GetTimelineDefaultTimeSpan(out ts); + Assert.That(ts.GetStart().Get(), Is.EqualTo(0L)); + Assert.That(ts.GetStop().Get(), Is.EqualTo(141120000L)); + Assert.That(ts.GetDuration().Get(), Is.EqualTo(141120000L)); + Assert.That(settings.GetCustomFrameRate(), Is.EqualTo(-1.0d)); + + Assert.That(settings.GetTimeMarkerCount(), Is.EqualTo(0)); + Assert.That(settings.GetCurrentTimeMarker(), Is.EqualTo(-1)); + } + + [Test] + public void FbxGlobalSettings_SetTimeMode_DifferentFromProperty() + { + // given: + var settings = new FbxGlobalSettings(""); + FbxProperty prop; + prop = settings.FindProperty("TimeMode"); + + // expect: + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EMode.eDefaultMode)); + Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames30)); + + // when: + settings.SetTimeMode(FbxTime.EMode.eFrames48); + // then: + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EMode.eFrames48)); + Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames48)); + + // when: + settings.SetTimeMode(FbxTime.EMode.eFrames30); + // then: + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EMode.eFrames30)); + Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames30)); + + // when: + settings.SetTimeMode(FbxTime.EMode.eDefaultMode); + // then: + Assert.That(prop.Get(), Is.EqualTo((int)FbxTime.EMode.eDefaultMode)); + Assert.That(settings.GetTimeMode(), Is.EqualTo(FbxTime.EMode.eFrames30)); + } + } +} diff --git a/FbxSharpTests/FbxIOSettingsTest.cs b/FbxSharpTests/FbxIOSettingsTest.cs new file mode 100644 index 0000000..9ece3c7 --- /dev/null +++ b/FbxSharpTests/FbxIOSettingsTest.cs @@ -0,0 +1,2258 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxIOSettingsTest : TestBase + { + [Test] + public void FbxIOSettings_Create_HasDefaults() + { + // given: + var settings = new FbxIOSettings(""); + FbxProperty prop; + + // expect: + Assert.NotNull(settings); + Assert.That(settings.GetSrcObjectCount(), Is.EqualTo(0)); + Assert.That(settings.GetDstObjectCount(), Is.EqualTo(0)); + Assert.That(settings.GetSrcPropertyCount(), Is.EqualTo(0)); + Assert.That(settings.GetDstPropertyCount(), Is.EqualTo(0)); + + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_UI_WIDTH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_UI_HEIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_VERSIONS_URL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PI_VERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PRESET_SELECTED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PRESETS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_STATISTICS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNITS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_INCLUDE_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ADV_OPT_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AXISCONV_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CAMERA_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_LIGHT_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EXTRA_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONSTRAINTS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_INPUTCONNECTIONS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_INFORMATION_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UP_AXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UP_AXIS_MAX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ZUPROTATION_MAX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AXISCONVERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AUTO_AXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FILE_UP_AXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PRESETS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_STATISTICS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNITS_SCALE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TOTAL_UNITS_SCALE_TB).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SCALECONVERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MASTERSCALE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DYN_SCALE_CONVERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNITSELECTOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AUDIO).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DEFORMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MARKERS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CHARACTER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CHARACTER_AS_MAYA_HIK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CHARACTER_TYPE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CHARACTER_TYPE_DESC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SETLOCKEDATTRIB).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TRIANGULATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MRCUSTOMATTRIBUTES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MESHPRIMITIVE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MESHTRIANGLE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MESHPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_NURB).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PATCH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BIP2FBX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ASCIIFBX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TAKE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYMESHPRIMITIVEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYMESHTRIANGLEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYMESHPOLYAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYNURBSAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYNURBSSURFACEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMETRYPATCHAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TANGENTS_BINORMALS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SMOOTH_MESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SELECTION_SET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ANIMATIONONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SELECTIONONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONEWIDTHHEIGHTLOCK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONEASDUMMY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONEMAX4BONEWIDTH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONEMAX4BONEHEIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BONEMAX4BONETAPER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_REMOVE_SINGLE_KEY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CURVE_FILTER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONSTRAINT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UI).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHOW_UI_MODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHOW_WARNINGS_MANAGER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GENERATE_LOG_DATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PERF_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_REMOVEBADPOLYSFROMMESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_META_DATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CACHE_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CACHE_SIZE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MERGE_MODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MERGE_MODE_DESCRIPTION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ONE_CLICK_MERGE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ONE_CLICK_MERGE_TEXTURE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SAMPLINGPANEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FILE_FORMAT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FBX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_OBJ).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_BASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BIOVISION_BVH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTIONANALYSIS_HTR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTIONANALYSIS_TRC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ACCLAIM_ASF).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ACCLAIM_AMC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VICON_C3D).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SKINS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_POINTCACHE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_QUATERNION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_NAMETAKE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHAPE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHAPEATTRIBUTES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHAPEATTRIBUTE_VALUES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_LIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_LIGHTATTENUATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CAMERA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VIEW_CUBE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BINDPOSE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EMBEDTEXTURE_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EMBEDTEXTURE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EMBEDDED_FOLDER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONVERTTOTIFF).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNLOCK_NORMALS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CREASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FINESTSUBDIVLEVEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEANIMATIONLAYERS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKECOMPLEXANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMESTART).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMEEND).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMESTEP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMESTARTNORESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMEENDNORESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BAKEFRAMESTEPNORESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_USEMATRIXFROMPOSE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_NULLSTOPIVOT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PIVOTTONULLS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GEOMNORMALPERPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MAXBONEASBONE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MAXNURBSSTEP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PROTECTDRIVENKEYS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DEFORMNULLSASJOINTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ENVIRONMENT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SAMPLINGRATESELECTOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SAMPLINGRATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_APPLYCSTKEYRED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CSTKEYREDTPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CSTKEYREDRPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CSTKEYREDSPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CSTKEYREDOPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_APPLYKEYREDUCE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_KEYREDUCEPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_APPLYKEYSONFRM).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_APPLYKEYSYNC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_APPLYUNROLL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNROLLPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNROLLPATH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UNROLLFORCEAUTO).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AUTOTANGENTSONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SMOOTHING_GROUPS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_HARDEDGES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EXP_HARDEDGES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BLINDDATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_INPUTCONNECTIONS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_INSTANCES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_REFERENCES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONTAINEROBJECTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BYPASSRRSINHERITANCE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FORCEWEIGHTNORMALIZE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHAPEANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SMOOTHKEYASUSER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SCALEFACTOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_AXISCONVERSIONMETHOD).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UPAXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SELECTIONSETNAMEASPOINTCACHE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_KEEPFRAMERATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ATTENUATIONASINTENSITYCURVE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_RESAMPLE_ANIMATION_CURVES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TIMELINE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TIMELINE_SPAN).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BUTTON_WEB_UPDATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BUTTON_EDIT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BUTTON_OK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BUTTON_CANCEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MENU_EDIT_PRESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MENU_SAVE_PRESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_UIL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_PRODUCT_FAMILY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_UI_XPOS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PLUGIN_UI_YPOS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FBX_EXTENTIONS_SDK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FBX_EXTENTIONS_SDK_WARNING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_FRAME_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_START).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_TAKE_NAME).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_TRIANGULATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_SINGLEMATRIX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLADA_FRAME_RATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF_TRIANGULATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF_DEFORMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF_WELD_VERTICES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF_OBJECT_DERIVATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DXF_REFERENCE_NODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_OBJ_REFERENCE_NODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_OBJ_TRIANGULATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_OBJ_DEFORMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_REFERENCENODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_TEXTURE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_MATERIAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_ANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_MESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_LIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_CAMERA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_AMBIENT_LIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_RESCALING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_FILTER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_SMOOTHGROUP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_TAKE_NAME).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_3DS_TEXUVBYPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ZOOMEXTENTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GLOBAL_AMBIENT_COLOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EDGE_ORIENTATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VERSIONS_UI_ALIAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VERSIONS_COMP_DESCRIPTIONS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MODEL_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_DEVICE_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CHARACTER_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ACTOR_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONSTRAINT_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MEDIA_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TEMPLATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PIVOT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GLOBAL_SETTINGS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MERGE_LAYER_AND_TIMEWARP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_GOBO).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_LINK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MATERIAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TEXTURE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MODEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_NORMAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_BINORMAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_TANGENT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VERTEXCOLOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_POLYGROUP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SMOOTHING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_USERDATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VISIBILITY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EDGECREASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_VERTEXCREASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_HOLE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EMBEDDED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PASSWORD).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PASSWORD_ENABLE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CURRENT_TAKE_NAME).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COLLAPSE_EXTERNALS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COMPRESS_ARRAYS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COMPRESS_LEVEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_COMPRESS_MINSIZE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EMBEDDED_PROPERTIES_SKIP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EXPORT_FILE_VERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_SHOW_UI_WARNING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ADD_MATERIAL_TO_EDIT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_ENABLE_TEX_DISPLAY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_PREFERED_ENVELOPPE_SYSTEM).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_FIRST_TIME_RUN_NOTICE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_EXTRACT_EMBEDDED_DATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CALCULATE_LEGACY_SHAPE_NORMAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_USETMPFILEPERIPHERAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_CONSTRUCTIONHISTORY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_RELAXED_FBX_CHECK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_KEEP_PRODUCER_CAM_SRCOBJ).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_INFORMATION_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_SETLOCKEDATTRIB).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ADD_MATERIAL_TO_EDIT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ENABLE_TEX_DISPLAY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_PREFERED_ENVELOPPE_SYSTEM).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ENVIRONMENT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_VIEW_CUBE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ZOOMEXTENTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_GLOBAL_AMBIENT_COLOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ATTENUATIONASINTENSITYCURVE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_QUATERNION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_PROTECTDRIVENKEYS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_DEFORMNULLSASJOINTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_NULLSTOPIVOT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_POINTCACHE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_SHAPEANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CONSTRAINTS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CONSTRAINT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CHARACTER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CHARACTER_AS_MAYA_HIK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CHARACTER_TYPE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_PERF_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_REMOVEBADPOLYSFROMMESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_META_DATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_SHOW_UI_WARNING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UNLOCK_NORMALS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CREASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_SMOOTHING_GROUPS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_HARDEDGES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BLINDDATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONE_WIDTHHEIGHTLOCK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONEASDUMMY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONEMAX4BONEWIDTH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONEMAX4BONEHEIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BONEMAX4BONETAPER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_SHAPE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_FORCEWEIGHTNORMALIZE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_APPLYCSTKEYRED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CSTKEYREDTPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CSTKEYREDRPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CSTKEYREDSPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_CSTKEYREDOPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_AUTOTANGENTSONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_APPLYKEYREDUCE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_KEYREDUCEPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_APPLYKEYSONFRM).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_APPLYKEYSYNC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_APPLYUNROLL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UNROLLPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UNROLLPATH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UNROLLFORCEAUTO).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UP_AXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_UP_AXIS_MAX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_ZUPROTATION_MAX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_FILE_UP_AXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_BUTTON_WEB_UPDATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IMP_PI_VERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_INFORMATION_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SCALEFACTOR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_AXISCONVERSIONMETHOD).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_UPAXIS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SHOW_UI_WARNING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_LIGHTATTENUATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_ENVIRONMENT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SELECTIONONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_INPUTCONNECTIONS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_INPUTCONNECTIONS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BYPASSRRSINHERITANCE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CONVERTTOTIFF).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BONE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_POINTCACHE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SMOOTHKEYASUSER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_QUATERNION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CONSTRAINTS_GRP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CONSTRAINT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CHARACTER).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MRCUSTOMATTRIBUTES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MESHPRIMITIVE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MESHTRIANGLE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MESHPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_NURB).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_PATCH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BIP2FBX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMNORMALPERPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_TANGENTSPACE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SMOOTHMESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SELECTIONSET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_FINESTSUBDIVLEVEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MAXBONEASBONE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MAXNURBSSTEP).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CREASE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BLINDDATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_NURBSSURFACEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SMOOTHING_GROUPS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_HARDEDGES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_ANIMATIONONLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_INSTANCES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CONTAINEROBJECTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_TRIANGULATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_EDGE_ORIENTATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SELECTIONSETNAMEASPOINTCACHE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRYMESHPRIMITIVEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRYMESHTRIANGLEAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRYMESHPOLYAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRYNURBSAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRYPATCHAS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SHAPE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SHAPEATTRIBUTES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_SHAPEATTRIBUTESVALUES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_APPLYKEYREDUCE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_KEYREDUCEPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_APPLYKEYSONFRM).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_APPLYKEYSYNC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_APPLYUNROLL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_UNROLLPREC).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_UNROLLPATH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_UNROLLFORCEAUTO).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BUTTON_WEB_UPDATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_PI_VERSION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BUTTON_EDIT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BUTTON_OK).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_BUTTON_CANCEL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MENU_EDIT_PRESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_MENU_SAVE_PRESET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_CONSTRUCTIONHISTORY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_REFERENCENODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_TEXTURE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_MATERIAL).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_ANIMATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_MESH).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_LIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_CAMERA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_AMBIENT_LIGHT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_RESCALING).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.EXP_3DS_TEXUVBYPOLY).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_START).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_FRAME_COUNT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_FRAME_RATE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_ACTOR_PREFIX).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_RENAME_DUPLICATE_NAMES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_EXACT_ZERO_AS_OCCLUDED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_SET_OCCLUDED_TO_LAST_VALID_POSITION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_AS_OPTICAL_SEGMENTS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_ASF_SCENE_OWNED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_MOTION_FROM_GLOBAL_POSITION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_GAPS_AS_VALID_DATA).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_C3D_REAL_FORMAT).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_CREATE_REFERENCE_NODE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_TRANSLATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_BASE_T_IN_OFFSET).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_BASE_R_IN_PREROTATION).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_DUMMY_NODES).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_LIMITS).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_FRAME_RATE_USED).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_FRAME_RANGE).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_WRITE_DEFAULT_AS_BASE_TR).IsValid()); + Assert.False(settings.GetProperty(FbxIOSettingsPath.IOSN_MOTION_UP_AXIS_USED_IN_FILE).IsValid()); + + Assert.That(CountProperties(settings), Is.EqualTo(275)); + + prop = settings.GetProperty(FbxIOSettingsPath.IOSROOT); + Assert.True(prop == settings.RootProperty); + Assert.True(prop.IsValid()); + Assert.True(prop == settings.RootProperty); + Assert.False(prop != settings.RootProperty); + Assert.That(prop.GetName(), Is.EqualTo("")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxUndefined)); + + prop = settings.GetProperty(FbxIOSettingsPath.IOSN_IMPORT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Import")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FIRST_TIME_RUN_NOTICE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FirstTimeRunNotice")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|FirstTimeRunNotice")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FIRST_TIME_RUN_NOTICE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FirstTimeRunNotice")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|FirstTimeRunNotice|FirstTimeRunNotice")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("*** Welcome! ***")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PRESETS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PresetsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PresetsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PRESETS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Presets")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PresetsGrp|Presets")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_STATISTICS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("StatisticsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|StatisticsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_STATISTICS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Statistics")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|StatisticsGrp|Statistics")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_INCLUDE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("IncludeGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MERGE_MODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MergeMode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|MergeMode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(1)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(3)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("Add")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("Add and update animation")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("Update animation")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MERGE_MODE_DESCRIPTION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MergeModeDescription")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|MergeModeDescription")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("---")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ONE_CLICK_MERGE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("OneClickMerge")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|OneClickMerge")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ONE_CLICK_MERGE_TEXTURE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("OneClickMergeTexture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|OneClickMergeTexture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_GEOMETRY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Geometry")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Geometry")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Animation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_EXTRA_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ExtraGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_CAMERA_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CameraGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|CameraGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_LIGHT_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LightGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|LightGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_AUDIO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Audio")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Audio")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_EMBEDDED_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("EmbedTexture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|EmbedTexture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_EXTRACT_FOLDER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ExtractFolder")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|EmbedTexture|ExtractFolder")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DEFORMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Deformation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|Deformation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ADV_OPT_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AdvOptGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_EXT_SDK_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FBXExtentionsSDK")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|FBXExtentionsSDK")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_EXTENTIONS_SDK_WARNING); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FBXExtentionsSDKWarning")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|FBXExtentionsSDK|FBXExtentionsSDKWarning")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("Add your custom properties here.")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_UNITS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_AXISCONV_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AxisConvGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|AxisConvGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_UI); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UI")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UI")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_CACHE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Cache")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Cache")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_UI_WIDTH); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIWidth")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PlugInUIWidth")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(500)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_UI_HEIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIHeight")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PlugInUIHeight")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(500)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_UI_XPOS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIXpos")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PlugInUIXpos")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(100)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_UI_YPOS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIYpos")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PlugInUIYpos")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(100)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PRESET_SELECTED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PresetSelected")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PresetSelected")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_UIL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UILIndex")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|UILIndex")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(7)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("ENU")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("DEU")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("FRA")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("JPN")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("KOR")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("CHS")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("PTB")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_PRODUCT_FAMILY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PluginProductFamily")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|PlugInGrp|PluginProductFamily")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SCALECONVERSION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ScaleConversion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|ScaleConversion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_TOTAL_UNITS_SCALE_TB); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TotalUnitsScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|TotalUnitsScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DYN_SCALE_CONVERSION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DynamicScaleConversion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|DynamicScaleConversion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_UNITSELECTOR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsSelector")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|UnitsSelector")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(9)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("Millimeters")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("Centimeters")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("Decimeters")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("Meters")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("Kilometers")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("Inches")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("Feet")); + Assert.That(prop.GetEnumValue(7), Is.EqualTo("Yards")); + Assert.That(prop.GetEnumValue(8), Is.EqualTo("Miles")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MASTERSCALE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MasterScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|MasterScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_UNITS_SCALE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UnitsGrp|UnitsScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SAMPLINGPANEL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SamplingPanel")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|SamplingPanel")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SAMPLINGRATESELECTOR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SamplingRateSelector")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|SamplingPanel|SamplingRateSelector")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(3)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("Scene")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("File")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("Custom")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SAMPLINGRATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterSamplingRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|SamplingPanel|CurveFilterSamplingRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(30.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_CURVEFILTERS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilter")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|CurveFilter")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_TAKE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Take")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|Take")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(-1)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_KEEPFRAMERATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("KeepFrameRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|KeepFrameRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_TIMELINE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeLine")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|TimeLine")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_TIMELINE_SPAN); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TimeLineSpan")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|TimeLineSpan")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_BAKEANIMATIONLAYERS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeAnimationLayers")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|BakeAnimationLayers")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MARKERS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Markers")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|ExtraGrp|Markers")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_CAMERA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Camera")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|CameraGrp|Camera")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_LIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Light")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|LightGrp|Light")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SHOW_WARNINGS_MANAGER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ShowWarningsManager")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UI|ShowWarningsManager")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_GENERATE_LOG_DATA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("GenerateLogData")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UI|GenerateLogData")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_PLUGIN_VERSIONS_URL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PluginVersionsURL")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UI|PluginVersionsURL")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("http://download.autodesk.com/us/fbx/versions/fbxversion.xml")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SHOW_UI_MODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ShowUIMode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|UI|ShowUIMode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_SKINS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Skins")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|Deformation|Skins")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_USEMATRIXFROMPOSE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UseMatrixFromPose")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|IncludeGrp|Animation|Deformation|UseMatrixFromPose")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_AXISCONVERSION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AxisConversion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|AxisConvGrp|AxisConversion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_AUTO_AXIS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AutoAxis")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|AxisConvGrp|AutoAxis")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_CACHE_SIZE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CacheSize")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Cache|CacheSize")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(8)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FILEFORMAT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FileFormat")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IOSN_EXPORT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Export")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FIRST_TIME_RUN_NOTICE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FirstTimeRunNotice")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|FirstTimeRunNotice")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FIRST_TIME_RUN_NOTICE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FirstTimeRunNotice")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|FirstTimeRunNotice|FirstTimeRunNotice")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("*** Welcome! ***")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PRESETS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PresetsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PresetsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PRESETS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Presets")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PresetsGrp|Presets")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_STATISTICS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("StatisticsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|StatisticsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_STATISTICS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Statistics")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|StatisticsGrp|Statistics")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_INCLUDE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("IncludeGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_GEOMETRY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Geometry")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Geometry")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Animation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_EXTRA_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ExtraGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|ExtraGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CAMERA_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CameraGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|CameraGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_LIGHT_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LightGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|LightGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_AUDIO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Audio")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Audio")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_EMBEDTEXTURE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("EmbedTextureGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|EmbedTextureGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKECOMPLEXANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeComplexAnimation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ADV_OPT_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AdvOptGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_EXT_SDK_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FBXExtentionsSDK")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|FBXExtentionsSDK")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_EXTENTIONS_SDK_WARNING); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FBXExtentionsSDKWarning")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|FBXExtentionsSDK|FBXExtentionsSDKWarning")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("Add your custom properties here.")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_UNITS_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_AXISCONV_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AxisConvGrp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|AxisConvGrp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_UI); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UI")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UI")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_DEFORMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Deformation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|Deformation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CACHE_GRP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Cache")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Cache")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_UI_WIDTH); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIWidth")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PlugInUIWidth")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(500)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_UI_HEIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIHeight")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PlugInUIHeight")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(500)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_UI_XPOS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIXpos")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PlugInUIXpos")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(100)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_UI_YPOS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PlugInUIYpos")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PlugInUIYpos")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(100)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_UIL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UILIndex")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|UILIndex")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(7)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("ENU")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("DEU")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("FRA")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("JPN")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("KOR")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("CHS")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("PTB")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_PRODUCT_FAMILY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PluginProductFamily")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PluginProductFamily")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PRESET_SELECTED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PresetSelected")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|PresetSelected")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_USETMPFILEPERIPHERAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UseTmpFilePeripheral")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|PlugInGrp|UseTmpFilePeripheral")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_TOTAL_UNITS_SCALE_TB); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("TotalUnitsScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp|TotalUnitsScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_DYN_SCALE_CONVERSION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DynamicScaleConversion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp|DynamicScaleConversion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_UNITSELECTOR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsSelector")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp|UnitsSelector")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_UNITS_SCALE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UnitsScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp|UnitsScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MASTERSCALE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MasterScale")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UnitsGrp|MasterScale")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(1.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMESTART); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameStart")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStart")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMEEND); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameEnd")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameEnd")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(200)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMESTEP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameStep")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStep")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKE_RESAMPLE_ANIMATION_CURVES); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ResampleAnimationCurves")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|ResampleAnimationCurves")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMESTARTNORESET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameStartNoReset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStartNoReset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMEENDNORESET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameEndNoReset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameEndNoReset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BAKEFRAMESTEPNORESET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BakeFrameStepNoReset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|BakeComplexAnimation|BakeFrameStepNoReset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CURVEFILTERS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilter")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_APPLYCSTKEYRED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterApplyCstKeyRed")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_SAMPLINGRATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterSamplingRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterSamplingRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(30.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CSTKEYREDTPREC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterCstKeyRedTPrec")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedTPrec")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(0.000090)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CSTKEYREDRPREC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterCstKeyRedRPrec")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedRPrec")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(0.009000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CSTKEYREDSPREC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterCstKeyRedSPrec")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedSPrec")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(0.004000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CSTKEYREDOPREC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CurveFilterCstKeyRedOPrec")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|CurveFilterCstKeyRedOPrec")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(0.009000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_AUTOTANGENTSONLY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AutoTangentsOnly")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|CurveFilter|CurveFilterApplyCstKeyRed|AutoTangentsOnly")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_NAMETAKE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("UseSceneName")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|ExtraGrp|UseSceneName")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_REMOVE_SINGLE_KEY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("RemoveSingleKey")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|ExtraGrp|RemoveSingleKey")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BINDPOSE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("BindPose")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|BindPose")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PIVOTTONULLS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PivotToNulls")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|PivotToNulls")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_EMBEDTEXTURE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("EmbedTexture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|EmbedTextureGrp|EmbedTexture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CAMERA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Camera")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|CameraGrp|Camera")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_LIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Light")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|LightGrp|Light")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_SKINS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Skins")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|IncludeGrp|Animation|Deformation|Skins")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_SHOW_WARNINGS_MANAGER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ShowWarningsManager")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UI|ShowWarningsManager")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_GENERATE_LOG_DATA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("GenerateLogData")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UI|GenerateLogData")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_PLUGIN_VERSIONS_URL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("PluginVersionsURL")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UI|PluginVersionsURL")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("http://download.autodesk.com/us/fbx/versions/fbxversion.xml")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_SHOW_UI_MODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ShowUIMode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|UI|ShowUIMode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_CACHE_SIZE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CacheSize")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Cache|CacheSize")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(8)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FILEFORMAT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FileFormat")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Fbx")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CURRENT_TAKE_NAME); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Current_Take_Name")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Current_Take_Name")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_MODEL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Model")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Model")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_NORMAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementNormal")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementNormal")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_BINORMAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementBinormal")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementBinormal")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_TANGENT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementTangent")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementTangent")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_VERTEXCOLOR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementVertexColor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVertexColor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_POLYGROUP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementPolygroup")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementPolygroup")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_SMOOTHING); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementSmoothing")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementSmoothing")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_USERDATA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementUserData")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementUserData")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_VISIBILITY); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementVisibility")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVisibility")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_EDGECREASE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementEdgeCrease")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementEdgeCrease")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_VERTEXCREASE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementVertexCrease")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementVertexCrease")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_HOLE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LayerElementHole")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|LayerElementHole")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_TEXTURE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Texture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Texture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_MATERIAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Material")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Material")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_LINK); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Link")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Link")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_SHAPE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Shape")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Shape")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_GOBO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Gobo")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Gobo")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_AUDIO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Audio")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Audio")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_ANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Animation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Animation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CHARACTER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Character")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Character")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_GLOBAL_SETTINGS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Global_Settings")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Global_Settings")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_PIVOT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Pivot")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Pivot")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_MERGE_LAYER_AND_TIMEWARP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Merge_Layer_and_Timewarp")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Merge_Layer_and_Timewarp")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_TEMPLATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Template")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Template")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CONSTRAINT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Constraint")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Constraint")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_EXTRACT_EMBEDDED_DATA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ExtractEmbeddedData")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|ExtractEmbeddedData")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CALCULATE_LEGACY_SHAPE_NORMAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("CalculateLegacyShapeNormal")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|CalculateLegacyShapeNormal")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_PASSWORD_ENABLE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Password_Enable")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Password_Enable")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_PASSWORD); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Password")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Password")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_MODEL_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Model_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Model_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_DEVICE_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Device_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Device_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CHARACTER_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Character_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Character_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_ACTOR_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Actor_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Actor_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_CONSTRAINT_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Constraint_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Constraint_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_FBX_MEDIA_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Media_Count")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|Media_Count")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_RELAXED_FBX_CHECK); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("RelaxedFbxCheck")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|RelaxedFbxCheck")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_KEEP_PRODUCER_CAM_SRCOBJ); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("KeepProducerCamSrcObj")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Fbx|KeepProducerCamSrcObj")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DXF); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Dxf")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Dxf")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DXF_WELD_VERTICES); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("WeldVertices")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Dxf|WeldVertices")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DXF_OBJECT_DERIVATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ObjectDerivation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Dxf|ObjectDerivation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(3)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("By layer")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("By entity")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("By block")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_DXF_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|Dxf|ReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_OBJ); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Obj")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Obj")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_OBJ_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Obj|ReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Max_3ds")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_REFERENCENODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|ReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_TEXTURE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Texture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Texture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_MATERIAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Material")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Material")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_ANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Animation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Animation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_MESH); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Mesh")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Mesh")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_LIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Light")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Light")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_CAMERA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Camera")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Camera")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_AMBIENT_LIGHT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AmbientLight")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|AmbientLight")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_RESCALING); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Rescaling")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Rescaling")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_FILTER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Filter")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Filter")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_3DS_SMOOTHGROUP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Smoothgroup")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Max_3ds|Smoothgroup")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOTION_BASE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Motion_Base")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_START); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionStart")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionStart")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxTime)); + Assert.That(prop.Get().Get(), Is.EqualTo(0L)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_FRAME_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameCount")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionFrameCount")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_FRAME_RATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionFrameRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(0.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_ACTOR_PREFIX); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionActorPrefix")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionActorPrefix")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_RENAME_DUPLICATE_NAMES); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionRenameDuplicateNames")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionRenameDuplicateNames")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_EXACT_ZERO_AS_OCCLUDED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionExactZeroAsOccluded")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionExactZeroAsOccluded")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_SET_OCCLUDED_TO_LAST_VALID_POSITION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionSetOccludedToLastValidPos")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionSetOccludedToLastValidPos")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_AS_OPTICAL_SEGMENTS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionAsOpticalSegments")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionAsOpticalSegments")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_ASF_SCENE_OWNED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionASFSceneOwned")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionASFSceneOwned")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOB_UP_AXIS_USED_IN_FILE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionUpAxisUsedInFile")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Motion_Base|MotionUpAxisUsedInFile")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(3)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_BIOVISION_BVH); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Biovision_BVH")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Biovision_BVH")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_BIOVISION_BVH_CREATE_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionCreateReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Biovision_BVH|MotionCreateReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOTIONANALYSIS_HTR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionAnalysis_HTR")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOTIONANALYSIS_HTR_CREATE_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionCreateReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionCreateReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOTIONANALYSIS_HTR_MOTION_BASE_T_IN_OFFSET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseTInOffset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionBaseTInOffset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_MOTIONANALYSIS_HTR_MOTION_BASE_R_IN_PREROTATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseRInPrerotation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|MotionAnalysis_HTR|MotionBaseRInPrerotation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty("Import|AdvOptGrp|FileFormat|MotionAnalysis_TRC"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionAnalysis_TRC")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|MotionAnalysis_TRC")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Acclaim_ASF")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF_CREATE_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionCreateReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionCreateReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF_DUMMY_NODES); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionDummyNodes")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionDummyNodes")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF_MOTION_LIMITS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionLimits")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionLimits")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF_MOTION_BASE_T_IN_OFFSET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseTInOffset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionBaseTInOffset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_ASF_MOTION_BASE_R_IN_PREROTATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseRInPrerotation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_ASF|MotionBaseRInPrerotation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Acclaim_AMC")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC_CREATE_REFERENCE_NODE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionCreateReferenceNode")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionCreateReferenceNode")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC_DUMMY_NODES); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionDummyNodes")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionDummyNodes")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC_MOTION_LIMITS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionLimits")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionLimits")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC_MOTION_BASE_T_IN_OFFSET); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseTInOffset")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionBaseTInOffset")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.IMP_ACCLAIM_AMC_MOTION_BASE_R_IN_PREROTATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionBaseRInPrerotation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Import|AdvOptGrp|FileFormat|Acclaim_AMC|MotionBaseRInPrerotation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Fbx")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ASCIIFBX); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("AsciiFbx")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|AsciiFbx")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(2)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("Binary")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("ASCII")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_EXPORT_FILE_VERSION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ExportFileVersion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|ExportFileVersion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(11)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("FBX202000")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("FBX201900")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("FBX201800")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("FBX201600")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("FBX201400")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("FBX201300")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("FBX201200")); + Assert.That(prop.GetEnumValue(7), Is.EqualTo("FBX201100")); + Assert.That(prop.GetEnumValue(8), Is.EqualTo("FBX201000")); + Assert.That(prop.GetEnumValue(9), Is.EqualTo("FBX200900")); + Assert.That(prop.GetEnumValue(10), Is.EqualTo("FBX200611")); + prop = settings.GetProperty("Export|AdvOptGrp|Fbx|VersionsUIAlias"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("VersionsUIAlias")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|VersionsUIAlias")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(11)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("FBX 2020")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("FBX 2019")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("FBX 2018")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("FBX 2016/2017")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("FBX 2014/2015")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("FBX 2013")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("FBX 2012")); + Assert.That(prop.GetEnumValue(7), Is.EqualTo("FBX 2011")); + Assert.That(prop.GetEnumValue(8), Is.EqualTo("FBX 2010")); + Assert.That(prop.GetEnumValue(9), Is.EqualTo("FBX 2009")); + Assert.That(prop.GetEnumValue(10), Is.EqualTo("FBX 2006")); + prop = settings.GetProperty("Export|AdvOptGrp|Fbx|VersionsCompDescriptions"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("VersionsCompDescriptions")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|VersionsCompDescriptions")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxEnum)); + Assert.That(prop.Get(), Is.EqualTo(0)); + Assert.That(prop.GetEnumCount(), Is.EqualTo(11)); + Assert.That(prop.GetEnumValue(0), Is.EqualTo("Compatible with Autodesk 2020 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(1), Is.EqualTo("Compatible with Autodesk 2019 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(2), Is.EqualTo("Compatible with Autodesk 2018 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(3), Is.EqualTo("Compatible with Autodesk 2016/2017 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(4), Is.EqualTo("Compatible with Autodesk 2014/2015 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(5), Is.EqualTo("Compatible with Autodesk 2013 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(6), Is.EqualTo("Compatible with Autodesk 2012 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(7), Is.EqualTo("Compatible with Autodesk 2011 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(8), Is.EqualTo("Compatible with Autodesk 2010 applications/FBX plug-ins and MotionBuilder 2009")); + Assert.That(prop.GetEnumValue(9), Is.EqualTo("Compatible with Autodesk 2009 applications/FBX plug-ins")); + Assert.That(prop.GetEnumValue(10), Is.EqualTo("Compatible with Autodesk 2006 FBX plug-ins and MotionBuilder 7.5, 7.0 and 6.0")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_MODEL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Model")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Model")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_TEXTURE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Texture")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Texture")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_MATERIAL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Material")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Material")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_SHAPE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Shape")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Shape")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_GOBO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Gobo")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Gobo")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_AUDIO); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Audio")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Audio")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_ANIMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Animation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Animation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_CHARACTER); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Character")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Character")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_GLOBAL_SETTINGS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Global_Settings")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Global_Settings")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_PIVOT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Pivot")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Pivot")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_TEMPLATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Template")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Template")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_CONSTRAINT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Constraint")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Constraint")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_EMBEDDED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("EMBEDDED")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|EMBEDDED")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_PASSWORD_ENABLE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Password_Enable")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Password_Enable")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_PASSWORD); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Password")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Password")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_COLLAPSE_EXTERNALS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("COLLAPSE EXTERNALS")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|COLLAPSE EXTERNALS")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_COMPRESS_ARRAYS); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Compress_Arrays")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Compress_Arrays")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_COMPRESS_LEVEL); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Compress_Level")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Compress_Level")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_COMPRESS_MINSIZE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Compress_Minsize")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Compress_Minsize")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(1024)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_FBX_EMBEDDED_PROPERTIES_SKIP); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Embedded_Skipped_Properties")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Fbx|Embedded_Skipped_Properties")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_DXF); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Dxf")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Dxf")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_DXF_DEFORMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Deformation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Dxf|Deformation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_DXF_TRIANGULATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Triangulate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Dxf|Triangulate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_OBJ); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Obj")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Obj")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_OBJ_TRIANGULATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Triangulate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Obj|Triangulate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_OBJ_DEFORMATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Deformation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Obj|Deformation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_COLLADA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Collada")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Collada")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_COLLADA_TRIANGULATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Triangulate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Collada|Triangulate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_COLLADA_SINGLEMATRIX); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SingleMatrix")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Collada|SingleMatrix")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_COLLADA_FRAME_RATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FrameRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|Collada|FrameRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(30.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOTION_BASE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Motion_Base")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_START); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionStart")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionStart")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxTime)); + Assert.That(prop.Get().Get(), Is.EqualTo(0L)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_FRAME_COUNT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameCount")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFrameCount")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxInt)); + Assert.That(prop.Get(), Is.EqualTo(0)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_FROM_GLOBAL_POSITION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFromGlobalPosition")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFromGlobalPosition")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_FRAME_RATE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRate")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionFrameRate")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDouble)); + Assert.That(prop.Get(), Is.EqualTo(30.000000)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_GAPS_AS_VALID_DATA); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionGapsAsValidData")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionGapsAsValidData")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_C3D_REAL_FORMAT); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionC3DRealFormat")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionC3DRealFormat")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_MOB_ASF_SCENE_OWNED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionASFSceneOwned")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Motion_Base|MotionASFSceneOwned")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BIOVISION_BVH); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Biovision_BVH")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Biovision_BVH")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_BIOVISION_BVH_MOTION_TRANSLATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionTranslation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Biovision_BVH|MotionTranslation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty("Export|AdvOptGrp|FileFormat|MotionAnalysis_HTR"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionAnalysis_HTR")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|MotionAnalysis_HTR")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty("Export|AdvOptGrp|FileFormat|MotionAnalysis_TRC"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionAnalysis_TRC")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|MotionAnalysis_TRC")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_ASF); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Acclaim_ASF")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_ASF")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_ASF_MOTION_TRANSLATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionTranslation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionTranslation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_ASF_FRAME_RATE_USED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRateUsed")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionFrameRateUsed")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_ASF_FRAME_RANGE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRange")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionFrameRange")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_ASF_WRITE_DEFAULT_AS_BASE_TR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionWriteDefaultAsBaseTR")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_ASF|MotionWriteDefaultAsBaseTR")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_AMC); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Acclaim_AMC")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_AMC")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_AMC_MOTION_TRANSLATION); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionTranslation")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionTranslation")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_AMC_FRAME_RATE_USED); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRateUsed")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionFrameRateUsed")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_AMC_FRAME_RANGE); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionFrameRange")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionFrameRange")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(true)); + prop = settings.GetProperty(FbxIOSettingsPath.EXP_ACCLAIM_AMC_WRITE_DEFAULT_AS_BASE_TR); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("MotionWriteDefaultAsBaseTR")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Export|AdvOptGrp|FileFormat|Acclaim_AMC|MotionWriteDefaultAsBaseTR")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxBool)); + Assert.That(prop.Get(), Is.EqualTo(false)); + } + + [Test] + public void FbxIOSettings_ELanguage_IdentifiersHaveSpecificValues() + { + // expect: + Assert.That((int)FbxIOSettings.ELanguage.eENU, Is.EqualTo(0)); + Assert.That((int)FbxIOSettings.ELanguage.eDEU, Is.EqualTo(1)); + Assert.That((int)FbxIOSettings.ELanguage.eFRA, Is.EqualTo(2)); + Assert.That((int)FbxIOSettings.ELanguage.eJPN, Is.EqualTo(3)); + Assert.That((int)FbxIOSettings.ELanguage.eKOR, Is.EqualTo(4)); + Assert.That((int)FbxIOSettings.ELanguage.eCHS, Is.EqualTo(5)); + Assert.That((int)FbxIOSettings.ELanguage.ePTB, Is.EqualTo(6)); + Assert.That((int)FbxIOSettings.ELanguage.eLanguageCount, Is.EqualTo(7)); + } + + [Test] + public void FbxIOSettings_AddPropertyGroup_CreatesPropertyGroupNotUnderIOSROOT() + { + // given: + var settings = new FbxIOSettings(""); + var dt = FbxDataTypes.FbxIntDT; + + // when: + var prop = settings.AddPropertyGroup("something", dt); + + // then: + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("something")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("something")); + Assert.True(prop.GetParent().IsValid()); + Assert.True(prop.GetParent().IsRoot()); + } + + [Test] + public void FbxIOSettings_AddPropertGroup_UnderParentCreatesPropertyUnderParent() + { + // given: + var settings = new FbxIOSettings(""); + var dt = FbxDataTypes.FbxIntDT; + var parent = settings.AddPropertyGroup("something", dt); + + // when: + var prop = settings.AddPropertyGroup(parent, "another", dt); + + // then: + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("another")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("something|another")); + } + + [Test] + public void FbxIOSettings_AddPropertGroup_UnderParentParent() + { + // given: + var settings = new FbxIOSettings(""); + var dt = FbxDataTypes.FbxIntDT; + var parent1 = settings.AddPropertyGroup("something", dt); + var parent2 = settings.AddPropertyGroup(parent1, "else", dt); + + // when: + var prop = settings.AddPropertyGroup(parent2, "another", dt); + + // then: + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("another")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("something|else|another")); + } + } +} diff --git a/FbxSharpTests/FbxImporterTest.cs b/FbxSharpTests/FbxImporterTest.cs new file mode 100644 index 0000000..2237bd3 --- /dev/null +++ b/FbxSharpTests/FbxImporterTest.cs @@ -0,0 +1,630 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxImporterTest : TestBase + { + [Test] + public void FbxImporter_Create_AllZero() + { + // given: + var importer = new FbxImporter(""); + + // expect: + Assert.False(importer.IsFBX()); + Assert.That(importer.GetFileFormat(), Is.EqualTo(-1)); + } + + [Test] + public void FbxImporter_IsImporting_UninitializedYieldsFalse() + { + // given: + var importer = new FbxImporter(""); + var result = false; + + // expect: + Assert.False(importer.IsImporting(out result)); + Assert.False(result); + } + + [Test] + public void FbxImporter_GetProgress_UninitializedYieldsZero() + { + // given: + var importer = new FbxImporter(""); + + // expect: + Assert.That(importer.GetProgress(null), Is.EqualTo(0.0)); + } + + [Test] + public void FbxImporter_GetFileVersion_UninitializedYieldsZero() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(0)); + Assert.That(minor, Is.EqualTo(0)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_UninitializedYieldsDefaults() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(false)); + Assert.That(header.mFileVersion, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(false)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(0)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(0)); + Assert.That(header.mCreator, Is.EqualTo("")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetIOSettings_UninitializedYieldsNull() + { + // given: + var importer = new FbxImporter(""); + FbxIOSettings result; + + // when: + result = importer.GetIOSettings(); + + // then: + Assert.Null(result); + } + + [Test] + public void FbxImporter_Initialize_ValidFile_Succeeds1() + { + // given: + var importer = new FbxImporter(""); + bool result; + + // when: + result = importer.Initialize(GetSample("monolith.fbx")); + + // then: + Assert.True(result); + } + + [Test] + public void FbxImporter_Initialize_ValidFile_Succeeds2() + { + // given: + var importer = new FbxImporter(""); + bool result; + + // when: + result = importer.Initialize(GetSample("monolith.fbx")); + + // then: + Assert.That(importer.GetStatus().GetCode(), Is.EqualTo(FbxStatus.EStatusCode.eSuccess)); + } + + [Test] + public void FbxImporter_Initialize_ValidFile_Succeeds3() + { + // given: + var importer = new FbxImporter(""); + bool result; + + // when: + result = importer.Initialize(GetSample("monolith.fbx")); + + // then: + Assert.False(importer.GetStatus().Error()); + } + + [Test] + public void FbxImporter_Initialize_ValidFile_Succeeds4() + { + // given: + var importer = new FbxImporter(""); + bool result; + + // when: + result = importer.Initialize(GetSample("monolith.fbx")); + + // then: + Assert.That(importer.GetStatus().GetErrorString(), Is.EqualTo("")); + } + + [Test] + public void FbxImporter_IsImporting_InitializedYieldsFalse() + { + // given: + var importer = new FbxImporter(""); + var result = false; + importer.Initialize(GetSample("monolith.fbx")); + + // expect: + Assert.False(importer.IsImporting(out result)); + Assert.False(result); + } + + [Test] + public void FbxImporter_GetProgress_InitializedYieldsZero() + { + // given: + var importer = new FbxImporter(""); + importer.Initialize(GetSample("monolith.fbx")); + + // expect: + Assert.That(importer.GetProgress(null), Is.EqualTo(0.0)); + } + + [Test] + public void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + importer.Initialize(GetSample("monolith.fbx")); + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(7)); + Assert.That(minor, Is.EqualTo(4)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6a() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + importer.Initialize(GetSample("monolith_fbx6ascii.fbx")); + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(6)); + Assert.That(minor, Is.EqualTo(1)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile6b() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + importer.Initialize(GetSample("monolith_fbx6binary.fbx")); + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(6)); + Assert.That(minor, Is.EqualTo(1)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7a() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + importer.Initialize(GetSample("monolith_fbx7ascii.fbx")); + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(7)); + Assert.That(minor, Is.EqualTo(7)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileVersion_InitializedYieldsVersionNumbersFromTheFile7b() + { + // given: + var importer = new FbxImporter(""); + var major = 0; + var minor = 0; + var revision = 0; + importer.Initialize(GetSample("monolith_fbx7binary.fbx")); + + // when: + importer.GetFileVersion(out major, out minor, out revision); + + // then: + Assert.That(major, Is.EqualTo(7)); + Assert.That(minor, Is.EqualTo(7)); + Assert.That(revision, Is.EqualTo(0)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + importer.Initialize(GetSample("monolith.fbx")); + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(true)); + Assert.That(header.mFileVersion, Is.EqualTo(7400)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(true)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(2024)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(5)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(13)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(22)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(30)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(25)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(938)); + Assert.That(header.mCreator, Is.EqualTo("Blender (stable FBX IO) - 4.0.1 - 5.8.12")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6a() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + importer.Initialize(GetSample("monolith_fbx6ascii.fbx")); + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(false)); + Assert.That(header.mFileVersion, Is.EqualTo(6100)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(true)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(2024)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(6)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(4)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(2)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(59)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(23)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(0)); + Assert.That(header.mCreator, Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues6b() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + importer.Initialize(GetSample("monolith_fbx6binary.fbx")); + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(true)); + Assert.That(header.mFileVersion, Is.EqualTo(6100)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(true)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(2024)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(6)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(4)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(2)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(59)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(23)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(0)); + Assert.That(header.mCreator, Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7a() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + importer.Initialize(GetSample("monolith_fbx7ascii.fbx")); + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(false)); + Assert.That(header.mFileVersion, Is.EqualTo(7700)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(true)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(2024)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(6)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(4)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(2)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(59)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(23)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(0)); + Assert.That(header.mCreator, Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetFileHeaderInfo_InitializedYieldsValues7b() + { + // given: + var importer = new FbxImporter(""); + FbxIOFileHeaderInfo header; + importer.Initialize(GetSample("monolith_fbx7binary.fbx")); + + // when: + header = importer.GetFileHeaderInfo(); + + // then: + Assert.NotNull(header); + Assert.That(header.mDefaultRenderResolution.mIsOK, Is.EqualTo(false)); + Assert.That(header.mDefaultRenderResolution.mCameraName, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionMode, Is.EqualTo("")); + Assert.That(header.mDefaultRenderResolution.mResolutionW, Is.EqualTo(0.0)); + Assert.That(header.mDefaultRenderResolution.mResolutionH, Is.EqualTo(0.0)); + Assert.That(header.mBinary, Is.EqualTo(true)); + Assert.That(header.mFileVersion, Is.EqualTo(7700)); + Assert.That(header.mCreationTimeStampPresent, Is.EqualTo(true)); + Assert.That(header.mCreationTimeStamp.mYear, Is.EqualTo(2024)); + Assert.That(header.mCreationTimeStamp.mMonth, Is.EqualTo(6)); + Assert.That(header.mCreationTimeStamp.mDay, Is.EqualTo(4)); + Assert.That(header.mCreationTimeStamp.mHour, Is.EqualTo(2)); + Assert.That(header.mCreationTimeStamp.mMinute, Is.EqualTo(59)); + Assert.That(header.mCreationTimeStamp.mSecond, Is.EqualTo(23)); + Assert.That(header.mCreationTimeStamp.mMillisecond, Is.EqualTo(0)); + Assert.That(header.mCreator, Is.EqualTo("FBX SDK/FBX Plugins version 2020.3.4")); + Assert.That(header.mIOPlugin, Is.EqualTo(false)); + Assert.That(header.mPLE, Is.EqualTo(false)); + } + + [Test] + public void FbxImporter_GetIOSettings_InitializedYieldsAnObject() + { + // given: + var importer = new FbxImporter(""); + FbxIOSettings result; + FbxIOSettings result2; + importer.Initialize(GetSample("monolith.fbx")); + + // when: + result = importer.GetIOSettings(); + + // then: + Assert.NotNull(result); + Assert.That(result.GetName(), Is.EqualTo("IOSRoot")); + + // when: + result2 = importer.GetIOSettings(); + + // then: + // it's the same object; + Assert.That(result2, Is.EqualTo(result)); + } + + [Test] + public void FbxImporter_ImportAsciiFile_DoesNotFail_1() + { + // given: + var importer = new FbxImporter(""); + importer.Initialize(GetSample("empty_7a.fbx")); + var scene = new FbxScene(""); + bool result; + + // when: + result = importer.Import(scene); + // then: + Assert.True(result); + var docinfo = scene.GetDocumentInfo(); + Assert.That(CountProperties(docinfo), Is.EqualTo(15)); + FbxProperty prop; + + prop = docinfo.FindProperty("DocumentUrl"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DocumentUrl")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("DocumentUrl")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("empty_7a.fbx")); + + prop = docinfo.FindProperty("SrcDocumentUrl"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SrcDocumentUrl")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("SrcDocumentUrl")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("empty_7a.fbx")); + + prop = docinfo.FindProperty("Original"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("Original")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxUndefined)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationVendor"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationVendor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original|ApplicationVendor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationName"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationName")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original|ApplicationName")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("Original|ApplicationVersion"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationVersion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original|ApplicationVersion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("Original|DateTime_GMT"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DateTime_GMT")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original|DateTime_GMT")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDateTime)); + Assert.That(prop.Get(), Is.EqualTo(new FbxDateTime())); + + prop = docinfo.FindPropertyHierarchical("Original|FileName"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("FileName")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("Original|FileName")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindProperty("LastSaved"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("LastSaved")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("LastSaved")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxUndefined)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationVendor"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationVendor")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("LastSaved|ApplicationVendor")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationName"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationName")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("LastSaved|ApplicationName")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("LastSaved|ApplicationVersion"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("ApplicationVersion")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("LastSaved|ApplicationVersion")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindPropertyHierarchical("LastSaved|DateTime_GMT"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DateTime_GMT")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("LastSaved|DateTime_GMT")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxDateTime)); + Assert.That(prop.Get(), Is.EqualTo(new FbxDateTime())); + + prop = docinfo.FindProperty("DocumentEmbeddedUrl"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("DocumentEmbeddedUrl")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("DocumentEmbeddedUrl")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxString)); + Assert.That(prop.Get(), Is.EqualTo("")); + + prop = docinfo.FindProperty("SceneThumbnail"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("SceneThumbnail")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("SceneThumbnail")); + Assert.That(prop.GetPropertyDataType().GetFbxType(), Is.EqualTo(EFbxType.eFbxReference)); + Assert.That(prop.Get(), Is.EqualTo(null)); + } + + [Test] + public void FbxImporter_ImportBinaryFile_DoesNotFail_1() + { + // given: + var importer = new FbxImporter(""); + importer.Initialize(GetSample("empty_7b.fbx")); + var scene = new FbxScene(""); + bool result; + + // when: + result = importer.Import(scene); + // then: + Assert.True(result); + var docinfo = scene.GetDocumentInfo(); + Assert.That(CountProperties(docinfo), Is.EqualTo(15)); + FbxProperty prop; + } + + [Test] + public void FbxImporter_Import_DoubleColonInStringHasOddEncoding() + { + // given: + var importer = new FbxImporter(""); + importer.Initialize(GetSample("hierarchy_string_1_7b.fbx")); + var scene = new FbxScene(""); + bool result; + + // when: + result = importer.Import(scene); + // then: + Assert.True(result); + var prop = scene.GetDocumentInfo().FindProperty("CustomProp"); + Assert.True(prop.IsValid()); + Assert.That(prop.Get(), Is.EqualTo("Abc::Def")); + } + } +} diff --git a/FbxSharpTests/FbxNullTest.cs b/FbxSharpTests/FbxNullTest.cs new file mode 100644 index 0000000..fa765b3 --- /dev/null +++ b/FbxSharpTests/FbxNullTest.cs @@ -0,0 +1,60 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxNullTest : TestBase + { + [Test] + public void FbxNull_StaticInitialization() + { + // expect: + Assert.AreEqual(100.0d, FbxNull.sDefaultSize); + Assert.AreEqual(FbxNull.ELook.eCross, FbxNull.sDefaultLook); + Assert.AreEqual("Size", FbxNull.sSize); + Assert.AreEqual("Look", FbxNull.sLook); + } + + [Test] + public void FbxNull_Create_SetsDefaults() + { + // given: + // when: + var n = new FbxNull("name"); + // then: + Assert.AreEqual("name", n.GetName()); + Assert.AreEqual(100.0d, n.GetSizeDefaultValue()); + Assert.AreEqual(100.0d, n.Size.Get()); + Assert.AreEqual(FbxNull.ELook.eCross, n.Look.Get()); + } + + [Test] + public void FbxNull_Reset_ResetsPropertyValues() + { + // given: + var n = new FbxNull(""); + n.Size.Set(234); + n.Look.Set(FbxNull.ELook.eNone); + // require: + Assert.AreEqual(234.0d, n.Size.Get()); + Assert.AreEqual(FbxNull.ELook.eNone, n.Look.Get()); + // when: + n.Reset(); + // then: + Assert.AreEqual(FbxNull.sDefaultSize, n.Size.Get()); + Assert.AreEqual(FbxNull.sDefaultLook, n.Look.Get()); + } + + [Test] + public void FbxNull_Create_HasNamespacePrefix() + { + // given: + var obj = new FbxNull("asdf"); + + // then: + Assert.AreEqual("NodeAttribute::", obj.GetNameSpacePrefix());; + } + } +} diff --git a/FbxSharpTests/FbxObjectTest.cs b/FbxSharpTests/FbxObjectTest.cs index 2a8cbe3..f16c143 100644 --- a/FbxSharpTests/FbxObjectTest.cs +++ b/FbxSharpTests/FbxObjectTest.cs @@ -815,5 +815,211 @@ public void FbxObject_TypedDisconnectAllDstObjectWithInheritance_DisconnectsAllD Assert.AreEqual(1, node.GetSrcObjectCount()); Assert.AreEqual(0, light.GetSrcObjectCount()); } + + [Test] + public void FbxObject_FindPropertyHierarchical_FindsChildren() + { + // given: + var obj = new FbxObject(""); + var prop1 = FbxProperty.Create(obj, FbxDataTypes.FbxStringDT, "Abc"); + var prop2 = FbxProperty.Create(prop1, FbxDataTypes.FbxStringDT, "Def"); + var prop3 = FbxProperty.Create(prop2, FbxDataTypes.FbxStringDT, "Ghi"); + + // require: + Assert.AreEqual("Abc", prop1.GetName()); + Assert.AreEqual("Abc", prop1.GetHierarchicalName()); + Assert.AreEqual("Def", prop2.GetName()); + Assert.AreEqual("Abc|Def", prop2.GetHierarchicalName()); + Assert.AreEqual("Ghi", prop3.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + var prop = obj.FindPropertyHierarchical("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Abc", prop.GetName()); + Assert.AreEqual("Abc", prop.GetHierarchicalName()); + Assert.True(prop == prop1); + + // when: + prop = obj.FindProperty("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == prop1); + + // when: + prop = obj.FindPropertyHierarchical("Abc|Def"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Def", prop.GetName()); + Assert.AreEqual("Abc|Def", prop.GetHierarchicalName()); + Assert.True(prop == prop2); + + // when: + prop = obj.FindProperty("Def"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = obj.FindPropertyHierarchical("Abc|Def|Ghi"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Ghi", prop.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop.GetHierarchicalName()); + Assert.True(prop == prop3); + + // when: + prop = obj.FindProperty("Ghi"); + + // then: + Assert.False(prop.IsValid()); + } + + [Test] + public void FbxObject_FindProperty_DoesNotFindsChildren() + { + // given: + var obj = new FbxObject(""); + var prop1 = FbxProperty.Create(obj, FbxDataTypes.FbxStringDT, "Abc"); + var prop2 = FbxProperty.Create(prop1, FbxDataTypes.FbxStringDT, "Def"); + var prop3 = FbxProperty.Create(prop2, FbxDataTypes.FbxStringDT, "Ghi"); + + // require: + Assert.AreEqual("Abc", prop1.GetName()); + Assert.AreEqual("Abc", prop1.GetHierarchicalName()); + Assert.AreEqual("Def", prop2.GetName()); + Assert.AreEqual("Abc|Def", prop2.GetHierarchicalName()); + Assert.AreEqual("Ghi", prop3.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + var prop = obj.FindProperty("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Abc", prop.GetName()); + Assert.AreEqual("Abc", prop.GetHierarchicalName()); + Assert.True(prop == prop1); + + // when: + prop = obj.FindProperty("Def"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = obj.FindProperty("Ghi"); + + // then: + Assert.False(prop.IsValid()); + } + + [Test] + public void FbxObject_RootProperty_FindHierarchical_FindsChildren() + { + // given: + var obj = new FbxObject(""); + var prop1 = FbxProperty.Create(obj, FbxDataTypes.FbxStringDT, "Abc"); + var prop2 = FbxProperty.Create(prop1, FbxDataTypes.FbxStringDT, "Def"); + var prop3 = FbxProperty.Create(prop2, FbxDataTypes.FbxStringDT, "Ghi"); + + // require: + Assert.AreEqual("Abc", prop1.GetName()); + Assert.AreEqual("Abc", prop1.GetHierarchicalName()); + Assert.AreEqual("Def", prop2.GetName()); + Assert.AreEqual("Abc|Def", prop2.GetHierarchicalName()); + Assert.AreEqual("Ghi", prop3.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + var prop = obj.RootProperty.FindHierarchical("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Abc", prop.GetName()); + Assert.AreEqual("Abc", prop.GetHierarchicalName()); + Assert.True(prop == prop1); + + // when: + prop = obj.RootProperty.Find("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == prop1); + + // when: + prop = obj.RootProperty.FindHierarchical("Abc|Def"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Def", prop.GetName()); + Assert.AreEqual("Abc|Def", prop.GetHierarchicalName()); + Assert.True(prop == prop2); + + // when: + prop = obj.RootProperty.Find("Def"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = obj.RootProperty.FindHierarchical("Abc|Def|Ghi"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Ghi", prop.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop.GetHierarchicalName()); + Assert.True(prop == prop3); + + // when: + prop = obj.RootProperty.Find("Ghi"); + + // then: + Assert.False(prop.IsValid()); + } + + [Test] + public void FbxObject_RootProperty_Find_DoesNotFindsChildren() + { + // given: + var obj = new FbxObject(""); + var prop1 = FbxProperty.Create(obj, FbxDataTypes.FbxStringDT, "Abc"); + var prop2 = FbxProperty.Create(prop1, FbxDataTypes.FbxStringDT, "Def"); + var prop3 = FbxProperty.Create(prop2, FbxDataTypes.FbxStringDT, "Ghi"); + + // require: + Assert.AreEqual("Abc", prop1.GetName()); + Assert.AreEqual("Abc", prop1.GetHierarchicalName()); + Assert.AreEqual("Def", prop2.GetName()); + Assert.AreEqual("Abc|Def", prop2.GetHierarchicalName()); + Assert.AreEqual("Ghi", prop3.GetName()); + Assert.AreEqual("Abc|Def|Ghi", prop3.GetHierarchicalName()); + + // when: + var prop = obj.RootProperty.Find("Abc"); + + // then: + Assert.True(prop.IsValid()); + Assert.AreEqual("Abc", prop.GetName()); + Assert.AreEqual("Abc", prop.GetHierarchicalName()); + Assert.True(prop == prop1); + + // when: + prop = obj.RootProperty.Find("Def"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = obj.RootProperty.Find("Ghi"); + + // then: + Assert.False(prop.IsValid()); + } } } diff --git a/FbxSharpTests/FbxPropertyFlagsTest.cs b/FbxSharpTests/FbxPropertyFlagsTest.cs new file mode 100644 index 0000000..d784efa --- /dev/null +++ b/FbxSharpTests/FbxPropertyFlagsTest.cs @@ -0,0 +1,62 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxPropertyFlagsTest : TestBase + { + [Test] + public void FbxPropertyFlags_EInheritType_IdentifiersHaveSpecificValues() + { + // expect: + Assert.That((int)FbxPropertyFlags.EInheritType.eOverride, Is.EqualTo(0)); + Assert.That((int)FbxPropertyFlags.EInheritType.eInherit, Is.EqualTo(1)); + Assert.That((int)FbxPropertyFlags.EInheritType.eDeleted, Is.EqualTo(2)); + } + + [Test] + public void FbxPropertyFlags_EFlags_IdentifiersHaveSpecificValues() + { + // expect: + Assert.That((int)FbxPropertyFlags.EFlags.eNone, Is.EqualTo(0)); + Assert.That((int)FbxPropertyFlags.EFlags.eStatic, Is.EqualTo(1)); + Assert.That((int)FbxPropertyFlags.EFlags.eAnimatable, Is.EqualTo(2)); + Assert.That((int)FbxPropertyFlags.EFlags.eAnimated, Is.EqualTo(4)); + Assert.That((int)FbxPropertyFlags.EFlags.eImported, Is.EqualTo(8)); + Assert.That((int)FbxPropertyFlags.EFlags.eUserDefined, Is.EqualTo(16)); + Assert.That((int)FbxPropertyFlags.EFlags.eHidden, Is.EqualTo(32)); + Assert.That((int)FbxPropertyFlags.EFlags.eNotSavable, Is.EqualTo(64)); + + Assert.That((int)FbxPropertyFlags.EFlags.eLockedMember0, Is.EqualTo(128)); + Assert.That((int)FbxPropertyFlags.EFlags.eLockedMember1, Is.EqualTo(256)); + Assert.That((int)FbxPropertyFlags.EFlags.eLockedMember2, Is.EqualTo(512)); + Assert.That((int)FbxPropertyFlags.EFlags.eLockedMember3, Is.EqualTo(1024)); + Assert.That((int)FbxPropertyFlags.EFlags.eLockedAll, Is.EqualTo(1920)); + + Assert.That((int)FbxPropertyFlags.EFlags.eMutedMember0, Is.EqualTo(2048)); + Assert.That((int)FbxPropertyFlags.EFlags.eMutedMember1, Is.EqualTo(4096)); + Assert.That((int)FbxPropertyFlags.EFlags.eMutedMember2, Is.EqualTo(8192)); + Assert.That((int)FbxPropertyFlags.EFlags.eMutedMember3, Is.EqualTo(16384)); + Assert.That((int)FbxPropertyFlags.EFlags.eMutedAll, Is.EqualTo(30720)); + + Assert.That((int)FbxPropertyFlags.EFlags.eUIDisabled, Is.EqualTo(32768)); + Assert.That((int)FbxPropertyFlags.EFlags.eUIGroup, Is.EqualTo(65536)); + Assert.That((int)FbxPropertyFlags.EFlags.eUIBoolGroup, Is.EqualTo(131072)); + Assert.That((int)FbxPropertyFlags.EFlags.eUIExpanded, Is.EqualTo(262144)); + Assert.That((int)FbxPropertyFlags.EFlags.eUINoCaption, Is.EqualTo(524288)); + Assert.That((int)FbxPropertyFlags.EFlags.eUIPanel, Is.EqualTo(1048576)); + Assert.That((int)FbxPropertyFlags.EFlags.eUILeftLabel, Is.EqualTo(2097152)); + Assert.That((int)FbxPropertyFlags.EFlags.eUIHidden, Is.EqualTo(4194304)); + + Assert.That((int)FbxPropertyFlags.EFlags.eCtrlFlags, Is.EqualTo(32767)); + + Assert.That((int)FbxPropertyFlags.EFlags.eUIFlags, Is.EqualTo(8355840)); + + Assert.That((int)FbxPropertyFlags.EFlags.eAllFlags, Is.EqualTo(8388607)); + + Assert.That((int)FbxPropertyFlags.EFlags.eFlagCount, Is.EqualTo(23)); + } + } +} diff --git a/FbxSharpTests/FbxPropertyTest.cs b/FbxSharpTests/FbxPropertyTest.cs new file mode 100644 index 0000000..3ab8b50 --- /dev/null +++ b/FbxSharpTests/FbxPropertyTest.cs @@ -0,0 +1,140 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxPropertyTest : TestBase + { + [Test] + public void FbxProperty_Create_HasDefaults() + { + // given: + var obj = new FbxObject(""); + var dt = FbxDataTypes.FbxIntDT; + // when: + var prop = FbxProperty.Create(obj, dt, "prop"); + // then: + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("prop")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("prop")); + Assert.True(prop.GetParent().IsValid()); + Assert.False(prop.IsRoot()); + Assert.True(prop.GetParent().IsRoot()); + Assert.False(prop.GetChild().IsValid()); + Assert.False(prop.GetSibling().IsValid()); + Assert.False(prop.GetFirstDescendent().IsValid()); + } + + [Test] + public void FbxProperty_Create_WithParentSetsParent() + { + // given: + var obj = new FbxObject(""); + var dt = FbxDataTypes.FbxIntDT; + var parent = FbxProperty.Create(obj, dt, "parent"); + // when: + var prop = FbxProperty.Create(parent, dt, "prop"); + Assert.True(prop.IsValid()); + Assert.That(prop.GetName(), Is.EqualTo("prop")); + Assert.That(prop.GetHierarchicalName(), Is.EqualTo("parent|prop")); + Assert.True(prop.GetParent().IsValid()); + Assert.That(prop.GetParent().GetHierarchicalName(), Is.EqualTo("parent")); + Assert.False(prop.IsRoot()); + Assert.False(prop.GetChild().IsValid()); + Assert.False(prop.GetSibling().IsValid()); + Assert.False(prop.GetFirstDescendent().IsValid()); + Assert.True(prop.IsChildOf(parent)); + Assert.True(prop.IsDescendentOf(parent)); + Assert.True(parent.GetChild().IsValid()); + Assert.That(parent.GetChild().GetHierarchicalName(), Is.EqualTo("parent|prop")); + Assert.True(parent.GetFirstDescendent().IsValid()); + Assert.That(parent.GetFirstDescendent().GetHierarchicalName(), Is.EqualTo("parent|prop")); + } + + [Test] + public void FbxProperty_Find_FindsChildren() + { + // given: + var obj = new FbxObject(""); + var dt = FbxDataTypes.FbxIntDT; + var parent = FbxProperty.Create(obj, dt, "parent"); + var child = FbxProperty.Create(parent, dt, "child"); + + // when: + var prop = parent.Find("child"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == child); + + // when: + prop = parent.Find("something else"); + + // then: + Assert.False(prop.IsValid()); + } + + [Test] + public void FbxProperty_Find_DoesNotFindGrandchildren() + { + // given: + var obj = new FbxObject(""); + var dt = FbxDataTypes.FbxIntDT; + var parent = FbxProperty.Create(obj, dt, "parent"); + var child = FbxProperty.Create(parent, dt, "child"); + var grandchild = FbxProperty.Create(child, dt, "grandchild"); + + // when: + var prop = parent.Find("grandchild"); + + // then: + Assert.False(prop.IsValid()); + } + + [Test] + public void FbxProperty_FindHierarchical_FindsDescendants() + { + // given: + var obj = new FbxObject(""); + var dt = FbxDataTypes.FbxIntDT; + var parent = FbxProperty.Create(obj, dt, "parent"); + var child = FbxProperty.Create(parent, dt, "child"); + var grandchild = FbxProperty.Create(child, dt, "grandchild"); + + // when: + var prop = parent.FindHierarchical("child"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == child); + + // when: + prop = parent.FindHierarchical("child|grandchild"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == grandchild); + + // when: + prop = parent.FindHierarchical("parent|child|grandchild"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = parent.FindHierarchical("grandchild"); + + // then: + Assert.False(prop.IsValid()); + + // when: + prop = child.FindHierarchical("grandchild"); + + // then: + Assert.True(prop.IsValid()); + Assert.True(prop == grandchild); + } + } +} diff --git a/FbxSharpTests/FbxSystemUnitTest.cs b/FbxSharpTests/FbxSystemUnitTest.cs new file mode 100644 index 0000000..3a6bdb4 --- /dev/null +++ b/FbxSharpTests/FbxSystemUnitTest.cs @@ -0,0 +1,87 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxSystemUnitTest : TestBase + { + [Test] + public void FbxSystemUnit_Create_HasDefaults() + { + // given: + FbxSystemUnit obj; + + // when: + obj = new FbxSystemUnit(); + + // then: + Assert.That(obj.GetScaleFactor(), Is.EqualTo(1.0d)); + Assert.That(obj.GetScaleFactorAsString(), Is.EqualTo("cm")); + Assert.That(obj.GetScaleFactorAsString_Plurial(), Is.EqualTo("Centimeters")); + Assert.That(obj.GetMultiplier(), Is.EqualTo(1.0d)); + } + + [Test] + public void FbxSystemUnit_StaticBuiltinsHaveDefaults() + { + // given: + FbxSystemUnit obj; + + // when: + obj = new FbxSystemUnit(); + + // then: + Assert.That(FbxSystemUnit.mm.GetScaleFactor(), Is.EqualTo(0.1d)); + Assert.That(FbxSystemUnit.mm.GetScaleFactorAsString(), Is.EqualTo("mm")); + Assert.That(FbxSystemUnit.mm.GetScaleFactorAsString_Plurial(), Is.EqualTo("Millimeters")); + Assert.That(FbxSystemUnit.mm.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.dm.GetScaleFactor(), Is.EqualTo(10.0d)); + Assert.That(FbxSystemUnit.dm.GetScaleFactorAsString(), Is.EqualTo("dm")); + Assert.That(FbxSystemUnit.dm.GetScaleFactorAsString_Plurial(), Is.EqualTo("Decimeters")); + Assert.That(FbxSystemUnit.dm.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.cm.GetScaleFactor(), Is.EqualTo(1.0d)); + Assert.That(FbxSystemUnit.cm.GetScaleFactorAsString(), Is.EqualTo("cm")); + Assert.That(FbxSystemUnit.cm.GetScaleFactorAsString_Plurial(), Is.EqualTo("Centimeters")); + Assert.That(FbxSystemUnit.cm.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.m.GetScaleFactor(), Is.EqualTo(100.0d)); + Assert.That(FbxSystemUnit.m.GetScaleFactorAsString(), Is.EqualTo("m")); + Assert.That(FbxSystemUnit.m.GetScaleFactorAsString_Plurial(), Is.EqualTo("Meters")); + Assert.That(FbxSystemUnit.m.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.km.GetScaleFactor(), Is.EqualTo(100000.0d)); + Assert.That(FbxSystemUnit.km.GetScaleFactorAsString(), Is.EqualTo("km")); + Assert.That(FbxSystemUnit.km.GetScaleFactorAsString_Plurial(), Is.EqualTo("Kilometers")); + Assert.That(FbxSystemUnit.km.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.Inch.GetScaleFactor(), Is.EqualTo(2.54d)); + Assert.That(FbxSystemUnit.Inch.GetScaleFactorAsString(), Is.EqualTo("in")); + Assert.That(FbxSystemUnit.Inch.GetScaleFactorAsString_Plurial(), Is.EqualTo("Inches")); + Assert.That(FbxSystemUnit.Inch.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.Foot.GetScaleFactor(), Is.EqualTo(30.48d)); + Assert.That(FbxSystemUnit.Foot.GetScaleFactorAsString(), Is.EqualTo("ft")); + Assert.That(FbxSystemUnit.Foot.GetScaleFactorAsString_Plurial(), Is.EqualTo("Feet")); + Assert.That(FbxSystemUnit.Foot.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.Mile.GetScaleFactor(), Is.EqualTo(160934.4d)); + Assert.That(FbxSystemUnit.Mile.GetScaleFactorAsString(), Is.EqualTo("mi")); + Assert.That(FbxSystemUnit.Mile.GetScaleFactorAsString_Plurial(), Is.EqualTo("Miles")); + Assert.That(FbxSystemUnit.Mile.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.Yard.GetScaleFactor(), Is.EqualTo(91.44d)); + Assert.That(FbxSystemUnit.Yard.GetScaleFactorAsString(), Is.EqualTo("yd")); + Assert.That(FbxSystemUnit.Yard.GetScaleFactorAsString_Plurial(), Is.EqualTo("Yards")); + Assert.That(FbxSystemUnit.Yard.GetMultiplier(), Is.EqualTo(1.0d)); + + Assert.That(FbxSystemUnit.sPredefinedUnits.GetScaleFactor(), Is.EqualTo(0.1d)); + Assert.That(FbxSystemUnit.sPredefinedUnits.GetScaleFactorAsString(), Is.EqualTo("mm")); + Assert.That(FbxSystemUnit.sPredefinedUnits.GetScaleFactorAsString_Plurial(), Is.EqualTo("Millimeters")); + Assert.That(FbxSystemUnit.sPredefinedUnits.GetMultiplier(), Is.EqualTo(1.0d)); + } + } +} diff --git a/FbxSharpTests/FbxTimeCodeTest.cs b/FbxSharpTests/FbxTimeCodeTest.cs new file mode 100644 index 0000000..45c8b46 --- /dev/null +++ b/FbxSharpTests/FbxTimeCodeTest.cs @@ -0,0 +1,20 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxTimeCodeTest : TestBase + { + [Test] + public void FbxTimeCode_Constants() + { + // expect: + Assert.That(FbxTimeCode.FBXSDK_TC_MILLISECOND, Is.EqualTo(141120L)); + Assert.That(FbxTimeCode.FBXSDK_TC_SECOND, Is.EqualTo(141120000L)); + Assert.That(FbxTimeCode.FBXSDK_TC_LEGACY_MILLISECOND, Is.EqualTo(46186158L)); + Assert.That(FbxTimeCode.FBXSDK_TC_LEGACY_SECOND, Is.EqualTo(46186158000L)); + } + } +} diff --git a/FbxSharpTests/FbxTimeSpanTest.cs b/FbxSharpTests/FbxTimeSpanTest.cs new file mode 100644 index 0000000..3c91043 --- /dev/null +++ b/FbxSharpTests/FbxTimeSpanTest.cs @@ -0,0 +1,50 @@ +using System; +using NUnit.Framework; +using FbxSharp; + +namespace FbxSharpTests +{ + [TestFixture] + public class FbxTimeSpanTest : TestBase + { + [Test] + public void FbxTimeSpan_Create_HasDefaults() + { + // given: + FbxTimeSpan ts; + ts = new FbxTimeSpan(); + + // expect: + Assert.That(ts.GetStart().Get(), Is.EqualTo(0L)); + Assert.That(ts.GetStop().Get(), Is.EqualTo(0L)); + Assert.That(ts.GetDuration().Get(), Is.EqualTo(0L)); + Assert.That(ts.GetSignedDuration().Get(), Is.EqualTo(0L)); + Assert.That(ts.GetDirection(), Is.EqualTo(1)); + } + + [Test] + public void FbxTimeSpan_Create_WithArguments() + { + // given: + FbxTimeSpan ts; + + // when: + ts = new FbxTimeSpan(new FbxTime(141120000L), new FbxTime(423360000L)); + // then: + Assert.That(ts.GetStart().Get(), Is.EqualTo(141120000L)); + Assert.That(ts.GetStop().Get(), Is.EqualTo(423360000L)); + Assert.That(ts.GetDuration().Get(), Is.EqualTo(282240000L)); + Assert.That(ts.GetSignedDuration().Get(), Is.EqualTo(282240000L)); + Assert.That(ts.GetDirection(), Is.EqualTo(1)); + + // when: + ts = new FbxTimeSpan(new FbxTime(423360000L), new FbxTime(141120000L)); + // then: + Assert.That(ts.GetStart().Get(), Is.EqualTo(423360000L)); + Assert.That(ts.GetStop().Get(), Is.EqualTo(141120000L)); + Assert.That(ts.GetDuration().Get(), Is.EqualTo(-282240000L)); + Assert.That(ts.GetSignedDuration().Get(), Is.EqualTo(-282240000L)); + Assert.That(ts.GetDirection(), Is.EqualTo(-1)); + } + } +} diff --git a/FbxSharpTests/FbxTimeTest.cs b/FbxSharpTests/FbxTimeTest.cs index e646c38..63840b6 100644 --- a/FbxSharpTests/FbxTimeTest.cs +++ b/FbxSharpTests/FbxTimeTest.cs @@ -7,14 +7,6 @@ namespace FbxSharpTests [TestFixture] public class FbxTimeTest : TestBase { - [Test] - public void FbxTime_Constants() - { - // expect: - Assert.AreEqual(141120L, FbxTime.FBXSDK_TC_MILLISECOND); - Assert.AreEqual(141120000L, FbxTime.FBXSDK_TC_SECOND); - } - [Test] public void FbxTime_CreateLongLong_HasSeconds() { @@ -382,5 +374,207 @@ public void FbxTime_GetGlobalTimeMode() // expect: Assert.AreEqual(FbxTime.EMode.eFrames30, FbxTime.GetGlobalTimeMode()); } + + [Test] + public void FbxTime_Get_YieldsInternalRepresentation() + { + // when: + var time = new FbxTime(0L); + // then: + Assert.That(time.Get(), Is.EqualTo(0L)); + // when: + time = new FbxTime(1L); + // then: + Assert.That(time.Get(), Is.EqualTo(1L)); + // when: + time = new FbxTime(2L); + // then: + Assert.That(time.Get(), Is.EqualTo(2L)); + // when: + time = new FbxTime(141119999L); + // then: + Assert.That(time.Get(), Is.EqualTo(141119999L)); + // when: + time = new FbxTime(141120000L); + // then: + Assert.That(time.Get(), Is.EqualTo(141120000L)); + // when: + time = new FbxTime(141120001L); + // then: + Assert.That(time.Get(), Is.EqualTo(141120001L)); + // when: + time = new FbxTime(-1L); + // then: + Assert.That(time.Get(), Is.EqualTo(-1L)); + // when: + time = new FbxTime(-2L); + // then: + Assert.That(time.Get(), Is.EqualTo(-2L)); + // when: + time = new FbxTime(-141119999L); + // then: + Assert.That(time.Get(), Is.EqualTo(-141119999L)); + // when: + time = new FbxTime(-141120000L); + // then: + Assert.That(time.Get(), Is.EqualTo(-141120000L)); + // when: + time = new FbxTime(-141120001L); + // then: + Assert.That(time.Get(), Is.EqualTo(-141120001L)); + } + + [Test] + public void FbxTime_CountFunctionAreIndependent() + { + // when: + var time = new FbxTime(516640320000L); + // then: + Assert.That(time.GetMilliSeconds(), Is.EqualTo(3661000L)); + Assert.That(time.GetSecondCount(), Is.EqualTo(3661)); + Assert.That(time.GetMinuteCount(), Is.EqualTo(61)); + Assert.That(time.GetHourCount(), Is.EqualTo(1)); + Assert.That(time.GetSecondDouble(), Is.EqualTo(3661.0)); + + // when: + time = new FbxTime(516640461120L); + Assert.That(time.GetMilliSeconds(), Is.EqualTo(3661001L)); + Assert.That(time.GetSecondCount(), Is.EqualTo(3661)); + Assert.That(time.GetMinuteCount(), Is.EqualTo(61)); + Assert.That(time.GetHourCount(), Is.EqualTo(1)); + Assert.That(time.GetSecondDouble(), Is.EqualTo(3661.001)); + } + + [Test] + public void FbxTime_EMode_Values() + { + // expect: + Assert.That((int)FbxTime.EMode.eDefaultMode, Is.EqualTo(0)); + Assert.That((int)FbxTime.EMode.eFrames120, Is.EqualTo(1)); + Assert.That((int)FbxTime.EMode.eFrames100, Is.EqualTo(2)); + Assert.That((int)FbxTime.EMode.eFrames60, Is.EqualTo(3)); + Assert.That((int)FbxTime.EMode.eFrames50, Is.EqualTo(4)); + Assert.That((int)FbxTime.EMode.eFrames48, Is.EqualTo(5)); + Assert.That((int)FbxTime.EMode.eFrames30, Is.EqualTo(6)); + Assert.That((int)FbxTime.EMode.eFrames30Drop, Is.EqualTo(7)); + Assert.That((int)FbxTime.EMode.eNTSCDropFrame, Is.EqualTo(8)); + Assert.That((int)FbxTime.EMode.eNTSCFullFrame, Is.EqualTo(9)); + Assert.That((int)FbxTime.EMode.ePAL, Is.EqualTo(10)); + Assert.That((int)FbxTime.EMode.eFrames24, Is.EqualTo(11)); + Assert.That((int)FbxTime.EMode.eFrames1000, Is.EqualTo(12)); + Assert.That((int)FbxTime.EMode.eFilmFullFrame, Is.EqualTo(13)); + Assert.That((int)FbxTime.EMode.eCustom, Is.EqualTo(14)); + Assert.That((int)FbxTime.EMode.eFrames96, Is.EqualTo(15)); + Assert.That((int)FbxTime.EMode.eFrames72, Is.EqualTo(16)); + Assert.That((int)FbxTime.EMode.eFrames59dot94, Is.EqualTo(17)); + Assert.That((int)FbxTime.EMode.eFrames119dot88, Is.EqualTo(18)); + Assert.That((int)FbxTime.EMode.eModesCount, Is.EqualTo(19)); + } + + [Test] + public void FbxTime_EProtocol_Values() + { + // expect: + Assert.That((int)FbxTime.EProtocol.eSMPTE, Is.EqualTo(0)); + Assert.That((int)FbxTime.EProtocol.eFrameCount, Is.EqualTo(1)); + Assert.That((int)FbxTime.EProtocol.eDefaultProtocol, Is.EqualTo(2)); + } + + [Test] + public void FbxTime_GetOneFrameValue() + { + // expect: + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eDefaultMode), Is.EqualTo(4704000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames120), Is.EqualTo(1176000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames100), Is.EqualTo(1411200L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames60), Is.EqualTo(2352000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames50), Is.EqualTo(2822400L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames48), Is.EqualTo(2940000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames30), Is.EqualTo(4704000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames30Drop), Is.EqualTo(0L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eNTSCDropFrame), Is.EqualTo(4708704L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eNTSCFullFrame), Is.EqualTo(4708704L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.ePAL), Is.EqualTo(5644800L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames24), Is.EqualTo(5880000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames1000), Is.EqualTo(141120L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFilmFullFrame), Is.EqualTo(5885880L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eCustom), Is.EqualTo(11289600L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames96), Is.EqualTo(1470000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames72), Is.EqualTo(1960000L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames59dot94), Is.EqualTo(2354352L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eFrames119dot88), Is.EqualTo(1177176L)); + Assert.That(FbxTime.GetOneFrameValue(FbxTime.EMode.eModesCount), Is.EqualTo(0L)); + } + + [Test] + public void FbxTime_GetGlobalTimeProtocol() + { + // expect: + Assert.That(FbxTime.GetGlobalTimeProtocol(), Is.EqualTo(FbxTime.EProtocol.eFrameCount)); + } + + [Test] + public void FbxTime_GetFrameRate() + { + // expect: + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eDefaultMode), Is.EqualTo(30.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames120), Is.EqualTo(120.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames100), Is.EqualTo(100.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames60), Is.EqualTo(60.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames50), Is.EqualTo(50.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames48), Is.EqualTo(48.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames30), Is.EqualTo(30.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames30Drop), Is.EqualTo(0.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eNTSCDropFrame), Is.EqualTo(29.970029970029969490497023798525333404541015625)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eNTSCFullFrame), Is.EqualTo(29.970029970029969490497023798525333404541015625)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.ePAL), Is.EqualTo(25.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames24), Is.EqualTo(24.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames1000), Is.EqualTo(1000.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFilmFullFrame), Is.EqualTo(23.976023976023977724025826319120824337005615234375)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eCustom), Is.EqualTo(12.5)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames96), Is.EqualTo(96.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames72), Is.EqualTo(72.0)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames59dot94), Is.EqualTo(59.94005994005993898099404759705066680908203125)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eFrames119dot88), Is.EqualTo(119.8801198801198779619880951941013336181640625)); + Assert.That(FbxTime.GetFrameRate(FbxTime.EMode.eModesCount), Is.EqualTo(0.0)); + } + + [Test] + public void FbxTime_ConvertFrameRateToTimeMode() + { + // expect: + Assert.AreEqual(FbxTime.EMode.eFrames30, FbxTime.ConvertFrameRateToTimeMode(30.0)); + Assert.AreEqual(FbxTime.EMode.eFrames120, FbxTime.ConvertFrameRateToTimeMode(120.0)); + Assert.AreEqual(FbxTime.EMode.eFrames100, FbxTime.ConvertFrameRateToTimeMode(100.0)); + Assert.AreEqual(FbxTime.EMode.eFrames60, FbxTime.ConvertFrameRateToTimeMode(60.0)); + Assert.AreEqual(FbxTime.EMode.eFrames50, FbxTime.ConvertFrameRateToTimeMode(50.0)); + Assert.AreEqual(FbxTime.EMode.eFrames48, FbxTime.ConvertFrameRateToTimeMode(48.0)); + Assert.AreEqual(FbxTime.EMode.eFrames30, FbxTime.ConvertFrameRateToTimeMode(30.0)); + Assert.AreEqual(FbxTime.EMode.eNTSCDropFrame, FbxTime.ConvertFrameRateToTimeMode(29.970029970029969490497023798525333404541015625)); + Assert.AreEqual(FbxTime.EMode.ePAL, FbxTime.ConvertFrameRateToTimeMode(25.0)); + Assert.AreEqual(FbxTime.EMode.eFrames24, FbxTime.ConvertFrameRateToTimeMode(24.0)); + Assert.AreEqual(FbxTime.EMode.eFrames1000, FbxTime.ConvertFrameRateToTimeMode(1000.0)); + Assert.AreEqual(FbxTime.EMode.eFilmFullFrame, FbxTime.ConvertFrameRateToTimeMode(23.976023976023977724025826319120824337005615234375)); + Assert.AreEqual(FbxTime.EMode.eCustom, FbxTime.ConvertFrameRateToTimeMode(12.5)); + Assert.AreEqual(FbxTime.EMode.eFrames96, FbxTime.ConvertFrameRateToTimeMode(96.0)); + Assert.AreEqual(FbxTime.EMode.eFrames72, FbxTime.ConvertFrameRateToTimeMode(72.0)); + Assert.AreEqual(FbxTime.EMode.eFrames59dot94, FbxTime.ConvertFrameRateToTimeMode(59.94005994005993898099404759705066680908203125)); + Assert.AreEqual(FbxTime.EMode.eFrames119dot88, FbxTime.ConvertFrameRateToTimeMode(119.8801198801198779619880951941013336181640625)); + + Assert.AreEqual(FbxTime.EMode.eFrames30Drop, FbxTime.ConvertFrameRateToTimeMode(0.0)); + Assert.AreEqual(FbxTime.EMode.eDefaultMode, FbxTime.ConvertFrameRateToTimeMode(1.0)); + Assert.AreEqual(FbxTime.EMode.eDefaultMode, FbxTime.ConvertFrameRateToTimeMode(10.0)); + + Assert.AreEqual(FbxTime.EMode.ePAL, FbxTime.ConvertFrameRateToTimeMode(27.0, 2.9)); + Assert.AreEqual(FbxTime.EMode.eFrames30, FbxTime.ConvertFrameRateToTimeMode(27.0, 3.0)); + Assert.AreEqual(FbxTime.EMode.eFrames30, FbxTime.ConvertFrameRateToTimeMode(27.0, 3.1)); + + Assert.AreEqual(FbxTime.EMode.ePAL, FbxTime.ConvertFrameRateToTimeMode(24.5, 0.5)); + Assert.AreEqual(FbxTime.EMode.eDefaultMode, FbxTime.ConvertFrameRateToTimeMode(24.5, 0.4)); + Assert.AreEqual(FbxTime.EMode.ePAL, FbxTime.ConvertFrameRateToTimeMode(24.6, 0.4)); + Assert.AreEqual(FbxTime.EMode.eDefaultMode, FbxTime.ConvertFrameRateToTimeMode(24.41, 0.4)); + Assert.AreEqual(FbxTime.EMode.eFrames24, FbxTime.ConvertFrameRateToTimeMode(24.4, 0.4)); + Assert.AreEqual(FbxTime.EMode.eFrames24, FbxTime.ConvertFrameRateToTimeMode(24.3, 0.4)); + } } } diff --git a/FbxSharpTests/ObjectPrinterTest.cs b/FbxSharpTests/ObjectPrinterTest.cs index c4ebe1e..a4192e3 100644 --- a/FbxSharpTests/ObjectPrinterTest.cs +++ b/FbxSharpTests/ObjectPrinterTest.cs @@ -27,12 +27,15 @@ public void QuoteQuotesAndEscapeStrings() public void PrintPropertyPrintsTheProperty() { // given - var prop = new FbxPropertyT("something"); + var prop = FbxPropertyT.StaticInit( + (FbxProperty)null, "something", null, 0.0, false); var printer = new ObjectPrinter(); var writer = new StringWriter(); var expected = @" Name = something - Type = Double + Type = eFbxDouble + HierName = something + Label = Value = 0 SrcObjectCount = 0 DstObjectCount = 0 diff --git a/FbxSharpTests/SubDeformerTest.cs b/FbxSharpTests/SubDeformerTest.cs index 6a52b1e..ec25105 100644 --- a/FbxSharpTests/SubDeformerTest.cs +++ b/FbxSharpTests/SubDeformerTest.cs @@ -7,5 +7,14 @@ namespace FbxSharpTests [TestFixture] public class SubDeformerTest : TestBase { + [Test] + public void SubDeformer_Create_HasNamespacePrefix() + { + // given: + var obj = new FbxCluster("asdf"); + + // then: + Assert.AreEqual("SubDeformer::", obj.GetNameSpacePrefix());; + } } } diff --git a/FbxSharpTests/TestBase.cs b/FbxSharpTests/TestBase.cs index 5fdffbd..22ea66e 100644 --- a/FbxSharpTests/TestBase.cs +++ b/FbxSharpTests/TestBase.cs @@ -1,5 +1,8 @@ using System; +using System.Collections.Generic; +using System.IO; using FbxSharp; +using NUnit.Framework; namespace FbxSharpTests { @@ -7,8 +10,47 @@ public class TestBase { public static int CountProperties(FbxObject obj) { - return obj.Properties.Count; + var allProps = new HashSet(); + GatherDescendantProperties(obj.RootProperty, allProps); + allProps.Remove(obj.RootProperty); + return allProps.Count; } + + public static void GatherDescendantProperties(FbxProperty prop, + ISet allProps) + { + if (allProps.Contains(prop)) + return; + allProps.Add(prop); + foreach (var child in prop.Children) + GatherDescendantProperties(child, allProps); + } + + public static string GetRootFolder() + { + var folder = TestContext.CurrentContext.TestDirectory; + int i; + for (i = 0; i < 100; i++) + { + if (Path.GetFileName(folder) == "FbxSharp") return folder; + if (folder.Length < 3) return null; + if (folder[1..] == ":\\") return null; + if (folder == "/") return null; + folder = Path.GetDirectoryName(folder); + } + + throw new NotImplementedException(); + } + + public static string GetSamplesFolder() + { + var root = GetRootFolder(); + if (root == null) + throw new NotImplementedException(); + return Path.Combine(root, "samples"); + } + + public static string GetSample(string name) => + Path.Combine(GetSamplesFolder(), name); } } - diff --git a/FbxSharpTests/gen_tests.sh b/FbxSharpTests/gen_tests.sh index 0db9daa..3df7e9e 100755 --- a/FbxSharpTests/gen_tests.sh +++ b/FbxSharpTests/gen_tests.sh @@ -1,16 +1,11 @@ #!/bin/bash -DEBUG= -if [[ "$1" == "--debug" ]]; then - DEBUG=1 -fi - -for f in ../test-cases/*.tc -do - g=`basename $f .tc` - if [[ -n "$DEBUG" ]]; then - echo "Generating $g in C#" - fi - dotnet ../TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll cs $f $g.cs -done +__DIR__="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" +__ROOT_DIR__="$(dirname "$(realpath "$__DIR__")")" +dotnet \ + "$__ROOT_DIR__/TestCaseGenerator/bin/Debug/net8.0/TestCaseGenerator.dll" \ + cs \ + --input "$__ROOT_DIR__/test-cases" \ + --output "$__DIR__" \ + "$@" diff --git a/TestCaseGenerator/Program.cs b/TestCaseGenerator/Program.cs index 50acb38..89a7f4b 100644 --- a/TestCaseGenerator/Program.cs +++ b/TestCaseGenerator/Program.cs @@ -4,6 +4,7 @@ using System.Text.RegularExpressions; using System.Linq; using System.Reflection; +using System.Text; using NCommander; namespace TestCaseGenerator @@ -13,8 +14,64 @@ class MainClass public static void Main(string [] args) { var commander = new Commander("TestCaseGenerator", GetVersionStringFromAssembly()); - commander.Commands.Add("cs", CreateCommand("cs", "Generate C# tests", GenerateCs)); - commander.Commands.Add("cpp", CreateCommand("cpp", "Generate C++ tests", GenerateCpp)); + + var forceOption = new Option() + { + Name = "force", + Description = + "Generate a test file even if it already exists and is " + + "newer than the source .tc file", + Type = ParameterType.Flag, + }; + var verboseOption = new Option() + { + Name = "verbose", + Description = + "Print additional information during execution", + Type = ParameterType.Flag, + }; + var inputOption = new Option + { + Name = "input", + Description = + "Path to the input directory where test case files are " + + "located", + Type = ParameterType.String, + }; + var outputOption = new Option + { + Name = "output", + Description = + "Path to the output directory where the resulting test " + + "files will be placed", + Type = ParameterType.String, + }; + + var csCmd = CreateCommand( + "cs", + "Generate C# tests", + GenerateCs, + options: new[] + { + forceOption, + verboseOption, + inputOption, + outputOption, + }); + commander.Commands.Add("cs", csCmd); + + var cppCmd = CreateCommand( + "cpp", + "Generate C++ tests", + GenerateCpp, + options: new[] + { + forceOption, + verboseOption, + inputOption, + outputOption, + }); + commander.Commands.Add("cpp", cppCmd); try { @@ -59,23 +116,30 @@ public static string GetVersionStringFromAssembly() return version.ToString(version.Major == 0 ? 2 : 3); } - static Command CreateCommand(string name, string description, Action, TextWriter> generator) + static Command CreateCommand(string name, string description, + Action generator, + IEnumerable extraParams = null, + IEnumerable