File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Assets/FbxExporters/Editor/UnitTests Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -261,5 +261,21 @@ public static void AssertSameHierarchy (
261
261
AssertSameHierarchy ( expectedChild . gameObject , actualChild . gameObject ) ;
262
262
}
263
263
}
264
+
265
+ /// <summary>
266
+ /// Given the path to a file, find the file relative to
267
+ /// the UnitTests folder.
268
+ /// </summary>
269
+ /// <returns>The path in unit tests.</returns>
270
+ /// <param name="partialPath">Partial path.</param>
271
+ protected static string FindPathInUnitTests ( string partialPath ) {
272
+ foreach ( var dir in Directory . GetDirectories ( Application . dataPath , "UnitTests" , SearchOption . AllDirectories ) ) {
273
+ var fullPath = Path . Combine ( dir , partialPath ) ;
274
+ if ( File . Exists ( fullPath ) ) {
275
+ return FbxExporters . EditorTools . ExportSettings . ConvertToAssetRelativePath ( fullPath ) ;
276
+ }
277
+ }
278
+ return null ;
279
+ }
264
280
}
265
281
}
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public static IEnumerable TestCases4 {
63
63
64
64
public static IEnumerable SkinnedMeshTestCases {
65
65
get {
66
- yield return "FbxExporters/Editor/UnitTests/ Models/DefaultMale/Male_DyingHitFromBack_Blend_T3_Cut01_James.fbx" ;
66
+ yield return "Models/DefaultMale/Male_DyingHitFromBack_Blend_T3_Cut01_James.fbx" ;
67
67
}
68
68
}
69
69
}
@@ -309,6 +309,9 @@ private AnimationClip GetClipFromFbx(string path){
309
309
[ Test , TestCaseSource ( typeof ( AnimationTestDataClass ) , "SkinnedMeshTestCases" ) ]
310
310
public void LegacySkinnedMeshAnimTest ( string fbxPath )
311
311
{
312
+ fbxPath = FindPathInUnitTests ( fbxPath ) ;
313
+ Assert . That ( fbxPath , Is . Not . Null ) ;
314
+
312
315
// add fbx to scene
313
316
GameObject originalFbxObj = AssetDatabase . LoadMainAssetAtPath ( "Assets/" + fbxPath ) as GameObject ;
314
317
Assert . IsNotNull ( originalFbxObj ) ;
You can’t perform that action at this time.
0 commit comments