@@ -61,29 +61,32 @@ public void TestDefaultSelection ()
61
61
m_root = CreateHierarchy ( ) ;
62
62
Assert . IsNotNull ( m_root ) ;
63
63
64
+ // test without centered objects
65
+ FbxExporters . EditorTools . ExportSettings . instance . centerObjects = false ;
66
+
64
67
// test Export Root
65
68
// Expected result: everything gets exported
66
- // Expected transform: root is zeroed out, all other transforms unchanged
69
+ // Expected transform: all transforms unchanged
67
70
var exportedRoot = ExportSelection ( new Object [ ] { m_root } ) ;
68
71
CompareHierarchies ( m_root , exportedRoot , true , false ) ;
69
- CompareGlobalTransform ( exportedRoot . transform ) ;
72
+ CompareGlobalTransform ( exportedRoot . transform , m_root . transform ) ;
70
73
71
74
// test Export Parent1, Child1
72
75
// Expected result: Parent1, Child1, Child2
73
- // Expected transform: Parent1 zeroed out, all other transforms unchanged
76
+ // Expected transform: all transforms unchanged
74
77
var parent1 = m_root . transform . Find ( "Parent1" ) ;
75
78
var child1 = parent1 . Find ( "Child1" ) ;
76
79
exportedRoot = ExportSelection ( new Object [ ] { parent1 . gameObject , child1 . gameObject } ) ;
77
80
CompareHierarchies ( parent1 . gameObject , exportedRoot , true , false ) ;
78
- CompareGlobalTransform ( exportedRoot . transform ) ;
81
+ CompareGlobalTransform ( exportedRoot . transform , parent1 ) ;
79
82
80
83
// test Export Child2
81
84
// Expected result: Child2
82
- // Expected transform: Child2 zeroed out
85
+ // Expected transform: Child2 unchanged
83
86
var child2 = parent1 . Find ( "Child2" ) . gameObject ;
84
87
exportedRoot = ExportSelection ( new Object [ ] { child2 } ) ;
85
88
CompareHierarchies ( child2 , exportedRoot , true , false ) ;
86
- CompareGlobalTransform ( exportedRoot . transform ) ;
89
+ CompareGlobalTransform ( exportedRoot . transform , child2 . transform ) ;
87
90
88
91
// test Export Child2, Parent2
89
92
// Expected result: Parent2, Child3, Child2
@@ -127,7 +130,12 @@ public void TestDefaultSelection ()
127
130
{
128
131
var actualMatrix = ConstructTRSMatrix ( actual ) ;
129
132
var expectedMatrix = expected == null ? new FbxAMatrix ( ) : ConstructTRSMatrix ( expected , false , center ) ;
130
- Assert . AreEqual ( expectedMatrix , actualMatrix ) ;
133
+
134
+ for ( int i = 0 ; i < 4 ; i ++ ) {
135
+ for ( int j = 0 ; j < 4 ; j ++ ) {
136
+ Assert . That ( actualMatrix [ i ] [ j ] , Is . EqualTo ( expectedMatrix [ i ] [ j ] ) . Within ( 0.0001 ) ) ;
137
+ }
138
+ }
131
139
}
132
140
133
141
/// <summary>
0 commit comments