private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (string str in importedAssets) { Object a = AssetDatabase.LoadAssetAtPath(str, typeof(Object)); if (FbxImportFixer.animDuplQueue.Contains(a)) { ModelImporter b = (ModelImporter)AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(a)); Debug.Log("Reimported Asset: " + str); Debug.Log("Procceeding with animation duplication; Reimport posError: " + b.animationPositionError + " Reimport animType: " + b.animationType.ToString()); AnimationDuplicator.DoAnimDuplOnFbx(a, true); FbxImportFixer.animDuplQueue.Remove(a); } } /* * foreach (string str in deletedAssets) * { * Debug.Log("Deleted Asset: " + str); * } * * for (int i = 0; i < movedAssets.Length; i++) * { * Debug.Log("Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]); * } */ }
private void OnGUI() { GUILayout.Label("Selected files: " + Selection.objects.Length); DisplaySettings(); GUILayout.BeginHorizontal(); if (GUILayout.Button("Change import settings")) { Object[] selObjects = Selection.objects; for (int i = 0; i < selObjects.Length; i++) { if (ValidateFbx(selObjects[i])) { ModifyMeta(selObjects[i]); } } if (experimentalApplyImportSettFirst) { for (int i = 0; i < selObjects.Length; i++) { if (ValidateFbx(selObjects[i])) { AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(selObjects[i]), ImportAssetOptions.ImportRecursive); } } } } if (GUILayout.Button("ManualAnimDupl")) { Object[] selObjects = Selection.objects; for (int i = 0; i < selObjects.Length; i++) { if (ValidateFbx(selObjects[i])) { AnimationDuplicator.DoAnimDuplOnFbx(selObjects[i], doAnimType); } } } if (GUILayout.Button("DebugMeta")) { DebugMeta(Selection.activeObject); } GUILayout.EndHorizontal(); }