Пример #1
0
 private static string AxisSystemToString(FbxAxisSystem fbxAxisSystem)
 {
     return(string.Format("[{0}, {1}, {2}]",
                          fbxAxisSystem.GetUpVector().ToString(),
                          fbxAxisSystem.GetFrontVector().ToString(),
                          fbxAxisSystem.GetCoorSystem().ToString()));
 }
Пример #2
0
            /// <summary>
            /// Process fbx scene by doing nothing
            /// </summary>
            public void ProcessScene(FbxScene fbxScene, IEnumerable <UnityEngine.Object> unitySelectionSet)
            {
                FbxDocumentInfo sceneInfo = fbxScene.GetSceneInfo();

                if (sceneInfo != null)
                {
                    MsgLine.Add(kBorderLine);
                    MsgLine.Add("Scene Meta-Data");
                    MsgLine.Add(kBorderLine);

                    MsgLine.Add(kPadding + string.Format("Title: \"{0}\"", sceneInfo.mTitle));
                    MsgLine.Add(kPadding + string.Format("Subject: \"{0}\"", sceneInfo.mSubject));
                    MsgLine.Add(kPadding + string.Format("Author: \"{0}\"", sceneInfo.mAuthor));
                    MsgLine.Add(kPadding + string.Format("Keywords: \"{0}\"", sceneInfo.mKeywords));
                    MsgLine.Add(kPadding + string.Format("Revision: \"{0}\"", sceneInfo.mRevision));
                    MsgLine.Add(kPadding + string.Format("Comment: \"{0}\"", sceneInfo.mComment));
                }

                var fbxSettings = fbxScene.GetGlobalSettings();

                MsgLine.Add(kBorderLine);
                MsgLine.Add("Global Settings");
                MsgLine.Add(kBorderLine);

                FbxSystemUnit fbxSystemUnit = fbxSettings.GetSystemUnit();

                if (fbxSystemUnit != UnitySystemUnit)
                {
                    Debug.LogWarning(string.Format("file system unit do not match Unity. Expected {0} Found {1}",
                                                   UnitySystemUnit.ToString(), fbxSystemUnit.ToString()));
                }

                MsgLine.Add(kPadding + string.Format("SystemUnits: {0}", fbxSystemUnit.ToString()));

                // The Unity axis system has Y up, Z forward, X to the right.
                FbxAxisSystem fbxAxisSystem = fbxSettings.GetAxisSystem();

                if (fbxAxisSystem != UnityAxisSystem)
                {
                    Debug.LogWarning(string.Format("file axis system do not match Unity, Expected [{0}, {1}, {2}] Found [{3}, {4}, {5}]",
                                                   UnityAxisSystem.GetUpVector().ToString(),
                                                   UnityAxisSystem.GetFrontVector().ToString(),
                                                   UnityAxisSystem.GetCoorSystem().ToString(),
                                                   fbxAxisSystem.GetUpVector().ToString(),
                                                   fbxAxisSystem.GetFrontVector().ToString(),
                                                   fbxAxisSystem.GetCoorSystem().ToString()));
                }
                MsgLine.Add(kPadding + string.Format("AxisSystem: {0}", AxisSystemToString(fbxAxisSystem)));

                // print report
                Debug.Log(string.Join(kNewLine, MsgLine.ToArray()));

                return;
            }