diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-13_13-28-17_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-13_13-28-17_CoverageHistory.xml new file mode 100644 index 000000000..a11ea0f58 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-13_13-28-17_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-20_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-20_CoverageHistory.xml new file mode 100644 index 000000000..0f8667daf --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-20_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-41_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-41_CoverageHistory.xml new file mode 100644 index 000000000..2b19a713f --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-06-41_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-15-03_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-15-03_CoverageHistory.xml new file mode 100644 index 000000000..cc93d9fc2 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-15-03_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-16-09_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-16-09_CoverageHistory.xml new file mode 100644 index 000000000..b8bb4956c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-16-09_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-30-23_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-30-23_CoverageHistory.xml new file mode 100644 index 000000000..e7fb9e37e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-30-23_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-31-10_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-31-10_CoverageHistory.xml new file mode 100644 index 000000000..59b12fbf5 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-31-10_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-32-53_CoverageHistory.xml b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-32-53_CoverageHistory.xml new file mode 100644 index 000000000..923459535 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report-history/2023-02-14_14-32-53_CoverageHistory.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Summary.xml b/TestProject/Usd-Development/CodeCoverage/Report/Summary.xml new file mode 100644 index 000000000..f9ecde38c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Summary.xml @@ -0,0 +1,119 @@ + + + + 2023-02-14 - 2:32:54 PM + MultiReportParser (2x OpenCoverParser) + 8 + 84 + 75 + 3150 + 5012 + 8162 + 16244 + 38.5 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_PackageUtils.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_PackageUtils.html new file mode 100644 index 000000000..d1b40d315 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_PackageUtils.html @@ -0,0 +1,153 @@ + + + + + + +Unity.Formats.USD.PackageUtils - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.PackageUtils
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Utils/PackageUtils.cs
Covered lines:13
Uncovered lines:3
Coverable lines:16
Total lines:49
Line coverage:81.2% (13 of 16)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetRelativeFolderPath(...)0%000100%
GetCallerRelativeToProjectFolderPath(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Utils/PackageUtils.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System;
 2using System.IO;
 3using System.Runtime.CompilerServices;
 4using UnityEditor;
 5using UnityEngine;
 6
 7namespace Unity.Formats.USD
 8{
 9    public static class PackageUtils
 10    {
 11        /// <summary>
 12        /// Utils function to get the relative path of a file considering a base folder
 13        /// </summary>
 14        public static string GetRelativeFolderPath(string baseFolderPath, string filePath = "")
 315        {
 16            const string universalSeparator = @"/";
 17            const string windowsSeparator = @"\";
 18
 19            // Conforming paths to ease next steps
 320            filePath = filePath.Replace(windowsSeparator, universalSeparator);
 321            baseFolderPath = baseFolderPath.Replace(windowsSeparator, universalSeparator);
 22
 23            // baseFolderPath must end with a slash to indicate folder
 324            baseFolderPath = baseFolderPath.TrimEnd();
 325            if (!baseFolderPath.EndsWith(universalSeparator))
 126            {
 127                baseFolderPath += universalSeparator;
 128            }
 29
 30            // Using URIs to find the relative path
 331            var sampleFolderAbsoluteURI = new Uri(Path.GetDirectoryName(filePath));
 332            var projectFolderAbsoluteURI = new Uri(baseFolderPath);
 333            var sampleFolderRelativePath =
 34                Uri.UnescapeDataString(
 35                    projectFolderAbsoluteURI.MakeRelativeUri(sampleFolderAbsoluteURI).ToString()
 36                        .Replace('/', Path.DirectorySeparatorChar)
 37                );
 338            return sampleFolderRelativePath;
 339        }
 40
 41        /// <summary>
 42        /// Utils function to get the relative path of the current caller with current Unity directory as a base folder
 43        /// </summary>
 44        public static string GetCallerRelativeToProjectFolderPath([CallerFilePath] string filePath = "")
 045        {
 046            return GetRelativeFolderPath(Directory.GetCurrentDirectory(), filePath);
 047        }
 48    }
 49}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_TargetedPropertyDrawer_T_.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_TargetedPropertyDrawer_T_.html new file mode 100644 index 000000000..07f826167 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_TargetedPropertyDrawer_T_.html @@ -0,0 +1,132 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T] - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/TargetedPropertyDrawer.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:28
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize(...)0%0000%
GetSerializedField(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/TargetedPropertyDrawer.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System.Reflection;
 2
 3namespace UnityEditor.Formats.USD.Recorder
 4{
 5    class TargetedPropertyDrawer<T> : PropertyDrawer where T : class
 6    {
 7        protected T target;
 8
 9        protected virtual void Initialize(SerializedProperty prop)
 010        {
 011            if (target == null)
 012            {
 013                var path = prop.propertyPath.Split('.');
 014                object obj = prop.serializedObject.targetObject;
 15
 016                foreach (var pathNode in path)
 017                    obj = GetSerializedField(obj, pathNode).GetValue(obj);
 18
 019                target = obj as T;
 020            }
 021        }
 22
 23        static FieldInfo GetSerializedField(object target, string pathNode)
 024        {
 025            return target.GetType().GetField(pathNode, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Pub
 026        }
 27    }
 28}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdAssetEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdAssetEditor.html new file mode 100644 index 000000000..459b071be --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdAssetEditor.html @@ -0,0 +1,470 @@ + + + + + + +Unity.Formats.USD.UsdAssetEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdAssetEditor
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs
Covered lines:0
Uncovered lines:213
Coverable lines:213
Total lines:350
Line coverage:0% (0 of 213)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdAssetEditor()0%0000%
OnEnable()0%0000%
GetPrefabObject(...)0%0000%
IsPrefabInstance(...)0%0000%
OnInspectorGUI()0%0000%
DrawSimpleInspector(...)0%0000%
ReloadFromUsd(...)0%0000%
DestroyAllImportedObjects(...)0%0000%
DetachFromUsd(...)0%0000%
ReloadFromUsdAsCoroutine(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdAssetEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.IO;
 16using UnityEngine;
 17using UnityEditor;
 18#if UNITY_2020_2_OR_NEWER
 19using UnityEditor.AssetImporters;
 20#else
 21using UnityEditor.Experimental.AssetImporters;
 22
 23#endif
 24
 25namespace Unity.Formats.USD
 26{
 27    [CustomEditor(typeof(UsdAsset))]
 28    public class UsdAssetEditor : Editor
 29    {
 030        private readonly string[] kTabNames = new string[] { "Simple", "Advanced" };
 31        private int m_tab;
 32
 33        private Texture2D m_usdLogo;
 34        private Texture2D m_refreshButton;
 35        private Texture2D m_trashButton;
 36        private Texture2D m_reimportButton;
 37        private Texture2D m_detachButton;
 38
 39        private enum LinearUnits
 40        {
 41            Millimeters = -1,
 42            Centimeters = 0,
 43            Meters = 1,
 44            Decimeters = 2,
 45            Kilometers = 3,
 46            Custom = 4
 47        }
 48
 49        public void OnEnable()
 050        {
 051            if (!m_usdLogo)
 052            {
 053                var script = MonoScript.FromScriptableObject(this);
 054                var path = AssetDatabase.GetAssetPath(script);
 055                var rootPath = Path.GetDirectoryName(path);
 056                m_usdLogo = AssetDatabase.LoadAssetAtPath(rootPath + "/UsdBanner.png",
 57                    typeof(Texture2D)) as Texture2D;
 058                m_refreshButton = AssetDatabase.LoadAssetAtPath(rootPath + "/RefreshButton.png",
 59                    typeof(Texture2D)) as Texture2D;
 060                m_trashButton = AssetDatabase.LoadAssetAtPath(rootPath + "/Trash.png",
 61                    typeof(Texture2D)) as Texture2D;
 062                m_reimportButton = AssetDatabase.LoadAssetAtPath(rootPath + "/Reimport.png",
 63                    typeof(Texture2D)) as Texture2D;
 064                m_detachButton = AssetDatabase.LoadAssetAtPath(rootPath + "/Detach.png",
 65                    typeof(Texture2D)) as Texture2D;
 066            }
 067        }
 68
 69        private GameObject GetPrefabObject(GameObject root)
 070        {
 71            // This is a great resource for determining object type, but only covers new APIs:
 72            // https://github.com/Unity-Technologies/UniteLA2018Examples/blob/master/Assets/Scripts/GameObjectTypeLoggin
 073            return PrefabUtility.GetCorrespondingObjectFromSource(root);
 074        }
 75
 76        private bool IsPrefabInstance(GameObject root)
 077        {
 078            return GetPrefabObject(root) != null;
 079        }
 80
 81        public override void OnInspectorGUI()
 082        {
 083            var usdAsset = (UsdAsset)this.target;
 84
 085            if (usdAsset.m_displayColorMaterial == null)
 086            {
 087                Debug.LogWarning("No fallback material set, reverting to default");
 088                var matMap = new MaterialMap();
 089                usdAsset.m_displayColorMaterial = matMap.DisplayColorMaterial;
 090            }
 91
 092            if (usdAsset.m_metallicWorkflowMaterial == null)
 093            {
 094                Debug.LogWarning("No metallic material set, reverting to default");
 095                var matMap = new MaterialMap();
 096                usdAsset.m_metallicWorkflowMaterial = matMap.MetallicWorkflowMaterial;
 097            }
 98
 099            if (usdAsset.m_specularWorkflowMaterial == null)
 0100            {
 0101                Debug.LogWarning("No specular material set, reverting to default");
 0102                var matMap = new MaterialMap();
 0103                usdAsset.m_specularWorkflowMaterial = matMap.SpecularWorkflowMaterial;
 0104            }
 105
 0106            var buttonStyle = new GUIStyle(GUI.skin.button);
 0107            buttonStyle.fixedWidth = 32;
 0108            buttonStyle.fixedHeight = 32;
 109
 0110            var gsImageStyle = new GUIStyle();
 0111            gsImageStyle.alignment = TextAnchor.MiddleCenter;
 0112            gsImageStyle.normal.background = EditorGUIUtility.whiteTexture;
 0113            gsImageStyle.padding.bottom = 0;
 114
 0115            GUILayout.Space(5);
 0116            GUILayout.BeginHorizontal(gsImageStyle);
 0117            EditorGUILayout.LabelField(new GUIContent(m_usdLogo), GUILayout.MinHeight(40.0f));
 118
 0119            var refreshStyle = new GUIStyle(buttonStyle);
 0120            refreshStyle.fixedHeight = 38;
 0121            refreshStyle.fixedWidth = 38;
 0122            if (GUILayout.Button(new GUIContent(m_refreshButton, "Refresh values from USD"), refreshStyle))
 0123            {
 0124                if (EditorUtility.DisplayDialog("Refresh from Source", "Refresh values from USD?\n\n"
 125                    + "Any object set to import will have it's state updated from USD",
 126                    "OK", "Cancel"))
 0127                {
 0128                    ReloadFromUsd(usdAsset, forceRebuild: false);
 0129                }
 0130            }
 131
 0132            GUILayout.EndHorizontal();
 133
 0134            GUILayout.Space(5);
 135
 0136            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
 0137            GUILayout.FlexibleSpace();
 0138            if (IsPrefabInstance(usdAsset.gameObject))
 0139            {
 0140                var style = new GUIStyle();
 0141                style.alignment = TextAnchor.MiddleCenter;
 0142                style.fontSize = 12;
 0143                style.wordWrap = true;
 0144                EditorGUILayout.LabelField("Edit prefab for destructive operations", style);
 0145            }
 146            else
 0147            {
 0148                if (usdAsset.transform.childCount == 0)
 0149                {
 0150                    if (GUILayout.Button(new GUIContent(m_reimportButton, "Import from USD"), buttonStyle))
 0151                    {
 0152                        ReloadFromUsd(usdAsset, forceRebuild: true);
 0153                    }
 0154                }
 155                else
 0156                {
 0157                    if (GUILayout.Button(new GUIContent(m_reimportButton, "Reimport from USD (destructive)"),
 158                        buttonStyle))
 0159                    {
 0160                        if (EditorUtility.DisplayDialog("Reimport from Source",
 161                            "Destroy and rebuild all USD objects?\n\n"
 162                            + "Any GameObject with a UsdPrimSource will be destroyed and reimported.",
 163                            "OK", "Cancel"))
 0164                        {
 0165                            ReloadFromUsd(usdAsset, forceRebuild: true);
 0166                        }
 0167                    }
 0168                }
 169
 0170                EditorGUI.BeginDisabledGroup(usdAsset.transform.childCount == 0);
 0171                if (GUILayout.Button(new GUIContent(m_trashButton, "Remove USD Contents (destructive)"), buttonStyle))
 0172                {
 0173                    if (EditorUtility.DisplayDialog("Clear Contents", "Destroy all USD objects?\n\n"
 174                        + "Any GameObject with a UsdPrimSource will be destroyed. "
 175                        + "These objects can be re-imported but any custom components will be lost.",
 176                        "OK", "Cancel"))
 0177                    {
 0178                        DestroyAllImportedObjects(usdAsset);
 0179                    }
 0180                }
 181
 0182                if (GUILayout.Button(new GUIContent(m_detachButton, "Detach, remove all USD components"), buttonStyle))
 0183                {
 0184                    if (EditorUtility.DisplayDialog("Detach from USD", "Remove all USD components?\n\n"
 185                        + "USD components will be destroyed (except the UsdAsset root), "
 186                        + "but can be recreated by refreshing from USD.",
 187                        "OK", "Cancel"))
 0188                    {
 0189                        DetachFromUsd(usdAsset);
 0190                    }
 0191                }
 192
 0193                EditorGUI.EndDisabledGroup();
 0194            }
 195
 0196            GUILayout.FlexibleSpace();
 0197            GUILayout.EndHorizontal();
 198
 0199            if (Application.isPlaying && GUILayout.Button("Reload from USD (Coroutine)"))
 0200            {
 0201                ReloadFromUsdAsCoroutine(usdAsset);
 0202            }
 203
 0204            GUILayout.Space(5);
 205
 0206            m_tab = GUILayout.Toolbar(m_tab, kTabNames);
 0207            switch (m_tab)
 208            {
 209                case 0:
 0210                    DrawSimpleInspector(usdAsset);
 0211                    break;
 212                case 1:
 0213                    base.DrawDefaultInspector();
 0214                    break;
 215            }
 0216        }
 217
 218        private void DrawSimpleInspector(UsdAsset usdAsset)
 0219        {
 0220            GUILayout.Label("Source Asset", EditorStyles.boldLabel);
 221
 0222            EditorGUILayout.BeginHorizontal();
 0223            EditorGUILayout.PrefixLabel("USD File");
 0224            GUI.enabled = false;
 0225            EditorGUILayout.TextField(usdAsset.usdFullPath, EditorStyles.textField);
 0226            GUI.enabled = true;
 227
 0228            if (GUILayout.Button("..."))
 0229            {
 230                string lastDir;
 0231                if (string.IsNullOrEmpty(usdAsset.usdFullPath))
 0232                    lastDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
 233                else
 0234                    lastDir = Path.GetDirectoryName(usdAsset.usdFullPath);
 0235                string importFilepath =
 236                    EditorUtility.OpenFilePanelWithFilters("Usd Asset", lastDir, new string[] { "Usd", "us*" });
 0237                if (string.IsNullOrEmpty(importFilepath)) return;
 0238                usdAsset.usdFullPath = importFilepath;
 0239            }
 240
 0241            EditorGUILayout.EndHorizontal();
 242
 0243            EditorGUILayout.BeginHorizontal();
 0244            EditorGUILayout.PrefixLabel("USD Root Path");
 0245            usdAsset.m_usdRootPath = EditorGUILayout.TextField(usdAsset.m_usdRootPath, EditorStyles.textField);
 0246            EditorGUILayout.EndHorizontal();
 247
 0248            GUILayout.Label("Import Settings", EditorStyles.boldLabel);
 249
 0250            EditorGUI.BeginChangeCheck();
 0251            EditorGUILayout.BeginHorizontal();
 252
 0253            var op = LinearUnits.Custom;
 254
 0255            if (usdAsset.m_scale == 1)
 0256            {
 0257                op = LinearUnits.Meters;
 0258            }
 0259            else if (usdAsset.m_scale == .1f)
 0260            {
 0261                op = LinearUnits.Decimeters;
 0262            }
 0263            else if (usdAsset.m_scale == .01f)
 0264            {
 0265                op = LinearUnits.Centimeters;
 0266            }
 0267            else if (usdAsset.m_scale == .001f)
 0268            {
 0269                op = LinearUnits.Millimeters;
 0270            }
 0271            else if (usdAsset.m_scale == 1000f)
 0272            {
 0273                op = LinearUnits.Kilometers;
 0274            }
 275
 0276            var newOp = (LinearUnits)EditorGUILayout.EnumPopup("Original Scale", op);
 277
 0278            if (newOp == LinearUnits.Custom)
 0279            {
 280                // Force the UI to stay on the "custom" selection by adding an offset.
 0281                float offset = op == newOp ? 0 : 0.01f;
 0282                usdAsset.m_scale = EditorGUILayout.FloatField(usdAsset.m_scale + offset);
 0283            }
 284
 0285            op = newOp;
 0286            EditorGUILayout.EndHorizontal();
 287
 0288            switch (op)
 289            {
 290                case LinearUnits.Millimeters:
 0291                    usdAsset.m_scale = .001f;
 0292                    break;
 293                case LinearUnits.Centimeters:
 0294                    usdAsset.m_scale = .01f;
 0295                    break;
 296                case LinearUnits.Decimeters:
 0297                    usdAsset.m_scale = .1f;
 0298                    break;
 299                case LinearUnits.Meters:
 0300                    usdAsset.m_scale = 1f;
 0301                    break;
 302                case LinearUnits.Kilometers:
 0303                    usdAsset.m_scale = 1000;
 0304                    break;
 305            }
 306
 0307            usdAsset.m_materialImportMode =
 308                (MaterialImportMode)EditorGUILayout.EnumPopup("Materials", usdAsset.m_materialImportMode);
 0309            usdAsset.m_payloadPolicy =
 310                (PayloadPolicy)EditorGUILayout.EnumPopup("Payload Policy", usdAsset.m_payloadPolicy);
 311
 0312            GUILayout.Label("Object Types", EditorStyles.boldLabel);
 313
 0314            usdAsset.m_importCameras = EditorGUILayout.Toggle("Import Cameras", usdAsset.m_importCameras);
 0315            usdAsset.m_importMeshes = EditorGUILayout.Toggle("Import Meshes", usdAsset.m_importMeshes);
 0316            usdAsset.m_importSkinning = EditorGUILayout.Toggle("Import Skinning", usdAsset.m_importSkinning);
 0317            usdAsset.m_importTransforms = EditorGUILayout.Toggle("Import Transforms", usdAsset.m_importTransforms);
 0318            if (EditorGUI.EndChangeCheck())
 0319                EditorUtility.SetDirty(usdAsset);
 0320        }
 321
 322        private void ReloadFromUsd(UsdAsset stageRoot, bool forceRebuild)
 0323        {
 0324            stageRoot.Reload(forceRebuild);
 0325            Repaint();
 0326        }
 327
 328        private void DestroyAllImportedObjects(UsdAsset stageRoot)
 0329        {
 0330            stageRoot.DestroyAllImportedObjects();
 0331            Repaint();
 0332        }
 333
 334        private void DetachFromUsd(UsdAsset stageRoot)
 0335        {
 0336            stageRoot.RemoveAllUsdComponents();
 0337            Repaint();
 0338        }
 339
 340        private void ReloadFromUsdAsCoroutine(UsdAsset stageRoot)
 0341        {
 0342            var options = new SceneImportOptions();
 0343            stageRoot.StateToOptions(ref options);
 0344            var parent = stageRoot.gameObject.transform.parent;
 0345            var root = parent ? parent.gameObject : null;
 0346            stageRoot.ImportUsdAsCoroutine(root, stageRoot.usdFullPath, stageRoot.m_usdTimeOffset, options,
 347                targetFrameMilliseconds: 5);
 0348        }
 349    }
 350}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdBuildPostProcess.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdBuildPostProcess.html new file mode 100644 index 000000000..bc93c7028 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdBuildPostProcess.html @@ -0,0 +1,174 @@ + + + + + + +Unity.Formats.USD.UsdBuildPostProcess - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdBuildPostProcess
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/UsdBuildPostProcess.cs
Covered lines:0
Uncovered lines:34
Coverable lines:34
Total lines:70
Line coverage:0% (0 of 34)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnPostprocessBuild(...)0%0000%
GetCurrentDir(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/UsdBuildPostProcess.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Pixar Animation Studios
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEditor;
 17using UnityEditor.Callbacks;
 18using System.IO;
 19using System.Runtime.CompilerServices;
 20
 21namespace Unity.Formats.USD
 22{
 23    public class UsdBuildPostProcess
 24    {
 25        [PostProcessBuildAttribute(1)]
 26        public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
 027        {
 028            var source = Path.Combine(GetCurrentDir(), "..", "..", "Runtime", "Plugins");
 029            var destination = "";
 030            if (target == BuildTarget.StandaloneLinux64)
 031            {
 032                destination = pathToBuiltProject.Replace(".x86_64", "_Data/Plugins");
 033            }
 034            else if (target == BuildTarget.StandaloneOSX)
 035            {
 036                destination = pathToBuiltProject + "/Contents/Plugins";
 037            }
 038            else if (target == BuildTarget.StandaloneWindows64)
 039            {
 040                destination = pathToBuiltProject.Replace(".exe", "_Data/Plugins");
 041            }
 42            else
 043            {
 044                Debug.LogWarning("The USD package is not supported in non desktop builds. The USD plugins directory will
 045                return;
 46            }
 47
 048            if (!Directory.Exists(destination))
 049            {
 050                Directory.CreateDirectory(destination);
 051            }
 52            else
 053            {
 054                var attrs = File.GetAttributes(destination);
 055                attrs &= ~FileAttributes.ReadOnly;
 056                File.SetAttributes(destination, attrs);
 057            }
 58
 59            // We need to copy the whole share folder
 060            FileUtil.CopyFileOrDirectory(source + "/x86_64/usd", destination + "/usd");
 061            FileUtil.CopyFileOrDirectory(source + "/x86_64/plugInfo.json", destination + "/plugInfo.json");
 062        }
 63
 64        static string GetCurrentDir([CallerFilePath] string filePath = "")
 065        {
 066            var fileInfo = new FileInfo(filePath);
 067            return fileInfo.DirectoryName;
 068        }
 69    }
 70}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdLayerStackEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdLayerStackEditor.html new file mode 100644 index 000000000..c0827dca9 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdLayerStackEditor.html @@ -0,0 +1,161 @@ + + + + + + +Unity.Formats.USD.UsdLayerStackEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdLayerStackEditor
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdLayerStackEditor.cs
Covered lines:0
Uncovered lines:22
Coverable lines:22
Total lines:59
Line coverage:0% (0 of 22)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnInspectorGUI()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdLayerStackEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEditor;
 17#if UNITY_2020_2_OR_NEWER
 18using UnityEditor.AssetImporters;
 19#else
 20using UnityEditor.Experimental.AssetImporters;
 21#endif
 22using USD.NET;
 23
 24namespace Unity.Formats.USD
 25{
 26    [CustomEditor(typeof(UsdLayerStack))]
 27    public class UsdLayerStackEditor : ScriptedImporterEditor
 28    {
 29        public override void OnInspectorGUI()
 030        {
 031            var layerStack = (UsdLayerStack)this.target;
 32
 033            base.DrawDefaultInspector();
 34
 035            GUILayout.Space(10);
 36
 037            if (GUILayout.Button("Save Overrides to Target Layer"))
 038            {
 039                InitUsd.Initialize();
 040                layerStack.SaveToLayer();
 041            }
 42
 043            if (GUILayout.Button("Save Layer Stack"))
 044            {
 045                InitUsd.Initialize();
 046                Scene scene = Scene.Open(layerStack.GetComponent<UsdAsset>().usdFullPath);
 47                try
 048                {
 049                    layerStack.SaveLayerStack(scene, layerStack.m_layerStack);
 050                }
 51                finally
 052                {
 053                    scene.Close();
 054                    scene = null;
 055                }
 056            }
 057        }
 58    }
 59}
+
+
+
+

Methods/Properties

+OnInspectorGUI()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdMenu.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdMenu.html new file mode 100644 index 000000000..357c6d5b4 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdMenu.html @@ -0,0 +1,373 @@ + + + + + + +Unity.Formats.USD.UsdMenu - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdMenu
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdMenu.cs
Covered lines:28
Uncovered lines:72
Coverable lines:100
Total lines:247
Line coverage:28% (28 of 100)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
EnableMenuExportSelectedWithChildren()0%0000%
MenuExportSelectedWithChildren()0%0000%
EnableMenuExportTransforms()0%0000%
MenuExportTransforms()0%0000%
EnableMenuExportSelectedAsUsdz()0%0000%
MenuExportSelectedAsUsdz()0%0000%
MenuImportAsGameObjects()0%0000%
MenuImportAsPrefab()0%0000%
MenuImportAsTimelineClip()0%0000%
EnableMenuUnloadSubtree()0%0000%
MenuUnloadSubtree()0%00085%
EnableMenuLoadSubtree()0%0000%
MenuLoadSubtree()0%00085%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdMenu.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.IO;
 16using System.Linq;
 17using UnityEngine;
 18using UnityEditor;
 19using USD.NET;
 20
 21namespace Unity.Formats.USD
 22{
 23    public static class UsdMenu
 24    {
 25        [MenuItem("USD/Export Selected with Children", true)]
 26        static bool EnableMenuExportSelectedWithChildren()
 027        {
 028            return Selection.gameObjects.Length > 0;
 029        }
 30
 31        [MenuItem("USD/Export Selected with Children", priority = 50)]
 32        static void MenuExportSelectedWithChildren()
 033        {
 034            var go = Selection.gameObjects.First();
 035            var filePath = EditorUtility.SaveFilePanel("Export USD File", "", go.name, "usd,usda,usdc");
 036            var scene = ExportHelpers.InitForSave(filePath);
 037            ExportHelpers.ExportGameObjects(Selection.gameObjects, scene, BasisTransformation.SlowAndSafe);
 038        }
 39
 40        [MenuItem("USD/Export Transform Overrides", true)]
 41        static bool EnableMenuExportTransforms()
 042        {
 043            return Selection.activeGameObject && Selection.activeGameObject.GetComponentInParent<UsdAsset>();
 044        }
 45
 46        [MenuItem("USD/Export Transform Overrides", priority = 50)]
 47        static public void MenuExportTransforms()
 048        {
 049            var root = Selection.activeGameObject.GetComponentInParent<UsdAsset>();
 050            var filePath = EditorUtility.SaveFilePanel("Export USD File", "", Path.GetFileNameWithoutExtension(root.usdF
 051            var overs = ExportHelpers.InitForSave(filePath);
 052            root.ExportOverrides(overs);
 053        }
 54
 55        [MenuItem("USD/Export Selected as USDZ", true)]
 56        static bool EnableMenuExportSelectedAsUsdz()
 057        {
 058            return Selection.gameObjects.Length == 1;
 059        }
 60
 61        [MenuItem("USD/Export Selected as USDZ", priority = 50)]
 62        static void MenuExportSelectedAsUsdz()
 063        {
 064            var defaultName = Path.GetFileNameWithoutExtension(Selection.activeGameObject.name);
 065            var filePath = EditorUtility.SaveFilePanel("Export USDZ File", "", defaultName, "usdz");
 66
 067            if (filePath == null || filePath.Length == 0)
 068            {
 069                return;
 70            }
 71
 072            var fileDir = Path.GetDirectoryName(filePath);
 73
 074            if (!Directory.Exists(fileDir))
 075            {
 076                var di = Directory.CreateDirectory(fileDir);
 077                if (!di.Exists)
 078                {
 079                    Debug.LogError("Failed to create directory: " + fileDir);
 080                    return;
 81                }
 082            }
 83
 084            UsdzExporter.ExportUsdz(filePath, Selection.activeGameObject);
 085        }
 86
 87#if false
 88        [MenuItem("USD/Save Unity as USD (Experimental)", true)]
 89        static bool EnableMenuSaveAsUsd()
 90        {
 91            return Selection.gameObjects.Length == 1;
 92        }
 93
 94        [MenuItem("USD/Save Unity as USD (Experimental)", priority = 170)]
 95        static void MenuExportSaveAsUsd()
 96        {
 97            ExportSelected(BasisTransformation.SlowAndSafe, exportMonoBehaviours: true);
 98        }
 99
 100        [MenuItem("USD/Load Unity from USD (Experimental)", priority = 170)]
 101        static void MenuExportLoadFromUsd()
 102        {
 103            var scene = InitForOpen();
 104            if (scene == null)
 105            {
 106                return;
 107            }
 108            string path = scene.FilePath;
 109
 110            // Time-varying data is not supported and often scenes are written without "Default" time
 111            // values, which makes setting an arbitrary time safer (because if only default was authored
 112            // the time will be ignored and values will resolve to default time automatically).
 113            scene.Time = 1.0;
 114
 115            var importOptions = new SceneImportOptions();
 116            importOptions.projectAssetPath = GetSelectedAssetPath();
 117            importOptions.changeHandedness = BasisTransformation.SlowAndSafe;
 118            importOptions.materialImportMode = MaterialImportMode.ImportDisplayColor;
 119            importOptions.usdRootPath = GetDefaultRoot(scene);
 120            importOptions.importMonoBehaviours = true;
 121
 122            GameObject root = new GameObject(GetObjectName(importOptions.usdRootPath, path));
 123
 124            if (Selection.gameObjects.Length > 0)
 125            {
 126                root.transform.SetParent(Selection.gameObjects[0].transform);
 127            }
 128
 129            try
 130            {
 131                UsdToGameObject(root, scene, importOptions);
 132            }
 133            finally
 134            {
 135                scene.Close();
 136            }
 137        }
 138
 139#endif
 140
 141
 142        [MenuItem("USD/Import as GameObjects", priority = 0)]
 143        public static void MenuImportAsGameObjects()
 0144        {
 0145            var scene = ImportHelpers.InitForOpen();
 0146            if (scene == null)
 0147            {
 0148                return;
 149            }
 150
 0151            ImportHelpers.ImportSceneAsGameObject(scene, Selection.activeGameObject);
 0152            scene.Close();
 0153        }
 154
 155        [MenuItem("USD/Import as Prefab", priority = 1)]
 156        public static void MenuImportAsPrefab()
 0157        {
 0158            var scene = ImportHelpers.InitForOpen();
 0159            if (scene == null)
 0160            {
 0161                return;
 162            }
 163
 0164            ImportHelpers.ImportAsPrefab(scene, null);
 0165        }
 166
 167        [MenuItem("USD/Import as Timeline Clip", priority = 2)]
 168        public static void MenuImportAsTimelineClip()
 0169        {
 0170            var scene = ImportHelpers.InitForOpen();
 0171            if (scene == null)
 0172            {
 0173                return;
 174            }
 175
 0176            ImportHelpers.ImportAsTimelineClip(scene, null);
 0177        }
 178
 179        [MenuItem("USD/Unload Subtree", true)]
 180        static bool EnableMenuUnloadSubtree()
 0181        {
 0182            return Selection.activeGameObject && Selection.activeGameObject.GetComponentInParent<UsdAsset>();
 0183        }
 184
 185        [MenuItem("USD/Unload Subtree", priority = 100)]
 186        public static void MenuUnloadSubtree()
 1187        {
 1188            var src = Selection.activeGameObject.transform;
 1189            int count = 0;
 190
 191            // Potential payload issue: If the payload policy is set to "Dont Load Payloads" on scene
 192            // load, then the policy is switched to "Load All" and the refresh button is hit, the
 193            // internal state of the existing payloads will be incorrect because they will have been
 194            // loaded by virtue of the UsdStage's payload policy, without a load/unload action.
 195            // The real underlying issue is that the system rebuilds the PrimMap on every refresh, which
 196            // enables unloaded and deleted prims to come back to life. What should happen is the
 197            // PrimMap should be reconstructed from the Unity scene on refresh instead. This would
 198            // ensure changing the load policy would not trigger previously unloaded prims to be loaded.
 199
 5200            foreach (var payload in src.GetComponentsInChildren<UsdPayload>())
 1201            {
 1202                if (payload.IsLoaded)
 1203                {
 1204                    payload.Unload();
 1205                    payload.Update();
 1206                }
 207
 1208                count++;
 1209            }
 210
 1211            if (count == 0)
 0212            {
 0213                Debug.LogWarning("No USD payloads found in subtree.");
 0214                return;
 215            }
 1216        }
 217
 218        [MenuItem("USD/Load Subtree", true)]
 219        static bool EnableMenuLoadSubtree()
 0220        {
 0221            return Selection.activeGameObject && Selection.activeGameObject.GetComponentInParent<UsdAsset>();
 0222        }
 223
 224        [MenuItem("USD/Load Subtree", priority = 101)]
 225        public static void MenuLoadSubtree()
 1226        {
 1227            var src = Selection.activeGameObject.transform;
 1228            int count = 0;
 5229            foreach (var payload in src.GetComponentsInChildren<UsdPayload>())
 1230            {
 1231                if (!payload.IsLoaded)
 1232                {
 1233                    payload.Load();
 1234                    payload.Update();
 1235                }
 236
 1237                count++;
 1238            }
 239
 1240            if (count == 0)
 0241            {
 0242                Debug.LogWarning("No USD payloads found in subtree.");
 0243                return;
 244            }
 1245        }
 246    }
 247}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdPrimSourceEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdPrimSourceEditor.html new file mode 100644 index 000000000..e26b9b08b --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdPrimSourceEditor.html @@ -0,0 +1,483 @@ + + + + + + +Unity.Formats.USD.UsdPrimSourceEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdPrimSourceEditor
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdPrimSourceEditor.cs
Covered lines:26
Uncovered lines:176
Coverable lines:202
Total lines:367
Line coverage:12.8% (26 of 202)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdPrimSourceEditor()0%000100%
OnInspectorGUI()0%00053.19%
DrawAttributeInfo(...)0%0000%
WalkNodes(...)0%0000%
WalkLayers(...)0%0000%
DrawAttributeGui(...)0%0000%
DebugPrintAttr(...)0%0000%
GetCSharpValue(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/UsdPrimSourceEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Linq;
 16using UnityEngine;
 17using UnityEditor;
 18using pxr;
 19using USD.NET;
 20
 21namespace Unity.Formats.USD
 22{
 23    [CustomEditor(typeof(UsdPrimSource))]
 24    public class UsdPrimSourceEditor : Editor
 25    {
 26        UsdAttribute selectedAttribute;
 327        bool m_showExpandedUi = false;
 28
 29        public override void OnInspectorGUI()
 1230        {
 1231            var attachment = (UsdPrimSource)target;
 1232            var stageRoot = attachment.GetComponentInParent<UsdAsset>();
 33
 1234            if (!stageRoot)
 035            {
 036                stageRoot = attachment.GetComponent<UsdAsset>();
 037            }
 38
 1239            if (!stageRoot)
 040            {
 041                Debug.LogError("No stage root found");
 042                return;
 43            }
 44
 1245            var scene = stageRoot.GetScene();
 1246            if (scene == null)
 047            {
 048                Debug.LogError("Invalid scene: " + stageRoot.usdFullPath);
 049                return;
 50            }
 51
 1252            var prim = scene.GetPrimAtPath(attachment.m_usdPrimPath);
 53
 54            //
 55            // BEGIN GUI.
 56            //
 57
 1258            GUILayout.BeginHorizontal();
 1259            EditorGUILayout.LabelField("USD Prim: ", GUILayout.Width(100));
 1260            EditorGUILayout.SelectableLabel(attachment.m_usdPrimPath, EditorStyles.textField,
 61                GUILayout.Height(EditorGUIUtility.singleLineHeight));
 1262            GUILayout.EndHorizontal();
 63
 1264            if (prim != null)
 1265            {
 1266                GUILayout.BeginHorizontal();
 1267                EditorGUILayout.LabelField("Prim Type: ", GUILayout.Width(100));
 1268                EditorGUILayout.SelectableLabel(prim.GetTypeName(), EditorStyles.textField,
 69                    GUILayout.Height(EditorGUIUtility.singleLineHeight));
 1270                GUILayout.EndHorizontal();
 1271            }
 72
 1273            EditorGUILayout.LabelField("USD Time: " + stageRoot.m_usdTimeOffset);
 74
 1275            m_showExpandedUi = GUILayout.Toggle(m_showExpandedUi, "Show USD Inspector");
 76
 1277            if (!m_showExpandedUi)
 1278            {
 1279                return;
 80            }
 81
 82            //
 83            // Attribute Grid.
 84            //
 85            // Separator.
 086            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
 87
 088            if (prim == null)
 089            {
 090                EditorGUILayout.LabelField("(Prim is not valid/loaded in USD file)");
 091                return;
 92            }
 93
 094            DrawAttributeGui(prim, scene);
 95
 96            //
 97            // Prim Composition Graph.
 98            //
 99            // Separator.
 0100            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
 0101            EditorGUILayout.LabelField("Prim Composition Graph", EditorStyles.boldLabel);
 102
 103            // Since composition can only happen at the prim level, the prim is used to construct the
 104            // composition graph. The Pcp (Prim Cache Population) API is the lowest level of the
 105            // composition system, which means it's most powerful and most complicated. PcpNodeRefs
 106            // provide direct access to the in-memory composition structure. Note that unloaded prims
 107            // will not have a PrimIndex.
 108            //
 109            // The composition graph is typically less useful for users, since it's a complicated
 110            // structure to understand, but often there is a small handful of power users on a
 111            // production responsible for setting up the pipeline composition structure; for them this
 112            // visualization can be extremely helpful.
 0113            WalkNodes(prim.GetPrimIndex().GetRootNode());
 114
 0115            if (selectedAttribute != null && selectedAttribute.IsValid())
 0116            {
 0117                DrawAttributeInfo(scene);
 0118            }
 12119        }
 120
 121        void DrawAttributeInfo(Scene scene)
 0122        {
 123            // Separator.
 0124            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
 125
 0126            EditorGUILayout.LabelField("Property Opinions", EditorStyles.boldLabel);
 0127            EditorGUILayout.LabelField("Name: " + selectedAttribute.GetName());
 0128            EditorGUILayout.LabelField("Type: " + selectedAttribute.GetTypeName().GetTfType().GetTypeName());
 0129            EditorGUILayout.LabelField("IsArray: " + selectedAttribute.GetTypeName().IsArray());
 0130            EditorGUILayout.LabelField("Composed Path: " + selectedAttribute.GetPath());
 0131            EditorGUILayout.LabelField("Variability: " + selectedAttribute.GetVariability());
 0132            EditorGUILayout.LabelField("Is Custom: " + selectedAttribute.IsCustom());
 133            double upper, lower, hasSamples;
 0134            selectedAttribute.GetBracketingTimeSamples(scene.Time.GetValueOrDefault(), out lower, out upper,
 135                out hasSamples);
 0136            if (hasSamples > 0)
 0137            {
 0138                EditorGUILayout.LabelField("Braketing TimeSamples: [ " + lower + ", " + upper + " ]");
 0139            }
 140            else
 0141            {
 0142                EditorGUILayout.LabelField("Braketing TimeSamples: [ ]");
 0143            }
 144
 0145            EditorGUILayout.LabelField("TimeSamples: ");
 0146            GUILayout.TextArea(string.Join(",",
 0147                selectedAttribute.GetTimeSamples().Select(p => p.ToString()).ToArray()));
 148
 149            // Spec are the low level API  in Sdf, the enable one to read and write a layer without
 150            // going through the composition graph. This is the fastest way to write USD data, but
 151            // also the most complicated.
 152            //
 153            // A property stack is an ordered list of all opinions about what this value should be.
 154            // The visualization below is a great debugging aid in production when something looks
 155            // wrong, but you have no idea why your value (opinion) isn't winning. It lets the user
 156            // understand how composition is working and shows them exactly what files are contributing
 157            // the final result.
 158
 0159            EditorGUILayout.LabelField("Authored Values: ");
 0160            var specs = selectedAttribute.GetPropertyStack();
 0161            if (specs.Count == 0)
 0162            {
 0163                EditorGUILayout.LabelField("[ Attribute has no authored opinions ]", EditorStyles.boldLabel);
 0164            }
 165
 0166            foreach (var propSpec in specs)
 0167            {
 0168                EditorGUILayout.LabelField(propSpec.GetLayer().GetIdentifier());
 0169            }
 170
 171            // Separator.
 0172            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
 0173        }
 174
 175        #region "Composition Graph"
 176
 177        void WalkNodes(PcpNodeRef node)
 0178        {
 0179            GUI.enabled = node.HasSpecs();
 0180            EditorGUILayout.LabelField("[" + node.GetArcType().ToString().Replace("PcpArcType", "") + "] < " +
 181                node.GetPath() + ">");
 0182            WalkLayers(node, node.GetLayerStack().GetLayerTree(), 1);
 0183            foreach (PcpNodeRef child in node.GetChildren())
 0184            {
 0185                WalkNodes(child);
 0186            }
 187
 0188            GUI.enabled = true;
 0189        }
 190
 191        void WalkLayers(PcpNodeRef node, SdfLayerTreeHandle tree, int indent)
 0192        {
 0193            GUILayout.BeginHorizontal();
 0194            GUILayout.Space(indent * 20);
 0195            EditorGUILayout.LabelField(tree.GetLayer().GetIdentifier());
 0196            GUILayout.EndHorizontal();
 0197            foreach (var childTree in tree.GetChildTrees())
 0198            {
 0199                WalkLayers(node, childTree, indent++);
 0200            }
 0201        }
 202
 203        #endregion
 204
 205        #region "Attribute Grid"
 206
 207        void DrawAttributeGui(UsdPrim prim, Scene usdScene)
 0208        {
 0209            double usdTime = usdScene.Time.GetValueOrDefault();
 210
 0211            var boldBlue = new GUIStyle(EditorStyles.boldLabel);
 0212            boldBlue.normal.textColor = Color.blue;
 213
 0214            foreach (UsdAttribute attr in prim.GetAttributes())
 0215            {
 0216                bool hasAuthoredValue = attr.HasAuthoredValueOpinion();
 0217                bool hasValue = attr.HasValue();
 0218                bool isSelected = GUI.GetNameOfFocusedControl() == attr.GetName();
 0219                var displayName = attr.GetDisplayName();
 0220                displayName = !string.IsNullOrEmpty(displayName) ? displayName : attr.GetName();
 221
 0222                GUILayout.BeginHorizontal();
 0223                EditorGUIUtility.labelWidth = 100;
 224
 0225                GUI.SetNextControlName(attr.GetName());
 0226                if (hasAuthoredValue)
 0227                {
 0228                    EditorGUILayout.SelectableLabel(displayName, isSelected ? boldBlue : EditorStyles.boldLabel,
 229                        GUILayout.MaxHeight(20));
 0230                }
 231                else
 0232                {
 0233                    EditorGUILayout.SelectableLabel(displayName, GUILayout.MaxHeight(20));
 0234                }
 235
 0236                if (isSelected)
 0237                {
 0238                    selectedAttribute = attr;
 0239                }
 240
 0241                EditorGUIUtility.labelWidth = 10;
 0242                var suffix = "";
 0243                if (attr.GetTypeName().IsArray())
 0244                {
 0245                    suffix = "[]";
 0246                }
 247
 0248                GUI.enabled = false;
 0249                EditorGUILayout.LabelField(attr.GetTypeName().GetTfType().GetTypeName() + suffix);
 0250                GUI.enabled = true;
 251
 0252                GUI.enabled = hasAuthoredValue;
 0253                if (isSelected)
 0254                {
 0255                    var csValue = GetCSharpValue(attr, usdTime);
 0256                    if (csValue != null)
 0257                    {
 0258                        var stringVal = csValue.ToString();
 0259                        EditorGUILayout.LabelField(stringVal.Substring(0, Mathf.Min(stringVal.Length, 100)));
 0260                    }
 261                    else
 0262                    {
 0263                        EditorGUILayout.LabelField("");
 0264                    }
 0265                }
 266                else
 0267                {
 0268                    EditorGUILayout.LabelField("");
 0269                }
 270
 0271                GUI.enabled = true;
 272
 0273                GUI.enabled = hasValue;
 0274                GUILayout.Width(40);
 0275                if (GUILayout.Button("Print"))
 0276                {
 0277                    DebugPrintAttr(usdScene, attr, usdTime);
 0278                }
 279
 0280                GUI.enabled = true;
 281
 0282                GUILayout.EndHorizontal();
 0283            }
 0284        }
 285
 286        /// <summary>
 287        /// Serializes the attribute value to USD-ASCII and writes it to Debug.Log.
 288        /// </summary>
 289        void DebugPrintAttr(Scene srcScene, UsdAttribute attr, UsdTimeCode time)
 0290        {
 291            // Copy the desired attribute into a temp scene, with nothing other than this one attr.
 0292            var tmpScene = Scene.Create();
 293
 294            // Up-Axis is unrelated to the attribute, but it makes the generated USDA look more correct,
 295            // since it will include an up-axis.
 0296            tmpScene.UpAxis = srcScene.UpAxis;
 297
 298            // Define the owning prim for the attribute.
 0299            var tmpPrim = tmpScene.Stage.DefinePrim(attr.GetPath().GetPrimPath(), attr.GetPrim().GetTypeName());
 300
 301            // Define the attribute itself.
 0302            var tmpAttr = tmpPrim.CreateAttribute(attr.GetName(), attr.GetTypeName());
 303
 304            // Gather the default value and the value at the current time.
 0305            var defaultVal = attr.Get(UsdTimeCode.Default());
 0306            var valAtTime = attr.Get(time);
 307
 308            // Copy them to the new attribute.
 0309            if (!defaultVal.IsEmpty())
 0310            {
 0311                tmpAttr.Set(defaultVal);
 0312            }
 313
 0314            if (attr.ValueMightBeTimeVarying())
 0315            {
 0316                tmpAttr.Set(valAtTime, time);
 0317            }
 318
 319            // If this is an array, get the size.
 0320            var arraySize = -1;
 0321            if (valAtTime.IsArrayValued())
 0322            {
 0323                arraySize = (int)valAtTime.GetArraySize();
 0324            }
 325
 326            // Metadata cannot be time-varying.
 0327            UsdMetadataValueMap metaData = attr.GetAllMetadata();
 0328            foreach (var key in metaData.GetKeys())
 0329            {
 0330                tmpAttr.SetMetadata(key, metaData.GetValue(key));
 0331            }
 332
 333            // Export the single attribute to a string.
 0334            var stringified = "";
 0335            tmpScene.Stage.ExportToString(out stringified, addSourceFileComment: false);
 336
 337            // Dispose the tmp scene.
 0338            tmpScene.Close();
 0339            tmpScene = null;
 340
 341            // Print.
 0342            if (arraySize > -1)
 0343            {
 0344                stringified = "Array Size: " + arraySize + "\n" + stringified;
 0345            }
 346
 0347            Debug.Log("Path: <" + attr.GetPath().ToString() + ">\n" + stringified);
 0348        }
 349
 350        #endregion
 351
 352        /// <summary>
 353        /// Returns the C# value from USD or null if there was no value or the value could not be converted.
 354        /// </summary>
 355        object GetCSharpValue(UsdAttribute attr, UsdTimeCode time)
 0356        {
 357            UsdTypeBinding binding;
 0358            if (!UsdIo.Bindings.GetReverseBinding(attr.GetTypeName(), out binding))
 0359            {
 360                // No binding for this type.
 0361                return null;
 362            }
 363
 0364            return binding.toCsObject(attr.Get(time));
 0365        }
 366    }
 367}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorder.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorder.html new file mode 100644 index 000000000..4d2433b6a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorder.html @@ -0,0 +1,244 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorder - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorder
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorder.cs
Covered lines:0
Uncovered lines:71
Coverable lines:71
Total lines:137
Line coverage:0% (0 of 71)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SessionCreated(...)0%0000%
EndRecording(...)0%0000%
RecordFrame(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorder.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using System;
 3using System.IO;
 4using pxr;
 5using Unity.Formats.USD;
 6using UnityEditor.Recorder;
 7using UnityEngine;
 8
 9namespace UnityEditor.Formats.USD.Recorder
 10{
 11    public class UsdRecorder : GenericRecorder<UsdRecorderSettings>
 12    {
 13        ExportContext context;
 014        UsdRecorderInput Input => m_Inputs[0] as UsdRecorderInput;
 15
 16        // Stateful stuff used during the recording that should be cleaned
 17        DirectoryInfo usdzTemporaryDir;
 18        string usdcFileName;
 19        string usdzFileName;
 20        string usdzFilePath;
 21        string currentDir;
 22        protected override void SessionCreated(RecordingSession session)
 023        {
 024            base.SessionCreated(session);
 25
 026            InitUsd.Initialize();
 027            var outputFile = Settings.FileNameGenerator.BuildAbsolutePath(session);
 028            if (Settings.ExportFormat == UsdRecorderSettings.Format.USDZ) // FIXME Support USDz
 029            {
 30                try
 031                {
 032                    currentDir = Directory.GetCurrentDirectory();
 33                    // Setup a temporary directory to export the wanted USD file and zip it.
 034                    var tmpDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
 035                    usdzTemporaryDir = Directory.CreateDirectory(tmpDirPath);
 36
 37                    // Get the usd file name to export and the usdz file name of the archive.
 038                    usdcFileName = Path.GetFileNameWithoutExtension(outputFile) + ".usdc";
 039                    usdzFileName = Path.GetFileName(outputFile);
 040                    var fi = new FileInfo(outputFile);
 041                    usdzFilePath = fi.FullName;
 42
 43                    // Set the current working directory to the tmp directory to export with relative paths.
 044                    Directory.SetCurrentDirectory(tmpDirPath);
 45
 046                    outputFile = Path.Combine(tmpDirPath, usdcFileName);
 047                }
 48                finally
 049                {
 050                    Directory.SetCurrentDirectory(currentDir);
 051                }
 052            }
 53
 54            try
 055            {
 056                context = new ExportContext
 57                {
 58                    scene = ExportHelpers.InitForSave(outputFile)
 59                };
 060            }
 061            catch (Exception)
 062            {
 063                throw new InvalidOperationException($"The file is already open in Unity. Please close all references to 
 64            }
 65
 66
 067            context.scene.FrameRate = Settings.FrameRate; // Variable framerate support ?
 068            context.scene.Stage.SetInterpolationType(Settings.InterpolationType); // User Option
 69
 070            context.basisTransform = Settings.BasisTransformation;
 071            context.activePolicy = Settings.ActivePolicy;
 072            context.exportMaterials = Settings.ExportMaterials;
 73
 074            context.scale = Settings.Scale;
 75
 076            context.scene.StartTime = 0; // Absolute vs relative Time
 77
 78            // Export the "default" frame, that is, all data which doesn't vary over time.
 079            context.scene.Time = null;
 80
 081            Input.Context = context;
 082        }
 83
 84        protected override void EndRecording(RecordingSession session)
 085        {
 86            // There is a bug in com.unity.recorder v4.0.0 - RecordingSession.Dispose is called twice
 87            // context is set to null in the first call and we can ignore the second call
 088            if (context == null)
 089            {
 090                return;
 91            }
 92
 093            context.scene.EndTime = session.recorderTime * session.settings.FrameRate;
 094            context.scene.Save();
 095            context.scene.Close();
 96
 097            if (Settings.ExportFormat == UsdRecorderSettings.Format.USDZ)
 098            {
 99                try
 0100                {
 0101                    Directory.SetCurrentDirectory(usdzTemporaryDir.FullName);
 0102                    var assetPath = new SdfAssetPath(usdcFileName);
 0103                    var success = UsdCs.UsdUtilsCreateNewARKitUsdzPackage(assetPath, usdzFileName);
 104
 0105                    if (!success)
 0106                    {
 0107                        Debug.LogError("Couldn't export to the usdz file: " + usdzFilePath);
 0108                        return;
 109                    }
 110
 111                    // needed if we export into temp folder first
 0112                    File.Copy(usdzFileName, usdzFilePath, overwrite: true);
 0113                }
 114                finally
 0115                {
 116                    // Clean up temp files.
 0117                    Directory.SetCurrentDirectory(currentDir);
 0118                    if (usdzTemporaryDir != null && usdzTemporaryDir.Exists)
 0119                    {
 0120                        usdzTemporaryDir.Delete(recursive: true);
 0121                    }
 0122                }
 0123            }
 124
 0125            context = null;
 0126            Input.Context = null;
 127
 0128            base.EndRecording(session);
 0129        }
 130
 131        protected override void RecordFrame(RecordingSession ctx) // Weird
 0132        {
 133            //
 0134        }
 135    }
 136}
 137#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInput.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInput.html new file mode 100644 index 000000000..5025e256c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInput.html @@ -0,0 +1,136 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorderInput - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorderInput
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderInput.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:29
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BeginRecording(...)0%0000%
NewFrameReady(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderInput.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using Unity.Formats.USD;
 3using UnityEditor.Recorder;
 4
 5namespace UnityEditor.Formats.USD.Recorder
 6{
 7    public class UsdRecorderInput : RecorderInput
 8    {
 09        internal ExportContext Context { get; set; }
 010        UsdRecorderInputSettings Settings => settings as UsdRecorderInputSettings;
 11
 12        protected override void BeginRecording(RecordingSession session)
 013        {
 014            SceneExporter.SyncExportContext(Settings.GameObject, Context);
 015            SceneExporter.Export(Settings.GameObject,
 16                Context,
 17                zeroRootTransform: false);
 018        }
 19
 20        protected override void NewFrameReady(RecordingSession session)
 021        {
 022            Context.scene.Time = session.recorderTime * session.settings.FrameRate;
 023            Context.exportMaterials = false;
 024            SceneExporter.Export(Settings.GameObject, Context, zeroRootTransform: false);
 025        }
 26    }
 27}
 28
 29#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettings.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettings.html new file mode 100644 index 000000000..2b9142585 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettings.html @@ -0,0 +1,157 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderInputSettings.cs
Covered lines:0
Uncovered lines:22
Coverable lines:22
Total lines:50
Line coverage:0% (0 of 22)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdRecorderInputSettings()0%0000%
ValidityCheck(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderInputSettings.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using System;
 3using System.Collections.Generic;
 4using UnityEditor.Recorder;
 5using UnityEngine;
 6
 7namespace UnityEditor.Formats.USD.Recorder
 8{
 9    [Serializable]
 10    public class UsdRecorderInputSettings : RecorderInputSettings
 11    {
 012        [SerializeField] string m_BindingId = null;
 13        public GameObject GameObject
 14        {
 15            get
 016            {
 017                if (string.IsNullOrEmpty(m_BindingId))
 018                {
 019                    return null;
 20                }
 21
 022                return BindingManager.Get(m_BindingId) as GameObject;
 023            }
 24
 25            set
 026            {
 027                if (string.IsNullOrEmpty(m_BindingId))
 028                {
 029                    m_BindingId = GUID.Generate().ToString();
 030                }
 31
 032                BindingManager.Set(m_BindingId, value);
 033            }
 34        }
 35
 36        protected override bool ValidityCheck(List<string> errors)
 037        {
 038            if (GameObject == null)
 039            {
 040                errors.Add("GameObject cannot be null");
 041                return false;
 42            }
 43
 044            return true;
 045        }
 46
 047        protected override Type InputType => typeof(UsdRecorderInput);
 48    }
 49}
 50#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettingsPropertyDrawer.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettingsPropertyDrawer.html new file mode 100644 index 000000000..986e8b88e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderInputSettingsPropertyDrawer.html @@ -0,0 +1,125 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/UsdRecorderInputSettingsPropertyDrawer.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:23
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnGUI(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/UsdRecorderInputSettingsPropertyDrawer.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using UnityEngine;
 3
 4namespace UnityEditor.Formats.USD.Recorder
 5{
 6    [CustomPropertyDrawer(typeof(UsdRecorderInputSettings))]
 7    class UsdRecorderInputSettingsPropertyDrawer : TargetedPropertyDrawer<UsdRecorderInputSettings>
 8    {
 9        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 010        {
 011            Initialize(property);
 012            using (var changed = new EditorGUI.ChangeCheckScope())
 013            {
 014                var go = EditorGUI.ObjectField(position, label, target.GameObject, typeof(GameObject), true) as GameObje
 015                if (changed.changed)
 016                {
 017                    target.GameObject = go;
 018                }
 019            }
 020        }
 21    }
 22}
 23#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettings.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettings.html new file mode 100644 index 000000000..3167c7c9c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettings.html @@ -0,0 +1,207 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorderSettings - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorderSettings
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderSettings.cs
Covered lines:0
Uncovered lines:29
Coverable lines:29
Total lines:91
Line coverage:0% (0 of 29)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdRecorderSettings()0%0000%
get_InputsSettings()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/UsdRecorderSettings.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using System;
 3using System.Collections.Generic;
 4using pxr;
 5using Unity.Formats.USD;
 6using UnityEditor.Recorder;
 7using UnityEngine;
 8
 9namespace UnityEditor.Formats.USD.Recorder
 10{
 11    [RecorderSettings(typeof(UsdRecorder), "USD Clip", "usd_recorder")]
 12    public class UsdRecorderSettings : RecorderSettings
 13    {
 014        [SerializeField] UsdRecorderInputSettings inputSettings = new UsdRecorderInputSettings();
 15        [SerializeField] Format exportFormat;
 016        [SerializeField] UsdInterpolationType interpolationType = UsdInterpolationType.UsdInterpolationTypeLinear;
 017        [SerializeField] BasisTransformation coordinateConversion = BasisTransformation.SlowAndSafe;
 018        [SerializeField] ActiveExportPolicy activePolicy = ActiveExportPolicy.ExportAsVisibility;
 019        [SerializeField] bool exportMaterials = true;
 020        [SerializeField] float scale = 1;
 21
 022        public UsdRecorderSettings()
 023        {
 024            FileNameGenerator.FileName = DefaultWildcard.Recorder + "_" + DefaultWildcard.Take;
 025        }
 26
 27        public enum Format
 28        {
 29            USD,
 30            USDA,
 31            USDZ,
 32        }
 33
 34        public UsdInterpolationType InterpolationType
 35        {
 036            get => interpolationType;
 037            set => interpolationType = value;
 38        }
 39
 40        public float Scale
 41        {
 042            get => scale;
 043            set => scale = value;
 44        }
 45
 46        public bool ExportMaterials
 47        {
 048            get => exportMaterials;
 049            set => exportMaterials = value;
 50        }
 51
 52        public ActiveExportPolicy ActivePolicy
 53        {
 054            get => activePolicy;
 055            set => activePolicy = value;
 56        }
 57
 58        public BasisTransformation BasisTransformation
 59        {
 060            get => coordinateConversion;
 061            set => coordinateConversion = value;
 62        }
 63
 064        public Format ExportFormat => exportFormat;
 65
 66        protected override string Extension
 67        {
 68            get
 069            {
 070                switch (exportFormat)
 71                {
 72                    case Format.USD:
 073                        return "usd";
 74                    case Format.USDA:
 075                        return "usda";
 76                    case Format.USDZ:
 077                        return "usdz";
 78                    default:
 079                        throw new ArgumentException("Unhandled format");
 80                }
 081            }
 82        }
 83
 84        public override IEnumerable<RecorderInputSettings> InputsSettings
 85        {
 086            get { yield return inputSettings; }
 87        }
 88    }
 89}
 90
 91#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettingsEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettingsEditor.html new file mode 100644 index 000000000..a3e81b420 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdRecorderSettingsEditor.html @@ -0,0 +1,122 @@ + + + + + + +UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/UsdRecorderSettingsEditor.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:20
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
FileTypeAndFormatGUI()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Recorder/Editors/UsdRecorderSettingsEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1#if RECORDER_AVAILABLE
 2using UnityEditor.Recorder;
 3
 4namespace UnityEditor.Formats.USD.Recorder
 5{
 6    [CustomEditor(typeof(UsdRecorderSettings))]
 7    public class UsdRecorderSettingsEditor : RecorderEditor
 8    {
 9        protected override void FileTypeAndFormatGUI()
 010        {
 011            EditorGUILayout.PropertyField(serializedObject.FindProperty("exportFormat"));
 012            EditorGUILayout.PropertyField(serializedObject.FindProperty("interpolationType"));
 013            EditorGUILayout.PropertyField(serializedObject.FindProperty("coordinateConversion"));
 014            EditorGUILayout.PropertyField(serializedObject.FindProperty("activePolicy"));
 015            EditorGUILayout.PropertyField(serializedObject.FindProperty("exportMaterials"));
 016            EditorGUILayout.PropertyField(serializedObject.FindProperty("scale"));
 017        }
 18    }
 19}
 20#endif
+
+
+
+

Methods/Properties

+FileTypeAndFormatGUI()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdVariantSetEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdVariantSetEditor.html new file mode 100644 index 000000000..9f6752cf4 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Editor_UsdVariantSetEditor.html @@ -0,0 +1,178 @@ + + + + + + +Unity.Formats.USD.UsdVariantSetEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdVariantSetEditor
Assembly:Unity.Formats.USD.Editor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/VariantSetEditor.cs
Covered lines:33
Uncovered lines:7
Coverable lines:40
Total lines:76
Line coverage:82.5% (33 of 40)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnInspectorGUI()0%00084.44%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Editor/Scripts/Behaviors/VariantSetEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEditor;
 17
 18namespace Unity.Formats.USD
 19{
 20    [CustomEditor(typeof(UsdVariantSet))]
 21    public class UsdVariantSetEditor : Editor
 22    {
 23        public override void OnInspectorGUI()
 1224        {
 1225            var variantSet = (UsdVariantSet)this.target;
 26
 1227            int selectedIndex = 0;
 1228            int varIdx = 0;
 1229            int setIdx = 0;
 1230            bool selChanged = false;
 31
 1232            GUILayout.Label("Variant Sets");
 33
 6034            foreach (string setName in variantSet.m_variantSetNames)
 1235            {
 1236                var options = new string[variantSet.m_variantCounts[setIdx] + 1];
 1237                selectedIndex = 0;
 1238                options[0] = " ";
 9639                for (int i = 0; i < variantSet.m_variantCounts[setIdx]; i++)
 3640                {
 3641                    options[i + 1] = variantSet.m_variants[varIdx + i];
 3642                    if (options[i + 1] == variantSet.m_selected[setIdx])
 1243                    {
 1244                        selectedIndex = i + 1;
 1245                    }
 3646                }
 47
 1248                int newSel = EditorGUILayout.Popup(setName, selectedIndex, options);
 49
 1250                if (selectedIndex != newSel)
 051                {
 052                    selChanged = true;
 053                }
 54
 1255                if (newSel == 0)
 056                {
 057                    variantSet.m_selected[setIdx] = "";
 058                }
 59                else
 1260                {
 1261                    variantSet.m_selected[setIdx] = variantSet.m_variants[varIdx + newSel - 1];
 1262                }
 63
 1264                varIdx += variantSet.m_variantCounts[setIdx];
 1265                setIdx += 1;
 1266            }
 67
 1268            if (!selChanged)
 1269            {
 1270                return;
 71            }
 72
 073            variantSet.ApplyVariantSelections();
 1274        }
 75    }
 76}
+
+
+
+

Methods/Properties

+OnInspectorGUI()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_Explode.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_Explode.html new file mode 100644 index 000000000..9a250e0ef --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_Explode.html @@ -0,0 +1,157 @@ + + + + + + +USD.NET.Examples.Explode - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:USD.NET.Examples.Explode
Assembly:Unity.Formats.USD.ExportMesh
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/Explode.cs
Covered lines:0
Uncovered lines:19
Coverable lines:19
Total lines:51
Line coverage:0% (0 of 19)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Explode()0%0000%
Start()0%0000%
Update()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/Explode.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16
 17namespace USD.NET.Examples
 18{
 19    public class Explode : MonoBehaviour
 20    {
 021        public int m_explodeTime = 10;
 22        public Transform m_effectRoot;
 023        public float m_force = 1;
 024        public float m_radius = 1;
 25
 026        private bool m_active = true;
 27
 28        void Start()
 029        {
 030        }
 31
 32        void Update()
 033        {
 034            if (!m_active)
 035            {
 036                return;
 37            }
 38
 039            if (Time.time < m_explodeTime)
 040            {
 041                return;
 42            }
 43
 044            m_active = false;
 045            foreach (Rigidbody rb in m_effectRoot.GetComponentsInChildren<Rigidbody>())
 046            {
 047                rb.AddExplosionForce(m_force, transform.position, m_radius);
 048            }
 049        }
 50    }
 51}
+
+
+
+

Methods/Properties

+Explode()
+Start()
+Update()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExample.html new file mode 100644 index 000000000..58a8afeb9 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExample.html @@ -0,0 +1,405 @@ + + + + + + +Unity.Formats.USD.Examples.ExportMeshExample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.ExportMeshExample
Assembly:Unity.Formats.USD.ExportMesh
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/ExportMeshExample.cs
Covered lines:0
Uncovered lines:109
Coverable lines:109
Total lines:291
Line coverage:0% (0 of 109)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportMeshExample()0%0000%
StartRecording()0%0000%
StopRecording()0%0000%
Awake()0%0000%
LateUpdate()0%0000%
Export(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/ExportMeshExample.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using UnityEngine;
 17using USD.NET;
 18
 19namespace Unity.Formats.USD.Examples
 20{
 21    /// <remarks>
 22    /// Export Mesh Example
 23    ///
 24    ///  * StartRecording:
 25    ///    * Create and configure a USD scene.
 26    ///    * Traverse the Unity scene, for each GameObject:
 27    ///      * Create an association between the Unity object and a USD prim.
 28    ///      * Assign an ExportFunction that will export the data for the object.
 29    ///
 30    ///  * Export unvarying data:
 31    ///    * Export mesh topology and any other data that doesn't change from frame-to-frame.
 32    ///
 33    ///  * On Update, export time-varying data:
 34    ///    * Traverse the map of GameObjects, for each object:
 35    ///      * Call the associated export function.
 36    ///
 37    ///  * StopRecording:
 38    ///    * Save and close the USD scene.
 39    ///    * Release the association map and USD scene.
 40    /// </remarks>
 41    public class ExportMeshExample : MonoBehaviour
 42    {
 43        [Serializable]
 44        public enum TimeCode
 45        {
 46            Frames,
 47            Seconds
 48        }
 49
 50        [Serializable]
 51        public enum FrameRate
 52        {
 53            Fps6 = 6,
 54            Fps12 = 12,
 55            Fps15 = 15,
 56            Fps24 = 24,
 57            Fps30 = 30,
 58            Fps48 = 48,
 59            Fps60 = 60,
 60            Fps72 = 72,
 61            Fps75 = 75,
 62            Fps90 = 90,
 63        }
 64
 65        // The root GameObject to export to USD.
 66        public GameObject m_exportRoot;
 67        public GameObject[] m_trackedRoots;
 68
 69        public int m_curFrame;
 70
 71        // How time is represened in USD.
 072        public TimeCode m_timeUnits = TimeCode.Frames;
 73
 74        // The desired playback rate.
 075        public FrameRate m_frameRate = FrameRate.Fps60;
 76
 77        // The number of frames to capture after hitting record;
 078        [Range(1, 500)] public int m_frameCount = 100;
 79
 080        public bool m_exportMaterials = true;
 081        public BasisTransformation m_convertHandedness = BasisTransformation.SlowAndSafe;
 082        public ActiveExportPolicy m_activePolicy = ActiveExportPolicy.ExportAsVisibility;
 83
 84        // The path to where the USD file will be written.
 85        // If null/empty, the file will be created in memory only.
 86        public string m_usdFile;
 87
 88        // The scene object to which the recording will be saved.
 89        private Scene m_usdScene;
 90
 91        // Recording start time in frames.
 92        private int m_startFrame;
 93
 94        // Recording start time in seconds.
 95        private float m_startTime;
 96
 097        ExportContext m_context = new ExportContext();
 98
 99        // Used by the custom editor to determine recording state.
 0100        public bool IsRecording { get; private set; }
 101
 102        // ------------------------------------------------------------------------------------------ //
 103        // Recording Control.
 104        // ------------------------------------------------------------------------------------------ //
 105
 106        public void StartRecording()
 0107        {
 0108            if (IsRecording)
 0109            {
 0110                return;
 111            }
 112
 0113            if (!m_exportRoot)
 0114            {
 0115                Debug.LogError("ExportRoot not assigned.");
 0116                return;
 117            }
 118
 0119            if (m_usdScene != null)
 0120            {
 0121                m_usdScene.Close();
 0122                m_usdScene = null;
 0123            }
 124
 125            try
 0126            {
 0127                if (string.IsNullOrEmpty(m_usdFile))
 0128                {
 0129                    m_usdScene = Scene.Create();
 0130                }
 131                else
 0132                {
 0133                    m_usdScene = Scene.Create(m_usdFile);
 0134                }
 135
 136                // USD operates on frames, so the frame rate is required for playback.
 137                // We could also set this to 1 to indicate that the TimeCode is in seconds.
 0138                Application.targetFrameRate = (int)m_frameRate;
 139
 140                // This forces Unity to use a fixed time step, resulting in evenly spaced
 141                // time samples in USD. Unfortunately, non-integer frame rates are not supported.
 142                // When non-integer frame rates are needed, time can be manually paused and
 143                // and advanced
 0144                Time.captureFramerate = Application.targetFrameRate;
 145
 146                // Set the frame rate in USD  as well.
 147                //
 148                // This both set the "time samples per second" and the playback rate.
 149                // Setting times samples per second allows the authoring code to express samples as integer
 150                // values, avoiding floating point error; so by setting FrameRate = 60, the samples written
 151                // at time=0 through time=59 represent the first second of playback.
 152                //
 153                // Stage.TimeCodesPerSecond is set implicitly to 1 / FrameRate.
 0154                m_usdScene.FrameRate = Application.targetFrameRate;
 155
 156                // When authoring in terms of seconds, at any frame rate the samles written at
 157                // time = 0.0 through time = 1.0 represent the first second of playback. The framerate
 158                // above will only be used as a target frame rate.
 0159                if (m_timeUnits == TimeCode.Seconds)
 0160                {
 0161                    m_usdScene.Stage.SetTimeCodesPerSecond(1);
 0162                }
 163
 0164                m_usdScene.StartTime = 0;
 0165                m_usdScene.EndTime = m_frameCount;
 166
 167                // For simplicity in this example, adding game objects while recording is not supported.
 0168                m_context = new ExportContext();
 0169                m_context.scene = m_usdScene;
 0170                m_context.basisTransform = m_convertHandedness;
 171
 172                // Do this last, in case an exception is thrown above.
 0173                IsRecording = true;
 174
 175                // Set the start frame and add one because the button event fires after update, so the first
 176                // frame update sees while recording is (frameCount + 1).
 0177                m_startFrame = Time.frameCount + 1;
 0178                m_startTime = Time.timeSinceLevelLoad;
 0179            }
 0180            catch
 0181            {
 0182                if (m_usdScene != null)
 0183                {
 0184                    m_usdScene.Close();
 0185                    m_usdScene = null;
 0186                }
 187
 0188                throw;
 189            }
 0190        }
 191
 192        public void StopRecording()
 0193        {
 0194            if (!IsRecording)
 0195            {
 0196                return;
 197            }
 198
 0199            m_context = new ExportContext();
 200
 201            // In a real exporter, additional error handling should be added here.
 0202            if (!string.IsNullOrEmpty(m_usdFile))
 0203            {
 204                // We could use SaveAs here, which is fine for small scenes, though it will require
 205                // everything to fit in memory and another step where that memory is copied to disk.
 0206                m_usdScene.Save();
 0207            }
 208
 209            // Release memory associated with the scene.
 0210            m_usdScene.Close();
 0211            m_usdScene = null;
 212
 0213            IsRecording = false;
 0214        }
 215
 216        // ------------------------------------------------------------------------------------------ //
 217        // Unity Behavior Events.
 218        // ------------------------------------------------------------------------------------------ //
 219
 220        void Awake()
 0221        {
 222            // Init USD.
 0223            InitUsd.Initialize();
 0224        }
 225
 226        // Why LateUpdate()?
 227        // Because Update fires before the animation system applies computed values.
 228        void LateUpdate()
 0229        {
 0230            if (!IsRecording)
 0231            {
 0232                return;
 233            }
 234
 235            // On the first frame, export all the unvarying data (e.g. mesh topology).
 236            // On subsequent frames, skip unvarying data to avoid writing redundant data.
 0237            if (Time.frameCount == m_startFrame)
 0238            {
 239                // First write materials and unvarying values (mesh topology, etc).
 0240                m_context.exportMaterials = m_exportMaterials;
 0241                m_context.scene.Time = null;
 0242                m_context.activePolicy = ActiveExportPolicy.ExportAsVisibility;
 243
 0244                SceneExporter.SyncExportContext(m_exportRoot, m_context);
 0245                SceneExporter.Export(m_exportRoot, m_context, zeroRootTransform: true);
 0246            }
 247
 248            // Set the time at which to read samples from USD.
 249            // If the FramesPerSecond is set to 1 above, this should be Time.time instead of frame count.
 0250            m_curFrame = Time.frameCount - m_startFrame;
 0251            if (m_timeUnits == TimeCode.Frames)
 0252            {
 0253                m_context.scene.Time = m_curFrame;
 0254            }
 255            else
 0256            {
 0257                m_context.scene.Time = Time.timeSinceLevelLoad - m_startTime;
 0258            }
 259
 0260            m_context.exportMaterials = false;
 261
 262            // Exit once we've recorded all frames.
 0263            if (m_curFrame > m_frameCount)
 0264            {
 0265                StopRecording();
 0266                return;
 267            }
 268
 269            // Record the time varying data that changes from frame to frame.
 0270            if (m_trackedRoots != null && m_trackedRoots.Length > 0)
 0271            {
 0272                foreach (var root in m_trackedRoots)
 0273                {
 0274                    SceneExporter.Export(root, m_context, zeroRootTransform: false);
 0275                }
 0276            }
 277            else
 0278            {
 0279                SceneExporter.Export(m_exportRoot, m_context, zeroRootTransform: true);
 0280            }
 0281        }
 282
 283        public static void Export(GameObject root,
 284            Scene scene,
 285            BasisTransformation basisTransform)
 0286        {
 0287            SceneExporter.Export(root, scene, basisTransform,
 288                exportUnvarying: true, zeroRootTransform: false);
 0289        }
 290    }
 291}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExampleEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExampleEditor.html new file mode 100644 index 000000000..dee66ed56 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ExportMesh_ExportMeshExampleEditor.html @@ -0,0 +1,157 @@ + + + + + + +Unity.Formats.USD.Examples.ExportMeshExampleEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.ExportMeshExampleEditor
Assembly:Unity.Formats.USD.ExportMesh
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/Editor/ExportMeshExampleEditor.cs
Covered lines:0
Uncovered lines:25
Coverable lines:25
Total lines:55
Line coverage:0% (0 of 25)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnInspectorGUI()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ExportMesh/Editor/ExportMeshExampleEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEditor;
 17
 18namespace Unity.Formats.USD.Examples
 19{
 20    [CustomEditor(typeof(ExportMeshExample))]
 21    public class ExportMeshExampleEditor : Editor
 22    {
 23        public override void OnInspectorGUI()
 024        {
 025            DrawDefaultInspector();
 26
 027            ExportMeshExample script = (ExportMeshExample)target;
 028            if (script.IsRecording)
 029            {
 030                var oldBg = GUI.backgroundColor;
 031                GUI.backgroundColor = Color.white;
 032                if (GUILayout.Button("Stop"))
 033                {
 034                    script.StopRecording();
 035                    EditorApplication.isPaused = true;
 036                }
 37
 038                GUI.backgroundColor = oldBg;
 039            }
 40            else
 041            {
 042                var oldBg = GUI.backgroundColor;
 043                GUI.backgroundColor = Color.red;
 044                if (GUILayout.Button("Record"))
 045                {
 046                    EditorApplication.isPaused = false;
 47                    //EditorApplication.isPlaying = true;
 048                    script.StartRecording();
 049                }
 50
 051                GUI.backgroundColor = oldBg;
 052            }
 053        }
 54    }
 55}
+
+
+
+

Methods/Properties

+OnInspectorGUI()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.HelloUsd_HelloUsdExample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.HelloUsd_HelloUsdExample.html new file mode 100644 index 000000000..811623841 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.HelloUsd_HelloUsdExample.html @@ -0,0 +1,175 @@ + + + + + + +Unity.Formats.USD.Examples.HelloUsdExample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.HelloUsdExample
Assembly:Unity.Formats.USD.HelloUsd
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/HelloUsd/HelloUsdExample.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:71
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%0000%
Test()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/HelloUsd/HelloUsdExample.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17
 18namespace Unity.Formats.USD.Examples
 19{
 20    public class HelloUsdExample : MonoBehaviour
 21    {
 22        [System.Serializable]
 23        class MyCustomData : SampleBase
 24        {
 25            public string aString;
 26            public int[] anArrayOfInts;
 27            public Bounds aBoundingBox;
 28        }
 29
 30        void Start()
 031        {
 032            InitUsd.Initialize();
 033            Test();
 034        }
 35
 36        void Test()
 037        {
 038            string usdFile = System.IO.Path.Combine(UnityEngine.Application.dataPath, "sceneFile.usda");
 39
 40            // Populate Values.
 041            var value = new MyCustomData();
 042            value.aString = "IT'S ALIIIIIIIIIIIIIVE!";
 043            value.anArrayOfInts = new int[] { 1, 2, 3, 4 };
 044            value.aBoundingBox = new UnityEngine.Bounds();
 45
 46            // Writing the value.
 047            var scene = Scene.Create(usdFile);
 048            scene.Time = 1.0;
 049            scene.Write("/someValue", value);
 050            Debug.Log(scene.Stage.GetRootLayer().ExportToString());
 051            scene.Save();
 052            scene.Close();
 53
 54            // Reading the value.
 055            Debug.Log(usdFile);
 056            value = new MyCustomData();
 057            scene = Scene.Open(usdFile);
 058            scene.Time = 1.0;
 059            scene.Read("/someValue", value);
 60
 061            Debug.LogFormat("Value: string={0}, ints={1}, bbox={2}",
 62                value.aString, value.anArrayOfInts, value.aBoundingBox);
 63
 064            var prim = scene.Stage.GetPrimAtPath(new pxr.SdfPath("/someValue"));
 065            var vtValue = prim.GetAttribute(new pxr.TfToken("aString")).Get(1);
 066            Debug.Log((string)vtValue);
 67
 068            scene.Close();
 069        }
 70    }
 71}
+
+
+
+

Methods/Properties

+Start()
+Test()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMaterials_ImportMaterialsExample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMaterials_ImportMaterialsExample.html new file mode 100644 index 000000000..d3aae6919 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMaterials_ImportMaterialsExample.html @@ -0,0 +1,527 @@ + + + + + + +Unity.Formats.USD.Examples.ImportMaterialsExample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.ImportMaterialsExample
Assembly:Unity.Formats.USD.ImportMaterials
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMaterials/ImportMaterialsExample.cs
Covered lines:0
Uncovered lines:219
Coverable lines:219
Total lines:415
Line coverage:0% (0 of 219)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ShaderPair(...)0%0000%
Update()0%0000%
Awake()0%0000%
Start()0%0000%
SetMaterialParameter(...)0%0000%
CreateSceneWithShading()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMaterials/ImportMaterialsExample.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using System.IO;
 17using UnityEngine;
 18using USD.NET;
 19using USD.NET.Unity;
 20
 21namespace Unity.Formats.USD.Examples
 22{
 23    public class ImportMaterialsExample : MonoBehaviour
 24    {
 25        private const string kCubePath = "/Model/Geom/Cube";
 26        private static string m_localPath;
 27
 28        // The USD Shader ID is used to index into this map to find the corresponding ShaderPair,
 29        // i.e. the Unity / USD shader pair that should be instantiated for the ID.
 30        private Dictionary<string, ShaderPair> m_shaderMap;
 31
 32        // This struct associates a Unity shader with a USD shader and combines them into a single
 33        // object that can be stored in the shader map.
 34        public struct ShaderPair
 35        {
 36            public Shader unityShader;
 37            public ShaderSample usdShader;
 38
 39            public ShaderPair(Shader unityShader,
 40                              ShaderSample usdShader)
 041            {
 042                this.unityShader = unityShader;
 043                this.usdShader = usdShader;
 044            }
 45        }
 46
 47        private Transform m_cube;
 48
 49        void Update()
 050        {
 051            if (!m_cube)
 052            {
 053                return;
 54            }
 55
 056            var rot = m_cube.localEulerAngles;
 057            rot.y += Time.deltaTime * 10 + Mathf.Sin(Time.time) * .1f + .05f;
 058            m_cube.localEulerAngles = rot;
 059        }
 60
 61        //
 62        // Technically, this entire example could be written in either Awake() or Start(), but Awake is
 63        // used here to emphasize the one-time-only initialization from the work that could
 64        // potentially be executed at run-time.
 65        //
 66
 67        void Awake()
 068        {
 69            // Init USD.
 070            InitUsd.Initialize();
 71
 72            // In this example, we assume there is a set of well known shaders, we will look up the
 73            // material based on the associated ID. This map allows the identifier in USD to differ from
 74            // the identifier specified in the Unity shader.
 075            m_shaderMap = new Dictionary<string, ShaderPair>();
 76
 77            // Setup the Standard shader USD <-> Unity mapping.
 078            m_shaderMap.Add("Unity.Standard",
 79                new ShaderPair(UnityEngine.Shader.Find("Standard"), new StandardShaderSample()));
 080        }
 81
 82        //
 83        // Start generates a USD scene procedurally, containing a single cube with a material, shader
 84        // and texture bound. It then inspects the cube to discover the material. A Unity material is
 85        // constructed and the parameters are copied in a generic way. Similarly, the texture is
 86        // discovered and loaded as a Unity Texture2D and bound to the material.
 87        //
 88        // Also See: https://docs.unity3d.com/Manual/MaterialsAccessingViaScript.html
 89        //
 90        void Start()
 091        {
 92            // Get the current local path
 093            m_localPath = PackageUtils.GetCallerRelativeToProjectFolderPath();
 94
 95            // Create a scene for this test, but could also be read from disk.
 096            Scene usdScene = CreateSceneWithShading();
 97
 98            // Read the material and shader ID.
 099            var usdMaterial = new MaterialSample();
 100            string shaderId;
 101
 102            // ReadMaterial was designed for Unity and assumes there is one "surface" shader bound.
 0103            if (!MaterialSample.ReadMaterial(usdScene, kCubePath, usdMaterial, out shaderId))
 0104            {
 0105                throw new System.Exception("Failed to read material");
 106            }
 107
 108            // Map the shader ID to the corresponding Unity/USD shader pair.
 109            ShaderPair shader;
 0110            if (shaderId == null || !m_shaderMap.TryGetValue(shaderId, out shader))
 0111            {
 0112                throw new System.Exception("Material had no surface bound");
 113            }
 114
 115            //
 116            // Read and process the shader-specific parameters.
 117            //
 118
 119            // UsdShade requires all connections target an attribute, but we actually want to deserialize
 120            // the entire prim, so we get just the prim path here.
 0121            var shaderPath = new pxr.SdfPath(usdMaterial.surface.connectedPath).GetPrimPath();
 0122            usdScene.Read(shaderPath, shader.usdShader);
 123
 124            //
 125            // Construct material & process the inputs, textures, and keywords.
 126            //
 127
 0128            var mat = new UnityEngine.Material(shader.unityShader);
 129
 130            // Apply material keywords.
 0131            foreach (string keyword in usdMaterial.requiredKeywords ?? new string[0])
 0132            {
 0133                mat.EnableKeyword(keyword);
 0134            }
 135
 136            // Iterate over all input parameters and copy values and/or construct textures.
 0137            foreach (var param in shader.usdShader.GetInputParameters())
 0138            {
 0139                if (!SetMaterialParameter(mat, param.unityName, param.value))
 0140                {
 0141                    throw new System.Exception("Incompatible shader data type: " + param.ToString());
 142                }
 0143            }
 144
 0145            foreach (var param in shader.usdShader.GetInputTextures())
 0146            {
 0147                if (string.IsNullOrEmpty(param.connectedPath))
 0148                {
 149                    // Not connected to a texture.
 0150                    continue;
 151                }
 152
 153                // Only 2D textures are supported in this example.
 0154                var usdTexture = new Texture2DSample();
 155
 156                // Again, we want the prim path, not the attribute path.
 0157                var texturePath = new pxr.SdfPath(param.connectedPath).GetPrimPath();
 0158                usdScene.Read(texturePath, usdTexture);
 159
 160                // This example also only supports explicit sourceFiles, they cannot be connected.
 0161                if (string.IsNullOrEmpty(usdTexture.sourceFile.defaultValue))
 0162                {
 0163                    continue;
 164                }
 165
 166                // For details, see: https://docs.unity3d.com/Manual/MaterialsAccessingViaScript.html
 0167                foreach (string keyword in param.requiredShaderKeywords)
 0168                {
 0169                    mat.EnableKeyword(keyword);
 0170                }
 171
 0172                var data = System.IO.File.ReadAllBytes(usdTexture.sourceFile.defaultValue);
 0173                var unityTex = new Texture2D(2, 2);
 0174                unityTex.LoadImage(data);
 0175                mat.SetTexture(param.unityName, unityTex);
 0176                Debug.Log("Set " + param.unityName + " to " + usdTexture.sourceFile.defaultValue);
 177
 0178                unityTex.Apply(updateMipmaps: true, makeNoLongerReadable: false);
 0179            }
 180
 181            //
 182            // Create and bind the geometry.
 183            //
 184
 185            // Create a cube and set the material.
 186            // Note that geometry is handled minimally here and is incomplete.
 0187            var cubeSample = new CubeSample();
 0188            usdScene.Read(kCubePath, cubeSample);
 189
 0190            var go = GameObject.CreatePrimitive(PrimitiveType.Cube);
 0191            go.transform.SetParent(transform, worldPositionStays: false);
 0192            go.transform.localScale = Vector3.one * (float)cubeSample.size;
 0193            m_cube = transform;
 194
 0195            go.GetComponent<MeshRenderer>().material = mat;
 0196        }
 197
 198        // ------------------------------------------------------------------------------------------ //
 199        // Unity parameter value helper.
 200        // ------------------------------------------------------------------------------------------ //
 201
 202        private bool SetMaterialParameter(Material mat, string unityParamName, object value)
 0203        {
 0204            if (value.GetType() == typeof(Color))
 0205            {
 0206                mat.SetColor(unityParamName, (Color)value);
 0207            }
 0208            else if (value.GetType() == typeof(Color[]))
 0209            {
 0210                mat.SetColorArray(unityParamName, (Color[])value);
 0211            }
 0212            else if (value.GetType() == typeof(List<Color>))
 0213            {
 0214                mat.SetColorArray(unityParamName, (List<Color>)value);
 0215            }
 0216            else if (value.GetType() == typeof(bool))
 0217            {
 0218                mat.SetFloat(unityParamName, ((bool)value) ? 1f : 0f);
 0219            }
 0220            else if (value.GetType() == typeof(float))
 0221            {
 0222                mat.SetFloat(unityParamName, (float)value);
 0223            }
 0224            else if (value.GetType() == typeof(float[]))
 0225            {
 0226                mat.SetFloatArray(unityParamName, (float[])value);
 0227            }
 0228            else if (value.GetType() == typeof(List<float>))
 0229            {
 0230                mat.SetFloatArray(unityParamName, (List<float>)value);
 0231            }
 0232            else if (value.GetType() == typeof(int))
 0233            {
 0234                mat.SetInt(unityParamName, (int)value);
 0235            }
 0236            else if (value.GetType() == typeof(Matrix4x4))
 0237            {
 0238                mat.SetMatrix(unityParamName, (Matrix4x4)value);
 0239            }
 0240            else if (value.GetType() == typeof(Matrix4x4[]))
 0241            {
 0242                mat.SetMatrixArray(unityParamName, (Matrix4x4[])value);
 0243            }
 0244            else if (value.GetType() == typeof(List<Matrix4x4>))
 0245            {
 0246                mat.SetMatrixArray(unityParamName, (List<Matrix4x4>)value);
 0247            }
 0248            else if (value.GetType() == typeof(Vector2))
 0249            {
 0250                mat.SetVector(unityParamName, (Vector2)value);
 0251            }
 0252            else if (value.GetType() == typeof(Vector3))
 0253            {
 0254                mat.SetVector(unityParamName, (Vector3)value);
 0255            }
 0256            else if (value.GetType() == typeof(Vector4))
 0257            {
 0258                mat.SetVector(unityParamName, (Vector4)value);
 0259            }
 0260            else if (value.GetType() == typeof(Vector4[]))
 0261            {
 0262                mat.SetVectorArray(unityParamName, (Vector4[])value);
 0263            }
 0264            else if (value.GetType() == typeof(List<Vector4>))
 0265            {
 0266                mat.SetVectorArray(unityParamName, (List<Vector4>)value);
 0267            }
 268            else
 0269            {
 0270                return false;
 271            }
 272
 0273            Debug.Log("Set " + unityParamName + " = " + value);
 0274            return true;
 0275        }
 276
 277        // ------------------------------------------------------------------------------------------ //
 278        // Create a USD scene for testing
 279        // ------------------------------------------------------------------------------------------ //
 280        static private Scene CreateSceneWithShading()
 0281        {
 0282            var scene = Scene.Create();
 283
 0284            var cubePath = kCubePath;
 0285            var materialPath = "/Model/Materials/SimpleMat";
 0286            var shaderPath = "/Model/Materials/SimpleMat/StandardShader";
 287
 0288            var albedoMapPath = "/Model/Materials/SimpleMat/AlbedoMap";
 0289            var normalMapPath = "/Model/Materials/SimpleMat/NormalMap";
 0290            var emissionMapPath = "/Model/Materials/SimpleMat/EmissionMap";
 0291            var metallicMapPath = "/Model/Materials/SimpleMat/MetallicMap";
 0292            var occlusionMapPath = "/Model/Materials/SimpleMat/OcclusionMap";
 0293            var parallaxMapPath = "/Model/Materials/SimpleMat/ParallaxMap";
 0294            var detailNormalMapPath = "/Model/Materials/SimpleMat/DetailNormalMap";
 0295            var detailMaskPath = "/Model/Materials/SimpleMat/DetailMask";
 296
 0297            var textureFilePath = Path.Combine(m_localPath, "Textures");
 298
 0299            var cube = new CubeSample();
 0300            cube.size = 7;
 0301            cube.transform = Matrix4x4.identity;
 302
 303            //
 304            // Setup Material.
 305            //
 0306            var material = new MaterialSample();
 0307            material.surface.SetConnectedPath(shaderPath, "outputs:out");
 308
 309            // Various shader keywords are required to enable the standard shader to work as intended,
 310            // while these can be encoded as part of the schema, often they require some logic (e.g. is
 311            // emission color != black?).
 0312            material.requiredKeywords = new string[] { "_EMISSION" };
 313
 314            //
 315            // Setup Shader.
 316            //
 0317            var shader = new StandardShaderSample();
 0318            shader.id = new pxr.TfToken("Unity.Standard");
 319
 320            // Note that USD requires all connections target attributes, hence "outputs:out" appended to
 321            // the paths below. Think of this as a shader network graph, where a texture object could
 322            // be executed per pixel with a sampler,  "outputs:out" would be the sampled color.
 323
 0324            shader.smoothnessScale.defaultValue = 0.99f;
 325
 0326            shader.enableSpecularHighlights.defaultValue = true;
 0327            shader.enableGlossyReflections.defaultValue = true;
 328
 0329            shader.albedo.defaultValue = Color.white;
 0330            shader.albedoMap.SetConnectedPath(albedoMapPath, "outputs:out");
 331
 0332            shader.normalMapScale.defaultValue = 0.76f;
 0333            shader.normalMap.SetConnectedPath(normalMapPath, "outputs:out");
 334
 0335            shader.emission.defaultValue = Color.white * 0.3f;
 0336            shader.emissionMap.SetConnectedPath(emissionMapPath, "outputs:out");
 337
 0338            shader.metallicMap.SetConnectedPath(metallicMapPath, "outputs:out");
 339
 0340            shader.occlusionMapScale.defaultValue = 0.65f;
 0341            shader.occlusionMap.SetConnectedPath(occlusionMapPath, "outputs:out");
 342
 0343            shader.parallaxMapScale.defaultValue = 0.1f;
 0344            shader.parallaxMap.SetConnectedPath(parallaxMapPath, "outputs:out");
 345
 0346            shader.detailMask.SetConnectedPath(detailMaskPath);
 0347            shader.detailNormalMapScale.defaultValue = .05f;
 0348            shader.detailNormalMap.SetConnectedPath(detailNormalMapPath, "outputs:out");
 349
 350            //
 351            // Setup Textures.
 352            //
 0353            var albedoTexture = new Texture2DSample();
 0354            albedoTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "albedoMap.png");
 0355            albedoTexture.sRgb = true;
 356
 0357            var normalTexture = new Texture2DSample();
 0358            normalTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "normalMap.png");
 0359            normalTexture.sRgb = true;
 360
 0361            var emissionTexture = new Texture2DSample();
 0362            emissionTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "emissionMap.png");
 0363            emissionTexture.sRgb = true;
 364
 0365            var metallicTexture = new Texture2DSample();
 0366            metallicTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "metallicMap.png");
 0367            metallicTexture.sRgb = true;
 368
 0369            var occlusionTexture = new Texture2DSample();
 0370            occlusionTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "occlusionMap.png");
 0371            occlusionTexture.sRgb = true;
 372
 0373            var parallaxTexture = new Texture2DSample();
 0374            parallaxTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "parallaxMap.png");
 0375            parallaxTexture.sRgb = true;
 376
 0377            var detailNormalTexture = new Texture2DSample();
 0378            detailNormalTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "detailMap.png");
 0379            detailNormalTexture.sRgb = true;
 380
 0381            var detailMaskTexture = new Texture2DSample();
 0382            detailMaskTexture.sourceFile.defaultValue = Path.Combine(textureFilePath, "metallicMap.png");
 0383            detailMaskTexture.sRgb = true;
 384
 385            //
 386            // Write Everything.
 387            //
 0388            scene.Write(cubePath, cube);
 0389            scene.Write(materialPath, material);
 0390            scene.Write(shaderPath, shader);
 391
 0392            scene.Write(albedoMapPath, albedoTexture);
 0393            scene.Write(normalMapPath, normalTexture);
 0394            scene.Write(emissionMapPath, emissionTexture);
 0395            scene.Write(metallicMapPath, metallicTexture);
 0396            scene.Write(occlusionMapPath, occlusionTexture);
 0397            scene.Write(parallaxMapPath, parallaxTexture);
 0398            scene.Write(detailNormalMapPath, detailNormalTexture);
 0399            scene.Write(detailMaskPath, detailMaskTexture);
 400
 401            //
 402            // Bind Material.
 403            //
 0404            MaterialSample.Bind(scene, cubePath, materialPath);
 405
 406            //
 407            // Write out the scene as a string, for debugging.
 408            //
 409            string s;
 0410            scene.Stage.ExportToString(out s);
 0411            Debug.Log("Loading:\n" + s);
 0412            return scene;
 0413        }
 414    }
 415}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_ImportMeshExample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_ImportMeshExample.html new file mode 100644 index 000000000..450859221 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_ImportMeshExample.html @@ -0,0 +1,265 @@ + + + + + + +Unity.Formats.USD.Examples.ImportMeshExample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.ImportMeshExample
Assembly:Unity.Formats.USD.ImportMesh
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMesh/ImportMeshExample.cs
Covered lines:0
Uncovered lines:58
Coverable lines:58
Total lines:153
Line coverage:0% (0 of 58)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ImportMeshExample()0%0000%
Start()0%0000%
Update()0%0000%
OnValidate()0%0000%
UnloadGameObjects()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMesh/ImportMeshExample.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using UnityEngine;
 17using System.IO;
 18using USD.NET;
 19
 20namespace Unity.Formats.USD.Examples
 21{
 22    /// <summary>
 23    /// Imports meshes and transforms from a USD file into the Unity GameObject hierarchy and
 24    /// creates meshes.
 25    /// </summary>
 26    [ExecuteInEditMode]
 27    public class ImportMeshExample : MonoBehaviour
 28    {
 29        public string m_usdFile;
 30        private const string K_DEFAULT_MESH = "mesh.usd";
 31        public Material m_material;
 32
 33        // The range is arbitrary, but adding it provides a slider in the UI.
 34        [Range(0, 100)] public float m_usdTime;
 35
 036        public BasisTransformation m_changeHandedness = BasisTransformation.FastWithNegativeScale;
 37
 38        [Tooltip("Enable GPU instancing on materials for USD point or scene instances.")]
 039        public bool m_enableGpuInstancing = false;
 40
 41        private float m_lastTime;
 42        private Scene m_scene;
 43
 44        // Keep track of all objects loaded.
 45        private PrimMap m_primMap;
 46
 47        public Scene UsdScene
 48        {
 049            get { return m_scene; }
 50        }
 51
 52        public PrimMap PrimMap
 53        {
 054            get { return m_primMap; }
 55        }
 56
 57        void Start()
 058        {
 059            InitUsd.Initialize();
 060            m_lastTime = m_usdTime;
 061            if (string.IsNullOrEmpty(m_usdFile))
 062                m_usdFile = Path.Combine(PackageUtils.GetCallerRelativeToProjectFolderPath(), K_DEFAULT_MESH);
 063        }
 64
 65        void Update()
 066        {
 067            if (string.IsNullOrEmpty(m_usdFile))
 068            {
 069                if (m_scene == null)
 070                {
 071                    return;
 72                }
 073                m_scene.Close();
 074                m_scene = null;
 075                UnloadGameObjects();
 076                return;
 77            }
 78
 79            // Is the stage already loaded?
 080            if (m_scene != null && m_scene.FilePath == m_usdFile && m_lastTime == m_usdTime)
 081            {
 082                return;
 83            }
 84
 85            try
 086            {
 087                m_lastTime = m_usdTime;
 88
 89                // Clear out the old scene.
 090                UnloadGameObjects();
 91
 92                // Import the new scene.
 093                m_scene = Scene.Open(m_usdFile);
 094                if (m_scene == null)
 095                {
 096                    throw new Exception("Failed to import");
 97                }
 98
 99                // Set the time at which to read samples from USD.
 0100                m_scene.Time = m_usdTime;
 101
 102                // When converting right handed (USD) to left handed (Unity), there are two options:
 103                //
 104                //  1) Add an inversion at the root of the scene, leaving the points right-handed.
 105                //  2) Convert all transforms and points to left-handed (deep change of basis).
 106                //
 107                // Option (2) is more computationally expensive, but results in fewer down stream
 108                // surprises.
 0109                var importOptions = new SceneImportOptions();
 0110                importOptions.changeHandedness = m_changeHandedness;
 0111                importOptions.materialMap.DisplayColorMaterial = m_material;
 0112                importOptions.enableGpuInstancing = m_enableGpuInstancing;
 113
 114                // The root object at which the USD scene will be reconstructed.
 115                // It may need a Z-up to Y-up conversion and a right- to left-handed change of basis.
 0116                var rootXf = new GameObject("root");
 0117                rootXf.transform.SetParent(this.transform, worldPositionStays: false);
 0118                m_primMap = SceneImporter.BuildScene(m_scene,
 119                    rootXf,
 120                    importOptions,
 121                    new PrimMap(),
 122                    composingSubtree: false);
 123
 124                // Ensure the file and the identifier match.
 0125                m_usdFile = m_scene.FilePath;
 0126            }
 0127            catch
 0128            {
 0129                enabled = false;
 0130                throw;
 131            }
 0132        }
 133
 134        private void OnValidate()
 0135        {
 0136            if (!string.IsNullOrEmpty(m_usdFile) && !System.IO.File.Exists(m_usdFile))
 0137            {
 0138                enabled = false;
 0139                throw new System.IO.FileNotFoundException(m_usdFile);
 140            }
 0141            enabled = true;
 0142        }
 143
 144        // Destroy all previously created objects.
 145        void UnloadGameObjects()
 0146        {
 0147            if (m_primMap != null)
 0148            {
 0149                m_primMap.DestroyAll();
 0150            }
 0151        }
 152    }
 153}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_UsdImportMeshEditor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_UsdImportMeshEditor.html new file mode 100644 index 000000000..c66f9e612 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportMesh_UsdImportMeshEditor.html @@ -0,0 +1,164 @@ + + + + + + +Unity.Formats.USD.Examples.UsdImportMeshEditor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.UsdImportMeshEditor
Assembly:Unity.Formats.USD.ImportMesh
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMesh/Editor/UsdImportMeshExampleEditor.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:60
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MakeOversPath(...)0%0000%
OnInspectorGUI()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportMesh/Editor/UsdImportMeshExampleEditor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEditor;
 17using USD.NET;
 18
 19namespace Unity.Formats.USD.Examples
 20{
 21    [CustomEditor(typeof(ImportMeshExample))]
 22    public class UsdImportMeshEditor : Editor
 23    {
 24        string MakeOversPath(string path)
 025        {
 026            return System.IO.Path.ChangeExtension(path, ".overs.usda");
 027        }
 28
 29        public override void OnInspectorGUI()
 030        {
 031            base.DrawDefaultInspector();
 032            if (GUILayout.Button("Export Overides"))
 033            {
 034                var importMesh = (ImportMeshExample)target;
 035                var oversFilePath = MakeOversPath(importMesh.m_usdFile);
 36
 037                if (string.IsNullOrEmpty(oversFilePath))
 038                {
 039                    Debug.LogWarning("Empty export path.");
 040                }
 41
 42                // Let the Scene.Create function throw an exception when it can't create a USD stage.
 043                var oversScene = Scene.Create(oversFilePath);
 44
 045                oversScene.UpAxis = importMesh.UsdScene.UpAxis;
 046                oversScene.Time = importMesh.m_usdTime;
 047                oversScene.AddSubLayer(importMesh.UsdScene);
 48
 049                XformExporter.WriteSparseOverrides(oversScene,
 50                    importMesh.PrimMap,
 51                    importMesh.m_changeHandedness);
 52
 053                oversScene.Save();
 054                oversScene.Close();
 55
 056                Debug.Log("Written: " + oversFilePath);
 057            }
 058        }
 59    }
 60}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_CombineMeshes.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_CombineMeshes.html new file mode 100644 index 000000000..b9a81ff0c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_CombineMeshes.html @@ -0,0 +1,255 @@ + + + + + + +Unity.Formats.USD.Examples.CombineMeshes - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.CombineMeshes
Assembly:Unity.Formats.USD.ImportProcessor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/CombineMeshes.cs
Covered lines:0
Uncovered lines:86
Coverable lines:86
Total lines:149
Line coverage:0% (0 of 86)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PostProcessComponents(...)0%0000%
Reset()0%0000%
DoCombineMeshes(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/CombineMeshes.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Licensed under the Apache License, Version 2.0 (the "License");
 2// you may not use this file except in compliance with the License.
 3// You may obtain a copy of the License at
 4//
 5//     http://www.apache.org/licenses/LICENSE-2.0
 6//
 7// Unless required by applicable law or agreed to in writing, software
 8// distributed under the License is distributed on an "AS IS" BASIS,
 9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 10// See the License for the specific language governing permissions and
 11// limitations under the License.
 12
 13using System.Collections.Generic;
 14using UnityEngine;
 15using pxr;
 16
 17namespace Unity.Formats.USD.Examples
 18{
 19    /// <summary>
 20    /// Combines all mesh children of matching Usd Paths into a single child mesh called "CombinedSubmesh."
 21    /// Deactivates the other child mesh GameObjects.
 22    /// Implements IImportPostProcessComponents, so it runs after Component instantiation
 23    /// </summary>
 24    public class CombineMeshes : RegexImportProcessor, IImportPostProcessComponents
 25    {
 26        const int kVertexLimit = 65534;
 27
 28        [Tooltip("If true, prevents vertex count from exceeding 65534 (old 16bit limit)")]
 29        public bool m_enforceU16VertexLimit;
 30
 31        public void PostProcessComponents(PrimMap primMap, SceneImportOptions sceneImportOptions)
 032        {
 033            InitRegex();
 34
 035            foreach (KeyValuePair<SdfPath, GameObject> kvp in primMap)
 036            {
 037                if (!IsMatch(kvp.Key)) continue;
 038                DoCombineMeshes(kvp.Value.transform);
 039            }
 040        }
 41
 42        void Reset()
 043        {
 044            matchExpression = "Geom";
 045            isNot = false;
 046            matchType = EMatchType.Wildcard;
 047            compareAgainst = ECompareAgainst.UsdName;
 048        }
 49
 50        void DoCombineMeshes(Transform current)
 051        {
 052            MeshRenderer[] renderers = current.GetComponentsInChildren<MeshRenderer>();
 053            List<List<CombineInstance>> listcis = new List<List<CombineInstance>>();
 054            List<CombineInstance> cis = new List<CombineInstance>();
 055            listcis.Add(cis);
 56
 057            List<Material> materials = new List<Material>();
 058            int vertexCount = 0;
 059            foreach (MeshRenderer renderer in renderers)
 060            {
 061                MeshFilter cmf = renderer.GetComponent<MeshFilter>();
 062                if (cmf == null) continue;
 63
 064                int meshVertexCount = cmf.sharedMesh.vertexCount;
 065                if (m_enforceU16VertexLimit && meshVertexCount > kVertexLimit)
 066                {
 067                    Debug.LogError(
 68                        "Unable to use single mesh with greater than " + kVertexLimit + " vertices" + current);
 069                    continue;
 70                }
 71
 072                vertexCount += meshVertexCount;
 73
 074                if (m_enforceU16VertexLimit && vertexCount > kVertexLimit)
 075                {
 076                    vertexCount = 0;
 077                    cis = new List<CombineInstance>();
 078                    listcis.Add(cis);
 079                }
 80
 081                CombineInstance ci = new CombineInstance();
 082                ci.mesh = cmf.sharedMesh;
 083                ci.transform = current.worldToLocalMatrix * cmf.transform.localToWorldMatrix;
 084                cis.Add(ci);
 85
 86                // Assume order is maintained???
 087                materials.AddRange(renderer.sharedMaterials);
 088            }
 89
 90            // Hide current meshes.
 091            current.gameObject.SetActive(true);
 092            foreach (Transform child in current)
 093            {
 094                child.gameObject.SetActive(false);
 095            }
 96
 97            // Build new meshes.
 098            bool mergeSubMeshes = true;
 99
 0100            foreach (List<CombineInstance> subcis in listcis)
 0101            {
 102                // TODO: trim and rearrange materials so there is only one submesh per material?
 0103                GameObject go = new GameObject();
 0104                go.name = "CombinedSubmesh";
 0105                Transform sub = go.transform;
 0106                sub.SetParent(current, false);
 107
 0108                MeshFilter mf = sub.GetComponent<MeshFilter>();
 0109                if (mf == null) mf = sub.gameObject.AddComponent<MeshFilter>();
 110
 0111                MeshRenderer mr = sub.gameObject.GetComponent<MeshRenderer>();
 0112                if (mr == null) mr = sub.gameObject.AddComponent<MeshRenderer>();
 113
 0114                mf.mesh = new Mesh();
 0115                if (vertexCount > kVertexLimit)
 0116                {
 0117                    mf.sharedMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
 0118                }
 119
 0120                if (Application.isPlaying)
 0121                {
 122                    // mf.mesh.Combine(subcis.ToArray());
 0123                    mf.mesh.CombineMeshes(subcis.ToArray(), mergeSubMeshes: mergeSubMeshes);
 0124                }
 125                else
 0126                {
 127                    // mf.sharedMesh.Combine(subcis.ToArray());
 0128                    mf.sharedMesh.CombineMeshes(subcis.ToArray(), mergeSubMeshes: mergeSubMeshes);
 0129                }
 130
 0131                if (mergeSubMeshes)
 0132                {
 0133                    if (materials.Count == 0)
 0134                    {
 0135                        Debug.LogError("No material to assign to combined mesh for " + current.name);
 0136                    }
 137                    else
 0138                    {
 0139                        mr.sharedMaterial = materials[0];
 0140                    }
 0141                }
 142                else
 0143                {
 0144                    mr.sharedMaterials = materials.ToArray();
 0145                }
 0146            }
 0147        }
 148    }
 149}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_RegexImportProcessor.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_RegexImportProcessor.html new file mode 100644 index 000000000..5e25e0b23 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_RegexImportProcessor.html @@ -0,0 +1,184 @@ + + + + + + +Unity.Formats.USD.Examples.RegexImportProcessor - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.RegexImportProcessor
Assembly:Unity.Formats.USD.ImportProcessor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/RegexImportProcessor.cs
Covered lines:0
Uncovered lines:16
Coverable lines:16
Total lines:76
Line coverage:0% (0 of 16)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
RegexImportProcessor()0%0000%
IsMatch(...)0%0000%
InitRegex()0%0000%
WildcardToRegex(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/RegexImportProcessor.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Licensed under the Apache License, Version 2.0 (the "License");
 2// you may not use this file except in compliance with the License.
 3// You may obtain a copy of the License at
 4//
 5//     http://www.apache.org/licenses/LICENSE-2.0
 6//
 7// Unless required by applicable law or agreed to in writing, software
 8// distributed under the License is distributed on an "AS IS" BASIS,
 9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 10// See the License for the specific language governing permissions and
 11// limitations under the License.
 12
 13using UnityEngine;
 14using System.Text.RegularExpressions;
 15using pxr;
 16
 17namespace Unity.Formats.USD.Examples
 18{
 19    /// <summary>
 20    /// Abstract class meant as base class for certain IImportPostProcessHierarchy
 21    /// implmentations.  Has methods for filtering Usd Paths based on glob-style wildcards or regex.
 22    /// </summary>
 23    public abstract class RegexImportProcessor : MonoBehaviour
 24    {
 25        public enum ECompareAgainst
 26        {
 27            UsdName,
 28            UsdPath,
 29        }
 30
 31        public enum EMatchType
 32        {
 33            Wildcard,
 34            Regex,
 35        }
 36
 37        [Tooltip(
 38            "UsdName matches only the name of the GameObject/UsdPrim, while UsdPath matches against the entire path of t
 39        public ECompareAgainst compareAgainst;
 40
 41        [Tooltip("Wildcard matches using simple filesystem-style globbing, Regex uses strict regular expression")]
 42        public EMatchType matchType;
 43
 44        [Tooltip("If true, matches are ignored, failed matches are proccessed.")]
 045        public bool isNot = false;
 46
 47        [Tooltip("The wildcard or regex expression to test against")]
 048        public string matchExpression = "*";
 49
 50        private Regex m_regex;
 51
 52        protected bool IsMatch(SdfPath sdfPath)
 053        {
 054            string test = compareAgainst == ECompareAgainst.UsdName ? sdfPath.GetName() : sdfPath.ToString();
 055            return isNot ? !m_regex.IsMatch(test) : m_regex.IsMatch(test);
 056        }
 57
 58        protected void InitRegex()
 059        {
 060            switch (matchType)
 61            {
 62                case EMatchType.Wildcard:
 063                    m_regex = new Regex(WildcardToRegex(matchExpression));
 064                    break;
 65                case EMatchType.Regex:
 066                    m_regex = new Regex(matchExpression);
 067                    break;
 68            }
 069        }
 70
 71        public static string WildcardToRegex(string pattern)
 072        {
 073            return "^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$";
 074        }
 75    }
 76}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_SetHideFlags.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_SetHideFlags.html new file mode 100644 index 000000000..7c88ad091 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.ImportProcessor_SetHideFlags.html @@ -0,0 +1,178 @@ + + + + + + +Unity.Formats.USD.Examples.SetHideFlags - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.SetHideFlags
Assembly:Unity.Formats.USD.ImportProcessor
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/SetHideFlags.cs
Covered lines:0
Uncovered lines:24
Coverable lines:24
Total lines:72
Line coverage:0% (0 of 24)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetHideFlags()0%0000%
PostProcessHierarchy(...)0%0000%
Reset()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/ImportProcessor/SetHideFlags.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Licensed under the Apache License, Version 2.0 (the "License");
 2// you may not use this file except in compliance with the License.
 3// You may obtain a copy of the License at
 4//
 5//     http://www.apache.org/licenses/LICENSE-2.0
 6//
 7// Unless required by applicable law or agreed to in writing, software
 8// distributed under the License is distributed on an "AS IS" BASIS,
 9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 10// See the License for the specific language governing permissions and
 11// limitations under the License.
 12
 13using System.Collections.Generic;
 14using UnityEngine;
 15using pxr;
 16
 17namespace Unity.Formats.USD.Examples
 18{
 19    /// <summary>
 20    /// For matching Usd Paths, set the HideFlags on the GameObject.
 21    /// </summary>
 22    /// <seealso cref="UnityEngine.HideFlags"/>
 23    public class SetHideFlags : RegexImportProcessor, IImportPostProcessHierarchy
 24    {
 025        public HideFlags hideFlagsSettings = HideFlags.DontSave;
 26
 27        public enum Operation
 28        {
 29            Overwrite,
 30            LogicalAND,
 31            LogicalOR,
 32            LogicalXOR
 33        }
 34
 35        [Tooltip("The logical operator to use when setting the flags. In most cases Or will produce expected results")]
 036        public Operation operation = Operation.LogicalOR;
 37
 38        public void PostProcessHierarchy(PrimMap primMap, SceneImportOptions sceneImportOptions)
 039        {
 040            InitRegex();
 41
 042            foreach (KeyValuePair<SdfPath, GameObject> kvp in primMap)
 043            {
 044                if (!IsMatch(kvp.Key)) continue;
 045                GameObject go = kvp.Value;
 046                switch (operation)
 47                {
 48                    case Operation.LogicalAND:
 049                        go.hideFlags &= hideFlagsSettings;
 050                        continue;
 51                    case Operation.LogicalOR:
 052                        go.hideFlags |= hideFlagsSettings;
 053                        continue;
 54                    case Operation.LogicalXOR:
 055                        go.hideFlags ^= hideFlagsSettings;
 056                        continue;
 57                    default:
 058                        go.hideFlags = hideFlagsSettings;
 059                        continue;
 60                }
 61            }
 062        }
 63
 64        void Reset()
 065        {
 066            matchExpression = @"^\/.+";
 067            isNot = false;
 068            matchType = EMatchType.Regex;
 069            compareAgainst = ECompareAgainst.UsdPath;
 070        }
 71    }
 72}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraExporter.html new file mode 100644 index 000000000..3b120ddd9 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraExporter.html @@ -0,0 +1,163 @@ + + + + + + +Unity.Formats.USD.CameraExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.CameraExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CameraExporter.cs
Covered lines:14
Uncovered lines:9
Coverable lines:23
Total lines:61
Line coverage:60.8% (14 of 23)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportCamera(...)0%00060.87%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CameraExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET.Unity;
 17
 18namespace Unity.Formats.USD
 19{
 20    public static class CameraExporter
 21    {
 22        public static void ExportCamera(ObjectContext objContext, ExportContext exportContext)
 223        {
 224            UnityEngine.Profiling.Profiler.BeginSample("USD: Camera Conversion");
 25
 226            CameraSample sample = (CameraSample)objContext.sample;
 227            Camera camera = objContext.gameObject.GetComponent<Camera>();
 228            var path = objContext.path;
 229            var scene = exportContext.scene;
 230            bool fastConvert = exportContext.basisTransform == BasisTransformation.FastWithNegativeScale;
 31
 32            // If doing a fast conversion, do not let the constructor do the change of basis for us.
 233            sample.CopyFromCamera(camera, convertTransformToUsd: !fastConvert);
 34
 235            if (fastConvert)
 036            {
 37                // Partial change of basis.
 038                var basisChange = Matrix4x4.identity;
 39                // Invert the forward vector.
 040                basisChange[2, 2] = -1;
 41                // Full change of basis would be b*t*b-1, but here we're placing only a single inversion
 42                // at the root of the hierarchy, so all we need to do is get the camera into the same
 43                // space.
 044                sample.transform = sample.transform * basisChange;
 45
 46                // Is this also a root path?
 47                // If so the partial basis conversion must be completed on the camera itself.
 048                if (path.LastIndexOf("/") == 0)
 049                {
 050                    sample.transform = basisChange * sample.transform;
 051                }
 052            }
 53
 254            UnityEngine.Profiling.Profiler.EndSample();
 55
 256            UnityEngine.Profiling.Profiler.BeginSample("USD: Camera Write");
 257            scene.Write(path, sample);
 258            UnityEngine.Profiling.Profiler.EndSample();
 259        }
 60    }
 61}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraImporter.html new file mode 100644 index 000000000..11e46486d --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CameraImporter.html @@ -0,0 +1,140 @@ + + + + + + +Unity.Formats.USD.CameraImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.CameraImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CameraImporter.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:38
Line coverage:100% (6 of 6)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildCamera(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CameraImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET.Unity;
 17
 18namespace Unity.Formats.USD
 19{
 20    /// <summary>
 21    /// A collection of methods used for importing USD Camera data into Unity.
 22    /// </summary>
 23    public static class CameraImporter
 24    {
 25        /// <summary>
 26        /// Copy camera data from USD to Unity with the given import options.
 27        /// </summary>
 28        public static void BuildCamera(CameraSample usdCamera,
 29            GameObject go,
 30            SceneImportOptions options)
 1431        {
 1432            var cam = ImporterBase.GetOrAddComponent<Camera>(go);
 1433            usdCamera.CopyToCamera(cam, setTransform: false);
 1434            cam.nearClipPlane *= options.scale;
 1435            cam.farClipPlane *= options.scale;
 1436        }
 37    }
 38}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CubeImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CubeImporter.html new file mode 100644 index 000000000..6686ac740 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_CubeImporter.html @@ -0,0 +1,396 @@ + + + + + + +Unity.Formats.USD.CubeImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.CubeImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CubeImporter.cs
Covered lines:49
Uncovered lines:126
Coverable lines:175
Total lines:290
Line coverage:28% (49 of 175)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildCube(...)0%00025.99%
ShouldImport(...)0%000100%
ShouldCompute(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/CubeImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET.Unity;
 17
 18namespace Unity.Formats.USD
 19{
 20    /// <summary>
 21    /// A collection of methods used for importing USD Cube data into Unity.
 22    /// </summary>
 23    public static class CubeImporter
 24    {
 25        /// <summary>
 26        /// Copy cube data from USD to Unity with the given import options.
 27        /// </summary>
 28        /// <param name="skinnedMesh">
 29        /// Whether the Cube to build is skinned or not. This will allow to determine which Renderer to create
 30        /// on the GameObject (MeshRenderer or SkinnedMeshRenderer). Default value is false (not skinned).
 31        /// </param>
 32        public static void BuildCube(CubeSample usdCube,
 33            GameObject go,
 34            SceneImportOptions options,
 35            bool skinnedMesh = false)
 236        {
 237            Material mat = null;
 38
 239            var cubeGo = GameObject.CreatePrimitive(PrimitiveType.Cube);
 240            var unityMesh = cubeGo.GetComponent<MeshFilter>().sharedMesh;
 241            GameObject.DestroyImmediate(cubeGo);
 42
 43            // Because Unity only handle a cube with a default size, the custom size of it is define by the localScale
 44            // transform. This also need to be taken into account while computing the Unity extent of the mesh (see bell
 45            // This is doable because xformable data are always handled before mesh data, so go.transform already
 46            // contains any transform of the geometry.
 247            float size = (float)usdCube.size;
 248            go.transform.localScale = go.transform.localScale * size;
 49
 250            bool changeHandedness = options.changeHandedness == BasisTransformation.SlowAndSafe;
 251            bool hasBounds = usdCube.extent.size.x > 0
 52                || usdCube.extent.size.y > 0
 53                || usdCube.extent.size.z > 0;
 54
 255            if (ShouldImport(options.meshOptions.boundingBox) && hasBounds)
 256            {
 257                if (changeHandedness)
 258                {
 259                    usdCube.extent.center = UnityTypeConverter.ChangeBasis(usdCube.extent.center);
 60
 61                    // Divide the extent by the size of the cube. A custom size of the extent is define by
 62                    // the localScale transform (see above).
 263                    usdCube.extent.extents = UnityTypeConverter.ChangeBasis(usdCube.extent.extents) / size;
 264                }
 65
 266                unityMesh.bounds = usdCube.extent;
 267            }
 068            else if (ShouldCompute(options.meshOptions.boundingBox))
 069            {
 070                unityMesh.RecalculateBounds();
 071            }
 72
 273            if (usdCube.colors != null && ShouldImport(options.meshOptions.color))
 274            {
 75                // NOTE: The following color conversion assumes PlayerSettings.ColorSpace == Linear.
 76                // For best performance, convert color space to linear off-line and skip conversion.
 77
 278                if (usdCube.colors.Length == 1)
 079                {
 80                    // Constant color can just be set on the material.
 081                    mat = options.materialMap.InstantiateSolidColor(usdCube.colors.value[0].gamma);
 082                }
 283                else if (usdCube.colors.Length == 6)
 084                {
 85                    // Uniform colors to verts.
 86                    // Note that USD cubes have 6 uniform colors and Unity cube mesh has 24 (6*4)
 87                    // TODO: move the conversion to C++ and use the color management API.
 088                    Debug.Log(unityMesh.vertexCount);
 089                    for (int i = 0; i < usdCube.colors.Length; i++)
 090                    {
 091                        usdCube.colors.value[i] = usdCube.colors.value[i];
 092                    }
 93
 094                    var unityColors = new Color[24];
 95                    // Front:0, Back:1, Top:2, Bottom:3, Right:4, Left:5
 096                    unityColors[0] = usdCube.colors.value[0]; // front bottom right
 097                    unityColors[1] = usdCube.colors.value[0]; // front bottom left
 098                    unityColors[2] = usdCube.colors.value[0]; // front top right
 099                    unityColors[3] = usdCube.colors.value[0]; // front top left
 100
 0101                    unityColors[4] = usdCube.colors.value[2]; // top back right
 0102                    unityColors[5] = usdCube.colors.value[2]; // top back left
 0103                    unityColors[6] = usdCube.colors.value[1]; // back bottom right
 0104                    unityColors[7] = usdCube.colors.value[1]; // back bottom left
 105
 0106                    unityColors[8] = usdCube.colors.value[2]; // top front right
 0107                    unityColors[9] = usdCube.colors.value[2]; // top front left
 0108                    unityColors[10] = usdCube.colors.value[1]; // back top right
 0109                    unityColors[11] = usdCube.colors.value[1]; // back top left
 110
 0111                    unityColors[12] = usdCube.colors.value[3]; // Bottom back right
 0112                    unityColors[13] = usdCube.colors.value[3]; // Bottom front right
 0113                    unityColors[14] = usdCube.colors.value[3]; // Bottom front left
 0114                    unityColors[15] = usdCube.colors.value[3]; // Bottom back left
 115
 0116                    unityColors[16] = usdCube.colors.value[5]; // left front bottom
 0117                    unityColors[17] = usdCube.colors.value[5]; // left front top
 0118                    unityColors[18] = usdCube.colors.value[5]; // left back top
 0119                    unityColors[19] = usdCube.colors.value[5]; // left back bottom
 120
 0121                    unityColors[20] = usdCube.colors.value[4]; // right back bottom
 0122                    unityColors[21] = usdCube.colors.value[4]; // right back top
 0123                    unityColors[22] = usdCube.colors.value[4]; // right front top
 0124                    unityColors[23] = usdCube.colors.value[4]; // right front bottom
 125
 0126                    unityMesh.colors = unityColors;
 0127                }
 2128                else if (usdCube.colors.Length == 24)
 0129                {
 130                    // Face varying colors to verts.
 131                    // Note that USD cubes have 24 face varying colors and Unity cube mesh has 24 (6*4)
 132                    // TODO: move the conversion to C++ and use the color management API.
 0133                    Debug.Log(unityMesh.vertexCount);
 0134                    for (int i = 0; i < usdCube.colors.Length; i++)
 0135                    {
 0136                        usdCube.colors.value[i] = usdCube.colors.value[i];
 0137                    }
 138
 139                    // USD order: front, back, top, bottom, right, left
 0140                    var unityColors = new Color[24];
 0141                    unityColors[0] = usdCube.colors.value[3]; // front bottom right
 0142                    unityColors[1] = usdCube.colors.value[2]; // front bottom left
 0143                    unityColors[2] = usdCube.colors.value[0]; // front top right
 0144                    unityColors[3] = usdCube.colors.value[1]; // front top left
 145
 0146                    unityColors[4] = usdCube.colors.value[8 + 1]; // top back right
 0147                    unityColors[5] = usdCube.colors.value[8 + 2]; // top back left
 0148                    unityColors[6] = usdCube.colors.value[4 + 3]; // back bottom right
 0149                    unityColors[7] = usdCube.colors.value[4 + 0]; // back bottom left
 150
 0151                    unityColors[8] = usdCube.colors.value[8 + 0]; // top front right
 0152                    unityColors[9] = usdCube.colors.value[8 + 3]; // top front left
 0153                    unityColors[10] = usdCube.colors.value[4 + 2]; // back top right
 0154                    unityColors[11] = usdCube.colors.value[4 + 1]; // back top left
 155
 0156                    unityColors[12] = usdCube.colors.value[12 + 1]; // Bottom back right
 0157                    unityColors[13] = usdCube.colors.value[12 + 2]; // Bottom front right
 0158                    unityColors[14] = usdCube.colors.value[12 + 3]; // Bottom front left
 0159                    unityColors[15] = usdCube.colors.value[12 + 0]; // Bottom back left
 160
 0161                    unityColors[16] = usdCube.colors.value[20 + 1]; // left front bottom
 0162                    unityColors[17] = usdCube.colors.value[20 + 2]; // left front top
 0163                    unityColors[18] = usdCube.colors.value[20 + 3]; // left back top
 0164                    unityColors[19] = usdCube.colors.value[20 + 0]; // left back bottom
 165
 0166                    unityColors[20] = usdCube.colors.value[16 + 2]; // right back bottom
 0167                    unityColors[21] = usdCube.colors.value[16 + 3]; // right back top
 0168                    unityColors[22] = usdCube.colors.value[16 + 0]; // right front top
 0169                    unityColors[23] = usdCube.colors.value[16 + 1]; // right front bottom
 170
 0171                    unityMesh.colors = unityColors;
 0172                }
 2173                else if (usdCube.colors.Length == 8)
 0174                {
 175                    // Vertex colors map on to verts.
 176                    // Note that USD cubes have 8 verts but Unity cube mesh has 24 (6*4)
 177                    // TODO: move the conversion to C++ and use the color management API.
 0178                    Debug.Log(unityMesh.vertexCount);
 0179                    for (int i = 0; i < usdCube.colors.Length; i++)
 0180                    {
 0181                        usdCube.colors.value[i] = usdCube.colors.value[i];
 0182                    }
 183
 184                    // USD order: front (top-right -> ccw)
 185                    //            back (bottom-left -> ccw (from back perspective))
 0186                    var unityColors = new Color[24];
 0187                    unityColors[0] = usdCube.colors.value[3]; // front bottom right
 0188                    unityColors[1] = usdCube.colors.value[2]; // front bottom left
 0189                    unityColors[2] = usdCube.colors.value[0]; // front top right
 0190                    unityColors[3] = usdCube.colors.value[1]; // front top left
 191
 0192                    unityColors[4] = usdCube.colors.value[6]; // top back right
 0193                    unityColors[5] = usdCube.colors.value[5]; // top back left
 0194                    unityColors[6] = usdCube.colors.value[7]; // back bottom right
 0195                    unityColors[7] = usdCube.colors.value[4]; // back bottom left
 196
 0197                    unityColors[8] = usdCube.colors.value[0]; // top front right
 0198                    unityColors[9] = usdCube.colors.value[1]; // top front left
 0199                    unityColors[10] = usdCube.colors.value[6]; // back top right
 0200                    unityColors[11] = usdCube.colors.value[5]; // back top left
 201
 0202                    unityColors[12] = usdCube.colors.value[7]; // Bottom back right
 0203                    unityColors[13] = usdCube.colors.value[3]; // Bottom front right
 0204                    unityColors[14] = usdCube.colors.value[2]; // Bottom front left
 0205                    unityColors[15] = usdCube.colors.value[4]; // Bottom back left
 206
 0207                    unityColors[16] = usdCube.colors.value[2]; // left front bottom
 0208                    unityColors[17] = usdCube.colors.value[1]; // left front top
 0209                    unityColors[18] = usdCube.colors.value[5]; // left back top
 0210                    unityColors[19] = usdCube.colors.value[4]; // left back bottom
 211
 0212                    unityColors[20] = usdCube.colors.value[7]; // right back bottom
 0213                    unityColors[21] = usdCube.colors.value[6]; // right back top
 0214                    unityColors[22] = usdCube.colors.value[0]; // right front top
 0215                    unityColors[23] = usdCube.colors.value[3]; // right front bottom
 216
 0217                    unityMesh.colors = unityColors;
 0218                    Debug.Log("vertex colors assigned");
 0219                }
 220                else
 2221                {
 222                    // FaceVarying and uniform both require breaking up the mesh and are not yet handled in
 223                    // this example.
 2224                    Debug.LogWarning("Uniform (color per face) and FaceVarying (color per vert per face) "
 225                        + "display color not supported in this example");
 2226                }
 2227            }
 228
 2229            if (mat == null)
 2230            {
 2231                mat = options.materialMap.InstantiateSolidColor(Color.white);
 2232            }
 233
 234            // Create Unity mesh.
 235            Renderer renderer;
 2236            if (skinnedMesh)
 0237            {
 0238                SkinnedMeshRenderer skinnedRenderer = ImporterBase.GetOrAddComponent<SkinnedMeshRenderer>(go);
 239
 0240                if (skinnedRenderer.sharedMesh == null)
 0241                {
 0242                    skinnedRenderer.sharedMesh = Mesh.Instantiate(unityMesh);
 0243                }
 244
 0245                renderer = skinnedRenderer;
 0246            }
 247            else
 2248            {
 2249                renderer = ImporterBase.GetOrAddComponent<MeshRenderer>(go);
 2250                MeshFilter meshFilter = ImporterBase.GetOrAddComponent<MeshFilter>(go);
 251
 2252                if (meshFilter.sharedMesh == null)
 1253                {
 1254                    meshFilter.sharedMesh = Mesh.Instantiate(unityMesh);
 1255                }
 2256            }
 257
 2258            if (unityMesh.subMeshCount == 1)
 2259            {
 2260                renderer.sharedMaterial = mat;
 2261            }
 262            else
 0263            {
 0264                var mats = new Material[unityMesh.subMeshCount];
 0265                for (int i = 0; i < mats.Length; i++)
 0266                {
 0267                    mats[i] = mat;
 0268                }
 269
 0270                renderer.sharedMaterials = mats;
 0271            }
 2272        }
 273
 274        /// <summary>
 275        /// Returns true if the mode is Import or ImportOrCompute.
 276        /// </summary>
 277        private static bool ShouldImport(ImportMode mode)
 4278        {
 4279            return mode == ImportMode.Import || mode == ImportMode.ImportOrCompute;
 4280        }
 281
 282        /// <summary>
 283        /// Returns true if the mode is Compute or ImportOrCompute.
 284        /// </summary>
 285        private static bool ShouldCompute(ImportMode mode)
 0286        {
 0287            return mode == ImportMode.Compute || mode == ImportMode.ImportOrCompute;
 0288        }
 289    }
 290}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportContext.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportContext.html new file mode 100644 index 000000000..579ee3810 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportContext.html @@ -0,0 +1,893 @@ + + + + + + +Unity.Formats.USD.ExportContext - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ExportContext
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs
Covered lines:14
Uncovered lines:0
Coverable lines:14
Total lines:791
Line coverage:100% (14 of 14)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportContext()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using UnityEngine;
 19using USD.NET;
 20using USD.NET.Unity;
 21
 22namespace Unity.Formats.USD
 23{
 24    // The export function allows for dispatch to different export functions without knowing what
 25    // type of data they export (e.g. mesh vs. transform).
 26    public delegate void ExportFunction(ObjectContext objContext, ExportContext exportContext);
 27
 28    delegate void ObjectProcessor(GameObject go,
 29        ExportContext context);
 30
 31    public struct ObjectContext
 32    {
 33        public GameObject gameObject;
 34        public string path;
 35        public SampleBase sample;
 36        public object additionalData;
 37    }
 38
 39    public enum ActiveExportPolicy
 40    {
 41        // Inactive GameObjects in Unity become invisible objects in USD, which is actually the
 42        // closest semantic mapping.
 43        ExportAsVisibility,
 44
 45        // Inactive GameObjects in Unity become deactivated objects in USD. Caution, this is not truly
 46        // an equivalent state because deactivated objects in USD are fully unloaded and their
 47        // subtree will not exist after being deactivated.
 48        ExportAsActive,
 49
 50        // Inactive GameObjects will not be exported.
 51        DoNotExport,
 52
 53        // Inactive GameObjects will be exported without special handling.
 54        Ignore,
 55    }
 56
 57    public class ExportContext
 58    {
 59        public Scene scene;
 60        public Transform exportRoot;
 1261        public bool exportMaterials = true;
 1262        public bool exportNative = false;
 1263        public float scale = 1.0f;
 64
 1265        public BasisTransformation basisTransform = BasisTransformation.FastWithNegativeScale;
 1266        public ActiveExportPolicy activePolicy = ActiveExportPolicy.ExportAsVisibility;
 1267        public Dictionary<GameObject, ExportPlan> plans = new Dictionary<GameObject, ExportPlan>();
 1268        public Dictionary<Material, string> matMap = new Dictionary<Material, string>();
 69
 1270        public Dictionary<Transform, Transform> meshToSkelRoot = new Dictionary<Transform, Transform>();
 1271        public Dictionary<Transform, Transform[]> meshToBones = new Dictionary<Transform, Transform[]>();
 72
 1273        public Dictionary<Transform, List<string>> skelSortedMap = new Dictionary<Transform, List<string>>();
 74
 75        // Dictionary from <oldRoot> to <newRoot>
 1276        public Dictionary<string, Transform> pathToBone = new Dictionary<string, Transform>();
 1277        public Dictionary<Transform, Transform> boneToRoot = new Dictionary<Transform, Transform>();
 1278        public Dictionary<Transform, Matrix4x4> bindPoses = new Dictionary<Transform, Matrix4x4>();
 79
 80        // Sample object instances, shared across multiple export methods.
 1281        public Dictionary<Type, SampleBase> samples = new Dictionary<Type, SampleBase>();
 82    }
 83
 84    public class Exporter
 85    {
 86        // The USD path at which the Unity data will be written.
 87        public string path;
 88
 89        // The sample type to be used when exporting.
 90        public SampleBase sample;
 91
 92        // The export function which implements the logic to populate the sample.
 93        public ExportFunction exportFunc;
 94
 95        // Additional arguments required for export.
 96        public object data;
 97    }
 98
 99    // An export plan will be created for each path in the scene. Each ExportPlan will use one of
 100    // the fixed export functions. For example, when setting up export for a mesh, an ExportPlan
 101    // will be created for that path in the scenegraph and the ExportFunction will the one which is
 102    // capable of exporting a mesh.
 103    public class ExportPlan
 104    {
 105        // The functions to run when exporting this object.
 106        public List<Exporter> exporters = new List<Exporter>();
 107    }
 108
 109    /// <summary>
 110    /// The scene exporter can be used to export data to USD.
 111    /// </summary>
 112    public static class SceneExporter
 113    {
 114        // ------------------------------------------------------------------------------------------ //
 115        // Main Export Logic.
 116        // ------------------------------------------------------------------------------------------ //
 117
 118        public static void Export(GameObject root,
 119            Scene scene,
 120            BasisTransformation basisTransform,
 121            bool exportUnvarying,
 122            bool zeroRootTransform,
 123            bool exportMaterials = false,
 124            bool exportMonoBehaviours = false)
 125        {
 126            var context = new ExportContext();
 127            context.scene = scene;
 128            context.basisTransform = basisTransform;
 129            context.exportRoot = root.transform.parent;
 130            SyncExportContext(root, context);
 131
 132            // Since this is a one-shot convenience function, we will automatically split the export
 133            // into varying and unvarying data, unless the user explicitly requested unvarying.
 134            if (exportUnvarying && scene.Time != null)
 135            {
 136                double? oldTime = scene.Time;
 137                scene.Time = null;
 138                Export(root, context, zeroRootTransform);
 139                scene.Time = oldTime;
 140            }
 141
 142            // Export data for the requested time.
 143            context.exportMaterials = exportMaterials;
 144            Export(root, context, zeroRootTransform);
 145        }
 146
 147        public static void Export(GameObject root,
 148            ExportContext context,
 149            bool zeroRootTransform)
 150        {
 151            // Remove parent transform effects while exporting.
 152            // This must be restored before returning from this function.
 153            var parent = root.transform.parent;
 154            if (zeroRootTransform)
 155            {
 156                root.transform.SetParent(null, worldPositionStays: false);
 157            }
 158
 159            // Also zero out and restore local rotations on the root.
 160            var localPos = root.transform.localPosition;
 161            var localRot = root.transform.localRotation;
 162            var localScale = root.transform.localScale;
 163            if (zeroRootTransform)
 164            {
 165                root.transform.localPosition = Vector3.zero;
 166                root.transform.localRotation = Quaternion.identity;
 167                root.transform.localScale = Vector3.one;
 168            }
 169
 170            // Scale overall scene for export (e.g. USDZ export needs scale 100)
 171            root.transform.localScale *= context.scale;
 172
 173            UnityEngine.Profiling.Profiler.BeginSample("USD: Export");
 174            try
 175            {
 176                ExportImpl(root, context);
 177                var path = new pxr.SdfPath(UnityTypeConverter.GetPath(root.transform));
 178                var prim = context.scene.Stage.GetPrimAtPath(path);
 179                if (prim)
 180                {
 181                    context.scene.Stage.SetDefaultPrim(prim);
 182                }
 183            }
 184            finally
 185            {
 186                if (zeroRootTransform)
 187                {
 188                    root.transform.localPosition = localPos;
 189                    root.transform.localRotation = localRot;
 190                    root.transform.localScale = localScale;
 191                    root.transform.SetParent(parent, worldPositionStays: false);
 192                }
 193                else
 194                {
 195                    root.transform.localScale = localScale;
 196                }
 197
 198                UnityEngine.Profiling.Profiler.EndSample();
 199            }
 200        }
 201
 202        private static void ExportImpl(GameObject root,
 203            ExportContext context)
 204        {
 205            var scene = context.scene;
 206            bool skipInactive = context.activePolicy == ActiveExportPolicy.DoNotExport;
 207
 208            if (context.exportMaterials)
 209            {
 210                // TODO: should account for skipped objects and also skip their materials.
 211                UnityEngine.Profiling.Profiler.BeginSample("USD: Export Materials");
 212                foreach (var kvp in context.matMap)
 213                {
 214                    Material mat = kvp.Key;
 215                    string usdPath = kvp.Value;
 216                    if (!mat || usdPath == null)
 217                    {
 218                        continue;
 219                    }
 220
 221                    try
 222                    {
 223                        MaterialExporter.ExportMaterial(scene, kvp.Key, kvp.Value);
 224                    }
 225                    catch (Exception ex)
 226                    {
 227                        Debug.LogException(new Exception("Error exporting material: " + kvp.Value, ex));
 228                    }
 229                }
 230
 231                UnityEngine.Profiling.Profiler.EndSample();
 232            }
 233
 234            UnityEngine.Profiling.Profiler.BeginSample("USD: Process Export Plans");
 235            foreach (var kvp in context.plans)
 236            {
 237                GameObject go = kvp.Key;
 238                ExportPlan exportPlan = kvp.Value;
 239
 240                if (!go || exportPlan == null)
 241                {
 242                    continue;
 243                }
 244
 245                if (go != root && !go.transform.IsChildOf(root.transform))
 246                {
 247                    continue;
 248                }
 249
 250                if (skipInactive && go.activeInHierarchy == false)
 251                {
 252                    continue;
 253                }
 254
 255                foreach (Exporter exporter in exportPlan.exporters)
 256                {
 257                    string path = exporter.path;
 258                    SampleBase sample = exporter.sample;
 259                    var objCtx = new ObjectContext
 260                    {
 261                        gameObject = go,
 262                        path = path,
 263                        sample = sample,
 264                        additionalData = exporter.data
 265                    };
 266
 267                    try
 268                    {
 269                        exporter.exportFunc(objCtx, context);
 270                    }
 271                    catch (Exception ex)
 272                    {
 273                        Debug.LogException(new Exception("Error exporting: " + path, ex));
 274                        continue;
 275                    }
 276
 277                    UnityEngine.Profiling.Profiler.BeginSample("USD: Process Visibility");
 278                    try
 279                    {
 280                        if (!go.gameObject.activeSelf)
 281                        {
 282                            switch (context.activePolicy)
 283                            {
 284                                case ActiveExportPolicy.Ignore:
 285                                    // Nothing to see here.
 286                                    break;
 287
 288                                case ActiveExportPolicy.ExportAsVisibility:
 289                                    // Make the prim invisible.
 290                                    var im = new pxr.UsdGeomImageable(scene.GetPrimAtPath(path));
 291                                    if (im)
 292                                    {
 293                                        im.CreateVisibilityAttr().Set(pxr.UsdGeomTokens.invisible);
 294                                    }
 295
 296                                    break;
 297
 298                                case ActiveExportPolicy.ExportAsActive:
 299                                    // TODO: this may actually cause errors because exported prims will not exist in
 300                                    // the USD scene graph. Right now, that's too much responsibility on the caller,
 301                                    // because the error messages will be mysterious.
 302
 303                                    // Make the prim inactive.
 304                                    scene.GetPrimAtPath(path).SetActive(false);
 305                                    break;
 306                            }
 307                        }
 308                    }
 309                    catch (Exception ex)
 310                    {
 311                        Debug.LogException(new Exception("Error setting visibility: " + path, ex));
 312                        continue;
 313                    }
 314
 315                    UnityEngine.Profiling.Profiler.EndSample();
 316                } // foreach exporter
 317            } // foreach plan
 318
 319            UnityEngine.Profiling.Profiler.EndSample();
 320        }
 321
 322        // ------------------------------------------------------------------------------------------ //
 323        // Init Hierarchy.
 324        // ------------------------------------------------------------------------------------------ //
 325
 326        static void Traverse(GameObject obj,
 327            ObjectProcessor processor,
 328            ExportContext context)
 329        {
 330            processor(obj, context);
 331            foreach (Transform child in obj.transform)
 332            {
 333                Traverse(child.gameObject, processor, context);
 334            }
 335        }
 336
 337        static void AccumNestedBones(Transform curXf,
 338            List<Transform> children,
 339            ExportContext ctx)
 340        {
 341            if (ctx.bindPoses.ContainsKey(curXf))
 342            {
 343                children.Add(curXf);
 344            }
 345
 346            foreach (Transform child in curXf.transform)
 347            {
 348                AccumNestedBones(child, children, ctx);
 349            }
 350        }
 351
 352        static T CreateSample<T>(ExportContext context) where T : SampleBase, new()
 353        {
 354            return new T();
 355            /*
 356            SampleBase sb;
 357            if (context.samples.TryGetValue(typeof(T), out sb)) {
 358              return (T)sb;
 359            }
 360
 361            sb = (new T());
 362            context.samples[typeof(T)] = sb;
 363            return (T)sb;
 364            */
 365        }
 366
 367        public static void SyncExportContext(GameObject exportRoot,
 368            ExportContext context)
 369        {
 370            context.exportRoot = exportRoot.transform.parent;
 371            Traverse(exportRoot, InitExportableObjects, context);
 372
 373            Transform expRoot = context.exportRoot;
 374            var foundAnimators = new List<Transform>();
 375            foreach (var rootBoneXf in context.meshToSkelRoot.Values.ToArray())
 376            {
 377                bool alreadyProcessed = false;
 378                foreach (var xf in foundAnimators)
 379                {
 380                    if (rootBoneXf.IsChildOf(xf))
 381                    {
 382                        alreadyProcessed = true;
 383                        break;
 384                    }
 385                }
 386
 387                if (alreadyProcessed)
 388                {
 389                    continue;
 390                }
 391
 392                var animatorXf = rootBoneXf;
 393
 394                while (animatorXf != null)
 395                {
 396                    // If there is an animator, assume this is the root of the rig.
 397                    // This feels very ad hoc, it would be nice to not use a heuristic.
 398                    var anim = animatorXf.GetComponent<Animator>();
 399                    if (anim != null)
 400                    {
 401                        // Any root bones under this animator will be merged into their most common ancestor,
 402                        // which is returned here and becomes the skeleton root.
 403                        Transform skeletonRoot = MergeBonesBelowAnimator(animatorXf, context);
 404
 405                        if (skeletonRoot == null)
 406                        {
 407                            animatorXf = animatorXf.parent;
 408                            Debug.LogWarning("No children found under animator: " +
 409                                UnityTypeConverter.GetPath(animatorXf) + " Root bone XF: " +
 410                                UnityTypeConverter.GetPath(rootBoneXf));
 411                            continue;
 412                        }
 413
 414                        foundAnimators.Add(anim.transform);
 415
 416                        // The skeleton is exported at the skeleton root and UsdSkelAnimation is nested under
 417                        // this prim as a new prim called "_anim".
 418                        SkelRootSample rootSample = CreateSample<SkelRootSample>(context);
 419                        string skelRootPath = UnityTypeConverter.GetPath(animatorXf.transform, expRoot);
 420                        string skelPath = UnityTypeConverter.GetPath(skeletonRoot, expRoot);
 421                        string skelPathSuffix = "";
 422                        string skelAnimSuffix = "/_anim";
 423
 424                        // When there is a collision between the SkelRoot and the Skeleton, make a new USD Prim
 425                        // for the Skeleton object. The reason this is safe is as follows: if the object was
 426                        // imported from USD, then the structure should already be correct and this code path will
 427                        // not be hit (and hence overrides, etc, will work correctly). If the object was created
 428                        // in Unity and there happened to be a collision, then we can safely create a new prim
 429                        // for the Skeleton prim because there will be no existing USD skeleton for which
 430                        // the namespace must match, hence adding a new prim is still safe.
 431                        if (skelPath == skelRootPath)
 432                        {
 433                            Debug.LogWarning("SkelRoot and Skeleton have the same path, renaming Skeleton");
 434                            skelPathSuffix = "/_skel";
 435                        }
 436
 437                        rootSample.animationSource = skelPath + skelAnimSuffix;
 438
 439                        // For any skinned mesh exported under this SkelRoot, pass along the skeleton path in
 440                        // the "additional data" member of the exporter. Note that this feels very ad hoc and
 441                        // should probably be formalized in some way (perhaps as a separate export event for
 442                        // which the SkinnedMesh exporter can explicitly register).
 443                        //
 444                        // While it is possible to bind the skel:skeleton relationship at the SkelRoot and
 445                        // have it inherit down namespace, the Apple importer did not respect this inheritance
 446                        // and it sometimes causes issues with geometry embedded in the bone hierarchy.
 447                        foreach (var p in context.plans)
 448                        {
 449                            if (p.Key.transform.IsChildOf(animatorXf.transform))
 450                            {
 451                                foreach (var e in p.Value.exporters)
 452                                {
 453                                    if (e.exportFunc == MeshExporter.ExportSkinnedMesh)
 454                                    {
 455                                        e.data = skelPath + skelPathSuffix;
 456                                    }
 457                                }
 458                            }
 459                        }
 460
 461                        CreateExportPlan(
 462                            animatorXf.gameObject,
 463                            rootSample,
 464                            SkeletonExporter.ExportSkelRoot,
 465                            context,
 466                            insertFirst: true);
 467                        CreateExportPlan(
 468                            animatorXf.gameObject,
 469                            rootSample,
 470                            NativeExporter.ExportObject,
 471                            context,
 472                            insertFirst: false);
 473
 474                        CreateExportPlan(
 475                            skeletonRoot.gameObject,
 476                            CreateSample<SkeletonSample>(context),
 477                            SkeletonExporter.ExportSkeleton,
 478                            context,
 479                            insertFirst: true,
 480                            pathSuffix: skelPathSuffix);
 481                        CreateExportPlan(
 482                            skeletonRoot.gameObject,
 483                            CreateSample<SkeletonSample>(context),
 484                            NativeExporter.ExportObject,
 485                            context,
 486                            insertFirst: false,
 487                            pathSuffix: skelPathSuffix);
 488
 489                        CreateExportPlan(
 490                            skeletonRoot.gameObject,
 491                            CreateSample<SkelAnimationSample>(context),
 492                            SkeletonExporter.ExportSkelAnimation,
 493                            context,
 494                            insertFirst: true,
 495                            pathSuffix: skelAnimSuffix);
 496
 497                        // Exporting animation is only possible while in-editor (in 2018 and earlier).
 498#if UNITY_EDITOR
 499#if false // Currently disabled, future work.
 500                        if (anim.layerCount > 0)
 501                        {
 502                            for (int l = 0; l < anim.layerCount; l++)
 503                            {
 504                                int clipCount = anim.GetCurrentAnimatorClipInfoCount(l);
 505                                var clipInfos = anim.GetCurrentAnimatorClipInfo(l);
 506                                foreach (var clipInfo in clipInfos)
 507                                {
 508                                    var bindings = UnityEditor.AnimationUtility.GetCurveBindings(clipInfo.clip);
 509                                    // Properties are expressed as individual values, for transforms this is:
 510                                    //   m_LocalPosition.x,y,z
 511                                    //   m_LocalScale.x,y,z
 512                                    //   m_LocalRotation.x,y,z,w
 513                                    // Which means they must be reaggregated into matrices.
 514                                    foreach (var binding in bindings)
 515                                    {
 516                                        if (binding.type != typeof(Transform))
 517                                        {
 518                                            continue;
 519                                        }
 520                                        Debug.Log(binding.path + "." + binding.propertyName);
 521                                        var knot = UnityEditor.AnimationUtility.GetEditorCurve(clipInfo.clip, binding);
 522                                    }
 523                                }
 524                            }
 525                        }
 526#endif // disabled.
 527#endif // Editor only.
 528
 529                        break;
 530                    }
 531
 532                    animatorXf = animatorXf.parent;
 533                }
 534            }
 535        }
 536
 537        static void InitExportableObjects(GameObject go,
 538            ExportContext context)
 539        {
 540            var smr = go.GetComponent<SkinnedMeshRenderer>();
 541            var mr = go.GetComponent<MeshRenderer>();
 542            var mf = go.GetComponent<MeshFilter>();
 543            var cam = go.GetComponent<Camera>();
 544            Transform expRoot = context.exportRoot;
 545
 546            var tmpPath = new pxr.SdfPath(UnityTypeConverter.GetPath(go.transform, expRoot));
 547            while (!tmpPath.IsRootPrimPath())
 548            {
 549                tmpPath = tmpPath.GetParentPath();
 550            }
 551
 552            // TODO: What if this path is in use?
 553            string materialBasePath = tmpPath.ToString() + "/Materials/";
 554
 555            // Ensure the "Materials" prim is defined with a valid prim type.
 556            context.scene.Write(materialBasePath.TrimEnd('/'), new ScopeSample());
 557
 558            if (smr != null)
 559            {
 560                foreach (var mat in smr.sharedMaterials)
 561                {
 562                    if (!context.matMap.ContainsKey(mat))
 563                    {
 564                        string usdPath = materialBasePath +
 565                            pxr.UsdCs.TfMakeValidIdentifier(
 566                            mat.name + "_" + mat.GetInstanceID().ToString());
 567                        context.matMap.Add(mat, usdPath);
 568                    }
 569                }
 570
 571                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportSkinnedMesh, context);
 572                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 573                    insertFirst: false);
 574                if (smr.rootBone == null)
 575                {
 576                    Debug.LogWarning("No root bone at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 577                }
 578                else if (smr.bones == null || smr.bones.Length == 0)
 579                {
 580                    Debug.LogWarning("No bones at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 581                }
 582                else
 583                {
 584                    // Each mesh in a model may have a different root bone, which now must be merged into a
 585                    // single skeleton for export to USD.
 586                    try
 587                    {
 588                        MergeBonesSimple(smr.transform, smr.rootBone, smr.bones, smr.sharedMesh.bindposes, context);
 589                    }
 590                    catch (Exception ex)
 591                    {
 592                        Debug.LogException(
 593                            new Exception("Failed to merge bones for " + UnityTypeConverter.GetPath(smr.transform),
 594                                ex));
 595                    }
 596                }
 597            }
 598            else if (mf != null && mr != null)
 599            {
 600                foreach (var mat in mr.sharedMaterials)
 601                {
 602                    if (mat == null)
 603                    {
 604                        continue;
 605                    }
 606
 607                    if (!context.matMap.ContainsKey(mat))
 608                    {
 609                        string usdPath = materialBasePath +
 610                            pxr.UsdCs.TfMakeValidIdentifier(
 611                            mat.name + "_" + mat.GetInstanceID().ToString());
 612                        context.matMap.Add(mat, usdPath);
 613                    }
 614                }
 615
 616                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportMesh, context);
 617                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 618                    insertFirst: false);
 619            }
 620            else if (cam)
 621            {
 622                CreateExportPlan(go, CreateSample<CameraSample>(context), CameraExporter.ExportCamera, context);
 623                CreateExportPlan(go, CreateSample<CameraSample>(context), NativeExporter.ExportObject, context,
 624                    insertFirst: false);
 625            }
 626        }
 627
 628        static Transform MergeBonesBelowAnimator(Transform animator, ExportContext context)
 629        {
 630            var toRemove = new Dictionary<Transform, Transform>();
 631            Transform commonRoot = null;
 632
 633            foreach (var sourceAndRoot in context.meshToSkelRoot)
 634            {
 635                var meshXf = sourceAndRoot.Key;
 636                var meshRootBone = sourceAndRoot.Value;
 637                if (!meshRootBone.IsChildOf(animator))
 638                {
 639                    continue;
 640                }
 641
 642                toRemove.Add(meshXf, meshRootBone);
 643                if (commonRoot == null)
 644                {
 645                    // We use the parent because the root bone is part of the skeleton and we're establishing
 646                    // the skeleton root here. If the root bone is used as the skeleton root, its transform
 647                    // will get applied twice after export to USD: once for the UsdPrim which is the skeleton
 648                    // root and once for the bone which is in the skeleton itself. The root bone could be
 649                    // excluded from the skeleton, but this seems simpler.
 650                    commonRoot = meshRootBone.parent;
 651                }
 652                else if (meshRootBone.IsChildOf(commonRoot))
 653                {
 654                    // Nothing to do.
 655                }
 656                else if (commonRoot.IsChildOf(meshRootBone))
 657                {
 658                    // The new root is a parent of the current common root, use it as the root instead.
 659                    commonRoot = meshRootBone.parent;
 660                }
 661                else
 662                {
 663                    // We have an animator which is a common parent of two disjoint skeletons, this is not
 664                    // desirable because it requires that the animator be the common root, however this
 665                    // root will be tagged as a guide, which will cuase the geometry not to render, which
 666                    // will be confusing. Another option would be to construct a new common parent in USD,
 667                    // but this will cause the asset namespace to change, which is almost never a good idea.
 668                    commonRoot = animator;
 669                }
 670            }
 671
 672            if (toRemove.Count == 0)
 673            {
 674                return null;
 675            }
 676
 677            // At this point, some number of root bones have been aggregated under some potentially new
 678            // common root. Next, we need to merge all these root bones and preserve the requirement that
 679            // the bones are in "parent first" order.
 680            var allBones = new List<Transform>();
 681
 682            foreach (var kvp in toRemove)
 683            {
 684                Transform curMeshXf = kvp.Key;
 685                Transform rootBone = kvp.Value;
 686
 687                allBones.AddRange(context.meshToBones[curMeshXf]);
 688
 689                // Downstream code will have a root bone and need to know how to make bone paths relative
 690                // to the new, arbitrary, common root which we have chosen.
 691                context.boneToRoot[rootBone] = commonRoot;
 692
 693                context.meshToSkelRoot.Remove(curMeshXf);
 694                context.meshToBones.Remove(curMeshXf);
 695            }
 696
 697            // Maintain a sorted list of bone names to ensure "parent first" ordering for UsdSkel.
 698            var allNames = allBones.Select(boneXf => UnityTypeConverter.GetPath(boneXf))
 699                .OrderBy(str => str)
 700                .Distinct()
 701                .ToList();
 702            context.skelSortedMap[commonRoot] = allNames;
 703
 704            return commonRoot;
 705        }
 706
 707        static void MergeBonesSimple(Transform source,
 708            Transform rootBone,
 709            Transform[] bones,
 710            Matrix4x4[] bindPoses,
 711            ExportContext context)
 712        {
 713            context.meshToSkelRoot.Add(source, rootBone);
 714            context.meshToBones.Add(source, bones);
 715            Matrix4x4 existingMatrix;
 716            for (int i = 0; i < bones.Length; i++)
 717            {
 718                Transform bone = bones[i];
 719                if (bone == null)
 720                {
 721                    var srcPath = UnityTypeConverter.GetPath(source);
 722                    Debug.LogWarning("Null bone at in bones list at position (" + i + ") " + srcPath);
 723                    continue;
 724                }
 725
 726                var path = UnityTypeConverter.GetPath(bone);
 727                context.pathToBone[path] = bone;
 728                context.boneToRoot[bone] = rootBone;
 729                context.bindPoses[bone] = bindPoses[i];
 730                if (context.bindPoses.TryGetValue(bone, out existingMatrix) && existingMatrix != bindPoses[i])
 731                {
 732                    Debug.LogWarning("Duplicate bone with different bind poses: " + path + "\n" +
 733                        existingMatrix.ToString() + "\n" + bindPoses[i].ToString());
 734                }
 735            }
 736        }
 737
 738        static void CreateExportPlan(GameObject go,
 739            SampleBase sample,
 740            ExportFunction exportFunc,
 741            ExportContext context,
 742            string pathSuffix = null,
 743            bool insertFirst = true)
 744        {
 745            // This is an exportable object.
 746            Transform expRoot = context.exportRoot;
 747            string path = UnityTypeConverter.GetPath(go.transform, expRoot);
 748            if (!string.IsNullOrEmpty(pathSuffix))
 749            {
 750                path += pathSuffix;
 751            }
 752
 753            if (!context.plans.ContainsKey(go))
 754            {
 755                context.plans.Add(go, new ExportPlan());
 756            }
 757
 758            var exp = new Exporter { exportFunc = exportFunc, sample = sample, path = path };
 759            if (insertFirst)
 760            {
 761                context.plans[go].exporters.Insert(0, exp);
 762            }
 763            else
 764            {
 765                context.plans[go].exporters.Add(exp);
 766            }
 767
 768            // Include the parent xform hierarchy.
 769            // Note that the parent hierarchy is memoised, so despite looking expensive, the time
 770            // complexity is linear.
 771            Transform xf = go.transform.parent;
 772            if (xf != context.exportRoot && !context.plans.ContainsKey(xf.gameObject))
 773            {
 774                // Since all GameObjects have a Transform, export all un-exported parents as transform.
 775                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), XformExporter.ExportXform, context);
 776                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), NativeExporter.ExportObject,
 777                    context, insertFirst: false);
 778            }
 779        }
 780
 781        static Matrix4x4 ComputeWorldXf(Transform curBone, ExportContext context)
 782        {
 783            if (!context.bindPoses.ContainsKey(curBone))
 784            {
 785                return curBone.parent.localToWorldMatrix;
 786            }
 787
 788            return context.bindPoses[curBone] * ComputeWorldXf(curBone.parent, context);
 789        }
 790    }
 791}
+
+
+
+

Methods/Properties

+ExportContext()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportHelpers.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportHelpers.html new file mode 100644 index 000000000..a0d297720 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportHelpers.html @@ -0,0 +1,164 @@ + + + + + + +Unity.Formats.USD.ExportHelpers - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ExportHelpers
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/ExportHelpers.cs
Covered lines:29
Uncovered lines:7
Coverable lines:36
Total lines:60
Line coverage:80.5% (29 of 36)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
InitForSave(...)0%00065%
ExportGameObjects(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/ExportHelpers.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System.IO;
 2using UnityEditor;
 3using UnityEngine;
 4using USD.NET;
 5
 6namespace Unity.Formats.USD
 7{
 8    public static class ExportHelpers
 9    {
 10        public static Scene InitForSave(string filePath)
 711        {
 712            if (string.IsNullOrEmpty(filePath))
 213            {
 214                return null;
 15            }
 16
 517            var fileDir = Path.GetDirectoryName(filePath);
 18
 519            if (!Directory.Exists(fileDir))
 020            {
 021                var di = Directory.CreateDirectory(fileDir);
 022                if (!di.Exists)
 023                {
 024                    Debug.LogError("Failed to create directory: " + fileDir);
 025                    return null;
 26                }
 027            }
 28
 529            InitUsd.Initialize();
 530            var scene = Scene.Create(filePath);
 531            scene.Time = 0;
 532            scene.StartTime = 0;
 533            scene.EndTime = 0;
 534            return scene;
 735        }
 36
 37        public static void ExportGameObjects(GameObject[] objects, Scene scene, BasisTransformation basisTransform,
 38            bool exportMonoBehaviours = false)
 939        {
 940            if (scene == null)
 141                return;
 42
 4243            foreach (GameObject go in objects)
 944            {
 45                try
 946                {
 947                    SceneExporter.Export(go, scene, basisTransform,
 48                        exportUnvarying: true, zeroRootTransform: false,
 49                        exportMonoBehaviours: exportMonoBehaviours);
 850                }
 151                catch (System.Exception ex)
 152                {
 153                    Debug.LogException(ex);
 154                }
 955            }
 856            scene.Save();
 857            scene.Close();
 958        }
 59    }
 60}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportPlan.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportPlan.html new file mode 100644 index 000000000..b47c6635a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ExportPlan.html @@ -0,0 +1,893 @@ + + + + + + +Unity.Formats.USD.ExportPlan - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ExportPlan
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs
Covered lines:1
Uncovered lines:0
Coverable lines:1
Total lines:791
Line coverage:100% (1 of 1)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportPlan()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using UnityEngine;
 19using USD.NET;
 20using USD.NET.Unity;
 21
 22namespace Unity.Formats.USD
 23{
 24    // The export function allows for dispatch to different export functions without knowing what
 25    // type of data they export (e.g. mesh vs. transform).
 26    public delegate void ExportFunction(ObjectContext objContext, ExportContext exportContext);
 27
 28    delegate void ObjectProcessor(GameObject go,
 29        ExportContext context);
 30
 31    public struct ObjectContext
 32    {
 33        public GameObject gameObject;
 34        public string path;
 35        public SampleBase sample;
 36        public object additionalData;
 37    }
 38
 39    public enum ActiveExportPolicy
 40    {
 41        // Inactive GameObjects in Unity become invisible objects in USD, which is actually the
 42        // closest semantic mapping.
 43        ExportAsVisibility,
 44
 45        // Inactive GameObjects in Unity become deactivated objects in USD. Caution, this is not truly
 46        // an equivalent state because deactivated objects in USD are fully unloaded and their
 47        // subtree will not exist after being deactivated.
 48        ExportAsActive,
 49
 50        // Inactive GameObjects will not be exported.
 51        DoNotExport,
 52
 53        // Inactive GameObjects will be exported without special handling.
 54        Ignore,
 55    }
 56
 57    public class ExportContext
 58    {
 59        public Scene scene;
 60        public Transform exportRoot;
 61        public bool exportMaterials = true;
 62        public bool exportNative = false;
 63        public float scale = 1.0f;
 64
 65        public BasisTransformation basisTransform = BasisTransformation.FastWithNegativeScale;
 66        public ActiveExportPolicy activePolicy = ActiveExportPolicy.ExportAsVisibility;
 67        public Dictionary<GameObject, ExportPlan> plans = new Dictionary<GameObject, ExportPlan>();
 68        public Dictionary<Material, string> matMap = new Dictionary<Material, string>();
 69
 70        public Dictionary<Transform, Transform> meshToSkelRoot = new Dictionary<Transform, Transform>();
 71        public Dictionary<Transform, Transform[]> meshToBones = new Dictionary<Transform, Transform[]>();
 72
 73        public Dictionary<Transform, List<string>> skelSortedMap = new Dictionary<Transform, List<string>>();
 74
 75        // Dictionary from <oldRoot> to <newRoot>
 76        public Dictionary<string, Transform> pathToBone = new Dictionary<string, Transform>();
 77        public Dictionary<Transform, Transform> boneToRoot = new Dictionary<Transform, Transform>();
 78        public Dictionary<Transform, Matrix4x4> bindPoses = new Dictionary<Transform, Matrix4x4>();
 79
 80        // Sample object instances, shared across multiple export methods.
 81        public Dictionary<Type, SampleBase> samples = new Dictionary<Type, SampleBase>();
 82    }
 83
 84    public class Exporter
 85    {
 86        // The USD path at which the Unity data will be written.
 87        public string path;
 88
 89        // The sample type to be used when exporting.
 90        public SampleBase sample;
 91
 92        // The export function which implements the logic to populate the sample.
 93        public ExportFunction exportFunc;
 94
 95        // Additional arguments required for export.
 96        public object data;
 97    }
 98
 99    // An export plan will be created for each path in the scene. Each ExportPlan will use one of
 100    // the fixed export functions. For example, when setting up export for a mesh, an ExportPlan
 101    // will be created for that path in the scenegraph and the ExportFunction will the one which is
 102    // capable of exporting a mesh.
 103    public class ExportPlan
 104    {
 105        // The functions to run when exporting this object.
 12106        public List<Exporter> exporters = new List<Exporter>();
 107    }
 108
 109    /// <summary>
 110    /// The scene exporter can be used to export data to USD.
 111    /// </summary>
 112    public static class SceneExporter
 113    {
 114        // ------------------------------------------------------------------------------------------ //
 115        // Main Export Logic.
 116        // ------------------------------------------------------------------------------------------ //
 117
 118        public static void Export(GameObject root,
 119            Scene scene,
 120            BasisTransformation basisTransform,
 121            bool exportUnvarying,
 122            bool zeroRootTransform,
 123            bool exportMaterials = false,
 124            bool exportMonoBehaviours = false)
 125        {
 126            var context = new ExportContext();
 127            context.scene = scene;
 128            context.basisTransform = basisTransform;
 129            context.exportRoot = root.transform.parent;
 130            SyncExportContext(root, context);
 131
 132            // Since this is a one-shot convenience function, we will automatically split the export
 133            // into varying and unvarying data, unless the user explicitly requested unvarying.
 134            if (exportUnvarying && scene.Time != null)
 135            {
 136                double? oldTime = scene.Time;
 137                scene.Time = null;
 138                Export(root, context, zeroRootTransform);
 139                scene.Time = oldTime;
 140            }
 141
 142            // Export data for the requested time.
 143            context.exportMaterials = exportMaterials;
 144            Export(root, context, zeroRootTransform);
 145        }
 146
 147        public static void Export(GameObject root,
 148            ExportContext context,
 149            bool zeroRootTransform)
 150        {
 151            // Remove parent transform effects while exporting.
 152            // This must be restored before returning from this function.
 153            var parent = root.transform.parent;
 154            if (zeroRootTransform)
 155            {
 156                root.transform.SetParent(null, worldPositionStays: false);
 157            }
 158
 159            // Also zero out and restore local rotations on the root.
 160            var localPos = root.transform.localPosition;
 161            var localRot = root.transform.localRotation;
 162            var localScale = root.transform.localScale;
 163            if (zeroRootTransform)
 164            {
 165                root.transform.localPosition = Vector3.zero;
 166                root.transform.localRotation = Quaternion.identity;
 167                root.transform.localScale = Vector3.one;
 168            }
 169
 170            // Scale overall scene for export (e.g. USDZ export needs scale 100)
 171            root.transform.localScale *= context.scale;
 172
 173            UnityEngine.Profiling.Profiler.BeginSample("USD: Export");
 174            try
 175            {
 176                ExportImpl(root, context);
 177                var path = new pxr.SdfPath(UnityTypeConverter.GetPath(root.transform));
 178                var prim = context.scene.Stage.GetPrimAtPath(path);
 179                if (prim)
 180                {
 181                    context.scene.Stage.SetDefaultPrim(prim);
 182                }
 183            }
 184            finally
 185            {
 186                if (zeroRootTransform)
 187                {
 188                    root.transform.localPosition = localPos;
 189                    root.transform.localRotation = localRot;
 190                    root.transform.localScale = localScale;
 191                    root.transform.SetParent(parent, worldPositionStays: false);
 192                }
 193                else
 194                {
 195                    root.transform.localScale = localScale;
 196                }
 197
 198                UnityEngine.Profiling.Profiler.EndSample();
 199            }
 200        }
 201
 202        private static void ExportImpl(GameObject root,
 203            ExportContext context)
 204        {
 205            var scene = context.scene;
 206            bool skipInactive = context.activePolicy == ActiveExportPolicy.DoNotExport;
 207
 208            if (context.exportMaterials)
 209            {
 210                // TODO: should account for skipped objects and also skip their materials.
 211                UnityEngine.Profiling.Profiler.BeginSample("USD: Export Materials");
 212                foreach (var kvp in context.matMap)
 213                {
 214                    Material mat = kvp.Key;
 215                    string usdPath = kvp.Value;
 216                    if (!mat || usdPath == null)
 217                    {
 218                        continue;
 219                    }
 220
 221                    try
 222                    {
 223                        MaterialExporter.ExportMaterial(scene, kvp.Key, kvp.Value);
 224                    }
 225                    catch (Exception ex)
 226                    {
 227                        Debug.LogException(new Exception("Error exporting material: " + kvp.Value, ex));
 228                    }
 229                }
 230
 231                UnityEngine.Profiling.Profiler.EndSample();
 232            }
 233
 234            UnityEngine.Profiling.Profiler.BeginSample("USD: Process Export Plans");
 235            foreach (var kvp in context.plans)
 236            {
 237                GameObject go = kvp.Key;
 238                ExportPlan exportPlan = kvp.Value;
 239
 240                if (!go || exportPlan == null)
 241                {
 242                    continue;
 243                }
 244
 245                if (go != root && !go.transform.IsChildOf(root.transform))
 246                {
 247                    continue;
 248                }
 249
 250                if (skipInactive && go.activeInHierarchy == false)
 251                {
 252                    continue;
 253                }
 254
 255                foreach (Exporter exporter in exportPlan.exporters)
 256                {
 257                    string path = exporter.path;
 258                    SampleBase sample = exporter.sample;
 259                    var objCtx = new ObjectContext
 260                    {
 261                        gameObject = go,
 262                        path = path,
 263                        sample = sample,
 264                        additionalData = exporter.data
 265                    };
 266
 267                    try
 268                    {
 269                        exporter.exportFunc(objCtx, context);
 270                    }
 271                    catch (Exception ex)
 272                    {
 273                        Debug.LogException(new Exception("Error exporting: " + path, ex));
 274                        continue;
 275                    }
 276
 277                    UnityEngine.Profiling.Profiler.BeginSample("USD: Process Visibility");
 278                    try
 279                    {
 280                        if (!go.gameObject.activeSelf)
 281                        {
 282                            switch (context.activePolicy)
 283                            {
 284                                case ActiveExportPolicy.Ignore:
 285                                    // Nothing to see here.
 286                                    break;
 287
 288                                case ActiveExportPolicy.ExportAsVisibility:
 289                                    // Make the prim invisible.
 290                                    var im = new pxr.UsdGeomImageable(scene.GetPrimAtPath(path));
 291                                    if (im)
 292                                    {
 293                                        im.CreateVisibilityAttr().Set(pxr.UsdGeomTokens.invisible);
 294                                    }
 295
 296                                    break;
 297
 298                                case ActiveExportPolicy.ExportAsActive:
 299                                    // TODO: this may actually cause errors because exported prims will not exist in
 300                                    // the USD scene graph. Right now, that's too much responsibility on the caller,
 301                                    // because the error messages will be mysterious.
 302
 303                                    // Make the prim inactive.
 304                                    scene.GetPrimAtPath(path).SetActive(false);
 305                                    break;
 306                            }
 307                        }
 308                    }
 309                    catch (Exception ex)
 310                    {
 311                        Debug.LogException(new Exception("Error setting visibility: " + path, ex));
 312                        continue;
 313                    }
 314
 315                    UnityEngine.Profiling.Profiler.EndSample();
 316                } // foreach exporter
 317            } // foreach plan
 318
 319            UnityEngine.Profiling.Profiler.EndSample();
 320        }
 321
 322        // ------------------------------------------------------------------------------------------ //
 323        // Init Hierarchy.
 324        // ------------------------------------------------------------------------------------------ //
 325
 326        static void Traverse(GameObject obj,
 327            ObjectProcessor processor,
 328            ExportContext context)
 329        {
 330            processor(obj, context);
 331            foreach (Transform child in obj.transform)
 332            {
 333                Traverse(child.gameObject, processor, context);
 334            }
 335        }
 336
 337        static void AccumNestedBones(Transform curXf,
 338            List<Transform> children,
 339            ExportContext ctx)
 340        {
 341            if (ctx.bindPoses.ContainsKey(curXf))
 342            {
 343                children.Add(curXf);
 344            }
 345
 346            foreach (Transform child in curXf.transform)
 347            {
 348                AccumNestedBones(child, children, ctx);
 349            }
 350        }
 351
 352        static T CreateSample<T>(ExportContext context) where T : SampleBase, new()
 353        {
 354            return new T();
 355            /*
 356            SampleBase sb;
 357            if (context.samples.TryGetValue(typeof(T), out sb)) {
 358              return (T)sb;
 359            }
 360
 361            sb = (new T());
 362            context.samples[typeof(T)] = sb;
 363            return (T)sb;
 364            */
 365        }
 366
 367        public static void SyncExportContext(GameObject exportRoot,
 368            ExportContext context)
 369        {
 370            context.exportRoot = exportRoot.transform.parent;
 371            Traverse(exportRoot, InitExportableObjects, context);
 372
 373            Transform expRoot = context.exportRoot;
 374            var foundAnimators = new List<Transform>();
 375            foreach (var rootBoneXf in context.meshToSkelRoot.Values.ToArray())
 376            {
 377                bool alreadyProcessed = false;
 378                foreach (var xf in foundAnimators)
 379                {
 380                    if (rootBoneXf.IsChildOf(xf))
 381                    {
 382                        alreadyProcessed = true;
 383                        break;
 384                    }
 385                }
 386
 387                if (alreadyProcessed)
 388                {
 389                    continue;
 390                }
 391
 392                var animatorXf = rootBoneXf;
 393
 394                while (animatorXf != null)
 395                {
 396                    // If there is an animator, assume this is the root of the rig.
 397                    // This feels very ad hoc, it would be nice to not use a heuristic.
 398                    var anim = animatorXf.GetComponent<Animator>();
 399                    if (anim != null)
 400                    {
 401                        // Any root bones under this animator will be merged into their most common ancestor,
 402                        // which is returned here and becomes the skeleton root.
 403                        Transform skeletonRoot = MergeBonesBelowAnimator(animatorXf, context);
 404
 405                        if (skeletonRoot == null)
 406                        {
 407                            animatorXf = animatorXf.parent;
 408                            Debug.LogWarning("No children found under animator: " +
 409                                UnityTypeConverter.GetPath(animatorXf) + " Root bone XF: " +
 410                                UnityTypeConverter.GetPath(rootBoneXf));
 411                            continue;
 412                        }
 413
 414                        foundAnimators.Add(anim.transform);
 415
 416                        // The skeleton is exported at the skeleton root and UsdSkelAnimation is nested under
 417                        // this prim as a new prim called "_anim".
 418                        SkelRootSample rootSample = CreateSample<SkelRootSample>(context);
 419                        string skelRootPath = UnityTypeConverter.GetPath(animatorXf.transform, expRoot);
 420                        string skelPath = UnityTypeConverter.GetPath(skeletonRoot, expRoot);
 421                        string skelPathSuffix = "";
 422                        string skelAnimSuffix = "/_anim";
 423
 424                        // When there is a collision between the SkelRoot and the Skeleton, make a new USD Prim
 425                        // for the Skeleton object. The reason this is safe is as follows: if the object was
 426                        // imported from USD, then the structure should already be correct and this code path will
 427                        // not be hit (and hence overrides, etc, will work correctly). If the object was created
 428                        // in Unity and there happened to be a collision, then we can safely create a new prim
 429                        // for the Skeleton prim because there will be no existing USD skeleton for which
 430                        // the namespace must match, hence adding a new prim is still safe.
 431                        if (skelPath == skelRootPath)
 432                        {
 433                            Debug.LogWarning("SkelRoot and Skeleton have the same path, renaming Skeleton");
 434                            skelPathSuffix = "/_skel";
 435                        }
 436
 437                        rootSample.animationSource = skelPath + skelAnimSuffix;
 438
 439                        // For any skinned mesh exported under this SkelRoot, pass along the skeleton path in
 440                        // the "additional data" member of the exporter. Note that this feels very ad hoc and
 441                        // should probably be formalized in some way (perhaps as a separate export event for
 442                        // which the SkinnedMesh exporter can explicitly register).
 443                        //
 444                        // While it is possible to bind the skel:skeleton relationship at the SkelRoot and
 445                        // have it inherit down namespace, the Apple importer did not respect this inheritance
 446                        // and it sometimes causes issues with geometry embedded in the bone hierarchy.
 447                        foreach (var p in context.plans)
 448                        {
 449                            if (p.Key.transform.IsChildOf(animatorXf.transform))
 450                            {
 451                                foreach (var e in p.Value.exporters)
 452                                {
 453                                    if (e.exportFunc == MeshExporter.ExportSkinnedMesh)
 454                                    {
 455                                        e.data = skelPath + skelPathSuffix;
 456                                    }
 457                                }
 458                            }
 459                        }
 460
 461                        CreateExportPlan(
 462                            animatorXf.gameObject,
 463                            rootSample,
 464                            SkeletonExporter.ExportSkelRoot,
 465                            context,
 466                            insertFirst: true);
 467                        CreateExportPlan(
 468                            animatorXf.gameObject,
 469                            rootSample,
 470                            NativeExporter.ExportObject,
 471                            context,
 472                            insertFirst: false);
 473
 474                        CreateExportPlan(
 475                            skeletonRoot.gameObject,
 476                            CreateSample<SkeletonSample>(context),
 477                            SkeletonExporter.ExportSkeleton,
 478                            context,
 479                            insertFirst: true,
 480                            pathSuffix: skelPathSuffix);
 481                        CreateExportPlan(
 482                            skeletonRoot.gameObject,
 483                            CreateSample<SkeletonSample>(context),
 484                            NativeExporter.ExportObject,
 485                            context,
 486                            insertFirst: false,
 487                            pathSuffix: skelPathSuffix);
 488
 489                        CreateExportPlan(
 490                            skeletonRoot.gameObject,
 491                            CreateSample<SkelAnimationSample>(context),
 492                            SkeletonExporter.ExportSkelAnimation,
 493                            context,
 494                            insertFirst: true,
 495                            pathSuffix: skelAnimSuffix);
 496
 497                        // Exporting animation is only possible while in-editor (in 2018 and earlier).
 498#if UNITY_EDITOR
 499#if false // Currently disabled, future work.
 500                        if (anim.layerCount > 0)
 501                        {
 502                            for (int l = 0; l < anim.layerCount; l++)
 503                            {
 504                                int clipCount = anim.GetCurrentAnimatorClipInfoCount(l);
 505                                var clipInfos = anim.GetCurrentAnimatorClipInfo(l);
 506                                foreach (var clipInfo in clipInfos)
 507                                {
 508                                    var bindings = UnityEditor.AnimationUtility.GetCurveBindings(clipInfo.clip);
 509                                    // Properties are expressed as individual values, for transforms this is:
 510                                    //   m_LocalPosition.x,y,z
 511                                    //   m_LocalScale.x,y,z
 512                                    //   m_LocalRotation.x,y,z,w
 513                                    // Which means they must be reaggregated into matrices.
 514                                    foreach (var binding in bindings)
 515                                    {
 516                                        if (binding.type != typeof(Transform))
 517                                        {
 518                                            continue;
 519                                        }
 520                                        Debug.Log(binding.path + "." + binding.propertyName);
 521                                        var knot = UnityEditor.AnimationUtility.GetEditorCurve(clipInfo.clip, binding);
 522                                    }
 523                                }
 524                            }
 525                        }
 526#endif // disabled.
 527#endif // Editor only.
 528
 529                        break;
 530                    }
 531
 532                    animatorXf = animatorXf.parent;
 533                }
 534            }
 535        }
 536
 537        static void InitExportableObjects(GameObject go,
 538            ExportContext context)
 539        {
 540            var smr = go.GetComponent<SkinnedMeshRenderer>();
 541            var mr = go.GetComponent<MeshRenderer>();
 542            var mf = go.GetComponent<MeshFilter>();
 543            var cam = go.GetComponent<Camera>();
 544            Transform expRoot = context.exportRoot;
 545
 546            var tmpPath = new pxr.SdfPath(UnityTypeConverter.GetPath(go.transform, expRoot));
 547            while (!tmpPath.IsRootPrimPath())
 548            {
 549                tmpPath = tmpPath.GetParentPath();
 550            }
 551
 552            // TODO: What if this path is in use?
 553            string materialBasePath = tmpPath.ToString() + "/Materials/";
 554
 555            // Ensure the "Materials" prim is defined with a valid prim type.
 556            context.scene.Write(materialBasePath.TrimEnd('/'), new ScopeSample());
 557
 558            if (smr != null)
 559            {
 560                foreach (var mat in smr.sharedMaterials)
 561                {
 562                    if (!context.matMap.ContainsKey(mat))
 563                    {
 564                        string usdPath = materialBasePath +
 565                            pxr.UsdCs.TfMakeValidIdentifier(
 566                            mat.name + "_" + mat.GetInstanceID().ToString());
 567                        context.matMap.Add(mat, usdPath);
 568                    }
 569                }
 570
 571                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportSkinnedMesh, context);
 572                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 573                    insertFirst: false);
 574                if (smr.rootBone == null)
 575                {
 576                    Debug.LogWarning("No root bone at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 577                }
 578                else if (smr.bones == null || smr.bones.Length == 0)
 579                {
 580                    Debug.LogWarning("No bones at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 581                }
 582                else
 583                {
 584                    // Each mesh in a model may have a different root bone, which now must be merged into a
 585                    // single skeleton for export to USD.
 586                    try
 587                    {
 588                        MergeBonesSimple(smr.transform, smr.rootBone, smr.bones, smr.sharedMesh.bindposes, context);
 589                    }
 590                    catch (Exception ex)
 591                    {
 592                        Debug.LogException(
 593                            new Exception("Failed to merge bones for " + UnityTypeConverter.GetPath(smr.transform),
 594                                ex));
 595                    }
 596                }
 597            }
 598            else if (mf != null && mr != null)
 599            {
 600                foreach (var mat in mr.sharedMaterials)
 601                {
 602                    if (mat == null)
 603                    {
 604                        continue;
 605                    }
 606
 607                    if (!context.matMap.ContainsKey(mat))
 608                    {
 609                        string usdPath = materialBasePath +
 610                            pxr.UsdCs.TfMakeValidIdentifier(
 611                            mat.name + "_" + mat.GetInstanceID().ToString());
 612                        context.matMap.Add(mat, usdPath);
 613                    }
 614                }
 615
 616                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportMesh, context);
 617                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 618                    insertFirst: false);
 619            }
 620            else if (cam)
 621            {
 622                CreateExportPlan(go, CreateSample<CameraSample>(context), CameraExporter.ExportCamera, context);
 623                CreateExportPlan(go, CreateSample<CameraSample>(context), NativeExporter.ExportObject, context,
 624                    insertFirst: false);
 625            }
 626        }
 627
 628        static Transform MergeBonesBelowAnimator(Transform animator, ExportContext context)
 629        {
 630            var toRemove = new Dictionary<Transform, Transform>();
 631            Transform commonRoot = null;
 632
 633            foreach (var sourceAndRoot in context.meshToSkelRoot)
 634            {
 635                var meshXf = sourceAndRoot.Key;
 636                var meshRootBone = sourceAndRoot.Value;
 637                if (!meshRootBone.IsChildOf(animator))
 638                {
 639                    continue;
 640                }
 641
 642                toRemove.Add(meshXf, meshRootBone);
 643                if (commonRoot == null)
 644                {
 645                    // We use the parent because the root bone is part of the skeleton and we're establishing
 646                    // the skeleton root here. If the root bone is used as the skeleton root, its transform
 647                    // will get applied twice after export to USD: once for the UsdPrim which is the skeleton
 648                    // root and once for the bone which is in the skeleton itself. The root bone could be
 649                    // excluded from the skeleton, but this seems simpler.
 650                    commonRoot = meshRootBone.parent;
 651                }
 652                else if (meshRootBone.IsChildOf(commonRoot))
 653                {
 654                    // Nothing to do.
 655                }
 656                else if (commonRoot.IsChildOf(meshRootBone))
 657                {
 658                    // The new root is a parent of the current common root, use it as the root instead.
 659                    commonRoot = meshRootBone.parent;
 660                }
 661                else
 662                {
 663                    // We have an animator which is a common parent of two disjoint skeletons, this is not
 664                    // desirable because it requires that the animator be the common root, however this
 665                    // root will be tagged as a guide, which will cuase the geometry not to render, which
 666                    // will be confusing. Another option would be to construct a new common parent in USD,
 667                    // but this will cause the asset namespace to change, which is almost never a good idea.
 668                    commonRoot = animator;
 669                }
 670            }
 671
 672            if (toRemove.Count == 0)
 673            {
 674                return null;
 675            }
 676
 677            // At this point, some number of root bones have been aggregated under some potentially new
 678            // common root. Next, we need to merge all these root bones and preserve the requirement that
 679            // the bones are in "parent first" order.
 680            var allBones = new List<Transform>();
 681
 682            foreach (var kvp in toRemove)
 683            {
 684                Transform curMeshXf = kvp.Key;
 685                Transform rootBone = kvp.Value;
 686
 687                allBones.AddRange(context.meshToBones[curMeshXf]);
 688
 689                // Downstream code will have a root bone and need to know how to make bone paths relative
 690                // to the new, arbitrary, common root which we have chosen.
 691                context.boneToRoot[rootBone] = commonRoot;
 692
 693                context.meshToSkelRoot.Remove(curMeshXf);
 694                context.meshToBones.Remove(curMeshXf);
 695            }
 696
 697            // Maintain a sorted list of bone names to ensure "parent first" ordering for UsdSkel.
 698            var allNames = allBones.Select(boneXf => UnityTypeConverter.GetPath(boneXf))
 699                .OrderBy(str => str)
 700                .Distinct()
 701                .ToList();
 702            context.skelSortedMap[commonRoot] = allNames;
 703
 704            return commonRoot;
 705        }
 706
 707        static void MergeBonesSimple(Transform source,
 708            Transform rootBone,
 709            Transform[] bones,
 710            Matrix4x4[] bindPoses,
 711            ExportContext context)
 712        {
 713            context.meshToSkelRoot.Add(source, rootBone);
 714            context.meshToBones.Add(source, bones);
 715            Matrix4x4 existingMatrix;
 716            for (int i = 0; i < bones.Length; i++)
 717            {
 718                Transform bone = bones[i];
 719                if (bone == null)
 720                {
 721                    var srcPath = UnityTypeConverter.GetPath(source);
 722                    Debug.LogWarning("Null bone at in bones list at position (" + i + ") " + srcPath);
 723                    continue;
 724                }
 725
 726                var path = UnityTypeConverter.GetPath(bone);
 727                context.pathToBone[path] = bone;
 728                context.boneToRoot[bone] = rootBone;
 729                context.bindPoses[bone] = bindPoses[i];
 730                if (context.bindPoses.TryGetValue(bone, out existingMatrix) && existingMatrix != bindPoses[i])
 731                {
 732                    Debug.LogWarning("Duplicate bone with different bind poses: " + path + "\n" +
 733                        existingMatrix.ToString() + "\n" + bindPoses[i].ToString());
 734                }
 735            }
 736        }
 737
 738        static void CreateExportPlan(GameObject go,
 739            SampleBase sample,
 740            ExportFunction exportFunc,
 741            ExportContext context,
 742            string pathSuffix = null,
 743            bool insertFirst = true)
 744        {
 745            // This is an exportable object.
 746            Transform expRoot = context.exportRoot;
 747            string path = UnityTypeConverter.GetPath(go.transform, expRoot);
 748            if (!string.IsNullOrEmpty(pathSuffix))
 749            {
 750                path += pathSuffix;
 751            }
 752
 753            if (!context.plans.ContainsKey(go))
 754            {
 755                context.plans.Add(go, new ExportPlan());
 756            }
 757
 758            var exp = new Exporter { exportFunc = exportFunc, sample = sample, path = path };
 759            if (insertFirst)
 760            {
 761                context.plans[go].exporters.Insert(0, exp);
 762            }
 763            else
 764            {
 765                context.plans[go].exporters.Add(exp);
 766            }
 767
 768            // Include the parent xform hierarchy.
 769            // Note that the parent hierarchy is memoised, so despite looking expensive, the time
 770            // complexity is linear.
 771            Transform xf = go.transform.parent;
 772            if (xf != context.exportRoot && !context.plans.ContainsKey(xf.gameObject))
 773            {
 774                // Since all GameObjects have a Transform, export all un-exported parents as transform.
 775                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), XformExporter.ExportXform, context);
 776                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), NativeExporter.ExportObject,
 777                    context, insertFirst: false);
 778            }
 779        }
 780
 781        static Matrix4x4 ComputeWorldXf(Transform curBone, ExportContext context)
 782        {
 783            if (!context.bindPoses.ContainsKey(curBone))
 784            {
 785                return curBone.parent.localToWorldMatrix;
 786            }
 787
 788            return context.bindPoses[curBone] * ComputeWorldXf(curBone.parent, context);
 789        }
 790    }
 791}
+
+
+
+

Methods/Properties

+ExportPlan()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderExporter.html new file mode 100644 index 000000000..93792afce --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderExporter.html @@ -0,0 +1,348 @@ + + + + + + +Unity.Formats.USD.HdrpShaderExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.HdrpShaderExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/HdrpShaderExporter.cs
Covered lines:0
Uncovered lines:162
Coverable lines:162
Total lines:246
Line coverage:0% (0 of 162)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportLit(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/HdrpShaderExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17using USD.NET.Unity;
 18
 19
 20namespace Unity.Formats.USD
 21{
 22    public class HdrpShaderExporter : ShaderExporterBase
 23    {
 24        public static void ExportLit(Scene scene,
 25            string usdShaderPath,
 26            Material material,
 27            PreviewSurfaceSample surface,
 28            string destTexturePath)
 029        {
 30            Color c;
 31
 32            // useful for debugging which keywords are set in which case to determine actual feature usage
 33            // (just because a material has an _AlphaCutoff does not mean the option is actually active)
 34            // Debug.Log("Material: " + material.name + ", Keywords: " + string.Join("\n", material.shaderKeywords), mat
 035            surface.diffuseColor.defaultValue = new Vector3(1, 1, 1);
 036            if (material.HasProperty("_BaseColorMap") && material.GetTexture("_BaseColorMap") != null)
 037            {
 038                var scale = Vector4.one;
 039                if (material.HasProperty("_BaseColor"))
 040                {
 041                    scale = material.GetColor("_BaseColor").linear;
 042                }
 43
 044                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 45                    "_BaseColorMap", "rgb");
 046                surface.diffuseColor.SetConnectedPath(newTex);
 047            }
 048            else if (material.HasProperty("_BaseColor"))
 049            {
 050                c = material.GetColor("_BaseColor").linear;
 051                surface.diffuseColor.defaultValue = new Vector3(c.r, c.g, c.b);
 052            }
 53            else
 054            {
 055                c = Color.white;
 056                surface.diffuseColor.defaultValue = new Vector3(c.r, c.g, c.b);
 057            }
 58
 059            if (material.IsKeywordEnabled("_SURFACE_TYPE_TRANSPARENT"))
 060            {
 061                if (material.HasProperty("_BaseColorMap") && material.GetTexture("_BaseColorMap") != null)
 062                {
 063                    var scale = Vector4.one;
 064                    if (material.HasProperty("_BaseColor"))
 065                    {
 066                        scale.w = material.GetColor("_BaseColor").linear.a;
 067                    }
 68
 069                    var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 70                        "_BaseColorMap", "a");
 071                    surface.opacity.SetConnectedPath(newTex);
 072                }
 073                else if (material.HasProperty("_BaseColor"))
 074                {
 075                    c = material.GetColor("_BaseColor").linear;
 076                    surface.opacity.defaultValue = c.a;
 077                }
 78                else
 079                {
 080                    c = Color.white;
 081                    surface.opacity.defaultValue = 1.0f;
 082                }
 83
 084                if (material.IsKeywordEnabled("_ALPHATEST_ON"))
 085                {
 086                    surface.opacityThreshold.defaultValue = material.GetFloat("_AlphaCutoff");
 087                }
 088            }
 89
 090            var materialType = (int)material.GetFloat("_MaterialID");
 091            bool useMetallic = false;
 092            bool useSpec = false;
 93
 094            switch (materialType)
 95            {
 96                case 0: // Subsurf, no metallic parameter
 097                    surface.useSpecularWorkflow.defaultValue = 1;
 098                    break;
 99                case 1: // Standard, metallic + smoothness.
 100                case 2: // Anisotropy, metallic + smoothness.
 101                case 3: // Iridescence, metallic + smoothness.
 0102                    surface.useSpecularWorkflow.defaultValue = 0;
 0103                    useMetallic = true;
 0104                    break;
 105                case 4: // Specular color.
 0106                    surface.useSpecularWorkflow.defaultValue = 0;
 0107                    useSpec = true;
 0108                    break;
 109                case 5: // Translucent, no metallic.
 0110                    surface.useSpecularWorkflow.defaultValue = 0;
 0111                    break;
 112            }
 113
 0114            if (useSpec && material.HasProperty("_SpecularColorMap") &&
 115                material.GetTexture("_SpecularColorMap") != null)
 0116            {
 0117                var scale = Vector4.one;
 0118                if (useSpec && material.HasProperty("_SpecularColor"))
 0119                {
 0120                    scale = material.GetColor("_SpecularColor");
 0121                }
 122
 0123                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 124                    "_SpecularColorMap", "rgb");
 0125                surface.specularColor.SetConnectedPath(newTex);
 0126            }
 0127            else if (useSpec && material.HasProperty("_SpecularColor"))
 0128            {
 0129                c = material.GetColor("_SpecularColor");
 0130                surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0131            }
 132            else
 0133            {
 0134                c = new Color(.5f, .5f, .5f);
 0135                surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0136            }
 137
 0138            surface.metallic.defaultValue = 1.0f;
 0139            if (useMetallic && material.HasProperty("_MaskMap") && material.GetTexture("_MaskMap") != null)
 0140            {
 0141                var scale = Vector4.one;
 0142                if (useSpec && material.HasProperty("_Metallic"))
 0143                {
 0144                    scale.x = material.GetFloat("_Metallic");
 0145                }
 146
 0147                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath, "_MaskMap",
 148                    "b", ConversionType.MaskMapToORM);
 0149                surface.metallic.SetConnectedPath(newTex);
 0150            }
 0151            else if (useMetallic && material.HasProperty("_Metallic"))
 0152            {
 0153                surface.metallic.defaultValue = material.GetFloat("_Metallic");
 0154            }
 155            else
 0156            {
 0157                surface.metallic.defaultValue = 0.5f;
 0158            }
 159
 160            // TODO seems _Smoothness isn't actually used in HDRP;
 161            // there's _SmoothnessMin and _SmoothnessMax for remapping which would need to be implemented with scale and
 0162            surface.roughness.defaultValue = 0.0f;
 0163            if (material.HasProperty("_MaskMap") && material.GetTexture("_MaskMap") != null)
 0164            {
 0165                var scale = Vector4.one;
 0166                if (material.HasProperty("_Smoothness"))
 0167                {
 0168                    scale.w = 1 - material.GetFloat("_Smoothness");
 0169                }
 170
 0171                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath, "_MaskMap",
 172                    "g", ConversionType.MaskMapToORM);
 0173                surface.roughness.SetConnectedPath(newTex);
 0174            }
 0175            else if (material.HasProperty("_Smoothness"))
 0176            {
 0177                surface.roughness.defaultValue = 1 - material.GetFloat("_Smoothness");
 0178            }
 179            else
 0180            {
 0181                surface.roughness.defaultValue = 0.5f;
 0182            }
 183
 0184            if (material.IsKeywordEnabled("_VERTEX_DISPLACEMENT") ||
 185                material.IsKeywordEnabled("_TESSELLATION_DISPLACEMENT"))
 0186            {
 0187                if (material.HasProperty("_HeightMap") && material.GetTexture("_HeightMap") != null)
 0188                {
 189                    // TODO texture scale and bias needs to be constructed from the heightmap parametrization;
 190                    // there's a lot of options
 191                    // (_HeightAmplitude, _HeightCenter, _HeightMapParametrization, _HeightMax, _HeightMin, _HeightOffse
 0192                    var newTex = SetupTexture(scene, usdShaderPath, material, surface, Vector4.one, destTexturePath,
 193                        "_HeightMap", "r");
 0194                    surface.displacement.SetConnectedPath(newTex);
 0195                }
 0196            }
 197
 0198            if (material.HasProperty("_MaskMap") && material.GetTexture("_MaskMap") != null)
 0199            {
 0200                var newTex = SetupTexture(scene, usdShaderPath, material, surface, Vector4.one, destTexturePath,
 201                    "_MaskMap", "r", ConversionType.MaskMapToORM);
 0202                surface.occlusion.SetConnectedPath(newTex);
 0203            }
 204
 0205            if (material.HasProperty("_CoatMaskMap") && material.GetTexture("_CoatMaskMap") != null)
 0206            {
 0207                var newTex = SetupTexture(scene, usdShaderPath, material, surface, Vector4.one, destTexturePath,
 208                    "_CoatMaskMap", "r");
 0209                surface.clearcoat.SetConnectedPath(newTex);
 0210            }
 211
 0212            if (material.HasProperty("_CoatMask"))
 0213            {
 0214                surface.clearcoatRoughness.defaultValue = material.GetFloat("_CoatMask");
 0215            }
 216
 0217            if (material.HasProperty("_NormalMap") && material.GetTexture("_NormalMap") != null)
 0218            {
 0219                var newTex = SetupTexture(scene, usdShaderPath, material, surface, Vector4.one, destTexturePath,
 220                    "_NormalMap", "rgb", ConversionType.UnpackNormal);
 0221                surface.normal.SetConnectedPath(newTex);
 0222            }
 223
 0224            if (material.IsKeywordEnabled("_EMISSIVE_COLOR_MAP"))
 0225            {
 0226                if (material.HasProperty("_EmissiveColorMap") && material.GetTexture("_EmissiveColorMap") != null)
 0227                {
 0228                    var scale = Vector4.one;
 0229                    if (material.HasProperty("_EmissiveColor"))
 0230                    {
 0231                        scale = material.GetColor("_EmissiveColor").linear;
 0232                    }
 233
 0234                    var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 235                        "_EmissiveColorMap", "rgb");
 0236                    surface.emissiveColor.SetConnectedPath(newTex);
 0237                }
 0238                else if (material.HasProperty("_EmissiveColor"))
 0239                {
 0240                    c = material.GetColor("_EmissiveColor").linear;
 0241                    surface.emissiveColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0242                }
 0243            }
 0244        }
 245    }
 246}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderImporter.html new file mode 100644 index 000000000..d44874180 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HdrpShaderImporter.html @@ -0,0 +1,296 @@ + + + + + + +Unity.Formats.USD.HdrpShaderImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.HdrpShaderImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/HdrpShaderImporter.cs
Covered lines:0
Uncovered lines:121
Coverable lines:121
Total lines:190
Line coverage:0% (0 of 121)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
HdrpShaderImporter(...)0%0000%
ImportFromUsd()0%0000%
BuildMaskMap(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/HdrpShaderImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16
 17namespace Unity.Formats.USD
 18{
 19    public class HdrpShaderImporter : ShaderImporterBase
 20    {
 21        private static Material ChannelCombinerMat;
 22
 023        public HdrpShaderImporter(Material material) : base(material)
 024        {
 025        }
 26
 27        public override void ImportFromUsd()
 028        {
 029            Material mat = Material;
 30
 031            if (DiffuseMap)
 032            {
 033                Debug.Log("here");
 034                mat.SetTexture("_BaseColorMap", DiffuseMap);
 035                mat.SetColor("_BaseColor", Color.white);
 036            }
 37            else
 038            {
 039                mat.SetColor("_BaseColor", Diffuse.GetValueOrDefault(mat.color));
 040            }
 41
 42            // TODO: What about opacity map?
 43
 044            if (!IsSpecularWorkflow)
 045            {
 46                // Robustness: It would be ideal if this parameter were provided by HDRP, however that
 47                // would require this asset package having a dependency on the HDRP package itself,
 48                // which is (yet) not desirable.
 049                mat.SetFloat("_MaterialID", /*Standard Metallic*/ 1);
 050            }
 51            else
 052            {
 053                mat.SetFloat("_MaterialID", /*Spec Color*/ 4);
 054                mat.EnableKeyword("_MATERIAL_FEATURE_SPECULAR_COLOR");
 055                mat.EnableKeyword("_SPECULARCOLORMAP");
 056            }
 57
 58            // R=Metallic, G=Occlusion, B=Displacement, A=Roughness(Smoothness)
 059            var MaskMap = BuildMaskMap(!IsSpecularWorkflow ? MetallicMap : null, OcclusionMap, DisplacementMap,
 60                RoughnessMap);
 061            if (MaskMap)
 062            {
 063                mat.SetTexture("_MaskMap", MaskMap);
 064                mat.EnableKeyword("_MASKMAP");
 065            }
 66
 067            if (!IsSpecularWorkflow)
 068            {
 069                if (!MetallicMap)
 070                {
 071                    mat.SetFloat("_Metallic", Metallic.GetValueOrDefault());
 072                }
 073            }
 74            else
 075            {
 076                if (SpecularMap)
 077                {
 078                    mat.SetTexture("_SpecularColorMap", SpecularMap);
 079                }
 80                else
 081                {
 082                    mat.SetColor("_SpecularColor", Specular.GetValueOrDefault());
 083                }
 084            }
 85
 086            if (!RoughnessMap)
 087            {
 088                var smoothness = 1 - Roughness.GetValueOrDefault();
 089                mat.SetFloat("_Smoothness", smoothness);
 90                // HDRP Lit does not seem to respect smoothness, so just clamp to the correct value.
 091                mat.SetFloat("_SmoothnessRemapMin", smoothness);
 092                mat.SetFloat("_SmoothnessRemapMax", smoothness);
 093            }
 94
 095            if (!OcclusionMap)
 096            {
 097                mat.SetFloat("_AORemapMin", Occlusion.GetValueOrDefault());
 098                mat.SetFloat("_AORemapMax", Occlusion.GetValueOrDefault());
 099            }
 100
 101            // Single displacement scalar value not supported.
 102
 0103            if (ClearcoatMap)
 0104            {
 0105                mat.SetTexture("_CoatMaskMap", ClearcoatMap);
 0106                mat.EnableKeyword("_MATERIAL_FEATURE_CLEAR_COAT");
 0107            }
 108
 0109            mat.SetFloat("_CoatMask", ClearcoatRoughness.GetValueOrDefault());
 110
 0111            if (NormalMap)
 0112            {
 0113                mat.SetTexture("_NormalMap", NormalMap);
 0114                mat.EnableKeyword("_NORMALMAP");
 0115            }
 116
 0117            if (EmissionMap)
 0118            {
 0119                mat.SetTexture("_EmissiveColorMap", EmissionMap);
 0120                mat.SetColor("_EmissiveColor", Color.white * 1000);
 0121                mat.SetColor("_EmissiveColorLDR", Color.white);
 0122                mat.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
 0123                mat.EnableKeyword("_EMISSIVE_COLOR_MAP");
 0124            }
 125            else
 0126            {
 0127                mat.SetColor("_EmissionColor", Emission.GetValueOrDefault());
 0128            }
 0129        }
 130
 131        private static Texture2D BuildMaskMap(Texture2D red, Texture2D green, Texture2D blue, Texture2D alpha)
 0132        {
 0133            var maxW = Mathf.Max(red ? red.width : 0, green ? green.width : 0);
 0134            maxW = Mathf.Max(maxW, blue ? blue.width : 0);
 0135            maxW = Mathf.Max(maxW, alpha ? alpha.width : 0);
 136
 0137            var maxH = Mathf.Max(red ? red.height : 0, green ? green.height : 0);
 0138            maxH = Mathf.Max(maxH, blue ? blue.height : 0);
 0139            maxH = Mathf.Max(maxH, alpha ? alpha.height : 0);
 140
 0141            if (maxH == 0 || maxW == 0)
 0142            {
 0143                return null;
 144            }
 145
 0146            var tmp = RenderTexture.GetTemporary(maxW, maxH, 0, RenderTextureFormat.ARGBFloat,
 147                RenderTextureReadWrite.Linear);
 148
 0149            if (!ChannelCombinerMat)
 0150            {
 0151                ChannelCombinerMat = new Material(Shader.Find("Hidden/USD/ChannelCombiner"));
 0152            }
 153
 0154            var newTex = new Texture2D(maxW, maxH, TextureFormat.ARGB32, true, true);
 0155            ChannelCombinerMat.SetVector("_Invert", new Vector4(0, 0, 0, 1));
 0156            ChannelCombinerMat.SetTexture("_R", red);
 0157            ChannelCombinerMat.SetVector("_RScale", new Vector4(1, 0, 0, 0));
 0158            ChannelCombinerMat.SetTexture("_G", green);
 0159            ChannelCombinerMat.SetVector("_GScale", new Vector4(1, 0, 0, 0));
 0160            ChannelCombinerMat.SetTexture("_B", blue);
 0161            ChannelCombinerMat.SetVector("_BScale", new Vector4(1, 0, 0, 0));
 0162            ChannelCombinerMat.SetTexture("_A", alpha);
 0163            ChannelCombinerMat.SetVector("_AScale", new Vector4(1, 0, 0, 0));
 0164            Graphics.Blit(red, tmp, ChannelCombinerMat);
 165
 0166            RenderTexture.active = tmp;
 0167            newTex.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
 0168            newTex.Apply();
 0169            RenderTexture.ReleaseTemporary(tmp);
 170
 171#if UNITY_EDITOR
 0172            var newAssetPath = UnityEditor.AssetDatabase.GenerateUniqueAssetPath("Assets/maskMap.png");
 0173            var bytes = newTex.EncodeToPNG();
 0174            Debug.Log(newAssetPath);
 0175            System.IO.File.WriteAllBytes(newAssetPath, bytes);
 0176            UnityEditor.AssetDatabase.ImportAsset(newAssetPath);
 0177            var texImporter = (UnityEditor.TextureImporter)UnityEditor.AssetImporter.GetAtPath(newAssetPath);
 0178            UnityEditor.EditorUtility.SetDirty(texImporter);
 0179            texImporter.SaveAndReimport();
 180#endif
 181            // To get the correct file ID, the texture must be reloaded from the asset path.
 0182            Texture2D.DestroyImmediate(newTex);
 183#if UNITY_EDITOR
 0184            return (Texture2D)UnityEditor.AssetDatabase.LoadAssetAtPath(newAssetPath, typeof(Texture2D));
 185#else
 186            return null;
 187#endif
 0188        }
 189    }
 190}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilder.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilder.html new file mode 100644 index 000000000..8fc2c51ed --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilder.html @@ -0,0 +1,1023 @@ + + + + + + +Unity.Formats.USD.HierarchyBuilder - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.HierarchyBuilder
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/HierarchyBuilder.cs
Covered lines:354
Uncovered lines:152
Coverable lines:506
Total lines:883
Line coverage:69.9% (354 of 506)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
HierarchyBuilder()0%000100%
Run()0%0000%
Execute(...)0%00080%
Run()0%0000%
Execute(...)0%000100%
BeginReading(...)0%000100%
BuildObjectLists(...)0%000100%
BuildGameObjects(...)0%00075.82%
IsVisible(...)0%00071.43%
ApplySelfVisibility(...)0%00066.67%
CreateAncestors(...)0%00048%
ProcessPaths(...)0%00080.33%
PopulateSkelCache(...)0%00054.55%
ReadSkeletonJoints(...)0%00067.31%
ExpandSkeleton(...)0%00072%
ReadModelInfo(...)0%00042.5%
AddModelRoot(...)0%00030.3%
AddPayload(...)0%00080%
AddVariantSet(...)0%00081.25%
FindOrCreateGameObject(...)0%00087.1%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/HierarchyBuilder.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using UnityEngine;
 19using UnityEngine.Profiling;
 20using pxr;
 21using USD.NET;
 22using USD.NET.Unity;
 23using Unity.Jobs;
 24
 25namespace Unity.Formats.USD
 26{
 27    /// <summary>
 28    /// A collection of methods for building the USD scene hierarchy in Unity.
 29    /// </summary>
 30    public static class HierarchyBuilder
 31    {
 232        static readonly SdfPath kAbsoluteRootPath = SdfPath.AbsoluteRootPath();
 33
 34        struct HierInfo
 35        {
 36            public bool isVisible;
 37            public bool isInstance;
 38            public bool isAssembly;
 39            public bool isModel;
 40            public bool hasPayload;
 41            public UsdPrim prim;
 42
 43            // Provides a list of all bound skeletons under a UsdSkelRoot.
 44            public UsdSkelBindingVector skelBindings;
 45
 46            public SdfPath[] skelJoints;
 47            public string modelAssetPath;
 48            public string modelName;
 49            public string modelVersion;
 50        }
 51
 52        struct ReadHierJob : IJobParallelFor
 53        {
 54            public static HierInfo[] result;
 55            public static Scene scene;
 56            public static UsdSkelCache skelCache; // Thread safe.
 57            public static SdfPath[] paths;
 58
 59            public void Run()
 060            {
 061                for (int i = 0; i < paths.Length; i++)
 062                {
 063                    Execute(i);
 064                }
 065            }
 66
 67            public void Execute(int index)
 36768            {
 36769                HierInfo info = new HierInfo();
 36770                info.prim = scene.Stage.GetPrimAtPath(paths[index]);
 71
 36772                if (!info.prim)
 073                {
 074                    info.prim = null;
 075                    return;
 76                }
 77
 36778                info.isVisible = HierarchyBuilder.IsVisible(info.prim);
 36779                info.isInstance = info.prim.IsInstance();
 36780                HierarchyBuilder.ReadModelInfo(ref info);
 36781                HierarchyBuilder.PopulateSkelCache(ref info, ReadHierJob.skelCache);
 36782                HierarchyBuilder.ReadSkeletonJoints(ref info);
 36783                info.hasPayload = info.prim.GetPrimIndex().HasAnyPayloads();
 84
 36785                result[index] = info;
 36786            }
 87        }
 88
 89        struct FindPathsJob : IJobParallelFor
 90        {
 91            public interface IQuery
 92            {
 93                SdfPath[] Find(Scene scene, SdfPath usdRoot);
 94            }
 95
 96            public struct Query<T> : IQuery where T : SampleBase, new()
 97            {
 98                public SdfPath[] Find(Scene scene, SdfPath usdRoot)
 99                {
 100                    return scene.Find<T>(usdRoot);
 101                }
 102            }
 103
 104            public static SdfPath usdRoot;
 105            public static Scene scene;
 106            public static SdfPath[][] results;
 107            public static IQuery[] queries;
 108
 109            public void Run()
 0110            {
 0111                for (int i = 0; i < queries.Length; i++)
 0112                {
 0113                    Execute(i);
 0114                }
 0115            }
 116
 117            public void Execute(int index)
 657118            {
 657119                var query = queries[index];
 657120                if (query == null)
 72121                {
 72122                    return;
 123                }
 124
 585125                results[index] = query.Find(scene, usdRoot);
 657126            }
 127        }
 128
 129        static JobHandle BeginReading(Scene scene,
 130            SdfPath usdRoot,
 131            PrimMap map,
 132            SceneImportOptions options)
 73133        {
 73134            FindPathsJob.usdRoot = usdRoot;
 73135            FindPathsJob.scene = scene;
 73136            FindPathsJob.results = new SdfPath[9][];
 73137            FindPathsJob.queries = new FindPathsJob.IQuery[9];
 138
 73139            if (options.ShouldBindMaterials)
 1140            {
 1141                FindPathsJob.queries[0] = (FindPathsJob.IQuery) new FindPathsJob.Query<MaterialSample>();
 1142            }
 143
 73144            if (options.importCameras)
 73145            {
 73146                FindPathsJob.queries[1] = (FindPathsJob.IQuery) new FindPathsJob.Query<CameraSample>();
 73147            }
 148
 73149            if (options.importMeshes)
 73150            {
 73151                FindPathsJob.queries[2] = (FindPathsJob.IQuery) new FindPathsJob.Query<MeshSample>();
 73152                FindPathsJob.queries[3] = (FindPathsJob.IQuery) new FindPathsJob.Query<CubeSample>();
 73153                FindPathsJob.queries[4] = (FindPathsJob.IQuery) new FindPathsJob.Query<SphereSample>();
 73154            }
 155
 73156            FindPathsJob.queries[5] = (FindPathsJob.IQuery) new FindPathsJob.Query<SkelRootSample>();
 157
 73158            if (options.importSkinning)
 73159            {
 73160                FindPathsJob.queries[6] = (FindPathsJob.IQuery) new FindPathsJob.Query<SkeletonSample>();
 73161            }
 162
 73163            if (options.importTransforms)
 73164            {
 73165                FindPathsJob.queries[7] = (FindPathsJob.IQuery) new FindPathsJob.Query<XformSample>();
 73166            }
 167
 73168            FindPathsJob.queries[8] = (FindPathsJob.IQuery) new FindPathsJob.Query<ScopeSample>();
 169
 73170            var findPathsJob = new FindPathsJob();
 73171            var findHandle = findPathsJob.Schedule(FindPathsJob.queries.Length, 1);
 73172            findHandle.Complete();
 173
 174            // Note that Scope prims are taken into account when building the hierarchy but not added to the PrimMap
 175            // This is because Scopes don't need specific import/export logic for now:
 176            //   * they don't hold any data ton convert on the way in
 177            //   * being represented as Xforms in Unity they get automatically exported (as Xform) as part of the parent
 178            //     valid prim
 179            // This will need to change if/when we want proper round tripping.
 73180            map.Materials = FindPathsJob.results[0];
 73181            map.Cameras = FindPathsJob.results[1];
 73182            map.Meshes = FindPathsJob.results[2];
 73183            map.Cubes = FindPathsJob.results[3];
 73184            map.Spheres = FindPathsJob.results[4];
 73185            map.SkelRoots = FindPathsJob.results[5];
 73186            map.Skeletons = FindPathsJob.results[6];
 73187            map.Xforms = FindPathsJob.results[7];
 188
 1315189            ReadHierJob.paths = FindPathsJob.results.Where(i => i != null).SelectMany(i => i).ToArray();
 73190            ReadHierJob.result = new HierInfo[ReadHierJob.paths.Length];
 73191            ReadHierJob.scene = scene;
 73192            ReadHierJob.skelCache = map.SkelCache;
 73193            var readHierInfo = new ReadHierJob();
 73194            return readHierInfo.Schedule(ReadHierJob.paths.Length, 8, dependsOn: findHandle);
 73195        }
 196
 197        static HierInfo[] BuildObjectLists(Scene scene,
 198            GameObject unityRoot,
 199            SdfPath usdRoot,
 200            PrimMap map,
 201            SceneImportOptions options)
 73202        {
 73203            if (map.SkelCache == null)
 73204            {
 205                // Note that UsdSkelCache is thread safe and can be populated from multiple threads.
 73206                map.SkelCache = new UsdSkelCache();
 207
 208                // The skelBindings dictionary, however, is not thread safe and must be populated after the
 209                // hierarchy discovery thread joins, in ProcessPaths.
 73210                map.SkelBindings = new Dictionary<SdfPath, UsdSkelBindingVector>();
 73211            }
 212
 73213            BeginReading(scene, usdRoot, map, options).Complete();
 73214            ProcessPaths(ReadHierJob.result, scene, unityRoot, usdRoot, map, options);
 215
 73216            return ReadHierJob.result;
 73217        }
 218
 219        /// <summary>
 220        /// Map all UsdPrims and build Unity GameObjects, reconstructing the parent relationship.
 221        /// </summary>
 222        /// <remarks>
 223        /// When forceRebuild is true, game objects will be destroyed and recreated. If buildHierarchy
 224        /// is false, the primMap will be populated, but missing game objects will not be created.
 225        /// </remarks>
 226        static public PrimMap BuildGameObjects(Scene scene,
 227            GameObject unityRoot,
 228            SdfPath usdRoot,
 229            IEnumerable<SdfPath> paths,
 230            PrimMap map,
 231            SceneImportOptions options)
 73232        {
 73233            map[usdRoot] = unityRoot;
 234
 235            // Like all GameObjects imported from USD, ensure the root has a UsdPrimSource.
 73236            if (unityRoot.GetComponent<UsdPrimSource>() == null)
 73237            {
 73238                var ua = unityRoot.AddComponent<UsdPrimSource>();
 73239                ua.m_usdPrimPath = usdRoot.ToString();
 73240            }
 241
 73242            Profiler.BeginSample("Build Object Lists");
 73243            var hierInfo = BuildObjectLists(scene, unityRoot, usdRoot, map, options);
 73244            Profiler.EndSample();
 245
 246            // TODO: Should recurse to discover deeply nested instancing.
 247            // TODO: Generates garbage for every prim, but we expect few masters.
 73248            if (options.importPointInstances || options.importSceneInstances)
 73249            {
 73250                Profiler.BeginSample("Build Masters");
 225251                foreach (var masterRootPrim in scene.Stage.GetMasters())
 3252                {
 3253                    var goMaster = FindOrCreateGameObject(unityRoot.transform,
 254                        masterRootPrim.GetPath(),
 255                        unityRoot.transform,
 256                        map,
 257                        options);
 258
 3259                    goMaster.hideFlags = HideFlags.HideInHierarchy;
 3260                    goMaster.SetActive(false);
 3261                    map.AddMasterRoot(masterRootPrim.GetPath(), goMaster);
 262                    try
 3263                    {
 3264                        var info = new HierInfo();
 3265                        info.prim = masterRootPrim;
 3266                        ReadModelInfo(ref info);
 3267                        AddModelRoot(goMaster, info);
 3268                        AddVariantSet(goMaster, masterRootPrim);
 3269                    }
 0270                    catch (Exception ex)
 0271                    {
 0272                        Debug.LogException(new Exception("Error processing " + masterRootPrim.GetPath(), ex));
 0273                    }
 274
 15275                    foreach (var usdPrim in masterRootPrim.GetAllDescendants())
 3276                    {
 3277                        var parentPath = usdPrim.GetPath().GetParentPath();
 3278                        Transform parentXf = null;
 3279                        if (parentPath == masterRootPrim.GetPath())
 3280                        {
 3281                            parentXf = goMaster.transform;
 3282                        }
 283                        else
 0284                        {
 0285                            parentXf = map[parentPath].transform;
 0286                        }
 287
 3288                        var goPrim = FindOrCreateGameObject(parentXf,
 289                            usdPrim.GetPath(),
 290                            unityRoot.transform,
 291                            map,
 292                            options);
 3293                        ApplySelfVisibility(goPrim, usdPrim);
 294
 3295                        if (usdPrim.IsInstance())
 0296                        {
 0297                            map.AddInstanceRoot(usdPrim.GetPath(), goPrim, usdPrim.GetMaster().GetPath());
 0298                        }
 299
 300                        try
 3301                        {
 3302                            var info = new HierInfo();
 3303                            info.prim = usdPrim;
 3304                            ReadModelInfo(ref info);
 3305                            AddModelRoot(goPrim, info);
 3306                            AddVariantSet(goPrim, usdPrim);
 3307                        }
 0308                        catch (Exception ex)
 0309                        {
 0310                            Debug.LogException(new Exception("Error processing " + usdPrim.GetPath(), ex));
 0311                            continue;
 312                        }
 3313                    }
 3314                }
 315
 73316                Profiler.EndSample();
 73317            }
 318
 73319            if (options.importSkinning)
 73320            {
 73321                Profiler.BeginSample("Expand Skeletons");
 953322                foreach (var info in hierInfo)
 367323                {
 367324                    if (info.skelJoints == null || info.skelJoints.Length == 0)
 364325                    {
 364326                        continue;
 327                    }
 328
 329                    try
 3330                    {
 3331                        ExpandSkeleton(info, unityRoot, usdRoot, info.prim, map, options);
 3332                    }
 0333                    catch (Exception ex)
 0334                    {
 0335                        Debug.LogException(new Exception("Error expanding skeleton at " + info.prim.GetPath(), ex));
 0336                    }
 3337                }
 338
 73339                Profiler.EndSample();
 73340            }
 341
 73342            return map;
 73343        }
 344
 345        static bool IsVisible(UsdPrim usdPrim)
 737346        {
 737347            if (!usdPrim)
 0348            {
 0349                return false;
 350            }
 351
 737352            var img = new UsdGeomImageable(usdPrim);
 737353            if (!img)
 2354            {
 2355                return true;
 356            }
 357
 358            // Using time=0.0 will enable this to pickup a single animated value by virtue of
 359            // interpolation, but correct handling of animated visibility would query it over time.
 360
 361            // Also note this code is intentionally not using ComputeVisibility(), since Unity will apply
 362            // inherited visibility. This is technically incorrect, since USD supports "super vis",
 363            // enabling visible children with invisible parents. The goal here is to avoid spamming all
 364            // descendent children with active=false. A better implementation would check for visible
 365            // children with invisible parents and somehow translate that to the Unity scenegraph, but
 366            // is left as a future improvement.
 367
 735368            VtValue visValue = new VtValue();
 735369            if (!img.GetVisibilityAttr().Get(visValue, 0.0))
 0370            {
 0371                return true;
 372            }
 373
 735374            return UsdCs.VtValueToTfToken(visValue) != UsdGeomTokens.invisible;
 737375        }
 376
 377        static void ApplySelfVisibility(GameObject go, UsdPrim usdPrim)
 370378        {
 370379            if (!go)
 0380            {
 0381                return;
 382            }
 383
 370384            if (IsVisible(usdPrim))
 370385            {
 370386                return;
 387            }
 388
 0389            go.SetActive(false);
 370390        }
 391
 392        // Creates ancestors, but note that this method does not apply visibility, since it was
 393        // designed to create bones, which cannot have visibility opinions in USD.
 394        static void CreateAncestors(SdfPath path,
 395            PrimMap map,
 396            GameObject unityRoot,
 397            SdfPath usdRoot,
 398            SceneImportOptions options,
 399            out GameObject parentGo)
 397400        {
 397401            var parentPath = path.GetParentPath();
 397402            if (path == parentPath)
 0403            {
 0404                Debug.LogException(new Exception("Parent path was identical to current path: " + path.ToString()));
 0405                parentGo = null;
 0406                return;
 407            }
 408
 397409            if (map.TryGetValue(parentPath, out parentGo) && parentGo)
 322410            {
 322411                return;
 412            }
 413
 414            // Base case.
 75415            if (parentPath == usdRoot)
 0416            {
 0417                map[parentPath] = unityRoot;
 0418                return;
 419            }
 420
 75421            if (parentPath == kAbsoluteRootPath)
 0422            {
 423                // Something went wrong.
 0424                Debug.LogException(new Exception(
 425                    "Error: unexpected path </> creating ancestors for <" + usdRoot.ToString() + ">"));
 0426            }
 427
 428            // Recursive case.
 429            // First, get the grandparent (parent's parent).
 430            GameObject grandparentGo;
 75431            CreateAncestors(parentPath, map, unityRoot, usdRoot, options, out grandparentGo);
 75432            if (!grandparentGo)
 0433            {
 0434                Debug.LogError("Failed to find ancestor for " + parentPath);
 0435                return;
 436            }
 437
 438            // Then find/create the current parent.
 75439            parentGo = FindOrCreateGameObject(grandparentGo.transform,
 440                parentPath,
 441                unityRoot.transform,
 442                map,
 443                options);
 397444        }
 445
 446        static void ProcessPaths(HierInfo[] infos,
 447            Scene scene,
 448            GameObject unityRoot,
 449            SdfPath usdRoot,
 450            PrimMap map,
 451            SceneImportOptions options)
 73452        {
 73453            Profiler.BeginSample("Process all paths");
 953454            foreach (var info in infos)
 367455            {
 367456                var prim = info.prim;
 367457                var path = info.prim.GetPath();
 458
 367459                if (info.skelBindings != null)
 3460                {
 461                    // Collect all discovered skelBindings back into the PrimMap.
 3462                    map.SkelBindings.Add(info.prim.GetPath(), info.skelBindings);
 3463                }
 464
 465                GameObject go;
 367466                if (path == usdRoot)
 45467                {
 45468                    go = unityRoot;
 45469                }
 470                else
 322471                {
 322472                    GameObject parentGo = null;
 322473                    CreateAncestors(path, map, unityRoot, usdRoot, options, out parentGo);
 474
 322475                    if (!parentGo)
 0476                    {
 0477                        Debug.LogWarning("Parent path not found for child: " + path.ToString());
 0478                        continue;
 479                    }
 480
 322481                    var parent = parentGo ? parentGo.transform : null;
 322482                    if (!map.TryGetValue(path, out go))
 247483                    {
 247484                        go = FindOrCreateGameObject(parent,
 485                            path,
 486                            unityRoot.transform,
 487                            map,
 488                            options);
 247489                    }
 322490                }
 491
 367492                if (options.importSceneInstances)
 367493                {
 367494                    Profiler.BeginSample("Add Scene Instance Root");
 367495                    if (prim.IsInstance())
 9496                    {
 9497                        map.AddInstanceRoot(prim.GetPath(), go, prim.GetMaster().GetPath());
 9498                    }
 499
 367500                    Profiler.EndSample();
 367501                }
 502
 367503                if (!options.importHierarchy)
 0504                {
 0505                    continue;
 506                }
 507
 367508                ApplySelfVisibility(go, prim);
 509
 510                try
 367511                {
 367512                    Profiler.BeginSample("Add Model Root");
 367513                    AddModelRoot(go, info);
 367514                    Profiler.EndSample();
 515
 367516                    Profiler.BeginSample("Add Variant Set");
 367517                    AddVariantSet(go, prim);
 367518                    Profiler.EndSample();
 519
 367520                    Profiler.BeginSample("Add Payload");
 367521                    AddPayload(go, info, options);
 367522                    Profiler.EndSample();
 367523                }
 0524                catch (Exception ex)
 0525                {
 0526                    Debug.LogException(new Exception("Error processing " + prim.GetPath(), ex));
 0527                }
 367528            }
 529
 73530            Profiler.EndSample();
 73531        }
 532
 533        static void PopulateSkelCache(ref HierInfo skelRootInfo, UsdSkelCache skelCache)
 367534        {
 535            //
 536            // Populate the UsdSkelCache.
 537            //
 367538            var skelRoot = new UsdSkelRoot(skelRootInfo.prim);
 367539            if (!skelRoot)
 364540            {
 364541                return;
 542            }
 543
 3544            if (!skelCache.Populate(skelRoot))
 0545            {
 0546                Debug.LogWarning("Failed to populate skel cache: " + skelRootInfo.prim.GetPath());
 0547                return;
 548            }
 549
 550            try
 3551            {
 3552                var binding = new UsdSkelBindingVector();
 3553                if (!skelCache.ComputeSkelBindings(skelRoot, binding))
 0554                {
 0555                    Debug.LogWarning("ComputeSkelBindings failed: " + skelRootInfo.prim.GetPath());
 0556                    return;
 557                }
 558
 3559                skelRootInfo.skelBindings = binding;
 3560            }
 0561            catch
 0562            {
 0563                Debug.LogError("Failed to compute binding for SkelRoot: " + skelRootInfo.prim.GetPath());
 0564            }
 367565        }
 566
 567        /// <summary>
 568        /// If HierInfo represents a UsdSkelRoot, reads the associated skelton joints into the
 569        /// skelJoints member.
 570        /// </summary>
 571        static void ReadSkeletonJoints(ref HierInfo skelRootInfo)
 367572        {
 367573            if (skelRootInfo.prim == null)
 0574            {
 0575                return;
 576            }
 577
 367578            var skelRoot = new UsdSkelRoot(skelRootInfo.prim);
 367579            if (!skelRoot)
 364580            {
 364581                return;
 582            }
 583
 3584            var processed = new HashSet<SdfPath>();
 15585            foreach (UsdSkelBinding binding in skelRootInfo.skelBindings)
 3586            {
 3587                var skel = binding.GetSkeleton();
 588
 3589                if (!skel)
 0590                {
 0591                    continue;
 592                }
 593
 594                // If the same skeleton is referenced multiple times, only process it once.
 3595                if (processed.Contains(skel.GetPath()))
 0596                {
 0597                    continue;
 598                }
 599
 3600                processed.Add(skel.GetPath());
 601
 3602                var jointsAttr = skel.GetJointsAttr();
 3603                if (!jointsAttr)
 0604                {
 0605                    continue;
 606                }
 607
 3608                var vtJoints = jointsAttr.Get();
 3609                if (vtJoints.IsEmpty())
 0610                {
 0611                    continue;
 612                }
 613
 3614                var vtStrings = UsdCs.VtValueToVtTokenArray(vtJoints);
 3615                var joints = UnityTypeConverter.FromVtArray(vtStrings);
 616
 3617                var skelPath = skel.GetPath();
 3618                skelRootInfo.skelJoints = new SdfPath[joints.Length];
 619
 30620                for (int i = 0; i < joints.Length; i++)
 12621                {
 12622                    var jointPath = new SdfPath(joints[i]);
 12623                    if (joints[i] == "/")
 0624                    {
 0625                        skelRootInfo.skelJoints[i] = skelPath;
 0626                        continue;
 627                    }
 12628                    else if (jointPath.IsAbsolutePath())
 0629                    {
 0630                        Debug.LogException(new Exception("Unexpected absolute joint path: " + jointPath));
 0631                        jointPath = new SdfPath(joints[i].TrimStart('/'));
 0632                    }
 633
 12634                    skelRootInfo.skelJoints[i] = skelPath.AppendPath(jointPath);
 12635                }
 3636            }
 367637        }
 638
 639        /// <summary>
 640        /// Given an array of bone names (HierInfo.skelJoints), creates GameObjects under unityRoot.
 641        /// </summary>
 642        static void ExpandSkeleton(HierInfo info,
 643            GameObject unityRoot,
 644            SdfPath usdRoot,
 645            UsdPrim prim,
 646            PrimMap map,
 647            SceneImportOptions options)
 3648        {
 33649            foreach (var joint in info.skelJoints)
 12650            {
 12651                var path = joint;
 12652                GameObject parentGo = null;
 12653                if (!map.TryGetValue(path.GetParentPath(), out parentGo))
 0654                {
 655                    // This will happen when the joints are discontinuous, for example:
 656                    //
 657                    //   Foo/Bar
 658                    //   Foo/Bar/Baz/Qux
 659                    //
 660                    // Baz is implicitly defined, which is allowed by UsdSkel.
 0661                    CreateAncestors(path, map, unityRoot, usdRoot, options, out parentGo);
 0662                    if (!parentGo)
 0663                    {
 0664                        Debug.LogException(new Exception("Failed to create ancestors for " + path + " for prim: " +
 665                            prim.GetPath()));
 0666                        continue;
 667                    }
 0668                }
 669
 12670                Transform child = parentGo.transform.Find(path.GetName());
 12671                if (!child)
 12672                {
 12673                    child = new GameObject(path.GetName()).transform;
 12674                    child.SetParent(parentGo.transform, worldPositionStays: false);
 12675                }
 676
 12677                map[path] = child.gameObject;
 12678            }
 3679        }
 680
 681        static void ReadModelInfo(ref HierInfo info)
 373682        {
 373683            if (!info.prim)
 0684            {
 0685                return;
 686            }
 687
 373688            var modelApi = new UsdModelAPI(info.prim);
 373689            if (!modelApi)
 0690            {
 0691                return;
 692            }
 693
 373694            var kindTok = new TfToken();
 373695            if (!modelApi.GetKind(kindTok))
 322696            {
 322697                return;
 698            }
 699
 51700            if (KindRegistry.IsA(kindTok, KindTokens.assembly))
 0701            {
 0702                info.isAssembly = true;
 0703            }
 51704            else if (!modelApi.IsModel() || modelApi.IsGroup())
 20705            {
 20706                return;
 707            }
 708
 31709            var modelInfo = new VtDictionary();
 31710            if (!modelApi.GetAssetInfo(modelInfo))
 31711            {
 31712                return;
 713            }
 714
 0715            info.isModel = true;
 716
 0717            var valName = modelInfo.GetValueAtPath("name");
 0718            var valVersion = modelInfo.GetValueAtPath("version");
 0719            var valIdentifier = modelInfo.GetValueAtPath("identifier");
 720
 0721            if (valIdentifier != null && !valIdentifier.IsEmpty())
 0722            {
 0723                info.modelAssetPath = UsdCs.VtValueToSdfAssetPath(valIdentifier).GetAssetPath().ToString();
 0724            }
 725
 0726            if (valName != null && !valName.IsEmpty())
 0727            {
 0728                info.modelName = UsdCs.VtValueTostring(valName);
 0729            }
 730
 0731            if (valVersion != null && !valVersion.IsEmpty())
 0732            {
 0733                info.modelVersion = UsdCs.VtValueTostring(valVersion);
 0734            }
 373735        }
 736
 737        /// <summary>
 738        /// Exposes model root and asset metadata. The game object is primarily a tag which is useful
 739        /// for smart selection of models instead of geometry.
 740        /// </summary>
 741        static void AddModelRoot(GameObject go, HierInfo info)
 373742        {
 373743            if (info.isAssembly)
 0744            {
 0745                var asm = go.GetComponent<UsdAssemblyRoot>();
 0746                if (!asm)
 0747                {
 0748                    go.AddComponent<UsdAssemblyRoot>();
 0749                }
 0750            }
 373751            else if (info.isModel)
 0752            {
 0753                var mdl = go.GetComponent<UsdModelRoot>();
 0754                if (!mdl)
 0755                {
 0756                    mdl = go.AddComponent<UsdModelRoot>();
 0757                }
 758
 0759                mdl.m_modelAssetPath = info.modelAssetPath;
 0760                mdl.m_modelName = info.modelName;
 0761                mdl.m_modelVersion = info.modelVersion;
 0762            }
 763            else
 373764            {
 765                // If these tags were added previously, remove them.
 373766                var mdl = go.GetComponent<UsdModelRoot>();
 373767                if (mdl)
 0768                {
 0769                    Component.DestroyImmediate(mdl);
 0770                }
 771
 373772                var asm = go.GetComponent<UsdAssemblyRoot>();
 373773                if (asm)
 0774                {
 0775                    Component.DestroyImmediate(asm);
 0776                }
 373777            }
 373778        }
 779
 780        /// <summary>
 781        /// If there is a Payload authored on this prim, expose it so the user can change the
 782        /// load state.
 783        /// </summary>
 784        static void AddPayload(GameObject go, HierInfo info, SceneImportOptions options)
 367785        {
 367786            var pl = go.GetComponent<UsdPayload>();
 787
 367788            if (!info.hasPayload)
 344789            {
 344790                if (pl)
 0791                {
 0792                    Component.DestroyImmediate(pl);
 0793                }
 794
 344795                return;
 796            }
 797
 23798            if (!pl)
 23799            {
 23800                pl = go.AddComponent<UsdPayload>();
 23801                pl.SetInitialState(info.prim.IsLoaded());
 23802            }
 367803        }
 804
 805        /// <summary>
 806        /// If there is a variant set authored on this prim, expose it so the user can change the
 807        /// variant selection.
 808        /// </summary>
 809        static void AddVariantSet(GameObject go, UsdPrim prim)
 373810        {
 373811            var setNames = prim.GetVariantSets().GetNames();
 373812            var vs = go.GetComponent<UsdVariantSet>();
 813
 373814            if (setNames.Count == 0)
 350815            {
 350816                if (vs)
 0817                {
 0818                    Component.DestroyImmediate(vs);
 0819                }
 820
 350821                return;
 822            }
 823
 23824            if (!vs)
 23825            {
 23826                vs = go.AddComponent<UsdVariantSet>();
 23827            }
 828
 23829            vs.LoadFromUsd(prim);
 373830        }
 831
 832        /// <summary>
 833        /// Checks for a child named "name" under the given parent, if it exists it is returned,
 834        /// else a new child is created with this name.
 835        /// </summary>
 836        static GameObject FindOrCreateGameObject(Transform parent,
 837            SdfPath path,
 838            Transform unityRoot,
 839            PrimMap primMap,
 840            SceneImportOptions options)
 328841        {
 328842            Transform root = null;
 328843            GameObject go = null;
 328844            string name = path.GetName();
 845
 328846            if (parent == null)
 0847            {
 0848                go = GameObject.Find(name);
 0849                root = go ? go.transform : null;
 0850            }
 851            else
 328852            {
 328853                root = parent.Find(name);
 328854                go = root ? root.gameObject : null;
 328855            }
 856
 328857            if (!go)
 325858            {
 859                // TODO: this should really not construct a game object if ImportHierarchy is false,
 860                // but it requires all downstream code be driven by the primMap instead of finding prims
 861                // via the usd scene. In addition, this requies the prim map to store lists of prims by
 862                // type, e.g. cameras, meshes, cubes, etc.
 325863                go = new GameObject(name);
 325864            }
 865
 328866            if (!go.GetComponent<UsdPrimSource>())
 325867            {
 325868                var ua = go.AddComponent<UsdPrimSource>();
 325869                ua.m_usdPrimPath = path.ToString();
 325870            }
 871
 328872            if (parent != null)
 328873            {
 328874                go.transform.SetParent(parent, worldPositionStays: false);
 328875            }
 876
 328877            Profiler.BeginSample("Add to PrimMap");
 328878            primMap[path] = go;
 328879            Profiler.EndSample();
 328880            return go;
 328881        }
 882    }
 883}
+
+
+
+

Methods/Properties

+HierarchyBuilder()
+Run()
+Execute(System.Int32)
+Run()
+Execute(System.Int32)
+BeginReading(USD.NET.Scene, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+BuildObjectLists(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+BuildGameObjects(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, System.Collections.Generic.IEnumerable[SdfPath], Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+IsVisible(pxr.UsdPrim)
+ApplySelfVisibility(UnityEngine.GameObject, pxr.UsdPrim)
+CreateAncestors(pxr.SdfPath, Unity.Formats.USD.PrimMap, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.SceneImportOptions, UnityEngine.GameObject&)
+ProcessPaths(Unity.Formats.USD.HierarchyBuilder/HierInfo[], USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+PopulateSkelCache(Unity.Formats.USD.HierarchyBuilder/HierInfo&, pxr.UsdSkelCache)
+ReadSkeletonJoints(Unity.Formats.USD.HierarchyBuilder/HierInfo&)
+ExpandSkeleton(Unity.Formats.USD.HierarchyBuilder/HierInfo, UnityEngine.GameObject, pxr.SdfPath, pxr.UsdPrim, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+ReadModelInfo(Unity.Formats.USD.HierarchyBuilder/HierInfo&)
+AddModelRoot(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo)
+AddPayload(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo, Unity.Formats.USD.SceneImportOptions)
+AddVariantSet(UnityEngine.GameObject, pxr.UsdPrim)
+FindOrCreateGameObject(UnityEngine.Transform, pxr.SdfPath, UnityEngine.Transform, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions)
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilderFindPathsJobQuery_T_.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilderFindPathsJobQuery_T_.html new file mode 100644 index 000000000..777cabd08 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_HierarchyBuilderFindPathsJobQuery_T_.html @@ -0,0 +1,985 @@ + + + + + + +Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T] - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/HierarchyBuilder.cs
Covered lines:0
Uncovered lines:3
Coverable lines:3
Total lines:883
Line coverage:0% (0 of 3)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Find(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/HierarchyBuilder.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using UnityEngine;
 19using UnityEngine.Profiling;
 20using pxr;
 21using USD.NET;
 22using USD.NET.Unity;
 23using Unity.Jobs;
 24
 25namespace Unity.Formats.USD
 26{
 27    /// <summary>
 28    /// A collection of methods for building the USD scene hierarchy in Unity.
 29    /// </summary>
 30    public static class HierarchyBuilder
 31    {
 32        static readonly SdfPath kAbsoluteRootPath = SdfPath.AbsoluteRootPath();
 33
 34        struct HierInfo
 35        {
 36            public bool isVisible;
 37            public bool isInstance;
 38            public bool isAssembly;
 39            public bool isModel;
 40            public bool hasPayload;
 41            public UsdPrim prim;
 42
 43            // Provides a list of all bound skeletons under a UsdSkelRoot.
 44            public UsdSkelBindingVector skelBindings;
 45
 46            public SdfPath[] skelJoints;
 47            public string modelAssetPath;
 48            public string modelName;
 49            public string modelVersion;
 50        }
 51
 52        struct ReadHierJob : IJobParallelFor
 53        {
 54            public static HierInfo[] result;
 55            public static Scene scene;
 56            public static UsdSkelCache skelCache; // Thread safe.
 57            public static SdfPath[] paths;
 58
 59            public void Run()
 60            {
 61                for (int i = 0; i < paths.Length; i++)
 62                {
 63                    Execute(i);
 64                }
 65            }
 66
 67            public void Execute(int index)
 68            {
 69                HierInfo info = new HierInfo();
 70                info.prim = scene.Stage.GetPrimAtPath(paths[index]);
 71
 72                if (!info.prim)
 73                {
 74                    info.prim = null;
 75                    return;
 76                }
 77
 78                info.isVisible = HierarchyBuilder.IsVisible(info.prim);
 79                info.isInstance = info.prim.IsInstance();
 80                HierarchyBuilder.ReadModelInfo(ref info);
 81                HierarchyBuilder.PopulateSkelCache(ref info, ReadHierJob.skelCache);
 82                HierarchyBuilder.ReadSkeletonJoints(ref info);
 83                info.hasPayload = info.prim.GetPrimIndex().HasAnyPayloads();
 84
 85                result[index] = info;
 86            }
 87        }
 88
 89        struct FindPathsJob : IJobParallelFor
 90        {
 91            public interface IQuery
 92            {
 93                SdfPath[] Find(Scene scene, SdfPath usdRoot);
 94            }
 95
 96            public struct Query<T> : IQuery where T : SampleBase, new()
 97            {
 98                public SdfPath[] Find(Scene scene, SdfPath usdRoot)
 099                {
 0100                    return scene.Find<T>(usdRoot);
 0101                }
 102            }
 103
 104            public static SdfPath usdRoot;
 105            public static Scene scene;
 106            public static SdfPath[][] results;
 107            public static IQuery[] queries;
 108
 109            public void Run()
 110            {
 111                for (int i = 0; i < queries.Length; i++)
 112                {
 113                    Execute(i);
 114                }
 115            }
 116
 117            public void Execute(int index)
 118            {
 119                var query = queries[index];
 120                if (query == null)
 121                {
 122                    return;
 123                }
 124
 125                results[index] = query.Find(scene, usdRoot);
 126            }
 127        }
 128
 129        static JobHandle BeginReading(Scene scene,
 130            SdfPath usdRoot,
 131            PrimMap map,
 132            SceneImportOptions options)
 133        {
 134            FindPathsJob.usdRoot = usdRoot;
 135            FindPathsJob.scene = scene;
 136            FindPathsJob.results = new SdfPath[9][];
 137            FindPathsJob.queries = new FindPathsJob.IQuery[9];
 138
 139            if (options.ShouldBindMaterials)
 140            {
 141                FindPathsJob.queries[0] = (FindPathsJob.IQuery) new FindPathsJob.Query<MaterialSample>();
 142            }
 143
 144            if (options.importCameras)
 145            {
 146                FindPathsJob.queries[1] = (FindPathsJob.IQuery) new FindPathsJob.Query<CameraSample>();
 147            }
 148
 149            if (options.importMeshes)
 150            {
 151                FindPathsJob.queries[2] = (FindPathsJob.IQuery) new FindPathsJob.Query<MeshSample>();
 152                FindPathsJob.queries[3] = (FindPathsJob.IQuery) new FindPathsJob.Query<CubeSample>();
 153                FindPathsJob.queries[4] = (FindPathsJob.IQuery) new FindPathsJob.Query<SphereSample>();
 154            }
 155
 156            FindPathsJob.queries[5] = (FindPathsJob.IQuery) new FindPathsJob.Query<SkelRootSample>();
 157
 158            if (options.importSkinning)
 159            {
 160                FindPathsJob.queries[6] = (FindPathsJob.IQuery) new FindPathsJob.Query<SkeletonSample>();
 161            }
 162
 163            if (options.importTransforms)
 164            {
 165                FindPathsJob.queries[7] = (FindPathsJob.IQuery) new FindPathsJob.Query<XformSample>();
 166            }
 167
 168            FindPathsJob.queries[8] = (FindPathsJob.IQuery) new FindPathsJob.Query<ScopeSample>();
 169
 170            var findPathsJob = new FindPathsJob();
 171            var findHandle = findPathsJob.Schedule(FindPathsJob.queries.Length, 1);
 172            findHandle.Complete();
 173
 174            // Note that Scope prims are taken into account when building the hierarchy but not added to the PrimMap
 175            // This is because Scopes don't need specific import/export logic for now:
 176            //   * they don't hold any data ton convert on the way in
 177            //   * being represented as Xforms in Unity they get automatically exported (as Xform) as part of the parent
 178            //     valid prim
 179            // This will need to change if/when we want proper round tripping.
 180            map.Materials = FindPathsJob.results[0];
 181            map.Cameras = FindPathsJob.results[1];
 182            map.Meshes = FindPathsJob.results[2];
 183            map.Cubes = FindPathsJob.results[3];
 184            map.Spheres = FindPathsJob.results[4];
 185            map.SkelRoots = FindPathsJob.results[5];
 186            map.Skeletons = FindPathsJob.results[6];
 187            map.Xforms = FindPathsJob.results[7];
 188
 189            ReadHierJob.paths = FindPathsJob.results.Where(i => i != null).SelectMany(i => i).ToArray();
 190            ReadHierJob.result = new HierInfo[ReadHierJob.paths.Length];
 191            ReadHierJob.scene = scene;
 192            ReadHierJob.skelCache = map.SkelCache;
 193            var readHierInfo = new ReadHierJob();
 194            return readHierInfo.Schedule(ReadHierJob.paths.Length, 8, dependsOn: findHandle);
 195        }
 196
 197        static HierInfo[] BuildObjectLists(Scene scene,
 198            GameObject unityRoot,
 199            SdfPath usdRoot,
 200            PrimMap map,
 201            SceneImportOptions options)
 202        {
 203            if (map.SkelCache == null)
 204            {
 205                // Note that UsdSkelCache is thread safe and can be populated from multiple threads.
 206                map.SkelCache = new UsdSkelCache();
 207
 208                // The skelBindings dictionary, however, is not thread safe and must be populated after the
 209                // hierarchy discovery thread joins, in ProcessPaths.
 210                map.SkelBindings = new Dictionary<SdfPath, UsdSkelBindingVector>();
 211            }
 212
 213            BeginReading(scene, usdRoot, map, options).Complete();
 214            ProcessPaths(ReadHierJob.result, scene, unityRoot, usdRoot, map, options);
 215
 216            return ReadHierJob.result;
 217        }
 218
 219        /// <summary>
 220        /// Map all UsdPrims and build Unity GameObjects, reconstructing the parent relationship.
 221        /// </summary>
 222        /// <remarks>
 223        /// When forceRebuild is true, game objects will be destroyed and recreated. If buildHierarchy
 224        /// is false, the primMap will be populated, but missing game objects will not be created.
 225        /// </remarks>
 226        static public PrimMap BuildGameObjects(Scene scene,
 227            GameObject unityRoot,
 228            SdfPath usdRoot,
 229            IEnumerable<SdfPath> paths,
 230            PrimMap map,
 231            SceneImportOptions options)
 232        {
 233            map[usdRoot] = unityRoot;
 234
 235            // Like all GameObjects imported from USD, ensure the root has a UsdPrimSource.
 236            if (unityRoot.GetComponent<UsdPrimSource>() == null)
 237            {
 238                var ua = unityRoot.AddComponent<UsdPrimSource>();
 239                ua.m_usdPrimPath = usdRoot.ToString();
 240            }
 241
 242            Profiler.BeginSample("Build Object Lists");
 243            var hierInfo = BuildObjectLists(scene, unityRoot, usdRoot, map, options);
 244            Profiler.EndSample();
 245
 246            // TODO: Should recurse to discover deeply nested instancing.
 247            // TODO: Generates garbage for every prim, but we expect few masters.
 248            if (options.importPointInstances || options.importSceneInstances)
 249            {
 250                Profiler.BeginSample("Build Masters");
 251                foreach (var masterRootPrim in scene.Stage.GetMasters())
 252                {
 253                    var goMaster = FindOrCreateGameObject(unityRoot.transform,
 254                        masterRootPrim.GetPath(),
 255                        unityRoot.transform,
 256                        map,
 257                        options);
 258
 259                    goMaster.hideFlags = HideFlags.HideInHierarchy;
 260                    goMaster.SetActive(false);
 261                    map.AddMasterRoot(masterRootPrim.GetPath(), goMaster);
 262                    try
 263                    {
 264                        var info = new HierInfo();
 265                        info.prim = masterRootPrim;
 266                        ReadModelInfo(ref info);
 267                        AddModelRoot(goMaster, info);
 268                        AddVariantSet(goMaster, masterRootPrim);
 269                    }
 270                    catch (Exception ex)
 271                    {
 272                        Debug.LogException(new Exception("Error processing " + masterRootPrim.GetPath(), ex));
 273                    }
 274
 275                    foreach (var usdPrim in masterRootPrim.GetAllDescendants())
 276                    {
 277                        var parentPath = usdPrim.GetPath().GetParentPath();
 278                        Transform parentXf = null;
 279                        if (parentPath == masterRootPrim.GetPath())
 280                        {
 281                            parentXf = goMaster.transform;
 282                        }
 283                        else
 284                        {
 285                            parentXf = map[parentPath].transform;
 286                        }
 287
 288                        var goPrim = FindOrCreateGameObject(parentXf,
 289                            usdPrim.GetPath(),
 290                            unityRoot.transform,
 291                            map,
 292                            options);
 293                        ApplySelfVisibility(goPrim, usdPrim);
 294
 295                        if (usdPrim.IsInstance())
 296                        {
 297                            map.AddInstanceRoot(usdPrim.GetPath(), goPrim, usdPrim.GetMaster().GetPath());
 298                        }
 299
 300                        try
 301                        {
 302                            var info = new HierInfo();
 303                            info.prim = usdPrim;
 304                            ReadModelInfo(ref info);
 305                            AddModelRoot(goPrim, info);
 306                            AddVariantSet(goPrim, usdPrim);
 307                        }
 308                        catch (Exception ex)
 309                        {
 310                            Debug.LogException(new Exception("Error processing " + usdPrim.GetPath(), ex));
 311                            continue;
 312                        }
 313                    }
 314                }
 315
 316                Profiler.EndSample();
 317            }
 318
 319            if (options.importSkinning)
 320            {
 321                Profiler.BeginSample("Expand Skeletons");
 322                foreach (var info in hierInfo)
 323                {
 324                    if (info.skelJoints == null || info.skelJoints.Length == 0)
 325                    {
 326                        continue;
 327                    }
 328
 329                    try
 330                    {
 331                        ExpandSkeleton(info, unityRoot, usdRoot, info.prim, map, options);
 332                    }
 333                    catch (Exception ex)
 334                    {
 335                        Debug.LogException(new Exception("Error expanding skeleton at " + info.prim.GetPath(), ex));
 336                    }
 337                }
 338
 339                Profiler.EndSample();
 340            }
 341
 342            return map;
 343        }
 344
 345        static bool IsVisible(UsdPrim usdPrim)
 346        {
 347            if (!usdPrim)
 348            {
 349                return false;
 350            }
 351
 352            var img = new UsdGeomImageable(usdPrim);
 353            if (!img)
 354            {
 355                return true;
 356            }
 357
 358            // Using time=0.0 will enable this to pickup a single animated value by virtue of
 359            // interpolation, but correct handling of animated visibility would query it over time.
 360
 361            // Also note this code is intentionally not using ComputeVisibility(), since Unity will apply
 362            // inherited visibility. This is technically incorrect, since USD supports "super vis",
 363            // enabling visible children with invisible parents. The goal here is to avoid spamming all
 364            // descendent children with active=false. A better implementation would check for visible
 365            // children with invisible parents and somehow translate that to the Unity scenegraph, but
 366            // is left as a future improvement.
 367
 368            VtValue visValue = new VtValue();
 369            if (!img.GetVisibilityAttr().Get(visValue, 0.0))
 370            {
 371                return true;
 372            }
 373
 374            return UsdCs.VtValueToTfToken(visValue) != UsdGeomTokens.invisible;
 375        }
 376
 377        static void ApplySelfVisibility(GameObject go, UsdPrim usdPrim)
 378        {
 379            if (!go)
 380            {
 381                return;
 382            }
 383
 384            if (IsVisible(usdPrim))
 385            {
 386                return;
 387            }
 388
 389            go.SetActive(false);
 390        }
 391
 392        // Creates ancestors, but note that this method does not apply visibility, since it was
 393        // designed to create bones, which cannot have visibility opinions in USD.
 394        static void CreateAncestors(SdfPath path,
 395            PrimMap map,
 396            GameObject unityRoot,
 397            SdfPath usdRoot,
 398            SceneImportOptions options,
 399            out GameObject parentGo)
 400        {
 401            var parentPath = path.GetParentPath();
 402            if (path == parentPath)
 403            {
 404                Debug.LogException(new Exception("Parent path was identical to current path: " + path.ToString()));
 405                parentGo = null;
 406                return;
 407            }
 408
 409            if (map.TryGetValue(parentPath, out parentGo) && parentGo)
 410            {
 411                return;
 412            }
 413
 414            // Base case.
 415            if (parentPath == usdRoot)
 416            {
 417                map[parentPath] = unityRoot;
 418                return;
 419            }
 420
 421            if (parentPath == kAbsoluteRootPath)
 422            {
 423                // Something went wrong.
 424                Debug.LogException(new Exception(
 425                    "Error: unexpected path </> creating ancestors for <" + usdRoot.ToString() + ">"));
 426            }
 427
 428            // Recursive case.
 429            // First, get the grandparent (parent's parent).
 430            GameObject grandparentGo;
 431            CreateAncestors(parentPath, map, unityRoot, usdRoot, options, out grandparentGo);
 432            if (!grandparentGo)
 433            {
 434                Debug.LogError("Failed to find ancestor for " + parentPath);
 435                return;
 436            }
 437
 438            // Then find/create the current parent.
 439            parentGo = FindOrCreateGameObject(grandparentGo.transform,
 440                parentPath,
 441                unityRoot.transform,
 442                map,
 443                options);
 444        }
 445
 446        static void ProcessPaths(HierInfo[] infos,
 447            Scene scene,
 448            GameObject unityRoot,
 449            SdfPath usdRoot,
 450            PrimMap map,
 451            SceneImportOptions options)
 452        {
 453            Profiler.BeginSample("Process all paths");
 454            foreach (var info in infos)
 455            {
 456                var prim = info.prim;
 457                var path = info.prim.GetPath();
 458
 459                if (info.skelBindings != null)
 460                {
 461                    // Collect all discovered skelBindings back into the PrimMap.
 462                    map.SkelBindings.Add(info.prim.GetPath(), info.skelBindings);
 463                }
 464
 465                GameObject go;
 466                if (path == usdRoot)
 467                {
 468                    go = unityRoot;
 469                }
 470                else
 471                {
 472                    GameObject parentGo = null;
 473                    CreateAncestors(path, map, unityRoot, usdRoot, options, out parentGo);
 474
 475                    if (!parentGo)
 476                    {
 477                        Debug.LogWarning("Parent path not found for child: " + path.ToString());
 478                        continue;
 479                    }
 480
 481                    var parent = parentGo ? parentGo.transform : null;
 482                    if (!map.TryGetValue(path, out go))
 483                    {
 484                        go = FindOrCreateGameObject(parent,
 485                            path,
 486                            unityRoot.transform,
 487                            map,
 488                            options);
 489                    }
 490                }
 491
 492                if (options.importSceneInstances)
 493                {
 494                    Profiler.BeginSample("Add Scene Instance Root");
 495                    if (prim.IsInstance())
 496                    {
 497                        map.AddInstanceRoot(prim.GetPath(), go, prim.GetMaster().GetPath());
 498                    }
 499
 500                    Profiler.EndSample();
 501                }
 502
 503                if (!options.importHierarchy)
 504                {
 505                    continue;
 506                }
 507
 508                ApplySelfVisibility(go, prim);
 509
 510                try
 511                {
 512                    Profiler.BeginSample("Add Model Root");
 513                    AddModelRoot(go, info);
 514                    Profiler.EndSample();
 515
 516                    Profiler.BeginSample("Add Variant Set");
 517                    AddVariantSet(go, prim);
 518                    Profiler.EndSample();
 519
 520                    Profiler.BeginSample("Add Payload");
 521                    AddPayload(go, info, options);
 522                    Profiler.EndSample();
 523                }
 524                catch (Exception ex)
 525                {
 526                    Debug.LogException(new Exception("Error processing " + prim.GetPath(), ex));
 527                }
 528            }
 529
 530            Profiler.EndSample();
 531        }
 532
 533        static void PopulateSkelCache(ref HierInfo skelRootInfo, UsdSkelCache skelCache)
 534        {
 535            //
 536            // Populate the UsdSkelCache.
 537            //
 538            var skelRoot = new UsdSkelRoot(skelRootInfo.prim);
 539            if (!skelRoot)
 540            {
 541                return;
 542            }
 543
 544            if (!skelCache.Populate(skelRoot))
 545            {
 546                Debug.LogWarning("Failed to populate skel cache: " + skelRootInfo.prim.GetPath());
 547                return;
 548            }
 549
 550            try
 551            {
 552                var binding = new UsdSkelBindingVector();
 553                if (!skelCache.ComputeSkelBindings(skelRoot, binding))
 554                {
 555                    Debug.LogWarning("ComputeSkelBindings failed: " + skelRootInfo.prim.GetPath());
 556                    return;
 557                }
 558
 559                skelRootInfo.skelBindings = binding;
 560            }
 561            catch
 562            {
 563                Debug.LogError("Failed to compute binding for SkelRoot: " + skelRootInfo.prim.GetPath());
 564            }
 565        }
 566
 567        /// <summary>
 568        /// If HierInfo represents a UsdSkelRoot, reads the associated skelton joints into the
 569        /// skelJoints member.
 570        /// </summary>
 571        static void ReadSkeletonJoints(ref HierInfo skelRootInfo)
 572        {
 573            if (skelRootInfo.prim == null)
 574            {
 575                return;
 576            }
 577
 578            var skelRoot = new UsdSkelRoot(skelRootInfo.prim);
 579            if (!skelRoot)
 580            {
 581                return;
 582            }
 583
 584            var processed = new HashSet<SdfPath>();
 585            foreach (UsdSkelBinding binding in skelRootInfo.skelBindings)
 586            {
 587                var skel = binding.GetSkeleton();
 588
 589                if (!skel)
 590                {
 591                    continue;
 592                }
 593
 594                // If the same skeleton is referenced multiple times, only process it once.
 595                if (processed.Contains(skel.GetPath()))
 596                {
 597                    continue;
 598                }
 599
 600                processed.Add(skel.GetPath());
 601
 602                var jointsAttr = skel.GetJointsAttr();
 603                if (!jointsAttr)
 604                {
 605                    continue;
 606                }
 607
 608                var vtJoints = jointsAttr.Get();
 609                if (vtJoints.IsEmpty())
 610                {
 611                    continue;
 612                }
 613
 614                var vtStrings = UsdCs.VtValueToVtTokenArray(vtJoints);
 615                var joints = UnityTypeConverter.FromVtArray(vtStrings);
 616
 617                var skelPath = skel.GetPath();
 618                skelRootInfo.skelJoints = new SdfPath[joints.Length];
 619
 620                for (int i = 0; i < joints.Length; i++)
 621                {
 622                    var jointPath = new SdfPath(joints[i]);
 623                    if (joints[i] == "/")
 624                    {
 625                        skelRootInfo.skelJoints[i] = skelPath;
 626                        continue;
 627                    }
 628                    else if (jointPath.IsAbsolutePath())
 629                    {
 630                        Debug.LogException(new Exception("Unexpected absolute joint path: " + jointPath));
 631                        jointPath = new SdfPath(joints[i].TrimStart('/'));
 632                    }
 633
 634                    skelRootInfo.skelJoints[i] = skelPath.AppendPath(jointPath);
 635                }
 636            }
 637        }
 638
 639        /// <summary>
 640        /// Given an array of bone names (HierInfo.skelJoints), creates GameObjects under unityRoot.
 641        /// </summary>
 642        static void ExpandSkeleton(HierInfo info,
 643            GameObject unityRoot,
 644            SdfPath usdRoot,
 645            UsdPrim prim,
 646            PrimMap map,
 647            SceneImportOptions options)
 648        {
 649            foreach (var joint in info.skelJoints)
 650            {
 651                var path = joint;
 652                GameObject parentGo = null;
 653                if (!map.TryGetValue(path.GetParentPath(), out parentGo))
 654                {
 655                    // This will happen when the joints are discontinuous, for example:
 656                    //
 657                    //   Foo/Bar
 658                    //   Foo/Bar/Baz/Qux
 659                    //
 660                    // Baz is implicitly defined, which is allowed by UsdSkel.
 661                    CreateAncestors(path, map, unityRoot, usdRoot, options, out parentGo);
 662                    if (!parentGo)
 663                    {
 664                        Debug.LogException(new Exception("Failed to create ancestors for " + path + " for prim: " +
 665                            prim.GetPath()));
 666                        continue;
 667                    }
 668                }
 669
 670                Transform child = parentGo.transform.Find(path.GetName());
 671                if (!child)
 672                {
 673                    child = new GameObject(path.GetName()).transform;
 674                    child.SetParent(parentGo.transform, worldPositionStays: false);
 675                }
 676
 677                map[path] = child.gameObject;
 678            }
 679        }
 680
 681        static void ReadModelInfo(ref HierInfo info)
 682        {
 683            if (!info.prim)
 684            {
 685                return;
 686            }
 687
 688            var modelApi = new UsdModelAPI(info.prim);
 689            if (!modelApi)
 690            {
 691                return;
 692            }
 693
 694            var kindTok = new TfToken();
 695            if (!modelApi.GetKind(kindTok))
 696            {
 697                return;
 698            }
 699
 700            if (KindRegistry.IsA(kindTok, KindTokens.assembly))
 701            {
 702                info.isAssembly = true;
 703            }
 704            else if (!modelApi.IsModel() || modelApi.IsGroup())
 705            {
 706                return;
 707            }
 708
 709            var modelInfo = new VtDictionary();
 710            if (!modelApi.GetAssetInfo(modelInfo))
 711            {
 712                return;
 713            }
 714
 715            info.isModel = true;
 716
 717            var valName = modelInfo.GetValueAtPath("name");
 718            var valVersion = modelInfo.GetValueAtPath("version");
 719            var valIdentifier = modelInfo.GetValueAtPath("identifier");
 720
 721            if (valIdentifier != null && !valIdentifier.IsEmpty())
 722            {
 723                info.modelAssetPath = UsdCs.VtValueToSdfAssetPath(valIdentifier).GetAssetPath().ToString();
 724            }
 725
 726            if (valName != null && !valName.IsEmpty())
 727            {
 728                info.modelName = UsdCs.VtValueTostring(valName);
 729            }
 730
 731            if (valVersion != null && !valVersion.IsEmpty())
 732            {
 733                info.modelVersion = UsdCs.VtValueTostring(valVersion);
 734            }
 735        }
 736
 737        /// <summary>
 738        /// Exposes model root and asset metadata. The game object is primarily a tag which is useful
 739        /// for smart selection of models instead of geometry.
 740        /// </summary>
 741        static void AddModelRoot(GameObject go, HierInfo info)
 742        {
 743            if (info.isAssembly)
 744            {
 745                var asm = go.GetComponent<UsdAssemblyRoot>();
 746                if (!asm)
 747                {
 748                    go.AddComponent<UsdAssemblyRoot>();
 749                }
 750            }
 751            else if (info.isModel)
 752            {
 753                var mdl = go.GetComponent<UsdModelRoot>();
 754                if (!mdl)
 755                {
 756                    mdl = go.AddComponent<UsdModelRoot>();
 757                }
 758
 759                mdl.m_modelAssetPath = info.modelAssetPath;
 760                mdl.m_modelName = info.modelName;
 761                mdl.m_modelVersion = info.modelVersion;
 762            }
 763            else
 764            {
 765                // If these tags were added previously, remove them.
 766                var mdl = go.GetComponent<UsdModelRoot>();
 767                if (mdl)
 768                {
 769                    Component.DestroyImmediate(mdl);
 770                }
 771
 772                var asm = go.GetComponent<UsdAssemblyRoot>();
 773                if (asm)
 774                {
 775                    Component.DestroyImmediate(asm);
 776                }
 777            }
 778        }
 779
 780        /// <summary>
 781        /// If there is a Payload authored on this prim, expose it so the user can change the
 782        /// load state.
 783        /// </summary>
 784        static void AddPayload(GameObject go, HierInfo info, SceneImportOptions options)
 785        {
 786            var pl = go.GetComponent<UsdPayload>();
 787
 788            if (!info.hasPayload)
 789            {
 790                if (pl)
 791                {
 792                    Component.DestroyImmediate(pl);
 793                }
 794
 795                return;
 796            }
 797
 798            if (!pl)
 799            {
 800                pl = go.AddComponent<UsdPayload>();
 801                pl.SetInitialState(info.prim.IsLoaded());
 802            }
 803        }
 804
 805        /// <summary>
 806        /// If there is a variant set authored on this prim, expose it so the user can change the
 807        /// variant selection.
 808        /// </summary>
 809        static void AddVariantSet(GameObject go, UsdPrim prim)
 810        {
 811            var setNames = prim.GetVariantSets().GetNames();
 812            var vs = go.GetComponent<UsdVariantSet>();
 813
 814            if (setNames.Count == 0)
 815            {
 816                if (vs)
 817                {
 818                    Component.DestroyImmediate(vs);
 819                }
 820
 821                return;
 822            }
 823
 824            if (!vs)
 825            {
 826                vs = go.AddComponent<UsdVariantSet>();
 827            }
 828
 829            vs.LoadFromUsd(prim);
 830        }
 831
 832        /// <summary>
 833        /// Checks for a child named "name" under the given parent, if it exists it is returned,
 834        /// else a new child is created with this name.
 835        /// </summary>
 836        static GameObject FindOrCreateGameObject(Transform parent,
 837            SdfPath path,
 838            Transform unityRoot,
 839            PrimMap primMap,
 840            SceneImportOptions options)
 841        {
 842            Transform root = null;
 843            GameObject go = null;
 844            string name = path.GetName();
 845
 846            if (parent == null)
 847            {
 848                go = GameObject.Find(name);
 849                root = go ? go.transform : null;
 850            }
 851            else
 852            {
 853                root = parent.Find(name);
 854                go = root ? root.gameObject : null;
 855            }
 856
 857            if (!go)
 858            {
 859                // TODO: this should really not construct a game object if ImportHierarchy is false,
 860                // but it requires all downstream code be driven by the primMap instead of finding prims
 861                // via the usd scene. In addition, this requies the prim map to store lists of prims by
 862                // type, e.g. cameras, meshes, cubes, etc.
 863                go = new GameObject(name);
 864            }
 865
 866            if (!go.GetComponent<UsdPrimSource>())
 867            {
 868                var ua = go.AddComponent<UsdPrimSource>();
 869                ua.m_usdPrimPath = path.ToString();
 870            }
 871
 872            if (parent != null)
 873            {
 874                go.transform.SetParent(parent, worldPositionStays: false);
 875            }
 876
 877            Profiler.BeginSample("Add to PrimMap");
 878            primMap[path] = go;
 879            Profiler.EndSample();
 880            return go;
 881        }
 882    }
 883}
+
+
+
+

Methods/Properties

+Find(USD.NET.Scene, pxr.SdfPath)
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImportHelpers.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImportHelpers.html new file mode 100644 index 000000000..7b6de9628 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImportHelpers.html @@ -0,0 +1,359 @@ + + + + + + +Unity.Formats.USD.ImportHelpers - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ImportHelpers
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/ImportHelpers.cs
Covered lines:92
Uncovered lines:36
Coverable lines:128
Total lines:237
Line coverage:71.8% (92 of 128)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ImportSceneAsGameObject(...)0%00084%
ImportAsPrefab(...)0%00085.71%
ImportAsTimelineClip(...)0%00085.71%
GetSelectedAssetPath()0%00031.82%
InitForOpen(...)0%00088.89%
GetDefaultRoot(...)0%000100%
UsdToGameObject(...)0%000100%
GetObjectName(...)0%000100%
GetObjectName(...)0%000100%
GetPrefabName(...)0%0000%
GetPrefabPath(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/ImportHelpers.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System;
 2using System.IO;
 3using System.Linq;
 4using pxr;
 5#if UNITY_EDITOR
 6using UnityEditor;
 7#endif
 8using UnityEngine;
 9using USD.NET;
 10using USD.NET.Unity;
 11using Object = UnityEngine.Object;
 12
 13namespace Unity.Formats.USD
 14{
 15    public static class ImportHelpers
 16    {
 17        public static GameObject ImportSceneAsGameObject(Scene scene, GameObject parent = null, SceneImportOptions impor
 5518        {
 5519            if (scene == null || scene.Stage == null)
 320            {
 321                Debug.LogError("The USD Scene needs to be opened before being imported.");
 322                return null;
 23            }
 24
 5225            string path = scene.FilePath;
 26
 27            // Time-varying data is not supported and often scenes are written without "Default" time
 28            // values, which makes setting an arbitrary time safer (because if only default was authored
 29            // the time will be ignored and values will resolve to default time automatically).
 5230            scene.Time = 1.0;
 31
 5232            if (importOptions == null)
 2733            {
 2734                importOptions = new SceneImportOptions();
 2735                importOptions.usdRootPath = GetDefaultRoot(scene);
 2736            }
 37
 5238            GameObject root = new GameObject(GetObjectName(importOptions.usdRootPath, path));
 39
 5240            if (parent != null)
 241            {
 242                root.transform.SetParent(parent.transform);
 243            }
 44
 45            try
 5246            {
 5247                UsdToGameObject(root, scene, importOptions);
 5248                return root;
 49            }
 050            catch (SceneImporter.ImportException)
 051            {
 52#if UNITY_EDITOR
 053                Object.DestroyImmediate(root);
 54#else
 55                Object.Destroy(root);
 56#endif
 057                return null;
 58            }
 5559        }
 60
 61#if UNITY_EDITOR
 62        public static string ImportAsPrefab(Scene scene, string prefabPath = null)
 363        {
 364            string path = scene.FilePath;
 65
 66            // Time-varying data is not supported and often scenes are written without "Default" time
 67            // values, which makes setting an arbitrary time safer (because if only default was authored
 68            // the time will be ignored and values will resolve to default time automatically).
 269            scene.Time = 1.0;
 70
 271            var importOptions = new SceneImportOptions();
 272            importOptions.projectAssetPath = GetSelectedAssetPath();
 273            importOptions.usdRootPath = GetDefaultRoot(scene);
 74
 275            if (string.IsNullOrEmpty(prefabPath))
 076            {
 077                prefabPath = GetPrefabPath(path, importOptions.projectAssetPath);
 078            }
 279            string clipName = Path.GetFileNameWithoutExtension(path);
 80
 281            var go = new GameObject(GetObjectName(importOptions.usdRootPath, path));
 82            try
 283            {
 284                UsdToGameObject(go, scene, importOptions);
 285                SceneImporter.SavePrefab(go, prefabPath, clipName, importOptions);
 286                return prefabPath;
 87            }
 88            finally
 289            {
 290                Object.DestroyImmediate(go);
 291                scene.Close();
 292            }
 293        }
 94
 95        public static string ImportAsTimelineClip(Scene scene, string prefabPath = null)
 396        {
 397            string path = scene.FilePath;
 98
 299            var importOptions = new SceneImportOptions();
 2100            importOptions.projectAssetPath = GetSelectedAssetPath();
 2101            importOptions.usdRootPath = GetDefaultRoot(scene);
 2102            importOptions.changeHandedness = BasisTransformation.FastWithNegativeScale;
 103
 2104            if (string.IsNullOrEmpty(prefabPath))
 0105            {
 0106                prefabPath = GetPrefabPath(path, importOptions.projectAssetPath);
 0107            }
 2108            string clipName = Path.GetFileNameWithoutExtension(path);
 109
 2110            var go = new GameObject(GetObjectName(importOptions.usdRootPath, path));
 111            try
 2112            {
 113                // Ensure we have at least one GameObject with the import settings.
 2114                XformImporter.BuildSceneRoot(scene, go.transform, importOptions);
 2115                SceneImporter.SavePrefab(go, prefabPath, clipName, importOptions);
 2116                return prefabPath;
 117            }
 118            finally
 2119            {
 2120                GameObject.DestroyImmediate(go);
 2121                scene.Close();
 2122            }
 2123        }
 124
 125        /// <summary>
 126        /// Returns the selected object path or "Assets/" if no object is selected.
 127        /// </summary>
 128        static string GetSelectedAssetPath()
 4129        {
 4130            Object[] selectedAsset = Selection.GetFiltered(typeof(Object), SelectionMode.Assets);
 12131            foreach (Object obj in selectedAsset)
 0132            {
 0133                var path = AssetDatabase.GetAssetPath(obj.GetInstanceID());
 0134                if (string.IsNullOrEmpty(path))
 0135                {
 0136                    continue;
 137                }
 138
 0139                if (File.Exists(path))
 0140                {
 0141                    path = Path.GetDirectoryName(path);
 0142                }
 143
 0144                if (!path.EndsWith("/"))
 0145                {
 0146                    path += "/";
 0147                }
 148
 0149                return path;
 150            }
 151
 4152            return "Assets/";
 4153        }
 154
 155#endif
 156
 157        public static Scene InitForOpen(string path = "", UsdStage.InitialLoadSet loadSet = pxr.UsdStage.InitialLoadSet.
 57158        {
 159#if UNITY_EDITOR
 57160            if (String.IsNullOrEmpty(path) && !UnityEngine.Application.isPlaying)
 0161                path = EditorUtility.OpenFilePanel("Import USD File", "", "usd,usda,usdc,abc");
 162#endif
 163
 57164            if (String.IsNullOrEmpty(path))
 1165                return null;
 166
 56167            InitUsd.Initialize();
 168            // var editingStage = new EditingStage(path);
 56169            var stage = pxr.UsdStage.Open(path, loadSet);
 56170            return Scene.Open(stage);
 56171        }
 172
 173        static pxr.SdfPath GetDefaultRoot(Scene scene)
 31174        {
 175            // We can't safely assume the default prim is the model root, because Alembic files will
 176            // always have a default prim set arbitrarily.
 177
 178            // If there is only one root prim, reference this prim.
 31179            var children = scene.Stage.GetPseudoRoot().GetChildren().ToList();
 31180            if (children.Count == 1)
 30181            {
 30182                return children[0].GetPath();
 183            }
 184
 185            // Otherwise there are 0 or many root prims, in this case the best option is to reference
 186            // them all, to avoid confusion.
 1187            return pxr.SdfPath.AbsoluteRootPath();
 31188        }
 189
 190        static GameObject UsdToGameObject(GameObject parent,
 191            Scene scene,
 192            SceneImportOptions importOptions)
 54193        {
 194            try
 54195            {
 54196                SceneImporter.ImportUsd(parent, scene, new PrimMap(), importOptions);
 54197            }
 198            finally
 54199            {
 54200                scene.Close();
 54201            }
 202
 54203            return parent;
 54204        }
 205
 206        static string GetObjectName(pxr.SdfPath rootPrimName, string path)
 56207        {
 56208            return pxr.UsdCs.TfIsValidIdentifier(rootPrimName.GetName())
 209                ? rootPrimName.GetName()
 210                : GetObjectName(path);
 56211        }
 212
 213        static string GetObjectName(string path)
 26214        {
 26215            return UnityTypeConverter.MakeValidIdentifier(Path.GetFileNameWithoutExtension(path));
 26216        }
 217
 218        static string GetPrefabName(string path)
 0219        {
 0220            var fileName = GetObjectName(path);
 0221            return fileName + "_prefab";
 0222        }
 223
 224#if UNITY_EDITOR
 225        static string GetPrefabPath(string usdPath, string dataPath)
 0226        {
 0227            var invalidChars = Path.GetInvalidFileNameChars();
 0228            var prefabName = string.Join("_", GetPrefabName(usdPath).Split(invalidChars,
 229                System.StringSplitOptions.RemoveEmptyEntries)).TrimEnd('.');
 0230            string prefabPath = dataPath + prefabName + ".prefab";
 0231            prefabPath = AssetDatabase.GenerateUniqueAssetPath(prefabPath);
 0232            return prefabPath;
 0233        }
 234
 235#endif
 236    }
 237}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImporterBase.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImporterBase.html new file mode 100644 index 000000000..3495ac34d --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ImporterBase.html @@ -0,0 +1,226 @@ + + + + + + +Unity.Formats.USD.ImporterBase - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ImporterBase
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/ImporterBase.cs
Covered lines:25
Uncovered lines:24
Coverable lines:49
Total lines:116
Line coverage:51% (25 of 49)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MakeRelativePath(...)0%0000%
ApproximatelyEqual(...)0%000100%
MoveComponentFirst(...)0%000100%
MoveComponentLast(...)0%0000%
GetOrAddComponent[T](...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/ImporterBase.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.IO;
 17using UnityEngine;
 18
 19namespace Unity.Formats.USD
 20{
 21    /// <summary>
 22    /// Basic functionality shared among Importers.
 23    /// </summary>
 24    public static class ImporterBase
 25    {
 26        /// <summary>
 27        /// Creates a relative path from one file or folder to another.
 28        /// </summary>
 29        public static String MakeRelativePath(string anchorPath, string pathToMakeRelative)
 030        {
 031            if (string.IsNullOrEmpty(anchorPath)) throw new ArgumentNullException("pathToMakeRelative");
 032            if (string.IsNullOrEmpty(pathToMakeRelative)) throw new ArgumentNullException("anchorPath");
 033            if (anchorPath == pathToMakeRelative)
 034            {
 035                return Path.GetFileName(pathToMakeRelative);
 36            }
 37
 038            Uri fromUri = new Uri(anchorPath);
 039            Uri toUri = new Uri(pathToMakeRelative);
 40
 41            // path can't be made relative.
 042            if (fromUri.Scheme != toUri.Scheme)
 043            {
 044                return pathToMakeRelative;
 45            }
 46
 047            Uri relativeUri = fromUri.MakeRelativeUri(toUri);
 048            String relativePath = Uri.UnescapeDataString(relativeUri.ToString());
 49
 050            if (toUri.Scheme.Equals("file", StringComparison.InvariantCultureIgnoreCase))
 051            {
 052                relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
 053            }
 54
 055            return relativePath;
 056        }
 57
 58        public static bool ApproximatelyEqual(Matrix4x4 lhs, Matrix4x4 rhs)
 959        {
 960            bool equal = true;
 30661            for (int i = 0; i < 16; i++)
 14462            {
 14463                equal = equal && (Mathf.Approximately(lhs[i], rhs[i]));
 14464            }
 65
 966            return equal;
 967        }
 68
 69        /// <summary>
 70        /// Moves the given component to be first in the list on the GameObject.
 71        /// If not in editor, this function is a no-op.
 72        /// </summary>
 73        public static void MoveComponentFirst(Component comp)
 5974        {
 75#if UNITY_EDITOR
 11976            while (UnityEditorInternal.ComponentUtility.MoveComponentUp(comp))
 6077            {
 6078            }
 79#else
 80            Debug.LogWarning("Cannot reorder component, not in editor");
 81#endif
 5982        }
 83
 84        /// <summary>
 85        /// Moves the given component to be last in the list on the GameObject.
 86        /// If not in editor, this function is a no-op.
 87        /// </summary>
 88        public static void MoveComponentLast(Component comp)
 089        {
 90#if UNITY_EDITOR
 091            while (UnityEditorInternal.ComponentUtility.MoveComponentDown(comp))
 092            {
 093            }
 94
 95#else
 96            Debug.LogWarning("Cannot reorder component, not in editor");
 97#endif
 098        }
 99
 100        public static T GetOrAddComponent<T>(GameObject go, bool insertFirst = false) where T : Component
 284101        {
 284102            T comp = go.GetComponent<T>();
 284103            if (!comp)
 282104            {
 282105                comp = go.AddComponent<T>();
 282106            }
 107
 284108            if (insertFirst)
 3109            {
 3110                MoveComponentFirst(comp);
 3111            }
 112
 284113            return comp;
 284114        }
 115    }
 116}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InitUsd.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InitUsd.html new file mode 100644 index 000000000..75cfe3156 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InitUsd.html @@ -0,0 +1,199 @@ + + + + + + +Unity.Formats.USD.InitUsd - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.InitUsd
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/InitUsd.cs
Covered lines:19
Uncovered lines:4
Coverable lines:23
Total lines:95
Line coverage:82.6% (19 of 23)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Initialize()0%00075%
SetupUsdPath(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/InitUsd.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Runtime.CompilerServices;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public static class InitUsd
 23    {
 24        private static bool m_usdInitialized;
 25        private static DiagnosticHandler m_handler;
 26
 27        public static bool Initialize()
 25628        {
 25629            if (m_usdInitialized)
 25430            {
 25431                return true;
 32            }
 33
 234            m_usdInitialized = true;
 35
 36            try
 237            {
 38                // Initializes native USD plugins and ensures plugins are discoverable on the system path.
 239                SetupUsdPath();
 40
 41                // The TypeBinder will generate code at runtime as a performance optimization, this must
 42                // be disabled when IL2CPP is enabled, since dynamic code generation is not possible.
 43#if ENABLE_IL2CPP
 44                TypeBinder.EnableCodeGeneration = false;
 45                Debug.Log("USD: Dynamic code generation disabled for IL2CPP.");
 46#endif
 47
 48                // Type registration enables automatic conversion from Unity-native types to USD types (e.g.
 49                // Vector3[] -> VtVec3fArray).
 250                UnityTypeBindings.RegisterTypes();
 51
 52                // The DiagnosticHandler propagates USD native errors, warnings and info up to C# exceptions
 53                // and Debug.Log[Warning] respectively.
 254                m_handler = new DiagnosticHandler();
 255            }
 056            catch (System.Exception ex)
 057            {
 058                Debug.LogException(ex);
 059                return false;
 60            }
 61
 262            return true;
 25663        }
 64
 65        // USD has several auxillary C++ plugin discovery files which must be discoverable at run-time
 66        // We store those libs in Support/ThirdParty/Usd and then set a magic environment variable to let
 67        // USD's libPlug know where to look to find them.
 68        private static void SetupUsdPath([CallerFilePath] string sourceFilePath = "")
 269        {
 70#if UNITY_EDITOR
 271            var fileInfo = new System.IO.FileInfo(sourceFilePath);
 272            var supPath = System.IO.Path.Combine(fileInfo.DirectoryName, "Plugins");
 73#else
 74            var supPath = UnityEngine.Application.dataPath.Replace("\\", "/") + "/Plugins";
 75#endif
 76
 77#if (UNITY_EDITOR_WIN)
 278            supPath += @"/x86_64/usd/";
 79#elif (UNITY_EDITOR_OSX)
 80            supPath += @"/x86_64/usd/";
 81#elif (UNITY_EDITOR_LINUX)
 82            supPath += @"/x86_64/usd/";
 83#elif (UNITY_STANDALONE_WIN)
 84            supPath += @"/usd/";
 85#elif (UNITY_STANDALONE_OSX)
 86            supPath += @"/usd/";
 87#elif (UNITY_STANDALONE_LINUX)
 88            supPath += @"/usd/";
 89#endif
 90
 291            Debug.LogFormat("Registering plugins: {0}", supPath);
 292            pxr.PlugRegistry.GetInstance().RegisterPlugins(supPath);
 293        }
 94    }
 95}
+
+
+
+

Methods/Properties

+Initialize()
+SetupUsdPath(System.String)
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InstanceImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InstanceImporter.html new file mode 100644 index 000000000..93af6002c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_InstanceImporter.html @@ -0,0 +1,283 @@ + + + + + + +Unity.Formats.USD.InstanceImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.InstanceImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/InstanceImporter.cs
Covered lines:49
Uncovered lines:43
Coverable lines:92
Total lines:177
Line coverage:53.2% (49 of 92)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildSceneInstances(...)0%00069.7%
BuildPointInstances(...)0%00069.09%
EnableGpuInstancing(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/InstanceImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17using PointInstancerSample = USD.NET.Unity.PointInstancerSample;
 18
 19namespace Unity.Formats.USD
 20{
 21    /// <summary>
 22    /// A collection of methods used for translating USD instances into Unity instances (CPU or GPU).
 23    /// </summary>
 24    public static class InstanceImporter
 25    {
 26        /// <summary>
 27        /// Given a PrimMap, finds all instanced objects and their respective master objects and
 28        /// instantiates Unity clones using GameObject.Instantiate. Note that this does not result
 29        /// in GPU instancing.
 30        /// </summary>
 31        public static void BuildSceneInstances(PrimMap primMap, SceneImportOptions options)
 7332        {
 7333            if (options.enableGpuInstancing)
 034            {
 035                foreach (var masterPath in primMap.GetMasterRootPaths())
 036                {
 037                    EnableGpuInstancing(primMap[masterPath]);
 038                }
 039            }
 40
 23741            foreach (var instance in primMap.GetInstanceRoots())
 942            {
 943                GameObject goInstance = instance.gameObject;
 944                GameObject goMaster = primMap[instance.masterPath];
 4545                foreach (Transform child in goMaster.transform)
 946                {
 947                    Transform newChild = goInstance.transform.Find(child.name);
 48
 49                    // If the old instance exists, we must destroy it to avoid a duplicate
 50                    // because the prototypes may have changed during re-import
 951                    if (newChild != null)
 052                        GameObject.DestroyImmediate(newChild.gameObject);
 53
 954                    newChild = GameObject.Instantiate(child.gameObject).transform;
 955                    newChild.name = child.name;
 956                    newChild.transform.SetParent(goInstance.transform, worldPositionStays: false);
 57
 958                    primMap.AddInstance(newChild.gameObject);
 959                }
 960            }
 7361        }
 62
 63        public static void BuildPointInstances(Scene scene,
 64            PrimMap primMap,
 65            string pointInstancerPath,
 66            PointInstancerSample sample,
 67            GameObject root,
 68            SceneImportOptions options)
 269        {
 270            Matrix4x4[] transforms = sample.ComputeInstanceMatrices(scene, pointInstancerPath);
 271            int i = 0;
 72
 1073            foreach (var protoRoot in sample.prototypes.targetPaths)
 274            {
 75                GameObject go;
 276                if (!primMap.TryGetValue(new pxr.SdfPath(protoRoot), out go))
 077                {
 078                    Debug.LogWarning("Proto not found in PrimMap: " + protoRoot);
 079                    continue;
 80                }
 81
 282                go.SetActive(false);
 283                if (options.enableGpuInstancing)
 084                {
 085                    EnableGpuInstancing(go);
 086                }
 287            }
 88
 289            var inactiveIds = new System.Collections.Generic.HashSet<long>();
 90            /*
 91             * Disabled until this bug is resolved:
 92             * https://github.com/PixarAnimationStudios/USD/issues/639
 93             *
 94            if (sample.inactiveIds != null) {
 95              foreach (long id in sample.inactiveIds.GetExplicitItems()) {
 96                inactiveIds.Add(id);
 97              }
 98            }
 99            */
 100
 406101            foreach (var index in sample.protoIndices)
 200102            {
 200103                if (inactiveIds.Contains(index))
 0104                {
 0105                    continue;
 106                }
 107
 200108                if (index >= sample.prototypes.targetPaths.Length)
 0109                {
 0110                    Debug.LogWarning("ProtoIndex out of bounds: [" + index + "] " +
 111                        "for instancer: " + pointInstancerPath);
 0112                    continue;
 113                }
 114
 200115                var targetPath = sample.prototypes.targetPaths[index];
 116
 117                GameObject goMaster;
 200118                if (!primMap.TryGetValue(new pxr.SdfPath(targetPath), out goMaster))
 0119                {
 0120                    Debug.LogWarning("Proto not found in PrimMap: " + targetPath);
 0121                    continue;
 122                }
 123
 200124                if (i >= transforms.Length)
 0125                {
 0126                    Debug.LogWarning("No transform for instance index [" + i + "] " +
 127                        "for instancer: " + pointInstancerPath);
 0128                    break;
 129                }
 130
 200131                var xf = transforms[i];
 132
 200133                var instanceName = $"{goMaster.name}_{i}";
 134
 135                // If the old instance exists, we must destroy it to avoid a duplicate
 136                // because the prototypes may have changed during re-import
 200137                var existingInstance = root.transform.Find(instanceName);
 200138                if (existingInstance != null)
 100139                {
 100140                    GameObject.DestroyImmediate(existingInstance.gameObject);
 100141                }
 142
 200143                var goInstance = GameObject.Instantiate(goMaster, root.transform);
 200144                goInstance.SetActive(true);
 200145                goInstance.name = instanceName;
 200146                XformImporter.BuildXform(xf, goInstance, options);
 147
 200148                primMap.AddInstance(goInstance);
 200149                i++;
 200150            }
 2151        }
 152
 153        private static void EnableGpuInstancing(GameObject go)
 0154        {
 0155            foreach (MeshRenderer mr in go.GetComponentsInChildren<MeshRenderer>())
 0156            {
 0157                if (mr.sharedMaterial != null && !mr.sharedMaterial.enableInstancing)
 0158                {
 0159                    mr.sharedMaterial = Material.Instantiate(mr.sharedMaterial);
 0160                    mr.sharedMaterial.enableInstancing = true;
 0161                }
 162
 0163                for (int i = 0; i < mr.sharedMaterials.Length; i++)
 0164                {
 0165                    var im = mr.sharedMaterials[i];
 0166                    if (im == null || im.enableInstancing == true)
 0167                    {
 0168                        continue;
 169                    }
 170
 0171                    mr.sharedMaterials[i] = Material.Instantiate(im);
 0172                    mr.sharedMaterials[i].enableInstancing = true;
 0173                }
 0174            }
 0175        }
 176    }
 177}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialExporter.html new file mode 100644 index 000000000..bb0d237a6 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialExporter.html @@ -0,0 +1,223 @@ + + + + + + +Unity.Formats.USD.MaterialExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MaterialExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialExporter.cs
Covered lines:44
Uncovered lines:6
Coverable lines:50
Total lines:119
Line coverage:88% (44 of 50)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MaterialExporter()0%000100%
ExportMaterial(...)0%00081.25%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public static class MaterialExporter
 23    {
 24        public delegate void ExportHandler(Scene scene,
 25            string usdShaderPath,
 26            Material material,
 27            UnityPreviewSurfaceSample surface,
 28            string destTexturePath);
 29
 230        public static readonly string kStandardFallbackHandler = "USD.NET/Fallback/Standard";
 231        public static readonly string kHdrpFallbackHandler = "USD.NET/Fallback/HDRP";
 232        public static readonly string kLwrpFallbackHandler = "USD.NET/Fallback/LWRP";
 33
 34        /// <summary>
 35        /// The ExportRegistry is a mapping from Unity shader name (e.g. "Standard") to ExportHandler.
 36        /// When exporting a Material, the shader name is used to lookup the export hanlder function
 37        /// in this registry.
 38        /// </summary>
 239        static public Dictionary<string, ExportHandler> ExportRegistry
 40            = new Dictionary<string, ExportHandler>();
 41
 42        static MaterialExporter()
 243        {
 244            ExportRegistry.Add("Standard",
 45                StandardShaderExporter.ExportStandard);
 246            ExportRegistry.Add("Standard (Roughness setup)",
 47                StandardShaderExporter.ExportStandardRoughness);
 248            ExportRegistry.Add("Standard (Specular setup)",
 49                StandardShaderExporter.ExportStandardSpecular);
 50
 251            ExportRegistry.Add("HDRenderPipeline/Lit",
 52                HdrpShaderExporter.ExportLit);
 253            ExportRegistry.Add("HDRenderPipeline/LitTessellation",
 54                HdrpShaderExporter.ExportLit);
 255            ExportRegistry.Add("HDRenderPipeline/LayeredLit",
 56                HdrpShaderExporter.ExportLit);
 257            ExportRegistry.Add("HDRenderPipeline/LayeredLitTessellation",
 58                HdrpShaderExporter.ExportLit);
 59
 260            ExportRegistry.Add("HDRP/Lit",
 61                HdrpShaderExporter.ExportLit);
 262            ExportRegistry.Add("HDRP/LitTessellation",
 63                HdrpShaderExporter.ExportLit);
 264            ExportRegistry.Add("HDRP/LayeredLit",
 65                HdrpShaderExporter.ExportLit);
 266            ExportRegistry.Add("HDRP/LayeredLitTessellation",
 67                HdrpShaderExporter.ExportLit);
 68
 269            ExportRegistry.Add(kStandardFallbackHandler,
 70                StandardShaderExporter.ExportGeneric);
 271        }
 72
 73        public static void ExportMaterial(Scene scene, Material mat, string usdMaterialPath)
 674        {
 675            string shaderPath = usdMaterialPath + "/PreviewSurface";
 76
 677            var material = new MaterialSample();
 678            material.surface.SetConnectedPath(shaderPath, "outputs:surface");
 679            var origTime = scene.Time;
 80
 81            try
 682            {
 683                scene.Time = null;
 684                scene.Write(usdMaterialPath, material);
 685            }
 86            finally
 687            {
 688                scene.Time = origTime;
 689            }
 90
 691            var shader = new UnityPreviewSurfaceSample();
 692            var texPath = /*TODO: this should be explicit*/
 93                System.IO.Path.GetDirectoryName(scene.FilePath);
 94
 695            ExportHandler handler = null;
 696            if (!ExportRegistry.TryGetValue(mat.shader.name, out handler))
 097            {
 098                handler = ExportRegistry[kStandardFallbackHandler];
 099            }
 100
 6101            if (handler == null)
 0102            {
 0103                Debug.LogException(new System.Exception("Could not find handler to export shader: " + mat.shader.name));
 0104                return;
 105            }
 106
 107            try
 6108            {
 6109                scene.Time = null;
 6110                handler(scene, shaderPath, mat, shader, texPath);
 6111                scene.Write(shaderPath, shader);
 6112            }
 113            finally
 6114            {
 6115                scene.Time = origTime;
 6116            }
 6117        }
 118    }
 119}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialImporter.html new file mode 100644 index 000000000..f5955d59c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialImporter.html @@ -0,0 +1,503 @@ + + + + + + +Unity.Formats.USD.MaterialImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MaterialImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialImporter.cs
Covered lines:53
Uncovered lines:167
Coverable lines:220
Total lines:389
Line coverage:24% (53 of 220)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MaterialImporter()0%000100%
ProcessMaterialBindings(...)0%00080%
BuildMaterial(...)0%00046.15%
ImportConnectedTexture[T](...)0%0000%
DefaultTextureResolver(...)0%0000%
CombineRoughness(...)0%0000%
GetSurfaceShaderPrim(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.IO;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    /// <summary>
 23    /// A collection of methods used for importing USD Material data into Unity.
 24    /// </summary>
 25    public static class MaterialImporter
 26    {
 27        // Cache the token so we don't create a new one on every use.
 28        // This value should come from USD, however it's currently only a defacto standard.
 229        private static readonly pxr.TfToken materialBindToken = new pxr.TfToken("materialBind");
 30
 31        private static Material AlbedoGlossCombiner;
 32
 33        public delegate Texture2D TextureResolver(pxr.SdfAssetPath textureAssetPath,
 34            bool isNormalMap,
 35            SceneImportOptions importOptions);
 36
 37        /// <summary>
 38        /// A callback that allows custom texture resolution logic.
 39        /// </summary>
 40        /// <remarks>
 41        /// Note that this method is only called when texture import is enabled. If this event is wired
 42        /// up, it must return a value, returning null will cause the texture to be skipped. The same
 43        /// texture may be resolved multiple times as needed.
 44        /// </remarks>
 45        public static TextureResolver OnResolveTexture;
 46
 47        /// <summary>
 48        /// Computes the bound material using UsdShade's inherited binding logic.
 49        /// If a material is bound, the request callback is executed to enable the caller to bind the
 50        /// material to the Unity geometry.
 51        /// </summary>
 52        public static void ProcessMaterialBindings(Scene scene, SceneImportOptions importOptions)
 7353        {
 7354            var requests = importOptions.materialMap.ClearRequestedBindings();
 7355            var prims = new pxr.UsdPrimVector();
 22156            foreach (var pathAndRequest in requests)
 157            {
 158                var prim = scene.GetPrimAtPath(pathAndRequest.Key);
 159                if (prim == null)
 060                {
 061                    continue;
 62                }
 63
 164                prims.Add(prim);
 165            }
 66
 7367            var matVector = pxr.UsdShadeMaterialBindingAPI.ComputeBoundMaterials(prims, materialBindToken);
 7368            var matIndex = -1;
 69
 22170            foreach (pxr.UsdShadeMaterial usdMat in matVector)
 171            {
 172                matIndex++;
 173                Material unityMat = importOptions.materialMap[usdMat.GetPath()];
 74
 175                if (unityMat == null)
 076                {
 077                    continue;
 78                }
 79
 80                // PERF: this is slow and garbage-y.
 181                string meshPath = prims[matIndex].GetPath();
 82
 183                if (!requests.ContainsKey(meshPath))
 084                {
 085                    Debug.LogError("Source object key not found: " + meshPath);
 086                    continue;
 87                }
 88
 189                System.Collections.Generic.List<string> primvars
 90                    = importOptions.materialMap.GetPrimvars(usdMat.GetPath());
 91
 192                requests[meshPath](scene, unityMat, primvars);
 193            }
 7394        }
 95
 96        /// <summary>
 97        /// Builds a Unity Material from the given USD material sample.
 98        /// </summary>
 99        public static Material BuildMaterial(Scene scene,
 100            string materialPath,
 101            MaterialSample sample,
 102            SceneImportOptions options)
 1103        {
 1104            if (string.IsNullOrEmpty(sample.surface.connectedPath))
 0105            {
 0106                return null;
 107            }
 108
 1109            var previewSurf = new UnityPreviewSurfaceSample();
 1110            scene.Read(new pxr.SdfPath(sample.surface.connectedPath).GetPrimPath(), previewSurf);
 111
 112            // Currently, only UsdPreviewSurface is supported.
 1113            if (previewSurf.id == null || previewSurf.id != "UsdPreviewSurface")
 0114            {
 0115                Debug.LogWarning("Unknown surface type: <" + sample.surface.connectedPath + ">"
 116                    + "Surface ID: " + previewSurf.id);
 0117                return null;
 118            }
 119
 1120            Material mat = null;
 1121            if (options.materialMap.useOriginalShaderIfAvailable && !string.IsNullOrEmpty(previewSurf.unity.shaderName))
 0122            {
 123                // We may or may not have the original shader.
 0124                var shader = Shader.Find(previewSurf.unity.shaderName);
 0125                if (shader)
 0126                {
 0127                    mat = new Material(shader);
 0128                    mat.shaderKeywords = previewSurf.unity.shaderKeywords;
 0129                }
 130                else
 0131                {
 0132                    Debug.LogWarning("Original shader not found: " + previewSurf.unity.shaderName);
 0133                }
 0134            }
 135
 1136            if (mat == null)
 1137            {
 1138                if (previewSurf.useSpecularWorkflow.defaultValue == 1)
 1139                {
 140                    // Metallic workflow.
 1141                    mat = Material.Instantiate(options.materialMap.SpecularWorkflowMaterial);
 1142                }
 143                else
 0144                {
 145                    // Metallic workflow.
 0146                    mat = Material.Instantiate(options.materialMap.MetallicWorkflowMaterial);
 0147                }
 1148            }
 149
 3150            foreach (var kvp in previewSurf.unity.colorArgs)
 0151            {
 0152                mat.SetColor(kvp.Key, kvp.Value);
 0153            }
 154
 3155            foreach (var kvp in previewSurf.unity.floatArgs)
 0156            {
 0157                mat.SetFloat(kvp.Key, kvp.Value);
 0158            }
 159
 3160            foreach (var kvp in previewSurf.unity.vectorArgs)
 0161            {
 0162                mat.SetVector(kvp.Key, kvp.Value);
 0163            }
 164
 1165            var pipeline = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
 1166            if (!pipeline)
 1167            {
 1168                var matAdapter = new StandardShaderImporter(mat);
 1169                matAdapter.ImportParametersFromUsd(scene, materialPath, sample, previewSurf, options);
 1170                matAdapter.ImportFromUsd();
 1171            }
 0172            else if (pipeline.GetType().Name == "HDRenderPipelineAsset")
 0173            {
 174                // Robustness: Comparing a strng ^ here is not great, but there is no other option.
 0175                var matAdapter = new HdrpShaderImporter(mat);
 0176                matAdapter.ImportParametersFromUsd(scene, materialPath, sample, previewSurf, options);
 0177                matAdapter.ImportFromUsd();
 0178            }
 179            else
 0180            {
 181                // Fallback to the Standard importer, which may pickup some attributes by luck.
 0182                var matAdapter = new StandardShaderImporter(mat);
 0183                matAdapter.ImportParametersFromUsd(scene, materialPath, sample, previewSurf, options);
 0184                matAdapter.ImportFromUsd();
 0185            }
 186
 187            // Get the material name from the path
 1188            if (mat != null && !string.IsNullOrEmpty(materialPath))
 1189            {
 1190                mat.name = new pxr.SdfPath(materialPath).GetName();
 1191            }
 192
 1193            return mat;
 1194        }
 195
 196        public static Texture2D ImportConnectedTexture<T>(Scene scene,
 197            Connectable<T> connection,
 198            bool isNormalMap,
 199            SceneImportOptions options,
 200            out string uvPrimvar)
 0201        {
 0202            uvPrimvar = null;
 203
 204            // TODO: look for the expected texture/primvar reader pair.
 0205            var textureSample = new TextureReaderSample();
 0206            var connectedPrimPath = scene.GetSdfPath(connection.connectedPath).GetPrimPath();
 0207            Texture2D result = null;
 208
 0209            scene.Read(connectedPrimPath, textureSample);
 210
 0211            if (textureSample.file.defaultValue != null &&
 212                !string.IsNullOrEmpty(textureSample.file.defaultValue.GetResolvedPath()))
 0213            {
 0214                if (OnResolveTexture != null)
 0215                {
 0216                    result = OnResolveTexture(textureSample.file.defaultValue, isNormalMap, options);
 0217                }
 218                else
 0219                {
 0220                    result = DefaultTextureResolver(textureSample.file.defaultValue, isNormalMap, options);
 0221                }
 0222            }
 223
 0224            Connectable<Vector2> st = textureSample.st;
 0225            if (st != null && st.IsConnected() && !string.IsNullOrEmpty(st.connectedPath))
 0226            {
 0227                var pvSrc = new PrimvarReaderSample<Vector2>();
 0228                scene.Read(new pxr.SdfPath(textureSample.st.connectedPath).GetPrimPath(), pvSrc);
 229
 0230                if (pvSrc.varname != null)
 0231                {
 0232                    if (pvSrc.varname.IsConnected())
 0233                    {
 0234                        var connPath = new pxr.SdfPath(pvSrc.varname.GetConnectedPath());
 0235                        var attr = scene.GetAttributeAtPath(connPath);
 0236                        if (attr != null)
 0237                        {
 0238                            var value = attr.Get(scene.Time);
 0239                            uvPrimvar = pxr.UsdCs.VtValueToTfToken(value).ToString();
 0240                        }
 241                        else
 0242                        {
 0243                            Debug.LogWarning("No primvar name was provided at the connected path: " + connPath);
 0244                            uvPrimvar = "";
 0245                        }
 0246                    }
 0247                    else if (pvSrc.varname.defaultValue != null)
 0248                    {
 249                        // Ask the mesh importer to load the specified texcoord.
 250                        // This must be a callback, since materials-to-meshes are one-to-many.
 0251                        uvPrimvar = pvSrc.varname.defaultValue;
 0252                    }
 0253                }
 0254            }
 255
 0256            return result;
 0257        }
 258
 259        /// <summary>
 260        /// Private default texture resolver. Copies the given texture into the asset database.
 261        /// </summary>
 262        private static Texture2D DefaultTextureResolver(pxr.SdfAssetPath textureAssetPath,
 263            bool isNormalMap,
 264            SceneImportOptions options)
 0265        {
 266#if UNITY_EDITOR
 0267            if (!File.Exists(textureAssetPath.GetResolvedPath()))
 0268            {
 0269                return null;
 270            }
 271
 0272            string sourcePath = textureAssetPath.GetResolvedPath();
 0273            string destPath = Path.Combine(options.projectAssetPath, Path.GetFileName(sourcePath));
 0274            string assetPath = options.projectAssetPath + Path.GetFileName(sourcePath);
 275
 0276            string fullPath = destPath;
 0277            if (fullPath.StartsWith("Assets/"))
 0278            {
 0279                fullPath = fullPath.Substring("Assets/".Length);
 0280            }
 281
 0282            if (!File.Exists(destPath))
 0283            {
 0284                UnityEditor.FileUtil.CopyFileOrDirectory(sourcePath, destPath);
 0285                UnityEditor.AssetDatabase.ImportAsset(assetPath);
 0286                UnityEditor.TextureImporter texImporter =
 287                    (UnityEditor.TextureImporter)UnityEditor.AssetImporter.GetAtPath(assetPath);
 0288                if (texImporter == null)
 0289                {
 0290                    Debug.LogError("Failed to load asset: " + assetPath);
 0291                    return null;
 292                }
 293                else
 0294                {
 0295                    texImporter.isReadable = true;
 0296                    if (isNormalMap)
 0297                    {
 0298                        texImporter.convertToNormalmap = true;
 0299                        texImporter.textureType = UnityEditor.TextureImporterType.NormalMap;
 0300                    }
 301
 0302                    UnityEditor.EditorUtility.SetDirty(texImporter);
 0303                    texImporter.SaveAndReimport();
 0304                }
 0305            }
 306
 0307            return (Texture2D)UnityEditor.AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D));
 308#else
 309            return null;
 310#endif
 0311        }
 312
 313        /// <summary>
 314        /// Copies the roughness texture into the alpha channel fo the rgb texture, inverting it to
 315        /// convert roughness into gloss.
 316        /// </summary>
 317        public static Texture2D CombineRoughness(Texture2D rgbTex,
 318            Texture2D roughnessTex,
 319            string fileNameSuffix)
 0320        {
 0321            if (!AlbedoGlossCombiner)
 0322            {
 0323                AlbedoGlossCombiner = new Material(Shader.Find("Hidden/USD/CombineAndConvertRoughness"));
 0324            }
 325
 0326            var baseTex = rgbTex ? rgbTex : roughnessTex;
 0327            var newTex = new Texture2D(baseTex.width, baseTex.height,
 328                TextureFormat.ARGB32, true);
 0329            AlbedoGlossCombiner.SetTexture("_RoughnessTex", roughnessTex);
 0330            var tmp = RenderTexture.GetTemporary(baseTex.width, baseTex.height, 0,
 331                RenderTextureFormat.ARGB32);
 0332            Graphics.Blit(rgbTex, tmp, AlbedoGlossCombiner);
 0333            RenderTexture.active = tmp;
 0334            newTex.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
 0335            newTex.Apply();
 0336            RenderTexture.ReleaseTemporary(tmp);
 337
 338#if UNITY_EDITOR
 0339            var assetPath = UnityEditor.AssetDatabase.GetAssetPath(baseTex.GetInstanceID());
 340
 0341            var bytes = newTex.EncodeToPNG();
 0342            var newAssetPath = Path.ChangeExtension(assetPath, fileNameSuffix + ".png");
 0343            File.WriteAllBytes(newAssetPath, bytes);
 0344            UnityEditor.AssetDatabase.ImportAsset(newAssetPath);
 0345            var texImporter = (UnityEditor.TextureImporter)UnityEditor.AssetImporter.GetAtPath(newAssetPath);
 0346            UnityEditor.EditorUtility.SetDirty(texImporter);
 0347            texImporter.SaveAndReimport();
 348#endif
 349            // To get the correct file ID, the texture must be reloaded from the asset path.
 0350            Texture2D.DestroyImmediate(newTex);
 351#if UNITY_EDITOR
 0352            return (Texture2D)UnityEditor.AssetDatabase.LoadAssetAtPath(newAssetPath, typeof(Texture2D));
 353#else
 354            return null;
 355#endif
 0356        }
 357
 358        /// <summary>
 359        /// Reads and returns the UsdPreviewSurface data for the prim at the given path, if present.
 360        /// </summary>
 361        /// <param name="scene">The USD scene object.</param>
 362        /// <param name="primPath">The path to the object in the USD scene.</param>
 363        /// <returns>A PreviewSurfaceSample if found, otherwise null.</returns>
 364        public static UnityPreviewSurfaceSample GetSurfaceShaderPrim(Scene scene, string primPath)
 0365        {
 0366            var materialBinding = new MaterialBindingSample();
 0367            scene.Read(primPath, materialBinding);
 368
 0369            var matPath = materialBinding.binding.GetTarget(0);
 0370            if (matPath == null)
 0371            {
 372                //Debug.LogWarning("No material binding found at: <" + meshPath + ">");
 0373                return null;
 374            }
 375
 0376            var materialSample = new MaterialSample();
 0377            scene.Read(matPath, materialSample);
 0378            if (string.IsNullOrEmpty(materialSample.surface.connectedPath))
 0379            {
 0380                Debug.LogWarning("Material surface not connected: <" + matPath + ">");
 0381            }
 382
 0383            var exportSurf = new UnityPreviewSurfaceSample();
 0384            scene.Read(new pxr.SdfPath(materialSample.surface.connectedPath).GetPrimPath(), exportSurf);
 385
 0386            return exportSurf;
 0387        }
 388    }
 389}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialMap.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialMap.html new file mode 100644 index 000000000..11fc758ef --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MaterialMap.html @@ -0,0 +1,339 @@ + + + + + + +Unity.Formats.USD.MaterialMap - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MaterialMap
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialMap.cs
Covered lines:65
Uncovered lines:15
Coverable lines:80
Total lines:211
Line coverage:81.2% (65 of 80)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MaterialMap()0%000100%
InstantiateMaterials()0%00064.29%
ClearRequestedBindings()0%000100%
RequestBinding(...)0%000100%
GetPrimvars(...)0%000100%
SetPrimvars(...)0%000100%
InstantiateSolidColor(...)0%000100%
AssignColor(...)0%00070%
GetEnumerator()0%0000%
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,UnityEngine.Material>>.GetEnumerator()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/MaterialMap.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections;
 16using System.Collections.Generic;
 17using UnityEngine;
 18using USD.NET;
 19
 20namespace Unity.Formats.USD
 21{
 22    /// <summary>
 23    /// A mapping from USD shader ID to Unity Material.
 24    /// </summary>
 25    public class MaterialMap : IEnumerable<KeyValuePair<string, Material>>
 26    {
 27        /// <summary>
 28        /// A callback to preform the material binding when requesting bindings.
 29        /// </summary>
 30        /// <param name="mat">The new material to bind.</param>
 31        public delegate void MaterialBinder(Scene scene,
 32            Material mat,
 33            List<string> uvPrimvars);
 34
 35        /// <summary>
 36        /// A mapping from USD shader ID to Unity material.
 37        /// </summary>
 9638        private Dictionary<string, Material> m_map = new Dictionary<string, Material>();
 39
 9640        private Dictionary<Color, Material> m_colorMap = new Dictionary<Color, Material>();
 41
 42        /// <summary>
 43        /// Bindings requested, to be processed in bulk.
 44        /// </summary>
 9645        private Dictionary<string, MaterialBinder> m_requestedBindings = new Dictionary<string, MaterialBinder>();
 46
 9647        private Dictionary<string, List<string>> m_primvars = new Dictionary<string, List<string>>();
 48
 49        /// <summary>
 50        /// Looks for additional metadata describing the original shader name, rather than using
 51        /// the generic spec/metallic workflow shaders.
 52        /// </summary>
 53        public bool useOriginalShaderIfAvailable;
 54
 55        Material m_displayColorMaterial, m_specularWorkflowMaterial, m_metallicWorkflowMaterial;
 56
 57        /// <summary>
 58        /// A material to use when no material could be found.
 59        /// </summary>
 60        public Material DisplayColorMaterial
 61        {
 62            get
 11963            {
 17464                if (m_displayColorMaterial == null) InstantiateMaterials();
 11965                return m_displayColorMaterial;
 11966            }
 22567            set { m_displayColorMaterial = value; }
 68        }
 69
 70        public Material SpecularWorkflowMaterial
 71        {
 72            get
 6573            {
 6674                if (m_specularWorkflowMaterial == null) InstantiateMaterials();
 6575                return m_specularWorkflowMaterial;
 6576            }
 22577            set { m_specularWorkflowMaterial = value; }
 78        }
 79
 80        public Material MetallicWorkflowMaterial
 81        {
 82            get
 6483            {
 6484                if (m_metallicWorkflowMaterial == null) InstantiateMaterials();
 6485                return m_metallicWorkflowMaterial;
 6486            }
 22587            set { m_metallicWorkflowMaterial = value; }
 88        }
 89
 90        void InstantiateMaterials()
 5691        {
 5692            var pipeline = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
 5693            if (!pipeline)
 5694            {
 95                // Fallback to the built-in render pipeline, assume Standard PBS shader.
 5696                SpecularWorkflowMaterial = new Material(Shader.Find("Standard (Specular setup)"));
 5697                MetallicWorkflowMaterial = new Material(Shader.Find("Standard"));
 5698                DisplayColorMaterial = new Material(Shader.Find("USD/StandardVertexColor"));
 5699            }
 100            else
 0101            {
 102#if UNITY_2019_1_OR_NEWER
 0103                SpecularWorkflowMaterial = Material.Instantiate(pipeline.defaultMaterial);
 0104                MetallicWorkflowMaterial = Material.Instantiate(pipeline.defaultMaterial);
 105#else
 106                SpecularWorkflowMaterial = Material.Instantiate(pipeline.GetDefaultMaterial());
 107                MetallicWorkflowMaterial = Material.Instantiate(pipeline.GetDefaultMaterial());
 108#endif
 0109                DisplayColorMaterial = new Material(Shader.Find("USD/SrpVertexColor"));
 0110            }
 56111        }
 112
 113        /// <summary>
 114        /// Clears the requested bindings, returning the current queue.
 115        /// </summary>
 116        public Dictionary<string, MaterialBinder> ClearRequestedBindings()
 73117        {
 73118            var bindings = m_requestedBindings;
 73119            m_requestedBindings = new Dictionary<string, MaterialBinder>();
 120
 73121            return bindings;
 73122        }
 123
 124        /// <summary>
 125        /// Request an object to be bound at a later time in a vectorized request.
 126        /// </summary>
 127        /// <param name="usdPath">The USD path to the object.</param>
 128        /// <param name="binder">
 129        /// A callback which will accept the material and bind it to a Unity object
 130        /// </param>
 131        public void RequestBinding(string usdPath, MaterialBinder binder)
 1132        {
 1133            m_requestedBindings.Add(usdPath, binder);
 1134        }
 135
 136        /// <summary>
 137        /// Returns a shared instance of the mapped material, else null. Does not throw exceptions.
 138        /// </summary>
 139        /// <param name="shaderId">The USD path to the material</param>
 140        public Material this[string path]
 141        {
 142            get
 1143            {
 144                Material mat;
 1145                if (m_map.TryGetValue(path, out mat))
 1146                {
 1147                    return mat;
 148                }
 149
 150                // Allow invalid material lookups.
 0151                return null;
 1152            }
 3153            set { m_map[path] = value; }
 154        }
 155
 156        public List<string> GetPrimvars(string materialPath)
 1157        {
 158            List<string> primvars;
 1159            m_primvars.TryGetValue(materialPath, out primvars);
 1160            return primvars;
 1161        }
 162
 163        public void SetPrimvars(string materialPath, List<string> primvars)
 1164        {
 1165            m_primvars[materialPath] = primvars;
 1166        }
 167
 168        /// <summary>
 169        /// Returns an instance of the solid color material, setting the color. If the same color is
 170        /// requested multiple times, a shared material is returned.
 171        /// </summary>
 172        public Material InstantiateSolidColor(Color color)
 138173        {
 174            Material material;
 138175            if (m_colorMap.TryGetValue(color, out material))
 83176            {
 83177                return material;
 178            }
 179
 55180            material = Material.Instantiate(DisplayColorMaterial);
 55181            AssignColor(material, color);
 55182            m_colorMap[color] = material;
 183
 55184            return material;
 138185        }
 186
 187        public static void AssignColor(Material material, Color color)
 55188        {
 55189            if (material.HasProperty("_Color"))
 55190            {
 55191                material.color = color;
 55192            }
 193
 55194            if (material.HasProperty("_BaseColor"))
 0195            {
 0196                material.SetColor("_BaseColor", color);
 0197            }
 55198        }
 199
 200        public IEnumerator GetEnumerator()
 0201        {
 0202            return ((IEnumerable)m_map).GetEnumerator();
 0203        }
 204
 205        IEnumerator<KeyValuePair<string, Material>>
 206        IEnumerable<KeyValuePair<string, Material>>.GetEnumerator()
 0207        {
 0208            return m_map.GetEnumerator();
 0209        }
 210    }
 211}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshExporter.html new file mode 100644 index 000000000..3b11b58f9 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshExporter.html @@ -0,0 +1,597 @@ + + + + + + +Unity.Formats.USD.MeshExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MeshExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshExporter.cs
Covered lines:120
Uncovered lines:135
Coverable lines:255
Total lines:485
Line coverage:47% (120 of 255)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MeshExporter()0%000100%
ExportSkinnedMesh(...)0%0000%
ExportSkelWeights(...)0%0000%
CanReadMesh(...)0%00019.23%
ExportMesh(...)0%000100%
ExportMesh(...)0%00067.86%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public static class MeshExporter
 23    {
 224        private static pxr.TfToken m_materialBindToken = new pxr.TfToken("materialBind");
 225        private static pxr.TfToken m_subMeshesToken = new pxr.TfToken("subMeshes");
 26
 27        public static void ExportSkinnedMesh(ObjectContext objContext, ExportContext exportContext)
 028        {
 029            var smr = objContext.gameObject.GetComponent<SkinnedMeshRenderer>();
 30
 031            UnityEngine.Profiling.Profiler.BeginSample("USD: Skinned Mesh");
 032            ExportMesh(objContext,
 33                exportContext,
 34                smr.sharedMesh,
 35                smr.sharedMaterial,
 36                smr.sharedMaterials,
 37                exportMeshPose: exportContext.scene.Time == null);
 038            UnityEngine.Profiling.Profiler.EndSample();
 39
 040            if (exportContext.scene.Time != null)
 041            {
 042                return;
 43            }
 44
 45            // Note that the baked mesh no longer has the bone weights, so here we switch back to the
 46            // shared SkinnedMeshRenderer mesh.
 047            Transform rootBone = null;
 048            if (smr.rootBone != null && !exportContext.boneToRoot.TryGetValue(smr.rootBone, out rootBone))
 049            {
 050                Debug.LogWarning("Root bone not found in export context for " +
 51                    UnityTypeConverter.GetPath(smr.rootBone));
 052                return;
 53            }
 54
 055            UnityEngine.Profiling.Profiler.BeginSample("USD: Skinning Weights");
 56
 57            // Skeleton path is stored in additionalData via the SceneExporter SyncExportContext(). It
 58            // would be nice to formalize this, rather than passing it as blind data.
 059            var skeletonPath = (string)objContext.additionalData;
 60
 061            ExportSkelWeights(exportContext.scene,
 62                objContext.path,
 63                smr.sharedMesh,
 64                rootBone,
 65                smr.bones,
 66                skeletonPath);
 067            UnityEngine.Profiling.Profiler.EndSample();
 068        }
 69
 70        static void ExportSkelWeights(Scene scene,
 71            string path,
 72            Mesh unityMesh,
 73            Transform rootBone,
 74            Transform[] bones,
 75            string skeletonPath)
 076        {
 077            var sample = new SkelBindingSample();
 78
 079            sample.geomBindTransform.value = Matrix4x4.identity;
 080            sample.joints = new string[bones.Length];
 081            if (!string.IsNullOrEmpty(skeletonPath))
 082            {
 083                sample.skeleton.targetPaths = new string[] { skeletonPath };
 084            }
 85
 086            int b = 0;
 087            var rootPath = UnityTypeConverter.GetPath(rootBone);
 088            foreach (Transform bone in bones)
 089            {
 090                var bonePath = UnityTypeConverter.GetPath(bone);
 091                if (bonePath == rootPath)
 092                {
 093                    sample.joints[b++] = "/";
 094                }
 95                else
 096                {
 097                    sample.joints[b++] = bonePath.Replace(rootPath + "/", "");
 098                }
 099            }
 100
 0101            int i = 0;
 0102            int w = 0;
 0103            b = 0;
 104#if UNITY_2019
 105            var bonesPerVertex = unityMesh.GetBonesPerVertex();
 106            var unityBoneWeights = unityMesh.GetAllBoneWeights();
 107            byte maxWeightCount = 0;
 108            foreach (var c in bonesPerVertex)
 109            {
 110                maxWeightCount = maxWeightCount > c ? maxWeightCount : c;
 111            }
 112
 113            sample.jointIndices.value = new int[bonesPerVertex.Length * maxWeightCount];
 114            sample.jointIndices.elementSize = maxWeightCount;
 115            sample.jointIndices.interpolation = PrimvarInterpolation.Vertex;
 116
 117            sample.jointWeights.value = new float[bonesPerVertex.Length * maxWeightCount];
 118            sample.jointWeights.elementSize = maxWeightCount;
 119            sample.jointWeights.interpolation = PrimvarInterpolation.Vertex;
 120
 121            foreach (var weightCount in bonesPerVertex)
 122            {
 123                for (int j = 0; j < weightCount; j++)
 124                {
 125                    var bw = unityBoneWeights[b++];
 126                    sample.jointIndices.value[i++] = bw.boneIndex;
 127                    sample.jointWeights.value[w++] = bw.weight;
 128                }
 129
 130                // Unity allows a variable number of weights per bone, but we've made the array square,
 131                // which means we may need to skip a few indicies, if this vert doesn't use the max number
 132                // of weights.
 133                i += maxWeightCount - weightCount;
 134                w += maxWeightCount - weightCount;
 135            }
 136#else
 0137            var unityBoneWeights = unityMesh.boneWeights;
 138
 0139            if (unityBoneWeights.Length == 0)
 0140            {
 0141                Debug.LogWarning("Found zero bone weights at: " + path);
 0142                return;
 143            }
 144
 0145            sample.jointIndices.value = new int[unityBoneWeights.Length * 4];
 0146            sample.jointIndices.elementSize = 4;
 0147            sample.jointIndices.interpolation = PrimvarInterpolation.Vertex;
 148
 0149            sample.jointWeights.value = new float[unityBoneWeights.Length * 4];
 0150            sample.jointWeights.elementSize = 4;
 0151            sample.jointWeights.interpolation = PrimvarInterpolation.Vertex;
 152
 0153            foreach (var bone in unityBoneWeights)
 0154            {
 0155                sample.jointIndices.value[i++] = bone.boneIndex0;
 0156                sample.jointIndices.value[i++] = bone.boneIndex1;
 0157                sample.jointIndices.value[i++] = bone.boneIndex2;
 0158                sample.jointIndices.value[i++] = bone.boneIndex3;
 0159                sample.jointWeights.value[w++] = bone.weight0;
 0160                sample.jointWeights.value[w++] = bone.weight1;
 0161                sample.jointWeights.value[w++] = bone.weight2;
 0162                sample.jointWeights.value[w++] = bone.weight3;
 0163            }
 164#endif
 0165            scene.Write(path, sample);
 0166        }
 167
 168#if UNITY_EDITOR
 169        static System.Reflection.MethodInfo Mesh_canAccess;
 170
 171        // This is a workaround for a Unity peculiarity -
 172        // non-readable meshes are actually always accessible from the Editor.
 173        // We're still logging a warning since this won't work in a build.
 174        static bool CanReadMesh(Mesh mesh)
 218175        {
 218176            if (mesh.isReadable)
 218177            {
 218178                return true;
 179            }
 180
 0181            if (!Application.isPlaying)
 0182            {
 0183                return true;
 184            }
 185
 0186            if (Mesh_canAccess == null)
 0187            {
 0188                Mesh_canAccess = typeof(Mesh).GetProperty("canAccess",
 189                    System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetMethod;
 0190            }
 191
 0192            if (Mesh_canAccess != null)
 0193            {
 194                try
 0195                {
 0196                    bool canAccess = (bool)Mesh_canAccess.Invoke(mesh, null);
 0197                    if (canAccess)
 0198                    {
 0199                        Debug.LogWarning(
 200                            "The mesh you are trying to export is not marked as readable. This will only work in the Edi
 201                            mesh);
 0202                        return true;
 203                    }
 0204                }
 0205                catch
 0206                {
 207                    // There has probably been an Unity internal API update causing an error on this call.
 0208                    return false;
 209                }
 0210            }
 211
 0212            return false;
 218213        }
 214
 215#endif
 216
 217        public static void ExportMesh(ObjectContext objContext, ExportContext exportContext)
 218218        {
 218219            MeshFilter mf = objContext.gameObject.GetComponent<MeshFilter>();
 218220            MeshRenderer mr = objContext.gameObject.GetComponent<MeshRenderer>();
 221
 218222            UnityEngine.Profiling.Profiler.BeginSample("USD: Mesh");
 223
 218224            ExportMesh(objContext,
 225                exportContext,
 226                mf.sharedMesh,
 227                mr.sharedMaterial,
 228                mr.sharedMaterials);
 229
 218230            UnityEngine.Profiling.Profiler.EndSample();
 218231        }
 232
 233        static void ExportMesh(ObjectContext objContext,
 234            ExportContext exportContext,
 235            Mesh mesh,
 236            Material sharedMaterial,
 237            Material[] sharedMaterials,
 238            bool exportMeshPose = true)
 218239        {
 218240            string path = objContext.path;
 241
 218242            if (mesh == null)
 0243            {
 0244                Debug.LogWarning("Null mesh for: " + path, objContext.gameObject);
 0245                return;
 246            }
 247
 248#if UNITY_EDITOR
 218249            if (!CanReadMesh(mesh))
 0250            {
 251#else
 252            if (!mesh.isReadable)
 253            {
 254#endif
 0255                Debug.LogError(
 256                    "Mesh is not readable: " + objContext.path +
 257                    ". To fix this, enable read/write in the inspector for the source asset that you are attempting to e
 258                    objContext.gameObject);
 0259                return;
 260            }
 261
 218262            var scene = exportContext.scene;
 218263            bool unvarying = scene.Time == null;
 218264            bool slowAndSafeConversion = exportContext.basisTransform == BasisTransformation.SlowAndSafe;
 218265            var sample = (MeshSample)objContext.sample;
 218266            var go = objContext.gameObject;
 267
 218268            if (mesh.bounds.center == Vector3.zero && mesh.bounds.extents == Vector3.zero)
 0269            {
 0270                mesh.RecalculateBounds();
 0271            }
 272
 218273            sample.extent = mesh.bounds;
 274
 218275            if (slowAndSafeConversion)
 218276            {
 277                // Unity uses a forward vector that matches DirectX, but USD matches OpenGL, so a change of
 278                // basis is required. There are shortcuts, but this is fully general.
 218279                sample.ConvertTransform();
 218280                sample.extent.center = UnityTypeConverter.ChangeBasis(sample.extent.center);
 218281            }
 282
 283            // Only export the mesh topology on the first frame.
 218284            if (unvarying)
 10285            {
 286                // TODO: Technically a mesh could be the root transform, which is not handled correctly here.
 287                // It should have the same logic for root prims as in ExportXform.
 10288                sample.transform = XformExporter.GetLocalTransformMatrix(
 289                    go.transform,
 290                    scene.UpAxis == Scene.UpAxes.Z,
 291                    new pxr.SdfPath(path).IsRootPrimPath(),
 292                    exportContext.basisTransform);
 293
 10294                sample.normals = mesh.normals;
 10295                sample.points = mesh.vertices;
 10296                sample.tangents = mesh.tangents;
 297
 10298                sample.colors.SetValue(mesh.colors);
 10299                if (sample.colors.value != null && sample.colors.Length == 0)
 10300                {
 10301                    sample.colors.value = null;
 10302                }
 303
 10304                if ((sample.colors.value == null || sample.colors.Length == 0)
 305                    && (sharedMaterial != null && sharedMaterial.HasProperty("_Color")))
 10306                {
 10307                    var color = new Color[1] { sharedMaterial.color.linear };
 10308                    sample.colors.SetValue(color);
 10309                }
 310
 311                // Gah. There is no way to inspect a meshes UVs.
 10312                sample.st.SetValue(mesh.uv);
 313
 314                // Set face vertex counts and indices.
 10315                var tris = mesh.triangles;
 316
 10317                if (slowAndSafeConversion)
 10318                {
 319                    // Unity uses a forward vector that matches DirectX, but USD matches OpenGL, so a change
 320                    // of basis is required. There are shortcuts, but this is fully general.
 321
 1610322                    for (int i = 0; i < sample.points.Length; i++)
 795323                    {
 795324                        sample.points[i] = UnityTypeConverter.ChangeBasis(sample.points[i]);
 795325                        if (sample.normals != null && sample.normals.Length == sample.points.Length)
 795326                        {
 795327                            sample.normals[i] = UnityTypeConverter.ChangeBasis(sample.normals[i]);
 795328                        }
 329
 795330                        if (sample.tangents != null && sample.tangents.Length == sample.points.Length)
 795331                        {
 795332                            var w = sample.tangents[i].w;
 795333                            var t = UnityTypeConverter.ChangeBasis(sample.tangents[i]);
 795334                            sample.tangents[i] = new Vector4(t.x, t.y, t.z, w);
 795335                        }
 795336                    }
 337
 1908338                    for (int i = 0; i < tris.Length; i += 3)
 944339                    {
 944340                        var t = tris[i];
 944341                        tris[i] = tris[i + 1];
 944342                        tris[i + 1] = t;
 944343                    }
 10344                }
 345
 10346                sample.SetTriangles(tris);
 347
 10348                UnityEngine.Profiling.Profiler.BeginSample("USD: Mesh Write");
 10349                scene.Write(path, sample);
 10350                UnityEngine.Profiling.Profiler.EndSample();
 351
 352                // TODO: this is a bit of a half-measure, we need real support for primvar interpolation.
 353                // Set interpolation based on color count.
 10354                if (sample.colors != null && sample.colors.Length == 1)
 10355                {
 10356                    pxr.UsdPrim usdPrim = scene.GetPrimAtPath(path);
 10357                    var colorPrimvar =
 358                        new pxr.UsdGeomPrimvar(usdPrim.GetAttribute(pxr.UsdGeomTokens.primvarsDisplayColor));
 10359                    colorPrimvar.SetInterpolation(pxr.UsdGeomTokens.constant);
 10360                    var opacityPrimvar =
 361                        new pxr.UsdGeomPrimvar(usdPrim.GetAttribute(pxr.UsdGeomTokens.primvarsDisplayOpacity));
 10362                    opacityPrimvar.SetInterpolation(pxr.UsdGeomTokens.constant);
 10363                }
 364
 365                string usdMaterialPath;
 10366                if (exportContext.exportMaterials && sharedMaterial != null)
 10367                {
 10368                    if (!exportContext.matMap.TryGetValue(sharedMaterial, out usdMaterialPath))
 0369                    {
 0370                        Debug.LogError("Invalid material bound for: " + path);
 0371                    }
 372                    else
 10373                    {
 10374                        MaterialSample.Bind(scene, path, usdMaterialPath);
 10375                    }
 10376                }
 377
 378                // In USD subMeshes are represented as UsdGeomSubsets.
 379                // When there are multiple subMeshes, convert them into UsdGeomSubsets.
 10380                if (mesh.subMeshCount > 1)
 0381                {
 382                    // Build a table of face indices, used to convert the subMesh triangles to face indices.
 0383                    var faceTable = new Dictionary<Vector3, int>();
 0384                    for (int i = 0; i < tris.Length; i += 3)
 0385                    {
 0386                        if (!slowAndSafeConversion)
 0387                        {
 0388                            faceTable.Add(new Vector3(tris[i], tris[i + 1], tris[i + 2]), i / 3);
 0389                        }
 390                        else
 0391                        {
 392                            // Under slow and safe export, index 0 and 1 are swapped.
 393                            // This swap will not be present in the subMesh indices, so must be undone here.
 0394                            faceTable.Add(new Vector3(tris[i + 1], tris[i], tris[i + 2]), i / 3);
 0395                        }
 0396                    }
 397
 0398                    var usdPrim = scene.GetPrimAtPath(path);
 0399                    var usdGeomMesh = new pxr.UsdGeomMesh(usdPrim);
 400
 401                    // Process each subMesh and create a UsdGeomSubset of faces this subMesh targets.
 0402                    for (int si = 0; si < mesh.subMeshCount; si++)
 0403                    {
 0404                        int[] indices = mesh.GetTriangles(si);
 0405                        int[] faceIndices = new int[indices.Length / 3];
 406
 0407                        for (int i = 0; i < indices.Length; i += 3)
 0408                        {
 0409                            faceIndices[i / 3] = faceTable[new Vector3(indices[i], indices[i + 1], indices[i + 2])];
 0410                        }
 411
 0412                        var vtIndices = UnityTypeConverter.ToVtArray(faceIndices);
 0413                        var subset = pxr.UsdGeomSubset.CreateUniqueGeomSubset(
 414                            usdGeomMesh, // The object of which this subset belongs.
 415                            m_subMeshesToken, // An arbitrary name for the subset.
 416                            pxr.UsdGeomTokens.face, // Indicator that these represent face indices
 417                            vtIndices, // The actual face indices.
 418                            m_materialBindToken // familyName = "materialBind"
 419                        );
 420
 0421                        if (exportContext.exportMaterials)
 0422                        {
 0423                            if (si >= sharedMaterials.Length || !sharedMaterials[si] ||
 424                                !exportContext.matMap.TryGetValue(sharedMaterials[si], out usdMaterialPath))
 0425                            {
 0426                                Debug.LogWarning("Invalid material bound for: " + path + "\n"
 427                                    + (si >= sharedMaterials.Length
 428                                        ? "More submeshes than materials assigned."
 429                                        : (!sharedMaterials[si]
 430                                            ? "Submesh " + si + " has null material"
 431                                            : "ExportMap can't map material")));
 0432                            }
 433                            else
 0434                            {
 0435                                MaterialSample.Bind(scene, subset.GetPath(), usdMaterialPath);
 0436                            }
 0437                        }
 0438                    }
 0439                }
 10440            }
 441            else
 208442            {
 443                // Only write the transform when animating.
 208444                var meshSample = new MeshSampleBase();
 208445                meshSample.extent = sample.extent;
 208446                meshSample.transform = XformExporter.GetLocalTransformMatrix(
 447                    go.transform,
 448                    scene.UpAxis == Scene.UpAxes.Z,
 449                    new pxr.SdfPath(path).IsRootPrimPath(),
 450                    exportContext.basisTransform);
 451
 208452                if (exportMeshPose)
 208453                {
 208454                    meshSample.points = mesh.vertices;
 455
 456                    // Set face vertex counts and indices.
 208457                    var tris = mesh.triangles;
 458
 208459                    if (slowAndSafeConversion)
 208460                    {
 461                        // Unity uses a forward vector that matches DirectX, but USD matches OpenGL, so a change
 462                        // of basis is required. There are shortcuts, but this is fully general.
 84770463                        for (int i = 0; i < meshSample.points.Length; i++)
 42177464                        {
 42177465                            meshSample.points[i] = UnityTypeConverter.ChangeBasis(meshSample.points[i]);
 42177466                        }
 467
 115824468                        for (int i = 0; i < tris.Length; i += 3)
 57704469                        {
 57704470                            var t = tris[i];
 57704471                            tris[i] = tris[i + 1];
 57704472                            tris[i + 1] = t;
 57704473                        }
 208474                    }
 475
 208476                    sample.SetTriangles(tris);
 208477                }
 478
 208479                UnityEngine.Profiling.Profiler.BeginSample("USD: Mesh Write");
 208480                scene.Write(path, meshSample);
 208481                UnityEngine.Profiling.Profiler.EndSample();
 208482            }
 218483        }
 484    }
 485}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportOptions.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportOptions.html new file mode 100644 index 000000000..2ebdaad52 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportOptions.html @@ -0,0 +1,216 @@ + + + + + + +Unity.Formats.USD.MeshImportOptions - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MeshImportOptions
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImportOptions.cs
Covered lines:14
Uncovered lines:0
Coverable lines:14
Total lines:114
Line coverage:100% (14 of 14)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MeshImportOptions()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImportOptions.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15namespace Unity.Formats.USD
 16{
 17    /// <summary>
 18    /// Indicates how an attribute should be imported.
 19    /// </summary>
 20    public enum ImportMode
 21    {
 22        /// <summary>
 23        /// The value is imported if authored, otherwise null/default.
 24        /// </summary>
 25        Import,
 26
 27        /// <summary>
 28        /// The value is imported if authored, else the value is computed (if possible).
 29        /// </summary>
 30        ImportOrCompute,
 31
 32        /// <summary>
 33        /// The value is only computed (if possible), authored values are ignored.
 34        /// </summary>
 35        Compute,
 36
 37        /// <summary>
 38        /// The authored value is ignored and no value is computed.
 39        /// </summary>
 40        Ignore,
 41    }
 42
 43    /// <summary>
 44    /// Indicates how values are imported from the given scene into a UnityEngine.Mesh object.
 45    /// </summary>
 46    [System.Serializable]
 47    public class MeshImportOptions
 48    {
 49        /// <summary>
 50        /// When true, instance cubes onto each joint of the rest pose.
 51        /// </summary>
 9652        public bool debugShowSkeletonRestPose = false;
 53
 54        /// <summary>
 55        /// When true, instance cubes onto each joint of the bind pose.
 56        /// These cubes will be presented in world space, the inverse of the actual bind pose.
 57        /// </summary>
 9658        public bool debugShowSkeletonBindPose = false;
 59
 60        /// <summary>
 61        /// If true, the vertex positions of the mesh will be imported.
 62        /// </summary>
 9663        public ImportMode points = ImportMode.Import;
 64
 65        /// <summary>
 66        /// If true, the topology (triangles/faces) of the mesh will be imported.
 67        /// </summary>
 9668        public ImportMode topology = ImportMode.Import;
 69
 70        /// <summary>
 71        /// If true, triangulates the mesh. Should only be set to false if the mesh is guaranteed
 72        /// to be a valid triangle mesh before import.
 73        /// </summary>
 9674        public bool triangulateMesh = true;
 75
 76        /// <summary>
 77        /// If true, a secondary UV set will be generated automatically for lightmapping.
 78        /// </summary>
 9679        public bool generateLightmapUVs = false;
 80
 81        #region "Advanced Unwrapping Options"
 82
 83        /// <summary>
 84        /// Maximum allowed angle distortion (0..1).
 85        /// </summary>
 9686        public float unwrapAngleError = .08f;
 87
 88        /// <summary>
 89        /// Maximum allowed area distortion (0..1).
 90        /// </summary>
 9691        public float unwrapAreaError = .15f;
 92
 93        /// <summary>
 94        /// This angle (in degrees) or greater between triangles will cause seam to be created.
 95        /// </summary>
 9696        public float unwrapHardAngle = 88;
 97
 98        /// <summary>
 99        /// How much uv-islands will be padded, in pixels.
 100        /// </summary>
 101        /// <remarks>
 102        /// Note that the Unity UnwrapParams API is actually specified in a unitless number. To convert
 103        /// pixels to this unitless value, this number is divided by 1024.
 104        /// </remarks>
 96105        public int unwrapPackMargin = 4;
 106
 107        #endregion
 108
 96109        public ImportMode color = ImportMode.Import;
 96110        public ImportMode normals = ImportMode.ImportOrCompute;
 96111        public ImportMode tangents = ImportMode.ImportOrCompute;
 96112        public ImportMode boundingBox = ImportMode.ImportOrCompute;
 113    }
 114}
+
+
+
+

Methods/Properties

+MeshImportOptions()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportStrategy.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportStrategy.html new file mode 100644 index 000000000..1c79efcc3 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImportStrategy.html @@ -0,0 +1,924 @@ + + + + + + +Unity.Formats.USD.MeshImportStrategy - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MeshImportStrategy
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs
Covered lines:75
Uncovered lines:48
Coverable lines:123
Total lines:818
Line coverage:60.9% (75 of 123)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MeshImportStrategy(...)0%000100%
BeginReading(...)0%000100%
Import()0%00058.97%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using UnityEngine;
 18using UnityEngine.Profiling;
 19using USD.NET;
 20using USD.NET.Unity;
 21using Unity.Jobs;
 22using pxr;
 23using Unity.Collections;
 24
 25namespace Unity.Formats.USD
 26{
 27    /// <summary>
 28    /// A callback function wich integrates the given sample into the given GameObject.
 29    /// </summary>
 30    public delegate void MeshImportFunction<T>(string path,
 31        T sample,
 32        MeshImporter.GeometrySubsets subsets,
 33        GameObject go,
 34        SceneImportOptions option,
 35        bool isDynamic,
 36        UsdSkelSkinningQuery query = null) where T : SampleBase, new();
 37
 38    /// <summary>
 39    /// This class is responsible for importing mesh samples into Unity. By swapping out the
 40    /// MeshImportFunctions, the import behavior can be customized.
 41    /// </summary>
 42    public class MeshImportStrategy : IImporter
 43    {
 44        MeshImportFunction<SanitizedMeshSample> m_meshImporter;
 45        MeshImportFunction<SanitizedMeshSample> m_skinnedMeshImporter;
 46
 247        public MeshImportStrategy(MeshImportFunction<SanitizedMeshSample> meshImporter,
 48                                  MeshImportFunction<SanitizedMeshSample> skinnedMeshImporter)
 249        {
 250            m_meshImporter = meshImporter;
 251            m_skinnedMeshImporter = skinnedMeshImporter;
 252        }
 53
 54        ReadAllJob<SanitizedMeshSample> m_readMeshesJob;
 55
 56        public void BeginReading(Scene scene, PrimMap primMap, SceneImportOptions importOptions)
 7357        {
 7358            m_readMeshesJob = new ReadAllJob<SanitizedMeshSample>(scene, primMap.Meshes, importOptions);
 7359            m_readMeshesJob.Schedule(primMap.Meshes.Length, 2);
 7360        }
 61
 62        public System.Collections.IEnumerator Import(Scene scene,
 63            PrimMap primMap,
 64            SceneImportOptions importOptions)
 7365        {
 7366            System.Reflection.MemberInfo faceVertexCounts = null;
 7367            System.Reflection.MemberInfo faceVertexIndices = null;
 7368            System.Reflection.MemberInfo orientation = null;
 7369            System.Reflection.MemberInfo points = null;
 7370            System.Reflection.MemberInfo normals = null;
 7371            System.Reflection.MemberInfo colors = null;
 7372            System.Reflection.MemberInfo st = null;
 7373            System.Reflection.MemberInfo uv = null;
 7374            System.Reflection.MemberInfo uv2 = null;
 7375            System.Reflection.MemberInfo uv3 = null;
 7376            System.Reflection.MemberInfo uv4 = null;
 7377            System.Reflection.MemberInfo purpose = null;
 7378            System.Reflection.MemberInfo visibility = null;
 7379            var isDynamic = false;
 80
 7381            if (scene.AccessMask != null && scene.IsPopulatingAccessMask)
 082            {
 083                var meshType = typeof(MeshSample);
 084                faceVertexCounts = meshType.GetMember("faceVertexCounts")[0];
 085                faceVertexIndices = meshType.GetMember("faceVertexIndices")[0];
 086                orientation = meshType.GetMember("orientation")[0];
 087                points = meshType.GetMember("points")[0];
 088                normals = meshType.GetMember("normals")[0];
 089                colors = meshType.GetMember("colors")[0];
 090                st = meshType.GetMember("st")[0];
 091                uv = meshType.GetMember("uv")[0];
 092                uv2 = meshType.GetMember("uv2")[0];
 093                uv3 = meshType.GetMember("uv3")[0];
 094                uv4 = meshType.GetMember("uv4")[0];
 095                purpose = meshType.GetMember("purpose")[0];
 096                visibility = meshType.GetMember("visibility")[0];
 097            }
 98
 46199            foreach (var pathAndSample in m_readMeshesJob)
 121100            {
 121101                if (scene.AccessMask != null && scene.IsPopulatingAccessMask)
 0102                {
 103                    HashSet<System.Reflection.MemberInfo> members;
 0104                    if (scene.AccessMask.Included.TryGetValue(pathAndSample.path, out members))
 0105                    {
 0106                        if (members.Contains(faceVertexCounts)
 107                            || members.Contains(orientation)
 108                            || members.Contains(faceVertexIndices)
 109                            || members.Contains(points)
 110                            || members.Contains(normals)
 111                            || members.Contains(colors)
 112                            || members.Contains(st)
 113                            || members.Contains(uv)
 114                            || members.Contains(uv2)
 115                            || members.Contains(uv3)
 116                            || members.Contains(uv4)
 117                        )
 0118                        {
 0119                            members.Add(faceVertexCounts);
 0120                            members.Add(faceVertexIndices);
 0121                            members.Add(orientation);
 0122                            members.Add(points);
 0123                            members.Add(normals);
 0124                            members.Add(colors);
 0125                            members.Add(st);
 0126                            members.Add(uv);
 0127                            members.Add(uv2);
 0128                            members.Add(uv3);
 0129                            members.Add(uv4);
 0130                        }
 131
 0132                        if (pathAndSample.sample.purpose != Purpose.Default && !members.Contains(purpose))
 0133                        {
 0134                            members.Add(purpose);
 0135                        }
 136
 0137                        if (pathAndSample.sample.visibility != Visibility.Inherited && !members.Contains(visibility))
 0138                        {
 0139                            members.Add(visibility);
 0140                        }
 141
 0142                        isDynamic = true;
 0143                    }
 0144                }
 145
 121146                Profiler.BeginSample("USD: Build Meshes");
 147                try
 121148                {
 121149                    GameObject go = primMap[pathAndSample.path];
 121150                    NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path), importOptions);
 151
 121152                    if (importOptions.importTransforms)
 121153                    {
 121154                        Profiler.BeginSample("Build Mesh Xform");
 121155                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 121156                        Profiler.EndSample();
 121157                    }
 158
 121159                    Profiler.BeginSample("Read Mesh Subsets");
 121160                    MeshImporter.GeometrySubsets subsets = null;
 121161                    if (primMap == null || !primMap.MeshSubsets.TryGetValue(pathAndSample.path, out subsets))
 121162                    {
 121163                        subsets = MeshImporter.ReadGeomSubsets(scene, pathAndSample.path);
 121164                    }
 165
 121166                    Profiler.EndSample();
 167
 168                    UsdSkelSkinningQuery skinningQuery;
 121169                    if (importOptions.importHierarchy)
 121170                    {
 121171                        if (importOptions.importSkinning && primMap.SkelCache != null)
 121172                        {
 173                            // This is pre-cached as part of calling skelCache.Populate and IsValid indicates if we
 174                            // have the data required to setup a skinned mesh.
 121175                            Profiler.BeginSample("Get Skinning Query");
 121176                            skinningQuery = new UsdSkelSkinningQuery();
 121177                            primMap.SkinningQueries[pathAndSample.path] =
 178                                primMap.SkelCache.GetSkinningQuery(scene.GetPrimAtPath(pathAndSample.path));
 121179                            Profiler.EndSample();
 121180                        }
 181
 121182                        if (importOptions.importMeshes)
 121183                        {
 121184                            primMap.MeshSubsets[pathAndSample.path] =
 185                                MeshImporter.ReadGeomSubsets(scene, pathAndSample.path);
 121186                        }
 121187                    }
 188
 121189                    if (importOptions.importSkinning
 190                        && primMap.SkelCache != null
 191                        && primMap.SkinningQueries.TryGetValue(pathAndSample.path, out skinningQuery)
 192                        && skinningQuery.IsValid())
 9193                    {
 9194                        Profiler.BeginSample("USD: Build Skinned Mesh");
 9195                        m_skinnedMeshImporter(pathAndSample.path,
 196                            pathAndSample.sample,
 197                            subsets, go, importOptions, isDynamic, skinningQuery);
 9198                        Profiler.EndSample();
 9199                    }
 200                    else
 112201                    {
 112202                        Profiler.BeginSample("USD: Build Mesh");
 112203                        m_meshImporter(pathAndSample.path,
 204                            pathAndSample.sample,
 205                            subsets, go, importOptions, isDynamic);
 112206                        Profiler.EndSample();
 112207                    }
 121208                }
 0209                catch (Exception ex)
 0210                {
 0211                    Debug.LogException(
 212                        new SceneImporter.ImportException(
 213                            "Error processing mesh <" + pathAndSample.path + ">", ex));
 0214                }
 215
 121216                Profiler.EndSample();
 121217                yield return null;
 121218            } // foreach mesh
 73219        }
 220    }
 221
 222    /// <summary>
 223    /// A collection of methods used for importing USD Mesh data into Unity.
 224    /// </summary>
 225    public static class MeshImporter
 226    {
 227        public class GeometrySubsets
 228        {
 229            public Dictionary<string, int[]> Subsets { get; set; }
 230
 231            public GeometrySubsets()
 232            {
 233                Subsets = new Dictionary<string, int[]>();
 234            }
 235        }
 236
 237        /// <summary>
 238        /// Reads geometry subsets if authored. If not authored, returns an empty dictionary.
 239        /// </summary>
 240        public static GeometrySubsets ReadGeomSubsets(Scene scene, string path)
 241        {
 242            var result = new GeometrySubsets();
 243
 244            var prim = scene.GetPrimAtPath(path);
 245            if (prim == null || prim.IsValid() == false)
 246            {
 247                return result;
 248            }
 249
 250            var im = new pxr.UsdGeomImageable(prim);
 251            if (im._IsValid() == false)
 252            {
 253                return result;
 254            }
 255
 256            var subsets =
 257                UsdGeomSubset.GetGeomSubsets(im, UsdGeomTokens.face,
 258                    new TfToken("materialBind"));
 259
 260            // Cache these values to minimize garbage collector churn.
 261            var value = new VtValue();
 262            var defaultTime = UsdTimeCode.Default();
 263
 264            foreach (var subset in subsets)
 265            {
 266                if (!subset._IsValid())
 267                {
 268                    continue;
 269                }
 270
 271                var indices = subset.GetIndicesAttr();
 272                if (!indices.IsValid())
 273                {
 274                    continue;
 275                }
 276
 277                if (!indices.Get(value, defaultTime))
 278                {
 279                    continue;
 280                }
 281
 282                var intValue = new int[0];
 283                IntrinsicTypeConverter.FromVtArray(value, ref intValue);
 284                result.Subsets.Add(subset.GetPath(), intValue);
 285            }
 286
 287            return result;
 288        }
 289
 290        /// <summary>
 291        /// Copy mesh data from USD to Unity with the given import options, setup for skinning.
 292        /// </summary>
 293        public static void BuildSkinnedMesh(string path,
 294            SanitizedMeshSample usdMesh,
 295            GeometrySubsets geomSubsets,
 296            GameObject go,
 297            SceneImportOptions options,
 298            bool isDynamic,
 299            UsdSkelSkinningQuery skinningQuery = null)
 300        {
 301            var smr = ImporterBase.GetOrAddComponent<SkinnedMeshRenderer>(go);
 302            if (smr.sharedMesh == null)
 303            {
 304                smr.sharedMesh = new Mesh { name = UniqueMeshName(go.name) };
 305            }
 306
 307            // We only check if a mesh is dynamic when scene.IsPopulatingAccessMask is True. It only happens when a play
 308            // created, potentially way after mesh creation.
 309            if (isDynamic)
 310            {
 311                smr.sharedMesh.MarkDynamic();
 312            }
 313
 314            BuildMesh_(path, usdMesh, smr.sharedMesh, geomSubsets, go, smr, options);
 315            if (options.importSkinWeights)
 316            {
 317                ImportSkinning(path, usdMesh, smr.sharedMesh, skinningQuery);
 318            }
 319        }
 320
 321        /// <summary>
 322        /// Import skin weights and joint indices from USD.
 323        /// </summary>
 324        /// <remarks>
 325        /// JointWeights and JointIndices attribute should probably go into the MeshSample but we might not want to pay
 326        /// the deserialization cost if we don't care about skinning info. Although sanitizing the data would be easier
 327        /// if done by SanitizedMeshSample.Sanitize
 328        /// </remarks>
 329        public static void ImportSkinning(string path, SanitizedMeshSample usdMesh, Mesh unityMesh, UsdSkelSkinningQuery
 330        {
 331            // Get and validate the joint weights and indices informations.
 332            UsdGeomPrimvar jointWeights = skinningQuery.GetJointWeightsPrimvar();
 333            UsdGeomPrimvar jointIndices = skinningQuery.GetJointIndicesPrimvar();
 334
 335            if (!jointWeights.IsDefined() || !jointIndices.IsDefined())
 336            {
 337                throw new Exception("Joints information (indices and/or weights) are missing for: " + path);
 338            }
 339
 340            // TODO: Both indices and weights attributes can be animated. It's not handled yet.
 341            // TODO: Having something that convert a UsdGeomPrimvar into a PrimvarSample could help simplify this code.
 342            int[] indices = IntrinsicTypeConverter.FromVtArray((VtIntArray)jointIndices.GetAttr().Get());
 343            int indicesElementSize = jointIndices.GetElementSize();
 344            TfToken indicesInterpolation = jointIndices.GetInterpolation();
 345
 346            if (indices.Length == 0
 347                || indicesElementSize == 0
 348                || indices.Length % indicesElementSize != 0
 349                || !UsdGeomPrimvar.IsValidInterpolation(indicesInterpolation))
 350            {
 351                throw new Exception("Joint indices information are invalid or empty for: " + path);
 352            }
 353
 354            float[] weights = IntrinsicTypeConverter.FromVtArray((VtFloatArray)jointWeights.GetAttr().Get());
 355            int weightsElementSize = jointWeights.GetElementSize();
 356            TfToken weightsInterpolation = jointWeights.GetInterpolation();
 357
 358            if (weights.Length == 0
 359                || weightsElementSize == 0
 360                || weights.Length % weightsElementSize != 0
 361                || !UsdGeomPrimvar.IsValidInterpolation(weightsInterpolation))
 362            {
 363                throw new Exception("Joints weights information are invalid or empty for: " + path);
 364            }
 365
 366            var bonesPerVertex = new NativeArray<byte>(unityMesh.vertexCount, Allocator.Temp);
 367            var boneWeights1 = new NativeArray<BoneWeight1>(unityMesh.vertexCount * weightsElementSize, Allocator.Temp);
 368
 369            // Remap the vertex indices if mesh attribute have been converted to faceVarying
 370            var remapIndices = weightsInterpolation.GetString() == UsdGeomTokens.vertex
 371                && usdMesh.arePrimvarsFaceVarying;
 372
 373            int isNotConstant = weightsInterpolation.GetString() == UsdGeomTokens.constant ? 0 : 1;
 374
 375            for (var i = 0; i < unityMesh.vertexCount; i++)
 376            {
 377                var unityIndex = remapIndices ? usdMesh.triangulatedFaceVertexIndices[i] * weightsElementSize : i * weig
 378                var usdIndex = isNotConstant * unityIndex;
 379
 380                bonesPerVertex[i] = (byte)weightsElementSize;
 381
 382                for (var wi = 0; wi < weightsElementSize; wi++)
 383                {
 384                    var bw = boneWeights1[i * weightsElementSize + wi];
 385                    bw.boneIndex = indices[usdIndex + wi];
 386                    bw.weight = weights[usdIndex + wi];
 387                    boneWeights1[i * weightsElementSize + wi] = bw;
 388                }
 389            }
 390            // TODO: Investigate if bone weights should be normalized before this line.
 391            unityMesh.SetBoneWeights(bonesPerVertex, boneWeights1);
 392            bonesPerVertex.Dispose();
 393            boneWeights1.Dispose();
 394        }
 395
 396        /// <summary>
 397        /// Copy mesh data from USD to Unity with the given import options.
 398        /// </summary>
 399        public static void BuildMesh(string path,
 400            SanitizedMeshSample usdMesh,
 401            GeometrySubsets geomSubsets,
 402            GameObject go,
 403            SceneImportOptions options,
 404            bool isDynamic,
 405            UsdSkelSkinningQuery skinQuery = null)
 406        {
 407            var mf = ImporterBase.GetOrAddComponent<MeshFilter>(go);
 408            var mr = ImporterBase.GetOrAddComponent<MeshRenderer>(go);
 409            if (mf.sharedMesh == null)
 410            {
 411                mf.sharedMesh = new Mesh { name = UniqueMeshName(go.name) };
 412            }
 413
 414            // We only check if a mesh is dynamic when scene.IsPopulatingAccessMask is True. It only happens when a play
 415            // created, potentially way after mesh creation.
 416            if (isDynamic)
 417            {
 418                mf.sharedMesh.MarkDynamic();
 419            }
 420
 421            BuildMesh_(path, usdMesh, mf.sharedMesh, geomSubsets, go, mr, options);
 422        }
 423
 424        static void BuildMesh_(string path,
 425            SanitizedMeshSample usdMesh,
 426            Mesh unityMesh,
 427            GeometrySubsets geomSubsets,
 428            GameObject go,
 429            Renderer renderer,
 430            SceneImportOptions options)
 431        {
 432            //
 433            // Purpose.
 434            //
 435            // Deactivate non-geometry prims (e.g. guides, render, etc).
 436            if (usdMesh.purpose != Purpose.Default)
 437            {
 438                go.SetActive(false);
 439            }
 440
 441            //
 442            // Points.
 443            //
 444            if (options.meshOptions.points == ImportMode.Import && usdMesh.points != null)
 445            {
 446                if (usdMesh.faceVertexIndices != null)
 447                {
 448                    // Annoyingly, there is a circular dependency between vertices and triangles, which makes
 449                    // it impossible to have a fixed update order in this function. As a result, we must clear
 450                    // the triangles before setting the points, to break that dependency.
 451                    unityMesh.SetTriangles(new int[0] {}, 0);
 452                }
 453
 454                unityMesh.vertices = usdMesh.points;
 455            }
 456
 457            //
 458            // Mesh Topology.
 459            //
 460            if (options.meshOptions.topology == ImportMode.Import && usdMesh.faceVertexIndices != null)
 461            {
 462                // Remap subsets
 463                var newSubsets = new GeometrySubsets();
 464                foreach (var nameAndSubset in geomSubsets.Subsets)
 465                {
 466                    var newFaceIndices = new List<int>();
 467                    foreach (var faceIndex in nameAndSubset.Value)
 468                    {
 469                        newFaceIndices.AddRange(usdMesh.faceMapping[faceIndex]);
 470                    }
 471
 472                    newSubsets.Subsets.Add(nameAndSubset.Key, newFaceIndices.ToArray());
 473                }
 474                geomSubsets = newSubsets;
 475
 476                if (usdMesh.faceVertexIndices.Length > 65535)
 477                    unityMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
 478
 479                Profiler.BeginSample("Breakdown triangles for Mesh Subsets");
 480                if (geomSubsets.Subsets.Count == 0)
 481                {
 482                    unityMesh.triangles = usdMesh.faceVertexIndices;
 483                }
 484                else
 485                {
 486                    var usdIndices = usdMesh.faceVertexIndices;
 487                    unityMesh.subMeshCount = geomSubsets.Subsets.Count;
 488                    var subsetIndex = 0;
 489                    foreach (var kvp in geomSubsets.Subsets)
 490                    {
 491                        int[] faceIndices = kvp.Value;
 492                        var triangleIndices = new int[faceIndices.Length * 3];
 493
 494                        for (var i = 0; i < faceIndices.Length; i++)
 495                        {
 496                            triangleIndices[i * 3 + 0] = usdIndices[faceIndices[i] * 3 + 0];
 497                            triangleIndices[i * 3 + 1] = usdIndices[faceIndices[i] * 3 + 1];
 498                            triangleIndices[i * 3 + 2] = usdIndices[faceIndices[i] * 3 + 2];
 499                        }
 500
 501                        unityMesh.SetTriangles(triangleIndices, subsetIndex);
 502                        subsetIndex++;
 503                    }
 504                }
 505
 506                Profiler.EndSample(); // Breakdown triangles for Mesh Subsets
 507            }
 508
 509            //
 510            // Extent / Bounds.
 511            // TODO: move the bounds calculation to SanitizedMeshSample
 512            var hasBounds = usdMesh.extent.size.x > 0
 513                || usdMesh.extent.size.y > 0
 514                || usdMesh.extent.size.z > 0;
 515
 516            if (ShouldImport(options.meshOptions.boundingBox) && hasBounds)
 517            {
 518                Profiler.BeginSample("Import Bounds");
 519                unityMesh.bounds = usdMesh.extent;
 520                Profiler.EndSample();
 521            }
 522            else if (ShouldCompute(options.meshOptions.boundingBox))
 523            {
 524                Profiler.BeginSample("Calculate Bounds");
 525                unityMesh.RecalculateBounds();
 526                Profiler.EndSample();
 527            }
 528
 529            //
 530            // Normals.
 531            // TODO: move the normals calculation to SanitizedMeshSample
 532            if (usdMesh.normals != null && ShouldImport(options.meshOptions.normals))
 533            {
 534                Profiler.BeginSample("Import Normals");
 535                unityMesh.normals = usdMesh.normals;
 536                Profiler.EndSample(); // Import Normals
 537            }
 538            else if (ShouldCompute(options.meshOptions.tangents))
 539            {
 540                Profiler.BeginSample("Calculate Normals");
 541                unityMesh.RecalculateNormals();
 542                Profiler.EndSample(); // Calculate Normals
 543            }
 544
 545            //
 546            // Tangents.
 547            // TODO: move the tangents calculation to SanitizedMeshSample
 548            if (usdMesh.tangents != null && ShouldImport(options.meshOptions.tangents))
 549            {
 550                Profiler.BeginSample("Import Tangents");
 551                // TODO: We should check the interpolation of tangents and treat them accordingly (for now, we assume th
 552                //       are always face varying).
 553                unityMesh.tangents = usdMesh.tangents;
 554                Profiler.EndSample(); // Import Tangents
 555            }
 556            else if (ShouldCompute(options.meshOptions.tangents))
 557            {
 558                Profiler.BeginSample("Calculate Tangents");
 559                unityMesh.RecalculateTangents();
 560                Profiler.EndSample(); // Calculate Tangents
 561            }
 562
 563            //
 564            // Display Color.
 565            //
 566
 567            var mat = renderer.sharedMaterial;
 568            if (ShouldImport(options.meshOptions.color) && usdMesh.colors.value != null)
 569            {
 570                Profiler.BeginSample("Import Display Color");
 571                // NOTE: The following color conversion assumes PlayerSettings.ColorSpace == Linear.
 572                // For best performance, convert color space to linear off-line and skip conversion.
 573                if (usdMesh.colors.Length == 1) // Constant
 574                {
 575                    // Constant color can just be set on the material.
 576                    if (options.useDisplayColorAsFallbackMaterial &&
 577                        options.materialImportMode != MaterialImportMode.None)
 578                        mat = options.materialMap.InstantiateSolidColor(usdMesh.colors.value[0].gamma);
 579                }
 580                else
 581                {
 582                    unityMesh.colors = usdMesh.colors.value;
 583                }
 584
 585                Profiler.EndSample(); // Import Display Color
 586            } // should import color
 587
 588            //
 589            // UVs / Texture Coordinates.
 590            //
 591            Profiler.BeginSample("Request Material Bindings");
 592
 593            //
 594            // Materials.
 595            //
 596
 597            if (options.materialImportMode != MaterialImportMode.None)
 598            {
 599                if (mat == null) mat = options.materialMap.InstantiateSolidColor(Color.white);
 600
 601                if (unityMesh.subMeshCount == 1)
 602                {
 603                    renderer.sharedMaterial = mat;
 604                    if (options.ShouldBindMaterials)
 605                        options.materialMap.RequestBinding(
 606                            path,
 607                            (scene, boundMat, primvars) => BindMat(
 608                                scene, unityMesh, boundMat, renderer, path, primvars, usdMesh));
 609                }
 610                else
 611                {
 612                    var mats = new Material[unityMesh.subMeshCount];
 613                    for (var i = 0; i < mats.Length; i++) mats[i] = mat;
 614                    renderer.sharedMaterials = mats;
 615                    if (options.ShouldBindMaterials)
 616                    {
 617                        Debug.Assert(geomSubsets.Subsets.Count == unityMesh.subMeshCount);
 618                        var subIndex = 0;
 619                        foreach (var kvp in geomSubsets.Subsets)
 620                        {
 621                            var idx = subIndex++;
 622                            options.materialMap.RequestBinding(
 623                                kvp.Key,
 624                                (scene, boundMat, primvars) => BindMat(
 625                                    scene, unityMesh, boundMat, renderer, idx, path, primvars,
 626                                    usdMesh));
 627                        }
 628                    }
 629                }
 630            }
 631
 632            Profiler.EndSample();
 633
 634            //
 635            // Lightmap UV Unwrapping.
 636            //
 637
 638#if UNITY_EDITOR
 639            if (options.meshOptions.generateLightmapUVs)
 640            {
 641                Profiler.BeginSample("Unwrap Lightmap UVs");
 642                var unwrapSettings = new UnityEditor.UnwrapParam();
 643
 644                unwrapSettings.angleError = options.meshOptions.unwrapAngleError;
 645                unwrapSettings.areaError = options.meshOptions.unwrapAngleError;
 646                unwrapSettings.hardAngle = options.meshOptions.unwrapHardAngle;
 647
 648                // Convert pixels to unitless UV space, which is what unwrapSettings uses internally.
 649                unwrapSettings.packMargin = options.meshOptions.unwrapPackMargin / 1024.0f;
 650
 651                UnityEditor.Unwrapping.GenerateSecondaryUVSet(unityMesh, unwrapSettings);
 652                Profiler.EndSample();
 653            }
 654#else
 655            if (options.meshOptions.generateLightmapUVs)
 656            {
 657                Debug.LogWarning(
 658                    "Lightmap UVs were requested to be generated, but cannot be generated outside of the editor");
 659            }
 660#endif
 661        }
 662
 663        static void LoadPrimvars(
 664            Scene scene,
 665            Mesh unityMesh,
 666            string usdMeshPath,
 667            List<string> primvars,
 668            MeshSample sample)
 669        {
 670            if (primvars == null || primvars.Count == 0) return;
 671
 672            for (var i = 0; i < primvars.Count; i++)
 673            {
 674                try
 675                {
 676                    if (primvars[i] == "st")
 677                    {
 678                        ImportUv(unityMesh, i, sample.st);
 679                    }
 680                    else if (primvars[i] == "uv")
 681                    {
 682                        ImportUv(unityMesh, i, sample.uv);
 683                    }
 684                    else if (primvars[i] == "uv2")
 685                    {
 686                        ImportUv(unityMesh, i, sample.uv2);
 687                    }
 688                    else if (primvars[i] == "uv3")
 689                    {
 690                        ImportUv(unityMesh, i, sample.uv3);
 691                    }
 692                    else if (primvars[i] == "uv4")
 693                    {
 694                        ImportUv(unityMesh, i, sample.uv4);
 695                    }
 696                }
 697                catch (Exception ex)
 698                {
 699                    Debug.LogError(new Exception("Error reading UVs at " + usdMeshPath + "> uv-index: " + i, ex));
 700                }
 701            }
 702        }
 703
 704        static void BindMat(Scene scene,
 705            Mesh unityMesh,
 706            Material mat,
 707            Renderer renderer,
 708            string usdMeshPath,
 709            List<string> primvars,
 710            MeshSample sample)
 711        {
 712            renderer.sharedMaterial = mat;
 713            LoadPrimvars(scene, unityMesh, usdMeshPath, primvars, sample);
 714        }
 715
 716        // Pass in Unity Mesh from registration.
 717        // Pass in scene, meshPath from MaterialImporter.
 718        // Lookup material UV primvars by material path.
 719        // Read primvars from USD mesh.
 720        // Assign to UnityMesh sequentially.
 721        // Material must assign both primvar and Unity Mesh texcoord slots.
 722        static void BindMat(Scene scene,
 723            Mesh unityMesh,
 724            Material mat,
 725            Renderer renderer,
 726            int index,
 727            string usdMeshPath,
 728            List<string> primvars,
 729            MeshSample sample)
 730        {
 731            var sharedMats = renderer.sharedMaterials;
 732            sharedMats[index] = mat;
 733            renderer.sharedMaterials = sharedMats;
 734            LoadPrimvars(scene, unityMesh, usdMeshPath, primvars, sample);
 735        }
 736
 737        /// <summary>
 738        /// Attempts to build a valid per-vertex UV set from the given object. If the type T is not
 739        /// the held type of the object "uv" argument, null is returned. If there is an error such
 740        /// that the type is correct, but the uv values are somehow incompatible, error messages
 741        /// will be generated and an empty array will be returned.
 742        /// </summary>
 743        /// <returns>
 744        /// An array of size > 0 on succes, an array of size 0 on failure, or null if the given object
 745        /// is not of the desired type T.
 746        /// </returns>
 747        static T[] TryGetPrimvarValue<T>(Primvar<object> primvar)
 748        {
 749            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 750            // the actual type of value.
 751            if (primvar.value.GetType() != typeof(T[]))
 752                return null;
 753
 754            return (T[])primvar.GetValue();
 755        }
 756
 757        /// <summary>
 758        /// Imports UV data from USD into the unityMesh at the given index with the given import rules.
 759        /// </summary>
 760        static void ImportUv(
 761            Mesh unityMesh,
 762            int uvSetIndex,
 763            Primvar<object> uv)
 764        {
 765            // As in Unity, UVs are a dynamic type which can be vec2, vec3, or vec4.
 766            if (uv.GetValue() == null)
 767                return;
 768
 769            var uv2 = TryGetPrimvarValue<Vector2>(uv);
 770            if (uv2 != null)
 771            {
 772                if (uv2.Length > 0) unityMesh.SetUVs(uvSetIndex, uv2);
 773                return;
 774            }
 775
 776            var uv3 = TryGetPrimvarValue<Vector3>(uv);
 777            if (uv3 != null)
 778            {
 779                if (uv3.Length > 0) unityMesh.SetUVs(uvSetIndex, uv3);
 780                return;
 781            }
 782
 783            var uv4 = TryGetPrimvarValue<Vector4>(uv);
 784            if (uv4 != null)
 785            {
 786                if (uv4.Length > 0) unityMesh.SetUVs(uvSetIndex, uv4);
 787                return;
 788            }
 789
 790            throw new Exception("Unexpected uv type: " + uv.GetType());
 791        }
 792
 793        /// <summary>
 794        /// Returns true if the mode is Import or ImportOrCompute.
 795        /// </summary>
 796        public static bool ShouldImport(ImportMode mode)
 797        {
 798            return mode == ImportMode.Import || mode == ImportMode.ImportOrCompute;
 799        }
 800
 801        /// <summary>
 802        /// Returns true if the mode is Compute or ImportOrCompute.
 803        /// </summary>
 804        public static bool ShouldCompute(ImportMode mode)
 805        {
 806            return mode == ImportMode.Compute || mode == ImportMode.ImportOrCompute;
 807        }
 808
 809        /// <summary>
 810        /// Returns a unique mesh name by appending a short guid to the given string
 811        /// </summary>
 812        static string UniqueMeshName(string meshName)
 813        {
 814            var shortGuid = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
 815            return meshName + "_" + shortGuid.Substring(0, shortGuid.Length - 2);
 816        }
 817    }
 818}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImporter.html new file mode 100644 index 000000000..6372f2475 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_MeshImporter.html @@ -0,0 +1,948 @@ + + + + + + +Unity.Formats.USD.MeshImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.MeshImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs
Covered lines:168
Uncovered lines:158
Coverable lines:326
Total lines:818
Line coverage:51.5% (168 of 326)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GeometrySubsets()0%000100%
ReadGeomSubsets(...)0%00041.18%
BuildSkinnedMesh(...)0%00081.25%
ImportSkinning(...)0%00086.05%
BuildMesh(...)0%00076.92%
BuildMesh_(...)0%00049.69%
LoadPrimvars(...)0%00011.43%
BindMat(...)0%000100%
BindMat(...)0%0000%
TryGetPrimvarValue[T](...)0%0000%
ImportUv(...)0%0000%
ShouldImport(...)0%000100%
ShouldCompute(...)0%000100%
UniqueMeshName(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/MeshImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using UnityEngine;
 18using UnityEngine.Profiling;
 19using USD.NET;
 20using USD.NET.Unity;
 21using Unity.Jobs;
 22using pxr;
 23using Unity.Collections;
 24
 25namespace Unity.Formats.USD
 26{
 27    /// <summary>
 28    /// A callback function wich integrates the given sample into the given GameObject.
 29    /// </summary>
 30    public delegate void MeshImportFunction<T>(string path,
 31        T sample,
 32        MeshImporter.GeometrySubsets subsets,
 33        GameObject go,
 34        SceneImportOptions option,
 35        bool isDynamic,
 36        UsdSkelSkinningQuery query = null) where T : SampleBase, new();
 37
 38    /// <summary>
 39    /// This class is responsible for importing mesh samples into Unity. By swapping out the
 40    /// MeshImportFunctions, the import behavior can be customized.
 41    /// </summary>
 42    public class MeshImportStrategy : IImporter
 43    {
 44        MeshImportFunction<SanitizedMeshSample> m_meshImporter;
 45        MeshImportFunction<SanitizedMeshSample> m_skinnedMeshImporter;
 46
 47        public MeshImportStrategy(MeshImportFunction<SanitizedMeshSample> meshImporter,
 48                                  MeshImportFunction<SanitizedMeshSample> skinnedMeshImporter)
 49        {
 50            m_meshImporter = meshImporter;
 51            m_skinnedMeshImporter = skinnedMeshImporter;
 52        }
 53
 54        ReadAllJob<SanitizedMeshSample> m_readMeshesJob;
 55
 56        public void BeginReading(Scene scene, PrimMap primMap, SceneImportOptions importOptions)
 57        {
 58            m_readMeshesJob = new ReadAllJob<SanitizedMeshSample>(scene, primMap.Meshes, importOptions);
 59            m_readMeshesJob.Schedule(primMap.Meshes.Length, 2);
 60        }
 61
 62        public System.Collections.IEnumerator Import(Scene scene,
 63            PrimMap primMap,
 64            SceneImportOptions importOptions)
 65        {
 66            System.Reflection.MemberInfo faceVertexCounts = null;
 67            System.Reflection.MemberInfo faceVertexIndices = null;
 68            System.Reflection.MemberInfo orientation = null;
 69            System.Reflection.MemberInfo points = null;
 70            System.Reflection.MemberInfo normals = null;
 71            System.Reflection.MemberInfo colors = null;
 72            System.Reflection.MemberInfo st = null;
 73            System.Reflection.MemberInfo uv = null;
 74            System.Reflection.MemberInfo uv2 = null;
 75            System.Reflection.MemberInfo uv3 = null;
 76            System.Reflection.MemberInfo uv4 = null;
 77            System.Reflection.MemberInfo purpose = null;
 78            System.Reflection.MemberInfo visibility = null;
 79            var isDynamic = false;
 80
 81            if (scene.AccessMask != null && scene.IsPopulatingAccessMask)
 82            {
 83                var meshType = typeof(MeshSample);
 84                faceVertexCounts = meshType.GetMember("faceVertexCounts")[0];
 85                faceVertexIndices = meshType.GetMember("faceVertexIndices")[0];
 86                orientation = meshType.GetMember("orientation")[0];
 87                points = meshType.GetMember("points")[0];
 88                normals = meshType.GetMember("normals")[0];
 89                colors = meshType.GetMember("colors")[0];
 90                st = meshType.GetMember("st")[0];
 91                uv = meshType.GetMember("uv")[0];
 92                uv2 = meshType.GetMember("uv2")[0];
 93                uv3 = meshType.GetMember("uv3")[0];
 94                uv4 = meshType.GetMember("uv4")[0];
 95                purpose = meshType.GetMember("purpose")[0];
 96                visibility = meshType.GetMember("visibility")[0];
 97            }
 98
 99            foreach (var pathAndSample in m_readMeshesJob)
 100            {
 101                if (scene.AccessMask != null && scene.IsPopulatingAccessMask)
 102                {
 103                    HashSet<System.Reflection.MemberInfo> members;
 104                    if (scene.AccessMask.Included.TryGetValue(pathAndSample.path, out members))
 105                    {
 106                        if (members.Contains(faceVertexCounts)
 107                            || members.Contains(orientation)
 108                            || members.Contains(faceVertexIndices)
 109                            || members.Contains(points)
 110                            || members.Contains(normals)
 111                            || members.Contains(colors)
 112                            || members.Contains(st)
 113                            || members.Contains(uv)
 114                            || members.Contains(uv2)
 115                            || members.Contains(uv3)
 116                            || members.Contains(uv4)
 117                        )
 118                        {
 119                            members.Add(faceVertexCounts);
 120                            members.Add(faceVertexIndices);
 121                            members.Add(orientation);
 122                            members.Add(points);
 123                            members.Add(normals);
 124                            members.Add(colors);
 125                            members.Add(st);
 126                            members.Add(uv);
 127                            members.Add(uv2);
 128                            members.Add(uv3);
 129                            members.Add(uv4);
 130                        }
 131
 132                        if (pathAndSample.sample.purpose != Purpose.Default && !members.Contains(purpose))
 133                        {
 134                            members.Add(purpose);
 135                        }
 136
 137                        if (pathAndSample.sample.visibility != Visibility.Inherited && !members.Contains(visibility))
 138                        {
 139                            members.Add(visibility);
 140                        }
 141
 142                        isDynamic = true;
 143                    }
 144                }
 145
 146                Profiler.BeginSample("USD: Build Meshes");
 147                try
 148                {
 149                    GameObject go = primMap[pathAndSample.path];
 150                    NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path), importOptions);
 151
 152                    if (importOptions.importTransforms)
 153                    {
 154                        Profiler.BeginSample("Build Mesh Xform");
 155                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 156                        Profiler.EndSample();
 157                    }
 158
 159                    Profiler.BeginSample("Read Mesh Subsets");
 160                    MeshImporter.GeometrySubsets subsets = null;
 161                    if (primMap == null || !primMap.MeshSubsets.TryGetValue(pathAndSample.path, out subsets))
 162                    {
 163                        subsets = MeshImporter.ReadGeomSubsets(scene, pathAndSample.path);
 164                    }
 165
 166                    Profiler.EndSample();
 167
 168                    UsdSkelSkinningQuery skinningQuery;
 169                    if (importOptions.importHierarchy)
 170                    {
 171                        if (importOptions.importSkinning && primMap.SkelCache != null)
 172                        {
 173                            // This is pre-cached as part of calling skelCache.Populate and IsValid indicates if we
 174                            // have the data required to setup a skinned mesh.
 175                            Profiler.BeginSample("Get Skinning Query");
 176                            skinningQuery = new UsdSkelSkinningQuery();
 177                            primMap.SkinningQueries[pathAndSample.path] =
 178                                primMap.SkelCache.GetSkinningQuery(scene.GetPrimAtPath(pathAndSample.path));
 179                            Profiler.EndSample();
 180                        }
 181
 182                        if (importOptions.importMeshes)
 183                        {
 184                            primMap.MeshSubsets[pathAndSample.path] =
 185                                MeshImporter.ReadGeomSubsets(scene, pathAndSample.path);
 186                        }
 187                    }
 188
 189                    if (importOptions.importSkinning
 190                        && primMap.SkelCache != null
 191                        && primMap.SkinningQueries.TryGetValue(pathAndSample.path, out skinningQuery)
 192                        && skinningQuery.IsValid())
 193                    {
 194                        Profiler.BeginSample("USD: Build Skinned Mesh");
 195                        m_skinnedMeshImporter(pathAndSample.path,
 196                            pathAndSample.sample,
 197                            subsets, go, importOptions, isDynamic, skinningQuery);
 198                        Profiler.EndSample();
 199                    }
 200                    else
 201                    {
 202                        Profiler.BeginSample("USD: Build Mesh");
 203                        m_meshImporter(pathAndSample.path,
 204                            pathAndSample.sample,
 205                            subsets, go, importOptions, isDynamic);
 206                        Profiler.EndSample();
 207                    }
 208                }
 209                catch (Exception ex)
 210                {
 211                    Debug.LogException(
 212                        new SceneImporter.ImportException(
 213                            "Error processing mesh <" + pathAndSample.path + ">", ex));
 214                }
 215
 216                Profiler.EndSample();
 217                yield return null;
 218            } // foreach mesh
 219        }
 220    }
 221
 222    /// <summary>
 223    /// A collection of methods used for importing USD Mesh data into Unity.
 224    /// </summary>
 225    public static class MeshImporter
 226    {
 227        public class GeometrySubsets
 228        {
 617229            public Dictionary<string, int[]> Subsets { get; set; }
 230
 369231            public GeometrySubsets()
 369232            {
 369233                Subsets = new Dictionary<string, int[]>();
 369234            }
 235        }
 236
 237        /// <summary>
 238        /// Reads geometry subsets if authored. If not authored, returns an empty dictionary.
 239        /// </summary>
 240        public static GeometrySubsets ReadGeomSubsets(Scene scene, string path)
 245241        {
 245242            var result = new GeometrySubsets();
 243
 245244            var prim = scene.GetPrimAtPath(path);
 245245            if (prim == null || prim.IsValid() == false)
 0246            {
 0247                return result;
 248            }
 249
 245250            var im = new pxr.UsdGeomImageable(prim);
 245251            if (im._IsValid() == false)
 0252            {
 0253                return result;
 254            }
 255
 245256            var subsets =
 257                UsdGeomSubset.GetGeomSubsets(im, UsdGeomTokens.face,
 258                    new TfToken("materialBind"));
 259
 260            // Cache these values to minimize garbage collector churn.
 245261            var value = new VtValue();
 245262            var defaultTime = UsdTimeCode.Default();
 263
 735264            foreach (var subset in subsets)
 0265            {
 0266                if (!subset._IsValid())
 0267                {
 0268                    continue;
 269                }
 270
 0271                var indices = subset.GetIndicesAttr();
 0272                if (!indices.IsValid())
 0273                {
 0274                    continue;
 275                }
 276
 0277                if (!indices.Get(value, defaultTime))
 0278                {
 0279                    continue;
 280                }
 281
 0282                var intValue = new int[0];
 0283                IntrinsicTypeConverter.FromVtArray(value, ref intValue);
 0284                result.Subsets.Add(subset.GetPath(), intValue);
 0285            }
 286
 245287            return result;
 245288        }
 289
 290        /// <summary>
 291        /// Copy mesh data from USD to Unity with the given import options, setup for skinning.
 292        /// </summary>
 293        public static void BuildSkinnedMesh(string path,
 294            SanitizedMeshSample usdMesh,
 295            GeometrySubsets geomSubsets,
 296            GameObject go,
 297            SceneImportOptions options,
 298            bool isDynamic,
 299            UsdSkelSkinningQuery skinningQuery = null)
 9300        {
 9301            var smr = ImporterBase.GetOrAddComponent<SkinnedMeshRenderer>(go);
 9302            if (smr.sharedMesh == null)
 9303            {
 9304                smr.sharedMesh = new Mesh { name = UniqueMeshName(go.name) };
 9305            }
 306
 307            // We only check if a mesh is dynamic when scene.IsPopulatingAccessMask is True. It only happens when a play
 308            // created, potentially way after mesh creation.
 9309            if (isDynamic)
 0310            {
 0311                smr.sharedMesh.MarkDynamic();
 0312            }
 313
 9314            BuildMesh_(path, usdMesh, smr.sharedMesh, geomSubsets, go, smr, options);
 9315            if (options.importSkinWeights)
 9316            {
 9317                ImportSkinning(path, usdMesh, smr.sharedMesh, skinningQuery);
 9318            }
 9319        }
 320
 321        /// <summary>
 322        /// Import skin weights and joint indices from USD.
 323        /// </summary>
 324        /// <remarks>
 325        /// JointWeights and JointIndices attribute should probably go into the MeshSample but we might not want to pay
 326        /// the deserialization cost if we don't care about skinning info. Although sanitizing the data would be easier
 327        /// if done by SanitizedMeshSample.Sanitize
 328        /// </remarks>
 329        public static void ImportSkinning(string path, SanitizedMeshSample usdMesh, Mesh unityMesh, UsdSkelSkinningQuery
 9330        {
 331            // Get and validate the joint weights and indices informations.
 9332            UsdGeomPrimvar jointWeights = skinningQuery.GetJointWeightsPrimvar();
 9333            UsdGeomPrimvar jointIndices = skinningQuery.GetJointIndicesPrimvar();
 334
 9335            if (!jointWeights.IsDefined() || !jointIndices.IsDefined())
 0336            {
 0337                throw new Exception("Joints information (indices and/or weights) are missing for: " + path);
 338            }
 339
 340            // TODO: Both indices and weights attributes can be animated. It's not handled yet.
 341            // TODO: Having something that convert a UsdGeomPrimvar into a PrimvarSample could help simplify this code.
 9342            int[] indices = IntrinsicTypeConverter.FromVtArray((VtIntArray)jointIndices.GetAttr().Get());
 9343            int indicesElementSize = jointIndices.GetElementSize();
 9344            TfToken indicesInterpolation = jointIndices.GetInterpolation();
 345
 9346            if (indices.Length == 0
 347                || indicesElementSize == 0
 348                || indices.Length % indicesElementSize != 0
 349                || !UsdGeomPrimvar.IsValidInterpolation(indicesInterpolation))
 0350            {
 0351                throw new Exception("Joint indices information are invalid or empty for: " + path);
 352            }
 353
 9354            float[] weights = IntrinsicTypeConverter.FromVtArray((VtFloatArray)jointWeights.GetAttr().Get());
 9355            int weightsElementSize = jointWeights.GetElementSize();
 9356            TfToken weightsInterpolation = jointWeights.GetInterpolation();
 357
 9358            if (weights.Length == 0
 359                || weightsElementSize == 0
 360                || weights.Length % weightsElementSize != 0
 361                || !UsdGeomPrimvar.IsValidInterpolation(weightsInterpolation))
 0362            {
 0363                throw new Exception("Joints weights information are invalid or empty for: " + path);
 364            }
 365
 9366            var bonesPerVertex = new NativeArray<byte>(unityMesh.vertexCount, Allocator.Temp);
 9367            var boneWeights1 = new NativeArray<BoneWeight1>(unityMesh.vertexCount * weightsElementSize, Allocator.Temp);
 368
 369            // Remap the vertex indices if mesh attribute have been converted to faceVarying
 9370            var remapIndices = weightsInterpolation.GetString() == UsdGeomTokens.vertex
 371                && usdMesh.arePrimvarsFaceVarying;
 372
 9373            int isNotConstant = weightsInterpolation.GetString() == UsdGeomTokens.constant ? 0 : 1;
 374
 132375            for (var i = 0; i < unityMesh.vertexCount; i++)
 57376            {
 57377                var unityIndex = remapIndices ? usdMesh.triangulatedFaceVertexIndices[i] * weightsElementSize : i * weig
 57378                var usdIndex = isNotConstant * unityIndex;
 379
 57380                bonesPerVertex[i] = (byte)weightsElementSize;
 381
 426382                for (var wi = 0; wi < weightsElementSize; wi++)
 156383                {
 156384                    var bw = boneWeights1[i * weightsElementSize + wi];
 156385                    bw.boneIndex = indices[usdIndex + wi];
 156386                    bw.weight = weights[usdIndex + wi];
 156387                    boneWeights1[i * weightsElementSize + wi] = bw;
 156388                }
 57389            }
 390            // TODO: Investigate if bone weights should be normalized before this line.
 9391            unityMesh.SetBoneWeights(bonesPerVertex, boneWeights1);
 9392            bonesPerVertex.Dispose();
 9393            boneWeights1.Dispose();
 9394        }
 395
 396        /// <summary>
 397        /// Copy mesh data from USD to Unity with the given import options.
 398        /// </summary>
 399        public static void BuildMesh(string path,
 400            SanitizedMeshSample usdMesh,
 401            GeometrySubsets geomSubsets,
 402            GameObject go,
 403            SceneImportOptions options,
 404            bool isDynamic,
 405            UsdSkelSkinningQuery skinQuery = null)
 115406        {
 115407            var mf = ImporterBase.GetOrAddComponent<MeshFilter>(go);
 115408            var mr = ImporterBase.GetOrAddComponent<MeshRenderer>(go);
 115409            if (mf.sharedMesh == null)
 115410            {
 115411                mf.sharedMesh = new Mesh { name = UniqueMeshName(go.name) };
 115412            }
 413
 414            // We only check if a mesh is dynamic when scene.IsPopulatingAccessMask is True. It only happens when a play
 415            // created, potentially way after mesh creation.
 115416            if (isDynamic)
 0417            {
 0418                mf.sharedMesh.MarkDynamic();
 0419            }
 420
 115421            BuildMesh_(path, usdMesh, mf.sharedMesh, geomSubsets, go, mr, options);
 115422        }
 423
 424        static void BuildMesh_(string path,
 425            SanitizedMeshSample usdMesh,
 426            Mesh unityMesh,
 427            GeometrySubsets geomSubsets,
 428            GameObject go,
 429            Renderer renderer,
 430            SceneImportOptions options)
 124431        {
 432            //
 433            // Purpose.
 434            //
 435            // Deactivate non-geometry prims (e.g. guides, render, etc).
 124436            if (usdMesh.purpose != Purpose.Default)
 0437            {
 0438                go.SetActive(false);
 0439            }
 440
 441            //
 442            // Points.
 443            //
 124444            if (options.meshOptions.points == ImportMode.Import && usdMesh.points != null)
 124445            {
 124446                if (usdMesh.faceVertexIndices != null)
 124447                {
 448                    // Annoyingly, there is a circular dependency between vertices and triangles, which makes
 449                    // it impossible to have a fixed update order in this function. As a result, we must clear
 450                    // the triangles before setting the points, to break that dependency.
 124451                    unityMesh.SetTriangles(new int[0] {}, 0);
 124452                }
 453
 124454                unityMesh.vertices = usdMesh.points;
 124455            }
 456
 457            //
 458            // Mesh Topology.
 459            //
 124460            if (options.meshOptions.topology == ImportMode.Import && usdMesh.faceVertexIndices != null)
 124461            {
 462                // Remap subsets
 124463                var newSubsets = new GeometrySubsets();
 372464                foreach (var nameAndSubset in geomSubsets.Subsets)
 0465                {
 0466                    var newFaceIndices = new List<int>();
 0467                    foreach (var faceIndex in nameAndSubset.Value)
 0468                    {
 0469                        newFaceIndices.AddRange(usdMesh.faceMapping[faceIndex]);
 0470                    }
 471
 0472                    newSubsets.Subsets.Add(nameAndSubset.Key, newFaceIndices.ToArray());
 0473                }
 124474                geomSubsets = newSubsets;
 475
 124476                if (usdMesh.faceVertexIndices.Length > 65535)
 0477                    unityMesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
 478
 124479                Profiler.BeginSample("Breakdown triangles for Mesh Subsets");
 124480                if (geomSubsets.Subsets.Count == 0)
 124481                {
 124482                    unityMesh.triangles = usdMesh.faceVertexIndices;
 124483                }
 484                else
 0485                {
 0486                    var usdIndices = usdMesh.faceVertexIndices;
 0487                    unityMesh.subMeshCount = geomSubsets.Subsets.Count;
 0488                    var subsetIndex = 0;
 0489                    foreach (var kvp in geomSubsets.Subsets)
 0490                    {
 0491                        int[] faceIndices = kvp.Value;
 0492                        var triangleIndices = new int[faceIndices.Length * 3];
 493
 0494                        for (var i = 0; i < faceIndices.Length; i++)
 0495                        {
 0496                            triangleIndices[i * 3 + 0] = usdIndices[faceIndices[i] * 3 + 0];
 0497                            triangleIndices[i * 3 + 1] = usdIndices[faceIndices[i] * 3 + 1];
 0498                            triangleIndices[i * 3 + 2] = usdIndices[faceIndices[i] * 3 + 2];
 0499                        }
 500
 0501                        unityMesh.SetTriangles(triangleIndices, subsetIndex);
 0502                        subsetIndex++;
 0503                    }
 0504                }
 505
 124506                Profiler.EndSample(); // Breakdown triangles for Mesh Subsets
 124507            }
 508
 509            //
 510            // Extent / Bounds.
 511            // TODO: move the bounds calculation to SanitizedMeshSample
 124512            var hasBounds = usdMesh.extent.size.x > 0
 513                || usdMesh.extent.size.y > 0
 514                || usdMesh.extent.size.z > 0;
 515
 124516            if (ShouldImport(options.meshOptions.boundingBox) && hasBounds)
 124517            {
 124518                Profiler.BeginSample("Import Bounds");
 124519                unityMesh.bounds = usdMesh.extent;
 124520                Profiler.EndSample();
 124521            }
 0522            else if (ShouldCompute(options.meshOptions.boundingBox))
 0523            {
 0524                Profiler.BeginSample("Calculate Bounds");
 0525                unityMesh.RecalculateBounds();
 0526                Profiler.EndSample();
 0527            }
 528
 529            //
 530            // Normals.
 531            // TODO: move the normals calculation to SanitizedMeshSample
 124532            if (usdMesh.normals != null && ShouldImport(options.meshOptions.normals))
 21533            {
 21534                Profiler.BeginSample("Import Normals");
 21535                unityMesh.normals = usdMesh.normals;
 21536                Profiler.EndSample(); // Import Normals
 21537            }
 103538            else if (ShouldCompute(options.meshOptions.tangents))
 103539            {
 103540                Profiler.BeginSample("Calculate Normals");
 103541                unityMesh.RecalculateNormals();
 103542                Profiler.EndSample(); // Calculate Normals
 103543            }
 544
 545            //
 546            // Tangents.
 547            // TODO: move the tangents calculation to SanitizedMeshSample
 124548            if (usdMesh.tangents != null && ShouldImport(options.meshOptions.tangents))
 0549            {
 0550                Profiler.BeginSample("Import Tangents");
 551                // TODO: We should check the interpolation of tangents and treat them accordingly (for now, we assume th
 552                //       are always face varying).
 0553                unityMesh.tangents = usdMesh.tangents;
 0554                Profiler.EndSample(); // Import Tangents
 0555            }
 124556            else if (ShouldCompute(options.meshOptions.tangents))
 124557            {
 124558                Profiler.BeginSample("Calculate Tangents");
 124559                unityMesh.RecalculateTangents();
 124560                Profiler.EndSample(); // Calculate Tangents
 124561            }
 562
 563            //
 564            // Display Color.
 565            //
 566
 124567            var mat = renderer.sharedMaterial;
 124568            if (ShouldImport(options.meshOptions.color) && usdMesh.colors.value != null)
 111569            {
 111570                Profiler.BeginSample("Import Display Color");
 571                // NOTE: The following color conversion assumes PlayerSettings.ColorSpace == Linear.
 572                // For best performance, convert color space to linear off-line and skip conversion.
 111573                if (usdMesh.colors.Length == 1) // Constant
 71574                {
 575                    // Constant color can just be set on the material.
 71576                    if (options.useDisplayColorAsFallbackMaterial &&
 577                        options.materialImportMode != MaterialImportMode.None)
 71578                        mat = options.materialMap.InstantiateSolidColor(usdMesh.colors.value[0].gamma);
 71579                }
 580                else
 40581                {
 40582                    unityMesh.colors = usdMesh.colors.value;
 40583                }
 584
 111585                Profiler.EndSample(); // Import Display Color
 111586            } // should import color
 587
 588            //
 589            // UVs / Texture Coordinates.
 590            //
 124591            Profiler.BeginSample("Request Material Bindings");
 592
 593            //
 594            // Materials.
 595            //
 596
 124597            if (options.materialImportMode != MaterialImportMode.None)
 124598            {
 177599                if (mat == null) mat = options.materialMap.InstantiateSolidColor(Color.white);
 600
 124601                if (unityMesh.subMeshCount == 1)
 124602                {
 124603                    renderer.sharedMaterial = mat;
 124604                    if (options.ShouldBindMaterials)
 1605                        options.materialMap.RequestBinding(
 606                            path,
 1607                            (scene, boundMat, primvars) => BindMat(
 608                                scene, unityMesh, boundMat, renderer, path, primvars, usdMesh));
 124609                }
 610                else
 0611                {
 0612                    var mats = new Material[unityMesh.subMeshCount];
 0613                    for (var i = 0; i < mats.Length; i++) mats[i] = mat;
 0614                    renderer.sharedMaterials = mats;
 0615                    if (options.ShouldBindMaterials)
 0616                    {
 0617                        Debug.Assert(geomSubsets.Subsets.Count == unityMesh.subMeshCount);
 0618                        var subIndex = 0;
 0619                        foreach (var kvp in geomSubsets.Subsets)
 0620                        {
 0621                            var idx = subIndex++;
 0622                            options.materialMap.RequestBinding(
 623                                kvp.Key,
 0624                                (scene, boundMat, primvars) => BindMat(
 625                                    scene, unityMesh, boundMat, renderer, idx, path, primvars,
 626                                    usdMesh));
 0627                        }
 0628                    }
 0629                }
 124630            }
 631
 124632            Profiler.EndSample();
 633
 634            //
 635            // Lightmap UV Unwrapping.
 636            //
 637
 638#if UNITY_EDITOR
 124639            if (options.meshOptions.generateLightmapUVs)
 0640            {
 0641                Profiler.BeginSample("Unwrap Lightmap UVs");
 0642                var unwrapSettings = new UnityEditor.UnwrapParam();
 643
 0644                unwrapSettings.angleError = options.meshOptions.unwrapAngleError;
 0645                unwrapSettings.areaError = options.meshOptions.unwrapAngleError;
 0646                unwrapSettings.hardAngle = options.meshOptions.unwrapHardAngle;
 647
 648                // Convert pixels to unitless UV space, which is what unwrapSettings uses internally.
 0649                unwrapSettings.packMargin = options.meshOptions.unwrapPackMargin / 1024.0f;
 650
 0651                UnityEditor.Unwrapping.GenerateSecondaryUVSet(unityMesh, unwrapSettings);
 0652                Profiler.EndSample();
 0653            }
 654#else
 655            if (options.meshOptions.generateLightmapUVs)
 656            {
 657                Debug.LogWarning(
 658                    "Lightmap UVs were requested to be generated, but cannot be generated outside of the editor");
 659            }
 660#endif
 124661        }
 662
 663        static void LoadPrimvars(
 664            Scene scene,
 665            Mesh unityMesh,
 666            string usdMeshPath,
 667            List<string> primvars,
 668            MeshSample sample)
 1669        {
 2670            if (primvars == null || primvars.Count == 0) return;
 671
 0672            for (var i = 0; i < primvars.Count; i++)
 0673            {
 674                try
 0675                {
 0676                    if (primvars[i] == "st")
 0677                    {
 0678                        ImportUv(unityMesh, i, sample.st);
 0679                    }
 0680                    else if (primvars[i] == "uv")
 0681                    {
 0682                        ImportUv(unityMesh, i, sample.uv);
 0683                    }
 0684                    else if (primvars[i] == "uv2")
 0685                    {
 0686                        ImportUv(unityMesh, i, sample.uv2);
 0687                    }
 0688                    else if (primvars[i] == "uv3")
 0689                    {
 0690                        ImportUv(unityMesh, i, sample.uv3);
 0691                    }
 0692                    else if (primvars[i] == "uv4")
 0693                    {
 0694                        ImportUv(unityMesh, i, sample.uv4);
 0695                    }
 0696                }
 0697                catch (Exception ex)
 0698                {
 0699                    Debug.LogError(new Exception("Error reading UVs at " + usdMeshPath + "> uv-index: " + i, ex));
 0700                }
 0701            }
 1702        }
 703
 704        static void BindMat(Scene scene,
 705            Mesh unityMesh,
 706            Material mat,
 707            Renderer renderer,
 708            string usdMeshPath,
 709            List<string> primvars,
 710            MeshSample sample)
 1711        {
 1712            renderer.sharedMaterial = mat;
 1713            LoadPrimvars(scene, unityMesh, usdMeshPath, primvars, sample);
 1714        }
 715
 716        // Pass in Unity Mesh from registration.
 717        // Pass in scene, meshPath from MaterialImporter.
 718        // Lookup material UV primvars by material path.
 719        // Read primvars from USD mesh.
 720        // Assign to UnityMesh sequentially.
 721        // Material must assign both primvar and Unity Mesh texcoord slots.
 722        static void BindMat(Scene scene,
 723            Mesh unityMesh,
 724            Material mat,
 725            Renderer renderer,
 726            int index,
 727            string usdMeshPath,
 728            List<string> primvars,
 729            MeshSample sample)
 0730        {
 0731            var sharedMats = renderer.sharedMaterials;
 0732            sharedMats[index] = mat;
 0733            renderer.sharedMaterials = sharedMats;
 0734            LoadPrimvars(scene, unityMesh, usdMeshPath, primvars, sample);
 0735        }
 736
 737        /// <summary>
 738        /// Attempts to build a valid per-vertex UV set from the given object. If the type T is not
 739        /// the held type of the object "uv" argument, null is returned. If there is an error such
 740        /// that the type is correct, but the uv values are somehow incompatible, error messages
 741        /// will be generated and an empty array will be returned.
 742        /// </summary>
 743        /// <returns>
 744        /// An array of size > 0 on succes, an array of size 0 on failure, or null if the given object
 745        /// is not of the desired type T.
 746        /// </returns>
 747        static T[] TryGetPrimvarValue<T>(Primvar<object> primvar)
 0748        {
 749            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 750            // the actual type of value.
 0751            if (primvar.value.GetType() != typeof(T[]))
 0752                return null;
 753
 0754            return (T[])primvar.GetValue();
 0755        }
 756
 757        /// <summary>
 758        /// Imports UV data from USD into the unityMesh at the given index with the given import rules.
 759        /// </summary>
 760        static void ImportUv(
 761            Mesh unityMesh,
 762            int uvSetIndex,
 763            Primvar<object> uv)
 0764        {
 765            // As in Unity, UVs are a dynamic type which can be vec2, vec3, or vec4.
 0766            if (uv.GetValue() == null)
 0767                return;
 768
 0769            var uv2 = TryGetPrimvarValue<Vector2>(uv);
 0770            if (uv2 != null)
 0771            {
 0772                if (uv2.Length > 0) unityMesh.SetUVs(uvSetIndex, uv2);
 0773                return;
 774            }
 775
 0776            var uv3 = TryGetPrimvarValue<Vector3>(uv);
 0777            if (uv3 != null)
 0778            {
 0779                if (uv3.Length > 0) unityMesh.SetUVs(uvSetIndex, uv3);
 0780                return;
 781            }
 782
 0783            var uv4 = TryGetPrimvarValue<Vector4>(uv);
 0784            if (uv4 != null)
 0785            {
 0786                if (uv4.Length > 0) unityMesh.SetUVs(uvSetIndex, uv4);
 0787                return;
 788            }
 789
 0790            throw new Exception("Unexpected uv type: " + uv.GetType());
 0791        }
 792
 793        /// <summary>
 794        /// Returns true if the mode is Import or ImportOrCompute.
 795        /// </summary>
 796        public static bool ShouldImport(ImportMode mode)
 269797        {
 269798            return mode == ImportMode.Import || mode == ImportMode.ImportOrCompute;
 269799        }
 800
 801        /// <summary>
 802        /// Returns true if the mode is Compute or ImportOrCompute.
 803        /// </summary>
 804        public static bool ShouldCompute(ImportMode mode)
 227805        {
 227806            return mode == ImportMode.Compute || mode == ImportMode.ImportOrCompute;
 227807        }
 808
 809        /// <summary>
 810        /// Returns a unique mesh name by appending a short guid to the given string
 811        /// </summary>
 812        static string UniqueMeshName(string meshName)
 124813        {
 124814            var shortGuid = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
 124815            return meshName + "_" + shortGuid.Substring(0, shortGuid.Length - 2);
 124816        }
 817    }
 818}
+
+
+
+

Methods/Properties

+Subsets()
+Subsets(System.Collections.Generic.Dictionary[String,Int32[]])
+GeometrySubsets()
+ReadGeomSubsets(USD.NET.Scene, System.String)
+BuildSkinnedMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery)
+ImportSkinning(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, pxr.UsdSkelSkinningQuery)
+BuildMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery)
+BuildMesh_(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, UnityEngine.Renderer, Unity.Formats.USD.SceneImportOptions)
+LoadPrimvars(USD.NET.Scene, UnityEngine.Mesh, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample)
+BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample)
+BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.Int32, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample)
+TryGetPrimvarValue[T](USD.NET.Primvar[Object])
+ImportUv(UnityEngine.Mesh, System.Int32, USD.NET.Primvar[Object])
+ShouldImport(Unity.Formats.USD.ImportMode)
+ShouldCompute(Unity.Formats.USD.ImportMode)
+UniqueMeshName(System.String)
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeExporter.html new file mode 100644 index 000000000..c28a1e5ae --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeExporter.html @@ -0,0 +1,315 @@ + + + + + + +Unity.Formats.USD.NativeExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.NativeExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeExporter.cs
Covered lines:5
Uncovered lines:96
Coverable lines:101
Total lines:207
Line coverage:4.9% (5 of 101)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportObject(...)0%00035.71%
ObjectToUsd(...)0%0000%
ComponentToUsd(...)0%0000%
PropertyToUsd(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19#if UNITY_EDITOR
 20using UnityEditor;
 21
 22namespace Unity.Formats.USD
 23{
 24    public class NativeExporter
 25    {
 26        // -------------------------------------------------------------------------------------------- //
 27        // Serialize Unity to -> USD
 28        // -------------------------------------------------------------------------------------------- //
 29
 30        /// <summary>
 31        /// Exports the given game object to USD, via Unity SerializedObject.
 32        /// Note that this is an experimental work in progress.
 33        /// </summary>
 34        public static void ExportObject(ObjectContext objContext,
 35            ExportContext exportContext)
 22236        {
 22237            if (!exportContext.exportNative)
 22238            {
 22239                return;
 40            }
 41
 042            var prim = exportContext.scene.GetPrimAtPath(objContext.path);
 043            ObjectToUsd(objContext.gameObject, prim, exportContext.scene);
 044            foreach (Component comp in objContext.gameObject.GetComponents(typeof(Component)))
 045            {
 046                ComponentToUsd(comp, objContext.path, exportContext.scene);
 047            }
 22248        }
 49
 50        /// <summary>
 51        /// Exports a single GameObject to USD, does not export components.
 52        /// </summary>
 53        static void ObjectToUsd(GameObject gameObj, pxr.UsdPrim prim, Scene scene)
 054        {
 055            var obj = new SerializedObject(gameObj);
 056            var sb = new System.Text.StringBuilder();
 057            var path = prim.GetPath().ToString();
 058            sb.AppendLine("Visited: " + path);
 59
 060            prim.SetCustomDataByKey(new pxr.TfToken("unity:name"), new pxr.TfToken(gameObj.name));
 61
 062            var itr = obj.GetIterator();
 063            itr.Next(true);
 064            PropertyToUsd(path, "", scene, itr, sb);
 065        }
 66
 67        /// <summary>
 68        /// Exports a single component to USD, does not include the parent GameObject.
 69        /// </summary>
 70        static void ComponentToUsd(Component component, string path, Scene scene)
 071        {
 072            var obj = new SerializedObject(component);
 073            var sb = new System.Text.StringBuilder();
 074            var propPrefix = component.GetType().Name;
 75
 076            sb.AppendLine("Visited: " + path + "." + propPrefix);
 77
 078            var itr = obj.GetIterator();
 079            itr.Next(true);
 080            PropertyToUsd(path, propPrefix, scene, itr, sb);
 81
 082            Debug.Log(sb.ToString());
 83
 84            // TODO: Handle multiple components of the same type.
 085            var usdPrim = scene.Stage.GetPrimAtPath(new pxr.SdfPath(path));
 086            var attr = usdPrim.CreateAttribute(
 87                new pxr.TfToken("unity:component:" + component.GetType().Name + ":type"),
 88                SdfValueTypeNames.String);
 89
 090            attr.Set(component.GetType().AssemblyQualifiedName);
 091        }
 92
 93        /// <summary>
 94        /// Writes SerializedProperty to USD, traversing all nested properties.
 95        /// </summary>
 96        static void PropertyToUsd(string path,
 97            string propPrefix,
 98            Scene scene,
 99            SerializedProperty prop,
 100            System.Text.StringBuilder sb)
 0101        {
 0102            string prefix = "";
 103            try
 0104            {
 0105                var nameStack = new List<string>();
 0106                nameStack.Add("unity");
 0107                if (!string.IsNullOrEmpty(propPrefix))
 0108                {
 0109                    nameStack.Add(propPrefix);
 0110                }
 111
 0112                string lastName = "";
 0113                int lastDepth = 0;
 114
 0115                while (prop.Next(prop.propertyType == SerializedPropertyType.Generic && !prop.isArray))
 0116                {
 0117                    string tabIn = "";
 0118                    for (int i = 0; i < prop.depth; i++)
 0119                    {
 0120                        tabIn += "  ";
 0121                    }
 122
 0123                    if (prop.depth > lastDepth)
 0124                    {
 0125                        Debug.Assert(lastName != "");
 0126                        nameStack.Add(lastName);
 0127                    }
 0128                    else if (prop.depth < lastDepth)
 0129                    {
 0130                        nameStack.RemoveRange(nameStack.Count - (lastDepth - prop.depth), lastDepth - prop.depth);
 0131                    }
 132
 0133                    lastDepth = prop.depth;
 0134                    lastName = prop.name;
 135
 0136                    if (nameStack.Count > 0)
 0137                    {
 0138                        prefix = string.Join(":", nameStack.ToArray());
 0139                        prefix += ":";
 0140                    }
 141                    else
 0142                    {
 0143                        prefix = "";
 0144                    }
 145
 0146                    sb.Append(tabIn + prefix + prop.name + "[" + prop.propertyType.ToString() + "] = ");
 0147                    if (prop.isArray && prop.propertyType != SerializedPropertyType.String)
 0148                    {
 149                        // TODO.
 0150                        sb.AppendLine("ARRAY");
 0151                    }
 0152                    else if (prop.propertyType == SerializedPropertyType.Generic)
 0153                    {
 0154                        sb.AppendLine("Generic");
 0155                    }
 0156                    else if (prop.propertyType == SerializedPropertyType.AnimationCurve ||
 157                             prop.propertyType == SerializedPropertyType.Gradient)
 0158                    {
 159                        // TODO.
 0160                        sb.AppendLine(NativeSerialization.ValueToString(prop));
 0161                    }
 162                    else
 0163                    {
 0164                        sb.AppendLine(NativeSerialization.ValueToString(prop));
 0165                        var vtValue = NativeSerialization.PropToVtValue(prop);
 0166                        var primPath = new pxr.SdfPath(path);
 0167                        var attrName = new pxr.TfToken(prefix + prop.name);
 168                        /*
 169                        var oldPrim = context.prevScene.Stage.GetPrimAtPath(primPath);
 170                        pxr.VtValue oldVtValue = null;
 171                        if (oldPrim.IsValid()) {
 172                          var oldAttr = oldPrim.GetAttribute(attrName);
 173                          if (oldAttr.IsValid()) {
 174                            oldVtValue = oldAttr.Get(0);
 175                          }
 176                        }
 177
 178                        if (oldVtValue != null && vtValue == oldVtValue) {
 179                          Debug.Log("skipping: " + prop.name);
 180                          continue;
 181                        }
 182                        */
 183
 0184                        var sdfType = NativeSerialization.GetSdfType(prop);
 0185                        var prim = scene.GetPrimAtPath(primPath);
 0186                        var attr = prim.CreateAttribute(attrName, sdfType);
 0187                        attr.Set(vtValue);
 0188                    }
 0189                }
 0190            }
 0191            catch
 0192            {
 0193                Debug.LogWarning("Failed on: " + path + "." + prefix + prop.name);
 0194                throw;
 195            }
 0196        }
 197    }
 198}
 199#else
 200namespace Unity.Formats.USD
 201{
 202    public class NativeExporter
 203    {
 204        public static void ExportObject(ObjectContext objContext, ExportContext exportContext) {}
 205    }
 206}
 207#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeImporter.html new file mode 100644 index 000000000..56442a742 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeImporter.html @@ -0,0 +1,288 @@ + + + + + + +Unity.Formats.USD.NativeImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.NativeImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeImporter.cs
Covered lines:5
Uncovered lines:98
Coverable lines:103
Total lines:184
Line coverage:4.8% (5 of 103)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ImportObject(...)0%00018.52%
PropertyFromUsd(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18#if UNITY_EDITOR
 19using UnityEditor;
 20
 21namespace Unity.Formats.USD
 22{
 23    public class NativeImporter
 24    {
 25        // -------------------------------------------------------------------------------------------- //
 26        // Deserialize USD to -> Unity
 27        // -------------------------------------------------------------------------------------------- //
 28
 29        static public void ImportObject(Scene scene,
 30            GameObject go,
 31            pxr.UsdPrim usdPrim,
 32            SceneImportOptions options)
 26733        {
 26734            if (!options.importMonoBehaviours)
 26735            {
 26736                return;
 37            }
 38
 039            var comps = usdPrim.GetAuthoredPropertiesInNamespace("unity:component");
 040            foreach (var compProp in comps)
 041            {
 042                var compAttr = usdPrim.GetAttribute(compProp.GetName());
 043                string assemblyQualifiedName = (string)compAttr.Get(0);
 044                var compType = System.Type.GetType(assemblyQualifiedName);
 45
 46                // TODO: Handle multiple components of the same type.
 047                Component comp = go.GetComponent(compType);
 048                if (comp == null)
 049                {
 050                    comp = go.AddComponent(compType);
 051                }
 52
 053                var so = new SerializedObject(comp);
 054                var prop = so.GetIterator();
 055                prop.Next(true);
 056                var sb = new System.Text.StringBuilder();
 57
 58                // TODO: Handle multiple components of the same type.
 059                PropertyFromUsd(usdPrim, prop, sb, comp.GetType().Name);
 60
 061                so.ApplyModifiedProperties();
 062                Debug.Log(sb.ToString());
 063            }
 26764        }
 65
 66        /// <summary>
 67        /// Constructs Unity SerializedProperties from USD.
 68        /// </summary>
 69        static void PropertyFromUsd(pxr.UsdPrim prim,
 70            SerializedProperty prop,
 71            System.Text.StringBuilder sb,
 72            string propPrefix)
 073        {
 074            if (prim == null)
 075            {
 076                Debug.LogError("Null prim - " + propPrefix);
 077            }
 78
 079            if (!prim.IsValid())
 080            {
 081                Debug.LogError("Invalid prim: " + prim.GetPath().ToString());
 082            }
 83
 084            string prefix = "";
 85            try
 086            {
 087                var nameStack = new List<string>();
 088                nameStack.Add("unity");
 089                if (!string.IsNullOrEmpty(propPrefix))
 090                {
 091                    nameStack.Add(propPrefix);
 092                }
 93
 094                string lastName = "";
 095                int lastDepth = 0;
 96
 097                while (prop.Next(prop.propertyType == SerializedPropertyType.Generic && !prop.isArray))
 098                {
 099                    string tabIn = "";
 0100                    for (int i = 0; i < prop.depth; i++)
 0101                    {
 0102                        tabIn += "  ";
 0103                    }
 104
 0105                    if (prop.depth > lastDepth)
 0106                    {
 0107                        Debug.Assert(lastName != "");
 0108                        nameStack.Add(lastName);
 0109                    }
 0110                    else if (prop.depth < lastDepth)
 0111                    {
 0112                        nameStack.RemoveRange(nameStack.Count - (lastDepth - prop.depth), lastDepth - prop.depth);
 0113                    }
 114
 0115                    lastDepth = prop.depth;
 0116                    lastName = prop.name;
 117
 0118                    if (nameStack.Count > 0)
 0119                    {
 0120                        prefix = string.Join(":", nameStack.ToArray());
 0121                        prefix += ":";
 0122                    }
 123                    else
 0124                    {
 0125                        prefix = "";
 0126                    }
 127
 0128                    sb.Append(tabIn + prefix + prop.name + "[" + prop.propertyType.ToString() + "] = ");
 0129                    if (prop.isArray && prop.propertyType != SerializedPropertyType.String)
 0130                    {
 131                        // TODO.
 0132                        sb.AppendLine("ARRAY");
 0133                    }
 0134                    else if (prop.propertyType == SerializedPropertyType.Generic)
 0135                    {
 0136                        sb.AppendLine("Generic");
 0137                    }
 0138                    else if (prop.propertyType == SerializedPropertyType.AnimationCurve ||
 139                             prop.propertyType == SerializedPropertyType.Gradient)
 0140                    {
 141                        // TODO.
 0142                        sb.AppendLine(NativeSerialization.ValueToString(prop));
 0143                    }
 144                    else
 0145                    {
 0146                        sb.AppendLine(NativeSerialization.ValueToString(prop));
 0147                        var attrName = new pxr.TfToken(prefix + prop.name);
 0148                        var attr = prim.GetAttribute(attrName);
 149
 0150                        if (attr == null)
 0151                        {
 0152                            Debug.LogError("Null attr: " + prim.GetPath().ToString() + "." + attrName.ToString());
 0153                        }
 154
 0155                        if (!attr.IsValid())
 0156                        {
 0157                            Debug.LogError("Attribute not found:" + attr.GetPath().ToString());
 0158                        }
 159
 0160                        NativeSerialization.VtValueToProp(prop, attr.Get(0));
 0161                    }
 0162                }
 0163            }
 0164            catch
 0165            {
 0166                Debug.LogWarning("Failed on: " + prim.GetPath() + "." + prefix + prop.name);
 0167                throw;
 168            }
 0169        }
 170    } // End Class
 171} // End Namespace
 172#else
 173namespace Unity.Formats.USD
 174{
 175    public class NativeImporter
 176    {
 177        static public void ImportObject(Scene scene,
 178            GameObject go,
 179            pxr.UsdPrim usdPrim,
 180            SceneImportOptions options)
 181        {}
 182    }
 183}
 184#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeSerialization.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeSerialization.html new file mode 100644 index 000000000..2be1bad90 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_NativeSerialization.html @@ -0,0 +1,513 @@ + + + + + + +Unity.Formats.USD.NativeSerialization - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.NativeSerialization
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeSerialization.cs
Covered lines:0
Uncovered lines:182
Coverable lines:182
Total lines:405
Line coverage:0% (0 of 182)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ValueToString(...)0%0000%
PropToVtValue(...)0%0000%
VtValueToProp(...)0%0000%
GetSdfType(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/UnityNative/NativeSerialization.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15#if UNITY_EDITOR
 16using USD.NET;
 17using USD.NET.Unity;
 18using UnityEngine;
 19using UnityEditor;
 20
 21namespace Unity.Formats.USD
 22{
 23    static public class NativeSerialization
 24    {
 25        /// <summary>
 26        /// Converts a serialized property to a string, e.g. for debugging.
 27        /// </summary>
 28        static public string ValueToString(SerializedProperty prop)
 029        {
 030            switch (prop.propertyType)
 31            {
 32                case SerializedPropertyType.AnimationCurve:
 033                    return prop.animationCurveValue.ToString();
 34                case SerializedPropertyType.ArraySize:
 035                    return prop.intValue.ToString();
 36                case SerializedPropertyType.Boolean:
 037                    return prop.boolValue.ToString();
 38                case SerializedPropertyType.Bounds:
 039                    return prop.boundsValue.ToString();
 40                case SerializedPropertyType.BoundsInt:
 041                    return prop.boundsIntValue.ToString();
 42                case SerializedPropertyType.Character:
 043                    return prop.intValue.ToString();
 44                case SerializedPropertyType.Color:
 045                    return prop.colorValue.ToString();
 46                case SerializedPropertyType.Enum:
 047                    return prop.enumDisplayNames[prop.enumValueIndex];
 48                case SerializedPropertyType.ExposedReference:
 049                    return prop.exposedReferenceValue.ToString();
 50                case SerializedPropertyType.FixedBufferSize:
 051                    return prop.fixedBufferSize.ToString();
 52                case SerializedPropertyType.Float:
 053                    return prop.floatValue.ToString();
 54                case SerializedPropertyType.Generic:
 055                    return "GENERIC";
 56                case SerializedPropertyType.Gradient:
 57                    // TODO: gradientValue accessor is not public. wat?
 058                    return "Gradient";
 59                case SerializedPropertyType.Integer:
 060                    return prop.intValue.ToString();
 61                case SerializedPropertyType.LayerMask:
 062                    return prop.intValue.ToString();
 63                case SerializedPropertyType.ObjectReference:
 064                    var obj = prop.objectReferenceValue;
 065                    if (obj == null)
 066                    {
 067                        return "NULL";
 68                    }
 69
 070                    var pathId = prop.FindPropertyRelative("m_PathID").intValue;
 071                    var fileId = prop.FindPropertyRelative("m_FileID").intValue;
 072                    return string.Format("FileID: {0} PathID: {1} -- {2}", fileId, pathId, obj.ToString());
 73                case SerializedPropertyType.Quaternion:
 074                    return prop.quaternionValue.ToString();
 75                case SerializedPropertyType.Rect:
 076                    return prop.rectValue.ToString();
 77                case SerializedPropertyType.RectInt:
 078                    return prop.rectIntValue.ToString();
 79                case SerializedPropertyType.String:
 080                    return prop.stringValue.ToString();
 81                case SerializedPropertyType.Vector2:
 082                    return prop.vector2Value.ToString();
 83                case SerializedPropertyType.Vector2Int:
 084                    return prop.vector2IntValue.ToString();
 85                case SerializedPropertyType.Vector3:
 086                    return prop.vector3Value.ToString();
 87                case SerializedPropertyType.Vector3Int:
 088                    return prop.vector3IntValue.ToString();
 89                case SerializedPropertyType.Vector4:
 090                    return prop.vector4Value.ToString();
 91            }
 92
 093            return "UNKNOWN";
 094        }
 95
 96        /// <summary>
 97        /// Converts a SerializedProperty to a VtValue, for writing to USD.
 98        /// </summary>
 99        static public pxr.VtValue PropToVtValue(SerializedProperty prop)
 0100        {
 0101            switch (prop.propertyType)
 102            {
 103                case SerializedPropertyType.AnimationCurve:
 104                    // TODO: needs to be broken down into atoms.
 0105                    return new pxr.VtValue();
 106                case SerializedPropertyType.ArraySize:
 0107                    return prop.intValue;
 108                case SerializedPropertyType.Boolean:
 0109                    return prop.boolValue;
 110                case SerializedPropertyType.Bounds:
 0111                    return UnityTypeConverter.BoundsToVtArray(prop.boundsValue);
 112                case SerializedPropertyType.BoundsInt:
 113                    // TODO: add this to UnityTypeConverter.
 0114                    var bi = prop.boundsIntValue;
 0115                    var bnds = new Bounds(bi.center, bi.size);
 0116                    return UnityTypeConverter.BoundsToVtArray(bnds);
 117                case SerializedPropertyType.Character:
 0118                    return prop.intValue;
 119                case SerializedPropertyType.Color:
 0120                    return UnityTypeConverter.ColorToVec4f(prop.colorValue);
 121                case SerializedPropertyType.Enum:
 0122                    return prop.enumDisplayNames[prop.enumValueIndex];
 123                case SerializedPropertyType.ExposedReference:
 124                    // TODO.
 125                    //return prop.exposedReferenceValue;
 0126                    return new pxr.VtValue();
 127                case SerializedPropertyType.FixedBufferSize:
 0128                    return prop.fixedBufferSize;
 129                case SerializedPropertyType.Float:
 0130                    return prop.floatValue;
 131                case SerializedPropertyType.Generic:
 0132                    return "GENERIC";
 133                case SerializedPropertyType.Gradient:
 134                    // TODO: gradientValue accessor is not public. wat?
 0135                    return "Gradient";
 136                case SerializedPropertyType.Integer:
 0137                    return prop.intValue;
 138                case SerializedPropertyType.LayerMask:
 0139                    return prop.intValue;
 140                case SerializedPropertyType.ObjectReference:
 0141                    var obj = prop.objectReferenceValue;
 0142                    if (obj == null)
 0143                    {
 0144                        return new pxr.VtValue("");
 145                    }
 146
 147                    // For object references in the scene, the asset path will be empty/null.
 148                    // However, for mesh and material instances in the scen, what do we want to do here?
 149                    // They are serialized to .unity files with just a file id, rather than fileid, pathid, and guid.
 0150                    string assetPath = AssetDatabase.GetAssetPath(prop.objectReferenceValue);
 0151                    if (string.IsNullOrEmpty(assetPath))
 0152                    {
 0153                        return new pxr.VtValue("");
 154                    }
 155
 0156                    var fileId = prop.FindPropertyRelative("m_FileID").intValue;
 0157                    var pathId = prop.FindPropertyRelative("m_PathID").intValue;
 0158                    string guid = AssetDatabase.AssetPathToGUID(assetPath);
 0159                    return prop.FindPropertyRelative("m_PathID").intValue + ":" + guid + ":" + fileId;
 160
 161                case SerializedPropertyType.Quaternion:
 0162                    return UnityTypeConverter.QuaternionToQuatf(prop.quaternionValue);
 163                case SerializedPropertyType.Rect:
 0164                    return UnityTypeConverter.RectToVtVec4(prop.rectValue);
 165                case SerializedPropertyType.RectInt:
 166                    // TODO: add this to UnityTypeConverter.
 0167                    var ri = prop.rectIntValue;
 0168                    return new pxr.GfVec4i(ri.x, ri.y, ri.width, ri.height);
 169                case SerializedPropertyType.String:
 0170                    return prop.stringValue;
 171                case SerializedPropertyType.Vector2:
 0172                    return UnityTypeConverter.Vector2ToVec2f(prop.vector2Value);
 173                case SerializedPropertyType.Vector2Int:
 174                    // TODO: add this to UnityTypeConverter.
 0175                    return new pxr.GfVec2i(prop.vector2IntValue.x, prop.vector2IntValue.y);
 176                case SerializedPropertyType.Vector3:
 0177                    return UnityTypeConverter.Vector3ToVec3f(prop.vector3Value);
 178                case SerializedPropertyType.Vector3Int:
 0179                    var v3 = prop.vector3IntValue;
 180                    // TODO: add this to UnityTypeConverter.
 0181                    return new pxr.GfVec3i(v3.x, v3.y, v3.z);
 182                case SerializedPropertyType.Vector4:
 0183                    return UnityTypeConverter.Vector4ToVec4f(prop.vector4Value);
 184            }
 185
 0186            return "UNKNOWN";
 0187        }
 188
 189        /// <summary>
 190        /// Converts a VtValue to a SerializedProperty, to reconstruct the USD scene in Unity.
 191        /// </summary>
 192        static public void VtValueToProp(SerializedProperty prop, pxr.VtValue val)
 0193        {
 0194            switch (prop.propertyType)
 195            {
 196                case SerializedPropertyType.AnimationCurve:
 197                    // TODO: needs to be broken down into atoms.
 0198                    throw new System.NotImplementedException();
 199                case SerializedPropertyType.ArraySize:
 200                    //prop.intValue = (int)val;
 0201                    break;
 202                case SerializedPropertyType.Boolean:
 0203                    prop.boolValue = (bool)val;
 0204                    break;
 205                case SerializedPropertyType.Bounds:
 0206                    prop.boundsValue = UnityTypeConverter.BoundsFromVtArray(val);
 0207                    break;
 208                case SerializedPropertyType.BoundsInt:
 209                    // TODO: add this to UnityTypeConverter.
 0210                    var bnds = UnityTypeConverter.BoundsFromVtArray(val);
 0211                    var center = new Vector3Int((int)bnds.center.x, (int)bnds.center.y, (int)bnds.center.z);
 0212                    var size = new Vector3Int((int)bnds.size.x, (int)bnds.size.y, (int)bnds.size.z);
 0213                    prop.boundsIntValue = new BoundsInt(center, size);
 0214                    break;
 215                case SerializedPropertyType.Character:
 0216                    prop.intValue = (int)val;
 0217                    break;
 218                case SerializedPropertyType.Color:
 0219                    prop.colorValue = UnityTypeConverter.Vec4fToColor(val);
 0220                    break;
 221                case SerializedPropertyType.Enum:
 0222                    prop.enumValueIndex = (int)val;
 0223                    break;
 224                case SerializedPropertyType.ExposedReference:
 225                    // TODO.
 226                    //prop.exposedReferenceValue;
 0227                    throw new System.NotImplementedException();
 228                case SerializedPropertyType.FixedBufferSize:
 229                    //prop.fixedBufferSize = (int)val;
 230                    // TODO.
 0231                    throw new System.NotImplementedException();
 232                case SerializedPropertyType.Float:
 0233                    prop.floatValue = (float)val;
 0234                    break;
 235                case SerializedPropertyType.Generic:
 0236                    throw new System.Exception();
 237                case SerializedPropertyType.Gradient:
 238                    // TODO: gradientValue accessor is not public. wat?
 0239                    throw new System.NotImplementedException();
 240                case SerializedPropertyType.Integer:
 0241                    prop.intValue = (int)val;
 0242                    break;
 243                case SerializedPropertyType.LayerMask:
 0244                    prop.intValue = (int)val;
 0245                    break;
 246                case SerializedPropertyType.ObjectReference:
 247                    /*
 248                    var v2i = (pxr.GfVec2i)val;
 249                    if (v2i[0] == 0 && v2i[1] == 0) {
 250                      break;
 251                    }
 252                    Debug.Log("FileID: " + v2i[0] + " PathID: " + v2i[1]);
 253                    */
 0254                    if (val.IsEmpty())
 0255                    {
 0256                        break;
 257                    }
 258
 0259                    string strValue = pxr.UsdCs.VtValueTostring(val);
 0260                    if (string.IsNullOrEmpty(strValue))
 0261                    {
 0262                        break;
 263                    }
 264
 0265                    string[] names = strValue.Split(':');
 0266                    int pathId = int.Parse(names[0]);
 0267                    var guid = names[1];
 0268                    int fileId = int.Parse(names[2]);
 269
 0270                    string assetPath = AssetDatabase.GUIDToAssetPath(guid);
 0271                    Object[] objs = AssetDatabase.LoadAllAssetsAtPath(assetPath);
 272
 0273                    Object obj = objs[pathId];
 274
 0275                    Debug.Log("pathId: " + pathId
 276                        + " fileId: " + fileId
 277                        + " guid: " + guid.ToString()
 278                        + " obj: " + obj.ToString());
 279
 280                    //break;
 281                    /* TODO:
 282                    string expectedName = names[2];
 283                    if (objs[index].name != expectedName) {
 284                      Debug.LogWarning("Expected name '" + expectedName + "' but found '" + objs[index].name + "'");
 285                    }
 286                     */
 0287                    prop.FindPropertyRelative("m_PathID").intValue = pathId;
 0288                    prop.FindPropertyRelative("m_FileID").intValue = fileId;
 0289                    prop.objectReferenceValue = obj;
 290
 0291                    break;
 292                case SerializedPropertyType.Quaternion:
 0293                    prop.quaternionValue = UnityTypeConverter.QuatfToQuaternion(val);
 0294                    break;
 295                case SerializedPropertyType.Rect:
 0296                    prop.rectValue = UnityTypeConverter.Vec4fToRect(val);
 0297                    break;
 298                case SerializedPropertyType.RectInt:
 0299                    var rect = UnityTypeConverter.Vec4fToRect(val);
 0300                    prop.rectIntValue = new RectInt((int)rect.xMin, (int)rect.yMin,
 301                        (int)rect.width, (int)rect.height);
 0302                    break;
 303                case SerializedPropertyType.String:
 0304                    var s = (string)val;
 0305                    if (s == null)
 0306                    {
 0307                        break;
 308                    }
 309
 0310                    prop.stringValue = (string)val;
 0311                    break;
 312                case SerializedPropertyType.Vector2:
 0313                    prop.vector2Value = UnityTypeConverter.Vec2fToVector2(val);
 0314                    break;
 315                case SerializedPropertyType.Vector2Int:
 316                    // TODO: add this to UnityTypeConverter.
 0317                    var v2 = (pxr.GfVec2i)val;
 0318                    prop.vector2IntValue = new Vector2Int(v2[0], v2[1]);
 0319                    break;
 320                case SerializedPropertyType.Vector3:
 0321                    prop.vector3Value = UnityTypeConverter.Vec3fToVector3(val);
 0322                    break;
 323                case SerializedPropertyType.Vector3Int:
 324                    // TODO: add this to UnityTypeConverter.
 0325                    var v3 = (pxr.GfVec3i)val;
 0326                    prop.vector3IntValue = new Vector3Int(v3[0], v3[1], v3[2]);
 0327                    break;
 328                case SerializedPropertyType.Vector4:
 0329                    prop.vector4Value = UnityTypeConverter.Vec4fToVector4(val);
 0330                    break;
 331            }
 0332        }
 333
 334        /// <summary>
 335        /// Returns the SdfValueType for a given property, useful for creating attributes in USD to
 336        /// hold SerializedProperties.
 337        /// </summary>
 338        static public pxr.SdfValueTypeName GetSdfType(SerializedProperty prop)
 0339        {
 0340            switch (prop.propertyType)
 341            {
 342                case SerializedPropertyType.AnimationCurve:
 343                    // TODO: needs to be broken down into atoms.
 0344                    throw new System.NotImplementedException();
 345                case SerializedPropertyType.ArraySize:
 0346                    return SdfValueTypeNames.Int;
 347                case SerializedPropertyType.Boolean:
 0348                    return SdfValueTypeNames.Bool;
 349                case SerializedPropertyType.Bounds:
 0350                    return SdfValueTypeNames.Float3Array;
 351                case SerializedPropertyType.BoundsInt:
 0352                    return SdfValueTypeNames.Int3Array;
 353                case SerializedPropertyType.Character:
 0354                    return SdfValueTypeNames.Int;
 355                case SerializedPropertyType.Color:
 0356                    return SdfValueTypeNames.Float4;
 357                case SerializedPropertyType.Enum:
 0358                    return SdfValueTypeNames.String;
 359                case SerializedPropertyType.ExposedReference:
 360                    // TODO.
 361                    //prop.exposedReferenceValue;
 0362                    throw new System.NotImplementedException();
 363                case SerializedPropertyType.FixedBufferSize:
 364                    //prop.fixedBufferSize = (int)val;
 365                    // TODO.
 0366                    throw new System.NotImplementedException();
 367                case SerializedPropertyType.Float:
 0368                    return SdfValueTypeNames.Float;
 369                case SerializedPropertyType.Generic:
 0370                    throw new System.Exception();
 371                case SerializedPropertyType.Gradient:
 372                    // TODO: gradientValue accessor is not public. wat?
 0373                    throw new System.NotImplementedException();
 374                case SerializedPropertyType.Integer:
 0375                    return SdfValueTypeNames.Int;
 376                case SerializedPropertyType.LayerMask:
 0377                    return SdfValueTypeNames.Int;
 378                case SerializedPropertyType.ObjectReference:
 0379                    return SdfValueTypeNames.String;
 380                case SerializedPropertyType.Quaternion:
 0381                    return SdfValueTypeNames.Quatf;
 382                case SerializedPropertyType.Rect:
 0383                    return SdfValueTypeNames.Float4;
 384                case SerializedPropertyType.RectInt:
 0385                    return SdfValueTypeNames.Float4;
 386                case SerializedPropertyType.String:
 0387                    return SdfValueTypeNames.String;
 388                case SerializedPropertyType.Vector2:
 0389                    return SdfValueTypeNames.Float2;
 390                case SerializedPropertyType.Vector2Int:
 0391                    return SdfValueTypeNames.Int2;
 392                case SerializedPropertyType.Vector3:
 0393                    return SdfValueTypeNames.Float3;
 394                case SerializedPropertyType.Vector3Int:
 0395                    return SdfValueTypeNames.Int3;
 396                case SerializedPropertyType.Vector4:
 0397                    return SdfValueTypeNames.Float4;
 398            }
 399
 0400            throw new System.NotImplementedException();
 0401        }
 402    }
 403}
 404
 405#endif
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_PrimMap.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_PrimMap.html new file mode 100644 index 000000000..9bb5e3943 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_PrimMap.html @@ -0,0 +1,311 @@ + + + + + + +Unity.Formats.USD.PrimMap - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.PrimMap
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/PrimMap.cs
Covered lines:57
Uncovered lines:26
Coverable lines:83
Total lines:171
Line coverage:68.6% (57 of 83)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
PrimMap()0%000100%
TryGetValue(...)0%000100%
GetEnumerator()0%0000%
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<pxr.SdfPath,UnityEngine.GameObject>>.GetEnumerator()0%0000%
AddInstance(...)0%000100%
AddMasterRoot(...)0%000100%
AddInstanceRoot(...)0%000100%
GetMasterRootPaths()0%000100%
GetInstanceRoots()0%000100%
DestroyAll()0%0000%
Clear()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/PrimMap.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections;
 16using System.Collections.Generic;
 17using pxr;
 18using UnityEngine;
 19
 20namespace Unity.Formats.USD
 21{
 22    /// <summary>
 23    /// Maps from UsdPrim paths to Unity GameObjects.
 24    /// </summary>
 25    public class PrimMap : IEnumerable<KeyValuePair<SdfPath, GameObject>>, IEnumerable
 26    {
 27        public struct InstanceRoot
 28        {
 29            public GameObject gameObject;
 30            public SdfPath masterPath;
 31        }
 32
 7333        public UsdSkelCache SkelCache = null;
 34        public Dictionary<SdfPath, UsdSkelBindingVector> SkelBindings;
 35
 7336        public Dictionary<SdfPath, UsdSkelSkinningQuery> SkinningQueries =
 37            new Dictionary<SdfPath, UsdSkelSkinningQuery>();
 38
 7339        public Dictionary<SdfPath, MeshImporter.GeometrySubsets> MeshSubsets =
 40            new Dictionary<SdfPath, MeshImporter.GeometrySubsets>();
 41
 21942        public SdfPath[] Cameras { get; set; }
 29243        public SdfPath[] Meshes { get; set; }
 21944        public SdfPath[] Cubes { get; set; }
 21945        public SdfPath[] Spheres { get; set; }
 29246        public SdfPath[] Xforms { get; set; }
 29247        public SdfPath[] SkelRoots { get; set; }
 22248        public SdfPath[] Skeletons { get; set; }
 14749        public SdfPath[] Materials { get; set; }
 50
 51        // Normal objects in the hierarchy.
 7352        private Dictionary<SdfPath, GameObject> m_prims = new Dictionary<SdfPath, GameObject>();
 53
 54        // Objects at the root of an instanced sub-tree.
 55        // Instances may be found in masters as well.
 7356        private Dictionary<SdfPath, InstanceRoot> m_instanceRoots = new Dictionary<SdfPath, InstanceRoot>();
 7357        private HashSet<GameObject> m_instances = new HashSet<GameObject>();
 58
 59        // Objects which exist only as source of instances.
 7360        private Dictionary<SdfPath, GameObject> m_masterRoots = new Dictionary<SdfPath, GameObject>();
 61
 7362        public PrimMap()
 7363        {
 7364        }
 65
 66        public GameObject this[SdfPath path]
 67        {
 68            get
 34469            {
 70                GameObject go;
 34471                if (m_prims.TryGetValue(path, out go))
 34472                {
 34473                    return go;
 74                }
 75
 076                throw new KeyNotFoundException("The path <" + path + "> does not exist in the PrimMap");
 34477            }
 124878            set { m_prims[path] = value; }
 79        }
 80
 81        public bool TryGetValue(SdfPath key, out GameObject obj)
 93382        {
 93383            return m_prims.TryGetValue(key, out obj);
 93384        }
 85
 86        public IEnumerator GetEnumerator()
 087        {
 088            return m_prims.GetEnumerator();
 089        }
 90
 91        IEnumerator<KeyValuePair<SdfPath, GameObject>>
 92        IEnumerable<KeyValuePair<SdfPath, GameObject>>.GetEnumerator()
 093        {
 094            return m_prims.GetEnumerator();
 095        }
 96
 97        public void AddInstance(GameObject goInst)
 20998        {
 20999            m_instances.Add(goInst);
 209100        }
 101
 102        public void AddMasterRoot(SdfPath path, GameObject go)
 3103        {
 3104            m_masterRoots[path] = go;
 3105            this[path] = go;
 3106        }
 107
 108        public void AddInstanceRoot(SdfPath instancePath, GameObject go, SdfPath masterPath)
 9109        {
 9110            m_instanceRoots[instancePath] = new InstanceRoot { gameObject = go, masterPath = masterPath };
 9111        }
 112
 113        public Dictionary<SdfPath, GameObject>.KeyCollection GetMasterRootPaths()
 73114        {
 73115            return m_masterRoots.Keys;
 73116        }
 117
 118        public Dictionary<SdfPath, InstanceRoot>.ValueCollection GetInstanceRoots()
 73119        {
 73120            return m_instanceRoots.Values;
 73121        }
 122
 123        /// <summary>
 124        /// Destroy all GameObjects and clear the map.
 125        /// </summary>
 126        public void DestroyAll()
 0127        {
 128            // When running in-editor DestroyImmediate must be used.
 0129            foreach (var go in m_prims.Values)
 0130            {
 0131                GameObject.DestroyImmediate(go);
 0132            }
 133
 0134            foreach (var instance in m_instanceRoots.Values)
 0135            {
 0136                GameObject.DestroyImmediate(instance.gameObject);
 0137            }
 138
 0139            foreach (var go in m_instances)
 0140            {
 0141                GameObject.DestroyImmediate(go);
 0142            }
 143
 0144            foreach (var go in m_masterRoots.Values)
 0145            {
 0146                GameObject.DestroyImmediate(go);
 0147            }
 148
 0149            m_prims.Clear();
 0150        }
 151
 152        /// <summary>
 153        /// Clear the map without destroying game objects.
 154        /// </summary>
 155        public void Clear()
 73156        {
 73157            m_prims.Clear();
 73158            m_masterRoots.Clear();
 73159            m_instances.Clear();
 73160            m_instanceRoots.Clear();
 73161            Cameras = null;
 73162            Meshes = null;
 73163            Cubes = null;
 73164            Spheres = null;
 73165            Xforms = null;
 73166            SkelRoots = null;
 73167            Skeletons = null;
 73168            Materials = null;
 73169        }
 170    }
 171}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ReadAllJob_T_.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ReadAllJob_T_.html new file mode 100644 index 000000000..f8a46dc17 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ReadAllJob_T_.html @@ -0,0 +1,297 @@ + + + + + + +Unity.Formats.USD.ReadAllJob[T] - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ReadAllJob[T]
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/ReadJob.cs
Covered lines:55
Uncovered lines:24
Coverable lines:79
Total lines:176
Line coverage:69.6% (55 of 79)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
get_Current()0%0000%
ReadAllJob(...)0%000100%
ShouldReadPath(...)0%000100%
Run()0%0000%
Execute(...)0%00071.43%
MoveNext()0%00088.24%
Reset()0%0000%
Dispose()0%000100%
GetEnumerator()0%000100%
GetEnumerator()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/ReadJob.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using Unity.Jobs;
 18using pxr;
 19using System.Collections;
 20using System.Threading;
 21using USD.NET;
 22
 23namespace Unity.Formats.USD
 24{
 25    /// <summary>
 26    /// Uses the C# job system to read all data for the given path list and presents it as an
 27    /// enumerator.
 28    /// </summary>
 29    /// <remarks>
 30    /// Internally the reads happen in a background thread while the main thread is unblocked to
 31    /// begin processing the data as it arrives.
 32    ///
 33    /// Note because this class is templated on T, the static variables are unique to each
 34    /// instantiation of T; this is true regardless of whether or not the static uses type T.
 35    /// </remarks>
 36    public struct ReadAllJob<T> :
 37        IEnumerator<SampleEnumerator<T>.SampleHolder>,
 38            IEnumerable<SampleEnumerator<T>.SampleHolder>,
 39            IJobParallelFor
 40        where T : SampleBase, ISanitizable, new()
 41    {
 42        static private Scene m_scene;
 43        static private SdfPath[] m_paths;
 44        static private T[] m_results;
 45
 46        // Previously, setting elements in a bool[] caused a data race, resumably because of
 47        // bit packing. Here we use an object[] to avoid this, however there was no negative
 48        // effect of using a bool[] here, though the bug may have just not presented itself.
 49        // An alternative lock-free implementation would also be fine (preferable) here.
 50        static private object[] m_done;
 51
 52        static SampleEnumerator<T>.SampleHolder m_current;
 53        static private AutoResetEvent m_ready;
 54
 55        static SceneImportOptions m_importOptions;
 56
 57        public SampleEnumerator<T>.SampleHolder Current
 58        {
 81659            get { return m_current; }
 60        }
 61
 62        object IEnumerator.Current
 63        {
 064            get { return m_current; }
 65        }
 66
 67        public ReadAllJob(Scene scene, SdfPath[] paths, SceneImportOptions importOptions)
 14668        {
 14669            m_ready = new AutoResetEvent(false);
 14670            m_scene = scene;
 14671            m_results = new T[paths.Length];
 14672            m_done = new object[paths.Length];
 14673            m_current = new SampleEnumerator<T>.SampleHolder();
 14674            m_paths = paths;
 14675            m_importOptions = importOptions;
 14676        }
 77
 78        private bool ShouldReadPath(Scene scene, SdfPath path)
 1579        {
 1580            return scene.AccessMask == null
 81                || scene.IsPopulatingAccessMask
 82                || scene.AccessMask.Included.ContainsKey(path);
 1583        }
 84
 85        public void Run()
 086        {
 087            for (int i = 0; i < m_paths.Length; i++)
 088            {
 089                Execute(i);
 090            }
 091        }
 92
 93        public void Execute(int index)
 1594        {
 1595            var sample = new T();
 1596            if (ShouldReadPath(m_scene, m_paths[index]))
 1597            {
 1598                m_scene.Read(m_paths[index], sample);
 1599                sample.Sanitize(m_scene, m_importOptions);
 15100            }
 101            else
 0102            {
 0103                sample = null;
 104                // Any object value works here, the test below is if m_done[i] == null.
 0105                m_done[index] = true;
 0106            }
 107
 15108            m_results[index] = sample;
 109
 15110            m_ready.Set();
 15111        }
 112
 113        public bool MoveNext()
 418114        {
 418115            bool hasWork = true;
 116
 418117            int j = 0;
 654118            while (hasWork)
 654119            {
 654120                hasWork = false;
 5548121                for (int i = 0; i < m_done.Length; i++)
 2120122                {
 2120123                    hasWork = hasWork || (m_done[i] == null);
 2120124                }
 125
 654126                if (!hasWork)
 146127                {
 146128                    return false;
 129                }
 130
 3428131                for (int i = 0; i < m_done.Length; i++)
 1478132                {
 1478133                    if (m_done[i] == null && m_results[i] != null)
 272134                    {
 272135                        m_current.path = m_paths[i];
 272136                        m_current.sample = m_results[i];
 272137                        m_done[i] = true;
 272138                        return true;
 139                    }
 1206140                }
 141
 236142                j++;
 236143                if (!m_ready.WaitOne(1000))
 0144                {
 0145                    Debug.LogError("Timed out while waiting for thread read");
 0146                    return false;
 147                }
 236148            }
 149
 0150            return false;
 418151        }
 152
 153        public void Reset()
 0154        {
 0155            for (int i = 0; i < m_done.Length; i++)
 0156            {
 0157                m_done[i] = false;
 0158            }
 0159        }
 160
 161        public void Dispose()
 146162        {
 146163            m_ready.Close();
 146164        }
 165
 166        public IEnumerator<SampleEnumerator<T>.SampleHolder> GetEnumerator()
 146167        {
 146168            return this;
 146169        }
 170
 171        IEnumerator IEnumerable.GetEnumerator()
 0172        {
 0173            return this;
 0174        }
 175    }
 176}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedCameraSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedCameraSample.html new file mode 100644 index 000000000..85bb22892 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedCameraSample.html @@ -0,0 +1,586 @@ + + + + + + +Unity.Formats.USD.SanitizedCameraSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SanitizedCameraSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:484
Line coverage:100% (4 of 4)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Sanitize(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Runtime.CompilerServices;
 4using pxr;
 5using USD.NET;
 6using USD.NET.Unity;
 7using UnityEngine;
 8
 9[assembly: InternalsVisibleToAttribute("Unity.Formats.USD.Tests.Runtime")]
 10namespace Unity.Formats.USD
 11{
 12    public interface ISanitizable
 13    {
 14        /// <summary>
 15        /// Sanitize the USD data held by this sample to your target specifications according to the import options.
 16        /// </summary>
 17        void Sanitize(Scene scene, SceneImportOptions importOptions);
 18    }
 19
 20    /// <summary>
 21    /// A sanitizable version of an XFormSample. Enable automatic change of handedness.
 22    /// </summary>
 23    public class SanitizedXformSample : XformSample, ISanitizable
 24    {
 25        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 26        {
 27            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 28                ConvertTransform();
 29        }
 30    }
 31
 32    /// <summary>
 33    /// A sanitizable version of an CameraSample. Enable automatic change of handedness.
 34    /// </summary>
 35    public class SanitizedCameraSample : CameraSample, ISanitizable
 36    {
 37        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 1438        {
 1439            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 1240                ConvertTransform();
 1441        }
 42    }
 43
 44    /// <summary>
 45    /// A sanitizable version of a MeshSample. Enable automatic triangulation/handedness change/attribute interpolation 
 46    /// </summary>
 47    public class SanitizedMeshSample : MeshSample, ISanitizable
 48    {
 49        /// <summary>
 50        /// Store the face vertex counts straight from USD deserialization
 51        /// </summary>
 52        int[] originalFaceVertexCounts;
 53
 54        /// <summary>
 55        /// Store the face vertex indices straight from USD deserialization
 56        /// </summary>
 57        int[] originalFaceVertexIndices;
 58
 59        /// <summary>
 60        /// True when the mesh arrays have been converted to facevarying
 61        /// </summary>
 62        internal bool arePrimvarsFaceVarying;
 63
 64        /// <summary>
 65        /// After triangulation face ids are no longer correct. This maps old face ids to the new triangulated face ids.
 66        /// </summary>
 67        internal List<List<int>> faceMapping;
 68
 69        /// <summary>
 70        /// To unweld vertex attributes after the fact (skin weights, joint indices, ...) we need to store the face
 71        /// vertex indices post triangulation but before unweld.
 72        /// </summary>
 73        internal int[] triangulatedFaceVertexIndices;
 74
 75
 76        /// <summary>
 77        /// Sanitize Mesh data for Unity:
 78        ///     * change basis
 79        ///     * triangulate
 80        ///     * convert vertices and attributes/primvar to facevarying if necessary
 81        /// </summary>
 82        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 83        {
 84            var changeHandedness = importOptions.changeHandedness == BasisTransformation.SlowAndSafe ||
 85                importOptions.changeHandedness == BasisTransformation.SlowAndSafeAsFBX;
 86            // Start with the xform
 87            if (changeHandedness)
 88                ConvertTransform();
 89
 90            var santizePrimvars = importOptions.ShouldBindMaterials ||
 91                scene.IsPopulatingAccessMask || scene.AccessMask != null;                        //this is true when rea
 92
 93            var unwindVertices = ShouldUnwindVertices(changeHandedness);
 94            if (points == null)
 95                return;
 96
 97            // Points
 98            // originalPointCount = points.Length;
 99            if (changeHandedness)
 100            {
 101                for (var i = 0; i < points.Length; i++)
 102                    points[i] = UnityTypeConverter.ChangeBasis(points[i]);
 103            }
 104
 105            // Topology
 106            Triangulate(unwindVertices);
 107
 108            // Normals
 109            if (normals != null && changeHandedness)
 110            {
 111                for (var i = 0; i < normals.Length; i++)
 112                {
 113                    normals[i] = UnityTypeConverter.ChangeBasis(normals[i]);
 114                }
 115            }
 116
 117            // Bounds
 118            if (changeHandedness)
 119                extent.center = UnityTypeConverter.ChangeBasis(extent.center);
 120
 121            // Tangents
 122            // TODO: we should check interpolation
 123            if (changeHandedness && tangents != null)
 124            {
 125                var newTangents = new Vector4[tangents.Length];
 126                for (var i = 0; i < tangents.Length; i++)
 127                {
 128                    var w = tangents[i].w;
 129                    var t = UnityTypeConverter.ChangeBasis(tangents[i]);
 130                    newTangents[i] = new Vector4(t.x, t.y, t.z, w);
 131                }
 132            }
 133
 134            // Colors
 135            if (colors.value != null && colors.indices != null)
 136            {
 137                Flatten(ref colors.value, colors.indices);
 138            }
 139
 140            // UVs
 141            if (santizePrimvars)
 142            {
 143                FlattenUVs(st);
 144                FlattenUVs(uv);
 145                FlattenUVs(uv2);
 146                FlattenUVs(uv3);
 147                FlattenUVs(uv4);
 148            }
 149
 150            if (!ShouldUnweldVertices(santizePrimvars))
 151                return;
 152
 153            // At that point we know that primvars are of different interpolation type.
 154            // For now we use the worst case scenario which is to unroll all the values to faceVarying interpolation.
 155            // TODO: A more efficient solution would be to detect the larger interpolation type used across all primvars
 156            // and unroll values up to that interpolation type.
 157            if (normals == null)
 158            {
 159                normals = new Vector3[points.Length];
 160                ComputeNormals(points, faceVertexIndices, ref normals);
 161                Flatten(ref normals, faceVertexIndices);
 162            }
 163            else
 164            {
 165                ConvertInterpolationToFaceVarying(ref normals, faceVertexIndices, unwindVertices);
 166            }
 167
 168            ConvertInterpolationToFaceVarying(ref tangents, faceVertexIndices, unwindVertices);
 169
 170            ConvertInterpolationToFaceVarying(ref colors.value, faceVertexIndices, unwindVertices);
 171
 172            if (santizePrimvars)
 173            {
 174                UnweldUVs(st, unwindVertices);
 175                UnweldUVs(uv, unwindVertices);
 176                UnweldUVs(uv2, unwindVertices);
 177                UnweldUVs(uv3, unwindVertices);
 178                UnweldUVs(uv4, unwindVertices);
 179            }
 180
 181            // Convert points last, as points count might be used to guess the interpolation of other attributes
 182            // also update the vertex mapping
 183            Flatten(ref points, faceVertexIndices);
 184
 185            // Now that all attributes and primvar are converted to facevarying, update the faceIndices
 186            for (var i = 0; i < faceVertexIndices.Length; i++)
 187                faceVertexIndices[i] = i;
 188
 189
 190            arePrimvarsFaceVarying = true;
 191        }
 192
 193        /// <summary>
 194        /// Triangulate the usd mesh, compute the face mapping to remap face sets and store original face vertex counts
 195        /// and indices to unroll attributes and primvars.
 196        /// </summary>
 197        /// <param name="changeHandedness"></param>
 198        internal void Triangulate(bool changeHandedness)
 199        {
 200            originalFaceVertexCounts = faceVertexCounts;
 201            originalFaceVertexIndices = faceVertexIndices;
 202            faceMapping = new List<List<int>>();
 203
 204            var newIndices = new List<int>();
 205            var newCounts = new List<int>();
 206
 207            var last = 0;
 208            var currentOffset = 0;
 209            for (var i = 0; i < faceVertexCounts.Length; i++)
 210            {
 211                faceMapping.Add(new List<int>());
 212
 213                var next = last + 1;
 214                var t = 0;
 215                for (; t < faceVertexCounts[i] - 2; t++)
 216                {
 217                    newCounts.Add(3);
 218                    if (changeHandedness)
 219                    {
 220                        newIndices.Add(faceVertexIndices[next++]);
 221                        newIndices.Add(faceVertexIndices[last]);
 222                        newIndices.Add(faceVertexIndices[next]);
 223                    }
 224                    else
 225                    {
 226                        newIndices.Add(faceVertexIndices[last]);
 227                        newIndices.Add(faceVertexIndices[next++]);
 228                        newIndices.Add(faceVertexIndices[next]);
 229                    }
 230                    faceMapping[i].Add(currentOffset++);
 231                }
 232                last += faceVertexCounts[i];
 233            }
 234
 235            faceVertexIndices = newIndices.ToArray();
 236            triangulatedFaceVertexIndices = newIndices.ToArray();
 237            faceVertexCounts = newCounts.ToArray();
 238        }
 239
 240        internal bool ShouldUnweldVertices(bool bindMaterials)
 241        {
 242            // If any primvar is face varying (1 value per vertex) or uniform (1 value per face), all  primvars + mesh a
 243            // TODO: expose interpolation for standard mesh attributes (normals, tangents)
 244            return normals != null && (normals.Length == originalFaceVertexCounts.Length || normals.Length > points.Leng
 245                colors != null && (colors.GetInterpolationToken() == UsdGeomTokens.uniform || colors.GetInterpolationTok
 246                tangents != null &&
 247                (tangents.Length == originalFaceVertexCounts.Length || tangents.Length > points.Length) ||
 248                bindMaterials &&
 249                (st.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 250                    uv.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 251                    uv2.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 252                    uv3.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 253                    uv4.GetInterpolationToken() == UsdGeomTokens.faceVarying);
 254        }
 255
 256        internal static void Flatten<T>(ref T[] values, int[] indices)
 257        {
 258            if (values == null || indices == null)
 259                return;
 260
 261            var newValues = new T[indices.Length];
 262            for (var i = 0; i < indices.Length; i++)
 263            {
 264                newValues[i] = values[indices[i]];
 265            }
 266
 267            values = newValues;
 268        }
 269
 270        void UnweldUVs(Primvar<object> primvar, bool changeHandedness)
 271        {
 272            if (primvar.value == null)
 273                return;
 274
 275            if (primvar.GetInterpolationToken() == UsdGeomTokens.constant)
 276            {
 277                UsdIo.ArrayAllocator.Free(primvar.value.GetType(), (uint)(primvar.value as Array).GetLength(0),
 278                    primvar.value as Array);
 279                return;
 280            }
 281
 282            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 283            // the actual type of value.
 284            if (primvar.value.GetType() == typeof(Vector2[]))
 285            {
 286                var value = primvar.value as Vector2[];
 287                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 288                primvar.SetValue(value);
 289                return;
 290            }
 291
 292            if (primvar.value.GetType() == typeof(Vector3[]))
 293            {
 294                var value = primvar.value as Vector3[];
 295                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 296                primvar.SetValue(value);
 297                return;
 298            }
 299
 300            if (primvar.value.GetType() == typeof(Vector4[]))
 301            {
 302                var value = primvar.value as Vector4[];
 303                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 304                primvar.SetValue(value);
 305                return;
 306            }
 307        }
 308
 309        static void FlattenUVs(Primvar<object> primvar)
 310        {
 311            if (primvar.value == null)
 312                return;
 313
 314            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 315            // the actual type of value.
 316            if (primvar.value.GetType() == typeof(Vector2[]))
 317            {
 318                var value = primvar.value as Vector2[];
 319                Flatten(ref value, primvar.indices);
 320                primvar.SetValue(value);
 321                return;
 322            }
 323
 324            if (primvar.value.GetType() == typeof(Vector3[]))
 325            {
 326                var value = primvar.value as Vector3[];
 327                Flatten(ref value, primvar.indices);
 328                primvar.SetValue(value);
 329                return;
 330            }
 331
 332            if (primvar.value.GetType() == typeof(Vector4[]))
 333            {
 334                var value = primvar.value as Vector4[];
 335                Flatten(ref value, primvar.indices);
 336                primvar.SetValue(value);
 337                return;
 338            }
 339        }
 340
 341        internal static void TriangulateAttributes<T>(ref T[] values, int[] faceVertexCount, bool changeHandedness)
 342        {
 343            var newValues = new List<T>();
 344            var last = 0;
 345            for (var i = 0; i < faceVertexCount.Length; i++)
 346            {
 347                var next = last + 1;
 348                for (var t = 0; t < faceVertexCount[i] - 2; t++)
 349                    if (changeHandedness)
 350                    {
 351                        newValues.Add(values[next++]);
 352                        newValues.Add(values[last]);
 353                        newValues.Add(values[next]);
 354                    }
 355                    else
 356                    {
 357                        newValues.Add(values[last]);
 358                        newValues.Add(values[next++]);
 359                        newValues.Add(values[next]);
 360                    }
 361
 362                last += faceVertexCount[i];
 363            }
 364
 365            values = newValues.ToArray();
 366        }
 367
 368        /// <summary>
 369        /// Utility method to convert a given array of values to the equivalent faceVarying array (one value per vertex 
 370        /// </summary>
 371        /// <remarks> If the interpolation of the array to convert is not known, it will be guessed based on the length 
 372        void ConvertInterpolationToFaceVarying<T>(ref T[] values, int[] vertexIndices, bool changeHandedness = false, Tf
 373        {
 374            if (values == null)
 375                return;
 376
 377            if (interpolation == null)
 378                interpolation = GuessInterpolation(values.Length);
 379
 380            if (interpolation == UsdGeomTokens.constant)
 381            {
 382                // Ignore, constant values are supported by the importer
 383            }
 384            if (interpolation == UsdGeomTokens.uniform) // 1 value per face
 385            {
 386                UniformToFaceVarying(ref values, vertexIndices.Length);
 387            }
 388            else if (interpolation == UsdGeomTokens.vertex || interpolation == UsdGeomTokens.varying) // 1 value per poi
 389            {
 390                Flatten(ref values, faceVertexIndices);
 391            }
 392            else if (interpolation == UsdGeomTokens.faceVarying) // 1 value per vertex per triangle
 393            {
 394                TriangulateAttributes(ref values, originalFaceVertexCounts, changeHandedness);
 395            }
 396        }
 397
 398        /// <summary>
 399        /// Returns the interpolation of an data array based on the number of elements
 400        /// </summary>
 401        /// <param name="count"> The number of elements in the array</param>
 402        /// <remarks>
 403        /// This is a fallback mechanism when the interpolation token is not available for a given attribute.
 404        /// It might also fail in the case of degenerate polygons or single face mesh (vertex & face-varying are undisti
 405        /// </remarks>
 406        internal TfToken GuessInterpolation(int count)
 407        {
 408            if (count == 1)
 409            {
 410                return UsdGeomTokens.constant;
 411            }
 412            if (count == originalFaceVertexCounts.Length)
 413            {
 414                return UsdGeomTokens.uniform;
 415            }
 416            if (count == points.Length)
 417            {
 418                return UsdGeomTokens.vertex;
 419            }
 420            if (count == originalFaceVertexIndices.Length)
 421            {
 422                return UsdGeomTokens.faceVarying;
 423            }
 424
 425            return new TfToken();
 426        }
 427
 428        /// <summary>
 429        /// Convert an array of data per face to an array of data per vertex per triangle.
 430        /// Assume the input array is not indexed.
 431        /// </summary>
 432        /// <param name="values"> The data to convert</param>
 433        /// <param name="vertexCount"> The number of mesh vertices</param>
 434        /// <typeparam name="T"></typeparam>
 435        internal void UniformToFaceVarying<T>(ref T[] values, int vertexCount)
 436        {
 437            var newValues = new T[vertexCount];
 438            for (var faceIdx = 0; faceIdx < values.Length; faceIdx++)
 439            {
 440                var newFaceIndices = faceMapping[faceIdx];
 441                var value = values[faceIdx];
 442                foreach (var newFaceIdx in newFaceIndices)
 443                {
 444                    newValues[newFaceIdx * 3] = value;
 445                    newValues[newFaceIdx * 3 + 1] = value;
 446                    newValues[newFaceIdx * 3 + 2] = value;
 447                }
 448            }
 449
 450            values = newValues;
 451        }
 452
 453        static void ComputeNormals(Vector3[] points, int[] faceVertexIndices, ref Vector3[] normals)
 454        {
 455            for (int faceIndex = 0; faceIndex < faceVertexIndices.Length / 3; faceIndex++)
 456            {
 457                int i0 = faceVertexIndices[faceIndex * 3];
 458                int i1 = faceVertexIndices[faceIndex * 3 + 1];
 459                int i2 = faceVertexIndices[faceIndex * 3 + 2];
 460
 461                Vector3 e1 = points[i1];
 462                e1 -= points[i0];
 463                Vector3 e2 = points[i2];
 464                e2 -= points[i0];
 465                Vector3 n = Vector3.Cross(e1, e2);
 466
 467                normals[i0] += n;
 468                normals[i1] += n;
 469                normals[i2] += n;
 470            }
 471
 472            for (int i = 0; i < normals.Length; i++)
 473            {
 474                normals[i].Normalize();
 475            }
 476        }
 477
 478        internal bool ShouldUnwindVertices(bool changeHandedness)
 479        {
 480            return changeHandedness && orientation == Orientation.RightHanded ||
 481                !changeHandedness && orientation == Orientation.LeftHanded;
 482        }
 483    }
 484}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedMeshSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedMeshSample.html new file mode 100644 index 000000000..a90926540 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedMeshSample.html @@ -0,0 +1,608 @@ + + + + + + +Unity.Formats.USD.SanitizedMeshSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SanitizedMeshSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs
Covered lines:226
Uncovered lines:37
Coverable lines:263
Total lines:484
Line coverage:85.9% (226 of 263)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Sanitize(...)0%00084.81%
Triangulate(...)0%000100%
ShouldUnweldVertices(...)0%000100%
Flatten[T](...)0%000100%
UnweldUVs(...)0%00042.31%
FlattenUVs(...)0%00045.45%
TriangulateAttributes[T](...)0%000100%
ConvertInterpolationToFaceVarying[T](...)0%000100%
GuessInterpolation(...)0%000100%
UniformToFaceVarying[T](...)0%000100%
ComputeNormals(...)0%000100%
ShouldUnwindVertices(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Runtime.CompilerServices;
 4using pxr;
 5using USD.NET;
 6using USD.NET.Unity;
 7using UnityEngine;
 8
 9[assembly: InternalsVisibleToAttribute("Unity.Formats.USD.Tests.Runtime")]
 10namespace Unity.Formats.USD
 11{
 12    public interface ISanitizable
 13    {
 14        /// <summary>
 15        /// Sanitize the USD data held by this sample to your target specifications according to the import options.
 16        /// </summary>
 17        void Sanitize(Scene scene, SceneImportOptions importOptions);
 18    }
 19
 20    /// <summary>
 21    /// A sanitizable version of an XFormSample. Enable automatic change of handedness.
 22    /// </summary>
 23    public class SanitizedXformSample : XformSample, ISanitizable
 24    {
 25        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 26        {
 27            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 28                ConvertTransform();
 29        }
 30    }
 31
 32    /// <summary>
 33    /// A sanitizable version of an CameraSample. Enable automatic change of handedness.
 34    /// </summary>
 35    public class SanitizedCameraSample : CameraSample, ISanitizable
 36    {
 37        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 38        {
 39            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 40                ConvertTransform();
 41        }
 42    }
 43
 44    /// <summary>
 45    /// A sanitizable version of a MeshSample. Enable automatic triangulation/handedness change/attribute interpolation 
 46    /// </summary>
 47    public class SanitizedMeshSample : MeshSample, ISanitizable
 48    {
 49        /// <summary>
 50        /// Store the face vertex counts straight from USD deserialization
 51        /// </summary>
 52        int[] originalFaceVertexCounts;
 53
 54        /// <summary>
 55        /// Store the face vertex indices straight from USD deserialization
 56        /// </summary>
 57        int[] originalFaceVertexIndices;
 58
 59        /// <summary>
 60        /// True when the mesh arrays have been converted to facevarying
 61        /// </summary>
 62        internal bool arePrimvarsFaceVarying;
 63
 64        /// <summary>
 65        /// After triangulation face ids are no longer correct. This maps old face ids to the new triangulated face ids.
 66        /// </summary>
 67        internal List<List<int>> faceMapping;
 68
 69        /// <summary>
 70        /// To unweld vertex attributes after the fact (skin weights, joint indices, ...) we need to store the face
 71        /// vertex indices post triangulation but before unweld.
 72        /// </summary>
 73        internal int[] triangulatedFaceVertexIndices;
 74
 75
 76        /// <summary>
 77        /// Sanitize Mesh data for Unity:
 78        ///     * change basis
 79        ///     * triangulate
 80        ///     * convert vertices and attributes/primvar to facevarying if necessary
 81        /// </summary>
 82        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 14583        {
 14584            var changeHandedness = importOptions.changeHandedness == BasisTransformation.SlowAndSafe ||
 85                importOptions.changeHandedness == BasisTransformation.SlowAndSafeAsFBX;
 86            // Start with the xform
 14587            if (changeHandedness)
 12988                ConvertTransform();
 89
 14590            var santizePrimvars = importOptions.ShouldBindMaterials ||
 91                scene.IsPopulatingAccessMask || scene.AccessMask != null;                        //this is true when rea
 92
 14593            var unwindVertices = ShouldUnwindVertices(changeHandedness);
 14594            if (points == null)
 095                return;
 96
 97            // Points
 98            // originalPointCount = points.Length;
 14599            if (changeHandedness)
 129100            {
 11072101                for (var i = 0; i < points.Length; i++)
 5407102                    points[i] = UnityTypeConverter.ChangeBasis(points[i]);
 129103            }
 104
 105            // Topology
 145106            Triangulate(unwindVertices);
 107
 108            // Normals
 145109            if (normals != null && changeHandedness)
 12110            {
 328111                for (var i = 0; i < normals.Length; i++)
 152112                {
 152113                    normals[i] = UnityTypeConverter.ChangeBasis(normals[i]);
 152114                }
 12115            }
 116
 117            // Bounds
 145118            if (changeHandedness)
 129119                extent.center = UnityTypeConverter.ChangeBasis(extent.center);
 120
 121            // Tangents
 122            // TODO: we should check interpolation
 145123            if (changeHandedness && tangents != null)
 0124            {
 0125                var newTangents = new Vector4[tangents.Length];
 0126                for (var i = 0; i < tangents.Length; i++)
 0127                {
 0128                    var w = tangents[i].w;
 0129                    var t = UnityTypeConverter.ChangeBasis(tangents[i]);
 0130                    newTangents[i] = new Vector4(t.x, t.y, t.z, w);
 0131                }
 0132            }
 133
 134            // Colors
 145135            if (colors.value != null && colors.indices != null)
 13136            {
 13137                Flatten(ref colors.value, colors.indices);
 13138            }
 139
 140            // UVs
 145141            if (santizePrimvars)
 2142            {
 2143                FlattenUVs(st);
 2144                FlattenUVs(uv);
 2145                FlattenUVs(uv2);
 2146                FlattenUVs(uv3);
 2147                FlattenUVs(uv4);
 2148            }
 149
 145150            if (!ShouldUnweldVertices(santizePrimvars))
 109151                return;
 152
 153            // At that point we know that primvars are of different interpolation type.
 154            // For now we use the worst case scenario which is to unroll all the values to faceVarying interpolation.
 155            // TODO: A more efficient solution would be to detect the larger interpolation type used across all primvars
 156            // and unroll values up to that interpolation type.
 36157            if (normals == null)
 26158            {
 26159                normals = new Vector3[points.Length];
 26160                ComputeNormals(points, faceVertexIndices, ref normals);
 26161                Flatten(ref normals, faceVertexIndices);
 26162            }
 163            else
 10164            {
 10165                ConvertInterpolationToFaceVarying(ref normals, faceVertexIndices, unwindVertices);
 10166            }
 167
 36168            ConvertInterpolationToFaceVarying(ref tangents, faceVertexIndices, unwindVertices);
 169
 36170            ConvertInterpolationToFaceVarying(ref colors.value, faceVertexIndices, unwindVertices);
 171
 36172            if (santizePrimvars)
 2173            {
 2174                UnweldUVs(st, unwindVertices);
 2175                UnweldUVs(uv, unwindVertices);
 2176                UnweldUVs(uv2, unwindVertices);
 2177                UnweldUVs(uv3, unwindVertices);
 2178                UnweldUVs(uv4, unwindVertices);
 2179            }
 180
 181            // Convert points last, as points count might be used to guess the interpolation of other attributes
 182            // also update the vertex mapping
 36183            Flatten(ref points, faceVertexIndices);
 184
 185            // Now that all attributes and primvar are converted to facevarying, update the faceIndices
 2664186            for (var i = 0; i < faceVertexIndices.Length; i++)
 1296187                faceVertexIndices[i] = i;
 188
 189
 36190            arePrimvarsFaceVarying = true;
 145191        }
 192
 193        /// <summary>
 194        /// Triangulate the usd mesh, compute the face mapping to remap face sets and store original face vertex counts
 195        /// and indices to unroll attributes and primvars.
 196        /// </summary>
 197        /// <param name="changeHandedness"></param>
 198        internal void Triangulate(bool changeHandedness)
 149199        {
 149200            originalFaceVertexCounts = faceVertexCounts;
 149201            originalFaceVertexIndices = faceVertexIndices;
 149202            faceMapping = new List<List<int>>();
 203
 149204            var newIndices = new List<int>();
 149205            var newCounts = new List<int>();
 206
 149207            var last = 0;
 149208            var currentOffset = 0;
 15006209            for (var i = 0; i < faceVertexCounts.Length; i++)
 7354210            {
 7354211                faceMapping.Add(new List<int>());
 212
 7354213                var next = last + 1;
 7354214                var t = 0;
 35502215                for (; t < faceVertexCounts[i] - 2; t++)
 14074216                {
 14074217                    newCounts.Add(3);
 14074218                    if (changeHandedness)
 10090219                    {
 10090220                        newIndices.Add(faceVertexIndices[next++]);
 10090221                        newIndices.Add(faceVertexIndices[last]);
 10090222                        newIndices.Add(faceVertexIndices[next]);
 10090223                    }
 224                    else
 3984225                    {
 3984226                        newIndices.Add(faceVertexIndices[last]);
 3984227                        newIndices.Add(faceVertexIndices[next++]);
 3984228                        newIndices.Add(faceVertexIndices[next]);
 3984229                    }
 14074230                    faceMapping[i].Add(currentOffset++);
 14074231                }
 7354232                last += faceVertexCounts[i];
 7354233            }
 234
 149235            faceVertexIndices = newIndices.ToArray();
 149236            triangulatedFaceVertexIndices = newIndices.ToArray();
 149237            faceVertexCounts = newCounts.ToArray();
 149238        }
 239
 240        internal bool ShouldUnweldVertices(bool bindMaterials)
 145241        {
 242            // If any primvar is face varying (1 value per vertex) or uniform (1 value per face), all  primvars + mesh a
 243            // TODO: expose interpolation for standard mesh attributes (normals, tangents)
 145244            return normals != null && (normals.Length == originalFaceVertexCounts.Length || normals.Length > points.Leng
 245                colors != null && (colors.GetInterpolationToken() == UsdGeomTokens.uniform || colors.GetInterpolationTok
 246                tangents != null &&
 247                (tangents.Length == originalFaceVertexCounts.Length || tangents.Length > points.Length) ||
 248                bindMaterials &&
 249                (st.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 250                    uv.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 251                    uv2.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 252                    uv3.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 253                    uv4.GetInterpolationToken() == UsdGeomTokens.faceVarying);
 145254        }
 255
 256        internal static void Flatten<T>(ref T[] values, int[] indices)
 84257        {
 84258            if (values == null || indices == null)
 2259                return;
 260
 82261            var newValues = new T[indices.Length];
 5608262            for (var i = 0; i < indices.Length; i++)
 2722263            {
 2722264                newValues[i] = values[indices[i]];
 2722265            }
 266
 82267            values = newValues;
 84268        }
 269
 270        void UnweldUVs(Primvar<object> primvar, bool changeHandedness)
 10271        {
 10272            if (primvar.value == null)
 8273                return;
 274
 2275            if (primvar.GetInterpolationToken() == UsdGeomTokens.constant)
 0276            {
 0277                UsdIo.ArrayAllocator.Free(primvar.value.GetType(), (uint)(primvar.value as Array).GetLength(0),
 278                    primvar.value as Array);
 0279                return;
 280            }
 281
 282            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 283            // the actual type of value.
 2284            if (primvar.value.GetType() == typeof(Vector2[]))
 2285            {
 2286                var value = primvar.value as Vector2[];
 2287                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 2288                primvar.SetValue(value);
 2289                return;
 290            }
 291
 0292            if (primvar.value.GetType() == typeof(Vector3[]))
 0293            {
 0294                var value = primvar.value as Vector3[];
 0295                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 0296                primvar.SetValue(value);
 0297                return;
 298            }
 299
 0300            if (primvar.value.GetType() == typeof(Vector4[]))
 0301            {
 0302                var value = primvar.value as Vector4[];
 0303                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 0304                primvar.SetValue(value);
 0305                return;
 306            }
 10307        }
 308
 309        static void FlattenUVs(Primvar<object> primvar)
 10310        {
 10311            if (primvar.value == null)
 8312                return;
 313
 314            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 315            // the actual type of value.
 2316            if (primvar.value.GetType() == typeof(Vector2[]))
 2317            {
 2318                var value = primvar.value as Vector2[];
 2319                Flatten(ref value, primvar.indices);
 2320                primvar.SetValue(value);
 2321                return;
 322            }
 323
 0324            if (primvar.value.GetType() == typeof(Vector3[]))
 0325            {
 0326                var value = primvar.value as Vector3[];
 0327                Flatten(ref value, primvar.indices);
 0328                primvar.SetValue(value);
 0329                return;
 330            }
 331
 0332            if (primvar.value.GetType() == typeof(Vector4[]))
 0333            {
 0334                var value = primvar.value as Vector4[];
 0335                Flatten(ref value, primvar.indices);
 0336                primvar.SetValue(value);
 0337                return;
 338            }
 10339        }
 340
 341        internal static void TriangulateAttributes<T>(ref T[] values, int[] faceVertexCount, bool changeHandedness)
 23342        {
 23343            var newValues = new List<T>();
 23344            var last = 0;
 310345            for (var i = 0; i < faceVertexCount.Length; i++)
 132346            {
 132347                var next = last + 1;
 792348                for (var t = 0; t < faceVertexCount[i] - 2; t++)
 264349                    if (changeHandedness)
 138350                    {
 138351                        newValues.Add(values[next++]);
 138352                        newValues.Add(values[last]);
 138353                        newValues.Add(values[next]);
 138354                    }
 355                    else
 126356                    {
 126357                        newValues.Add(values[last]);
 126358                        newValues.Add(values[next++]);
 126359                        newValues.Add(values[next]);
 126360                    }
 361
 132362                last += faceVertexCount[i];
 132363            }
 364
 23365            values = newValues.ToArray();
 23366        }
 367
 368        /// <summary>
 369        /// Utility method to convert a given array of values to the equivalent faceVarying array (one value per vertex 
 370        /// </summary>
 371        /// <remarks> If the interpolation of the array to convert is not known, it will be guessed based on the length 
 372        void ConvertInterpolationToFaceVarying<T>(ref T[] values, int[] vertexIndices, bool changeHandedness = false, Tf
 84373        {
 84374            if (values == null)
 37375                return;
 376
 47377            if (interpolation == null)
 45378                interpolation = GuessInterpolation(values.Length);
 379
 47380            if (interpolation == UsdGeomTokens.constant)
 2381            {
 382                // Ignore, constant values are supported by the importer
 2383            }
 47384            if (interpolation == UsdGeomTokens.uniform) // 1 value per face
 19385            {
 19386                UniformToFaceVarying(ref values, vertexIndices.Length);
 19387            }
 28388            else if (interpolation == UsdGeomTokens.vertex || interpolation == UsdGeomTokens.varying) // 1 value per poi
 5389            {
 5390                Flatten(ref values, faceVertexIndices);
 5391            }
 23392            else if (interpolation == UsdGeomTokens.faceVarying) // 1 value per vertex per triangle
 21393            {
 21394                TriangulateAttributes(ref values, originalFaceVertexCounts, changeHandedness);
 21395            }
 84396        }
 397
 398        /// <summary>
 399        /// Returns the interpolation of an data array based on the number of elements
 400        /// </summary>
 401        /// <param name="count"> The number of elements in the array</param>
 402        /// <remarks>
 403        /// This is a fallback mechanism when the interpolation token is not available for a given attribute.
 404        /// It might also fail in the case of degenerate polygons or single face mesh (vertex & face-varying are undisti
 405        /// </remarks>
 406        internal TfToken GuessInterpolation(int count)
 50407        {
 50408            if (count == 1)
 3409            {
 3410                return UsdGeomTokens.constant;
 411            }
 47412            if (count == originalFaceVertexCounts.Length)
 20413            {
 20414                return UsdGeomTokens.uniform;
 415            }
 27416            if (count == points.Length)
 6417            {
 6418                return UsdGeomTokens.vertex;
 419            }
 21420            if (count == originalFaceVertexIndices.Length)
 20421            {
 20422                return UsdGeomTokens.faceVarying;
 423            }
 424
 1425            return new TfToken();
 50426        }
 427
 428        /// <summary>
 429        /// Convert an array of data per face to an array of data per vertex per triangle.
 430        /// Assume the input array is not indexed.
 431        /// </summary>
 432        /// <param name="values"> The data to convert</param>
 433        /// <param name="vertexCount"> The number of mesh vertices</param>
 434        /// <typeparam name="T"></typeparam>
 435        internal void UniformToFaceVarying<T>(ref T[] values, int vertexCount)
 20436        {
 20437            var newValues = new T[vertexCount];
 272438            for (var faceIdx = 0; faceIdx < values.Length; faceIdx++)
 116439            {
 116440                var newFaceIndices = faceMapping[faceIdx];
 116441                var value = values[faceIdx];
 812442                foreach (var newFaceIdx in newFaceIndices)
 232443                {
 232444                    newValues[newFaceIdx * 3] = value;
 232445                    newValues[newFaceIdx * 3 + 1] = value;
 232446                    newValues[newFaceIdx * 3 + 2] = value;
 232447                }
 116448            }
 449
 20450            values = newValues;
 20451        }
 452
 453        static void ComputeNormals(Vector3[] points, int[] faceVertexIndices, ref Vector3[] normals)
 26454        {
 676455            for (int faceIndex = 0; faceIndex < faceVertexIndices.Length / 3; faceIndex++)
 312456            {
 312457                int i0 = faceVertexIndices[faceIndex * 3];
 312458                int i1 = faceVertexIndices[faceIndex * 3 + 1];
 312459                int i2 = faceVertexIndices[faceIndex * 3 + 2];
 460
 312461                Vector3 e1 = points[i1];
 312462                e1 -= points[i0];
 312463                Vector3 e2 = points[i2];
 312464                e2 -= points[i0];
 312465                Vector3 n = Vector3.Cross(e1, e2);
 466
 312467                normals[i0] += n;
 312468                normals[i1] += n;
 312469                normals[i2] += n;
 312470            }
 471
 468472            for (int i = 0; i < normals.Length; i++)
 208473            {
 208474                normals[i].Normalize();
 208475            }
 26476        }
 477
 478        internal bool ShouldUnwindVertices(bool changeHandedness)
 149479        {
 149480            return changeHandedness && orientation == Orientation.RightHanded ||
 481                !changeHandedness && orientation == Orientation.LeftHanded;
 149482        }
 483    }
 484}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedXformSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedXformSample.html new file mode 100644 index 000000000..4ebf8068a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SanitizedXformSample.html @@ -0,0 +1,586 @@ + + + + + + +Unity.Formats.USD.SanitizedXformSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SanitizedXformSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:484
Line coverage:100% (4 of 4)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Sanitize(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/SanitizedSamples.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Runtime.CompilerServices;
 4using pxr;
 5using USD.NET;
 6using USD.NET.Unity;
 7using UnityEngine;
 8
 9[assembly: InternalsVisibleToAttribute("Unity.Formats.USD.Tests.Runtime")]
 10namespace Unity.Formats.USD
 11{
 12    public interface ISanitizable
 13    {
 14        /// <summary>
 15        /// Sanitize the USD data held by this sample to your target specifications according to the import options.
 16        /// </summary>
 17        void Sanitize(Scene scene, SceneImportOptions importOptions);
 18    }
 19
 20    /// <summary>
 21    /// A sanitizable version of an XFormSample. Enable automatic change of handedness.
 22    /// </summary>
 23    public class SanitizedXformSample : XformSample, ISanitizable
 24    {
 25        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 15126        {
 15127            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 14728                ConvertTransform();
 15129        }
 30    }
 31
 32    /// <summary>
 33    /// A sanitizable version of an CameraSample. Enable automatic change of handedness.
 34    /// </summary>
 35    public class SanitizedCameraSample : CameraSample, ISanitizable
 36    {
 37        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 38        {
 39            if (importOptions.changeHandedness != BasisTransformation.FastWithNegativeScale)
 40                ConvertTransform();
 41        }
 42    }
 43
 44    /// <summary>
 45    /// A sanitizable version of a MeshSample. Enable automatic triangulation/handedness change/attribute interpolation 
 46    /// </summary>
 47    public class SanitizedMeshSample : MeshSample, ISanitizable
 48    {
 49        /// <summary>
 50        /// Store the face vertex counts straight from USD deserialization
 51        /// </summary>
 52        int[] originalFaceVertexCounts;
 53
 54        /// <summary>
 55        /// Store the face vertex indices straight from USD deserialization
 56        /// </summary>
 57        int[] originalFaceVertexIndices;
 58
 59        /// <summary>
 60        /// True when the mesh arrays have been converted to facevarying
 61        /// </summary>
 62        internal bool arePrimvarsFaceVarying;
 63
 64        /// <summary>
 65        /// After triangulation face ids are no longer correct. This maps old face ids to the new triangulated face ids.
 66        /// </summary>
 67        internal List<List<int>> faceMapping;
 68
 69        /// <summary>
 70        /// To unweld vertex attributes after the fact (skin weights, joint indices, ...) we need to store the face
 71        /// vertex indices post triangulation but before unweld.
 72        /// </summary>
 73        internal int[] triangulatedFaceVertexIndices;
 74
 75
 76        /// <summary>
 77        /// Sanitize Mesh data for Unity:
 78        ///     * change basis
 79        ///     * triangulate
 80        ///     * convert vertices and attributes/primvar to facevarying if necessary
 81        /// </summary>
 82        public void Sanitize(Scene scene, SceneImportOptions importOptions)
 83        {
 84            var changeHandedness = importOptions.changeHandedness == BasisTransformation.SlowAndSafe ||
 85                importOptions.changeHandedness == BasisTransformation.SlowAndSafeAsFBX;
 86            // Start with the xform
 87            if (changeHandedness)
 88                ConvertTransform();
 89
 90            var santizePrimvars = importOptions.ShouldBindMaterials ||
 91                scene.IsPopulatingAccessMask || scene.AccessMask != null;                        //this is true when rea
 92
 93            var unwindVertices = ShouldUnwindVertices(changeHandedness);
 94            if (points == null)
 95                return;
 96
 97            // Points
 98            // originalPointCount = points.Length;
 99            if (changeHandedness)
 100            {
 101                for (var i = 0; i < points.Length; i++)
 102                    points[i] = UnityTypeConverter.ChangeBasis(points[i]);
 103            }
 104
 105            // Topology
 106            Triangulate(unwindVertices);
 107
 108            // Normals
 109            if (normals != null && changeHandedness)
 110            {
 111                for (var i = 0; i < normals.Length; i++)
 112                {
 113                    normals[i] = UnityTypeConverter.ChangeBasis(normals[i]);
 114                }
 115            }
 116
 117            // Bounds
 118            if (changeHandedness)
 119                extent.center = UnityTypeConverter.ChangeBasis(extent.center);
 120
 121            // Tangents
 122            // TODO: we should check interpolation
 123            if (changeHandedness && tangents != null)
 124            {
 125                var newTangents = new Vector4[tangents.Length];
 126                for (var i = 0; i < tangents.Length; i++)
 127                {
 128                    var w = tangents[i].w;
 129                    var t = UnityTypeConverter.ChangeBasis(tangents[i]);
 130                    newTangents[i] = new Vector4(t.x, t.y, t.z, w);
 131                }
 132            }
 133
 134            // Colors
 135            if (colors.value != null && colors.indices != null)
 136            {
 137                Flatten(ref colors.value, colors.indices);
 138            }
 139
 140            // UVs
 141            if (santizePrimvars)
 142            {
 143                FlattenUVs(st);
 144                FlattenUVs(uv);
 145                FlattenUVs(uv2);
 146                FlattenUVs(uv3);
 147                FlattenUVs(uv4);
 148            }
 149
 150            if (!ShouldUnweldVertices(santizePrimvars))
 151                return;
 152
 153            // At that point we know that primvars are of different interpolation type.
 154            // For now we use the worst case scenario which is to unroll all the values to faceVarying interpolation.
 155            // TODO: A more efficient solution would be to detect the larger interpolation type used across all primvars
 156            // and unroll values up to that interpolation type.
 157            if (normals == null)
 158            {
 159                normals = new Vector3[points.Length];
 160                ComputeNormals(points, faceVertexIndices, ref normals);
 161                Flatten(ref normals, faceVertexIndices);
 162            }
 163            else
 164            {
 165                ConvertInterpolationToFaceVarying(ref normals, faceVertexIndices, unwindVertices);
 166            }
 167
 168            ConvertInterpolationToFaceVarying(ref tangents, faceVertexIndices, unwindVertices);
 169
 170            ConvertInterpolationToFaceVarying(ref colors.value, faceVertexIndices, unwindVertices);
 171
 172            if (santizePrimvars)
 173            {
 174                UnweldUVs(st, unwindVertices);
 175                UnweldUVs(uv, unwindVertices);
 176                UnweldUVs(uv2, unwindVertices);
 177                UnweldUVs(uv3, unwindVertices);
 178                UnweldUVs(uv4, unwindVertices);
 179            }
 180
 181            // Convert points last, as points count might be used to guess the interpolation of other attributes
 182            // also update the vertex mapping
 183            Flatten(ref points, faceVertexIndices);
 184
 185            // Now that all attributes and primvar are converted to facevarying, update the faceIndices
 186            for (var i = 0; i < faceVertexIndices.Length; i++)
 187                faceVertexIndices[i] = i;
 188
 189
 190            arePrimvarsFaceVarying = true;
 191        }
 192
 193        /// <summary>
 194        /// Triangulate the usd mesh, compute the face mapping to remap face sets and store original face vertex counts
 195        /// and indices to unroll attributes and primvars.
 196        /// </summary>
 197        /// <param name="changeHandedness"></param>
 198        internal void Triangulate(bool changeHandedness)
 199        {
 200            originalFaceVertexCounts = faceVertexCounts;
 201            originalFaceVertexIndices = faceVertexIndices;
 202            faceMapping = new List<List<int>>();
 203
 204            var newIndices = new List<int>();
 205            var newCounts = new List<int>();
 206
 207            var last = 0;
 208            var currentOffset = 0;
 209            for (var i = 0; i < faceVertexCounts.Length; i++)
 210            {
 211                faceMapping.Add(new List<int>());
 212
 213                var next = last + 1;
 214                var t = 0;
 215                for (; t < faceVertexCounts[i] - 2; t++)
 216                {
 217                    newCounts.Add(3);
 218                    if (changeHandedness)
 219                    {
 220                        newIndices.Add(faceVertexIndices[next++]);
 221                        newIndices.Add(faceVertexIndices[last]);
 222                        newIndices.Add(faceVertexIndices[next]);
 223                    }
 224                    else
 225                    {
 226                        newIndices.Add(faceVertexIndices[last]);
 227                        newIndices.Add(faceVertexIndices[next++]);
 228                        newIndices.Add(faceVertexIndices[next]);
 229                    }
 230                    faceMapping[i].Add(currentOffset++);
 231                }
 232                last += faceVertexCounts[i];
 233            }
 234
 235            faceVertexIndices = newIndices.ToArray();
 236            triangulatedFaceVertexIndices = newIndices.ToArray();
 237            faceVertexCounts = newCounts.ToArray();
 238        }
 239
 240        internal bool ShouldUnweldVertices(bool bindMaterials)
 241        {
 242            // If any primvar is face varying (1 value per vertex) or uniform (1 value per face), all  primvars + mesh a
 243            // TODO: expose interpolation for standard mesh attributes (normals, tangents)
 244            return normals != null && (normals.Length == originalFaceVertexCounts.Length || normals.Length > points.Leng
 245                colors != null && (colors.GetInterpolationToken() == UsdGeomTokens.uniform || colors.GetInterpolationTok
 246                tangents != null &&
 247                (tangents.Length == originalFaceVertexCounts.Length || tangents.Length > points.Length) ||
 248                bindMaterials &&
 249                (st.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 250                    uv.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 251                    uv2.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 252                    uv3.GetInterpolationToken() == UsdGeomTokens.faceVarying ||
 253                    uv4.GetInterpolationToken() == UsdGeomTokens.faceVarying);
 254        }
 255
 256        internal static void Flatten<T>(ref T[] values, int[] indices)
 257        {
 258            if (values == null || indices == null)
 259                return;
 260
 261            var newValues = new T[indices.Length];
 262            for (var i = 0; i < indices.Length; i++)
 263            {
 264                newValues[i] = values[indices[i]];
 265            }
 266
 267            values = newValues;
 268        }
 269
 270        void UnweldUVs(Primvar<object> primvar, bool changeHandedness)
 271        {
 272            if (primvar.value == null)
 273                return;
 274
 275            if (primvar.GetInterpolationToken() == UsdGeomTokens.constant)
 276            {
 277                UsdIo.ArrayAllocator.Free(primvar.value.GetType(), (uint)(primvar.value as Array).GetLength(0),
 278                    primvar.value as Array);
 279                return;
 280            }
 281
 282            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 283            // the actual type of value.
 284            if (primvar.value.GetType() == typeof(Vector2[]))
 285            {
 286                var value = primvar.value as Vector2[];
 287                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 288                primvar.SetValue(value);
 289                return;
 290            }
 291
 292            if (primvar.value.GetType() == typeof(Vector3[]))
 293            {
 294                var value = primvar.value as Vector3[];
 295                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 296                primvar.SetValue(value);
 297                return;
 298            }
 299
 300            if (primvar.value.GetType() == typeof(Vector4[]))
 301            {
 302                var value = primvar.value as Vector4[];
 303                ConvertInterpolationToFaceVarying(ref value, faceVertexIndices, changeHandedness, primvar.GetInterpolati
 304                primvar.SetValue(value);
 305                return;
 306            }
 307        }
 308
 309        static void FlattenUVs(Primvar<object> primvar)
 310        {
 311            if (primvar.value == null)
 312                return;
 313
 314            // We can't use uv.GetValueType() as it return "typeof(T)" and so would return "object" in this case instead
 315            // the actual type of value.
 316            if (primvar.value.GetType() == typeof(Vector2[]))
 317            {
 318                var value = primvar.value as Vector2[];
 319                Flatten(ref value, primvar.indices);
 320                primvar.SetValue(value);
 321                return;
 322            }
 323
 324            if (primvar.value.GetType() == typeof(Vector3[]))
 325            {
 326                var value = primvar.value as Vector3[];
 327                Flatten(ref value, primvar.indices);
 328                primvar.SetValue(value);
 329                return;
 330            }
 331
 332            if (primvar.value.GetType() == typeof(Vector4[]))
 333            {
 334                var value = primvar.value as Vector4[];
 335                Flatten(ref value, primvar.indices);
 336                primvar.SetValue(value);
 337                return;
 338            }
 339        }
 340
 341        internal static void TriangulateAttributes<T>(ref T[] values, int[] faceVertexCount, bool changeHandedness)
 342        {
 343            var newValues = new List<T>();
 344            var last = 0;
 345            for (var i = 0; i < faceVertexCount.Length; i++)
 346            {
 347                var next = last + 1;
 348                for (var t = 0; t < faceVertexCount[i] - 2; t++)
 349                    if (changeHandedness)
 350                    {
 351                        newValues.Add(values[next++]);
 352                        newValues.Add(values[last]);
 353                        newValues.Add(values[next]);
 354                    }
 355                    else
 356                    {
 357                        newValues.Add(values[last]);
 358                        newValues.Add(values[next++]);
 359                        newValues.Add(values[next]);
 360                    }
 361
 362                last += faceVertexCount[i];
 363            }
 364
 365            values = newValues.ToArray();
 366        }
 367
 368        /// <summary>
 369        /// Utility method to convert a given array of values to the equivalent faceVarying array (one value per vertex 
 370        /// </summary>
 371        /// <remarks> If the interpolation of the array to convert is not known, it will be guessed based on the length 
 372        void ConvertInterpolationToFaceVarying<T>(ref T[] values, int[] vertexIndices, bool changeHandedness = false, Tf
 373        {
 374            if (values == null)
 375                return;
 376
 377            if (interpolation == null)
 378                interpolation = GuessInterpolation(values.Length);
 379
 380            if (interpolation == UsdGeomTokens.constant)
 381            {
 382                // Ignore, constant values are supported by the importer
 383            }
 384            if (interpolation == UsdGeomTokens.uniform) // 1 value per face
 385            {
 386                UniformToFaceVarying(ref values, vertexIndices.Length);
 387            }
 388            else if (interpolation == UsdGeomTokens.vertex || interpolation == UsdGeomTokens.varying) // 1 value per poi
 389            {
 390                Flatten(ref values, faceVertexIndices);
 391            }
 392            else if (interpolation == UsdGeomTokens.faceVarying) // 1 value per vertex per triangle
 393            {
 394                TriangulateAttributes(ref values, originalFaceVertexCounts, changeHandedness);
 395            }
 396        }
 397
 398        /// <summary>
 399        /// Returns the interpolation of an data array based on the number of elements
 400        /// </summary>
 401        /// <param name="count"> The number of elements in the array</param>
 402        /// <remarks>
 403        /// This is a fallback mechanism when the interpolation token is not available for a given attribute.
 404        /// It might also fail in the case of degenerate polygons or single face mesh (vertex & face-varying are undisti
 405        /// </remarks>
 406        internal TfToken GuessInterpolation(int count)
 407        {
 408            if (count == 1)
 409            {
 410                return UsdGeomTokens.constant;
 411            }
 412            if (count == originalFaceVertexCounts.Length)
 413            {
 414                return UsdGeomTokens.uniform;
 415            }
 416            if (count == points.Length)
 417            {
 418                return UsdGeomTokens.vertex;
 419            }
 420            if (count == originalFaceVertexIndices.Length)
 421            {
 422                return UsdGeomTokens.faceVarying;
 423            }
 424
 425            return new TfToken();
 426        }
 427
 428        /// <summary>
 429        /// Convert an array of data per face to an array of data per vertex per triangle.
 430        /// Assume the input array is not indexed.
 431        /// </summary>
 432        /// <param name="values"> The data to convert</param>
 433        /// <param name="vertexCount"> The number of mesh vertices</param>
 434        /// <typeparam name="T"></typeparam>
 435        internal void UniformToFaceVarying<T>(ref T[] values, int vertexCount)
 436        {
 437            var newValues = new T[vertexCount];
 438            for (var faceIdx = 0; faceIdx < values.Length; faceIdx++)
 439            {
 440                var newFaceIndices = faceMapping[faceIdx];
 441                var value = values[faceIdx];
 442                foreach (var newFaceIdx in newFaceIndices)
 443                {
 444                    newValues[newFaceIdx * 3] = value;
 445                    newValues[newFaceIdx * 3 + 1] = value;
 446                    newValues[newFaceIdx * 3 + 2] = value;
 447                }
 448            }
 449
 450            values = newValues;
 451        }
 452
 453        static void ComputeNormals(Vector3[] points, int[] faceVertexIndices, ref Vector3[] normals)
 454        {
 455            for (int faceIndex = 0; faceIndex < faceVertexIndices.Length / 3; faceIndex++)
 456            {
 457                int i0 = faceVertexIndices[faceIndex * 3];
 458                int i1 = faceVertexIndices[faceIndex * 3 + 1];
 459                int i2 = faceVertexIndices[faceIndex * 3 + 2];
 460
 461                Vector3 e1 = points[i1];
 462                e1 -= points[i0];
 463                Vector3 e2 = points[i2];
 464                e2 -= points[i0];
 465                Vector3 n = Vector3.Cross(e1, e2);
 466
 467                normals[i0] += n;
 468                normals[i1] += n;
 469                normals[i2] += n;
 470            }
 471
 472            for (int i = 0; i < normals.Length; i++)
 473            {
 474                normals[i].Normalize();
 475            }
 476        }
 477
 478        internal bool ShouldUnwindVertices(bool changeHandedness)
 479        {
 480            return changeHandedness && orientation == Orientation.RightHanded ||
 481                !changeHandedness && orientation == Orientation.LeftHanded;
 482        }
 483    }
 484}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneExporter.html new file mode 100644 index 000000000..0f2ce678b --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneExporter.html @@ -0,0 +1,915 @@ + + + + + + +Unity.Formats.USD.SceneExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SceneExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs
Covered lines:158
Uncovered lines:219
Coverable lines:377
Total lines:791
Line coverage:41.9% (158 of 377)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Export(...)0%000100%
Export(...)0%00065%
ExportImpl(...)0%00061.45%
Traverse(...)0%000100%
AccumNestedBones(...)0%0000%
CreateSample[T](...)0%000100%
SyncExportContext(...)0%00011.69%
InitExportableObjects(...)0%00052.11%
MergeBonesBelowAnimator(...)0%0000%
MergeBonesSimple(...)0%0000%
CreateExportPlan(...)0%00088.46%
ComputeWorldXf(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using UnityEngine;
 19using USD.NET;
 20using USD.NET.Unity;
 21
 22namespace Unity.Formats.USD
 23{
 24    // The export function allows for dispatch to different export functions without knowing what
 25    // type of data they export (e.g. mesh vs. transform).
 26    public delegate void ExportFunction(ObjectContext objContext, ExportContext exportContext);
 27
 28    delegate void ObjectProcessor(GameObject go,
 29        ExportContext context);
 30
 31    public struct ObjectContext
 32    {
 33        public GameObject gameObject;
 34        public string path;
 35        public SampleBase sample;
 36        public object additionalData;
 37    }
 38
 39    public enum ActiveExportPolicy
 40    {
 41        // Inactive GameObjects in Unity become invisible objects in USD, which is actually the
 42        // closest semantic mapping.
 43        ExportAsVisibility,
 44
 45        // Inactive GameObjects in Unity become deactivated objects in USD. Caution, this is not truly
 46        // an equivalent state because deactivated objects in USD are fully unloaded and their
 47        // subtree will not exist after being deactivated.
 48        ExportAsActive,
 49
 50        // Inactive GameObjects will not be exported.
 51        DoNotExport,
 52
 53        // Inactive GameObjects will be exported without special handling.
 54        Ignore,
 55    }
 56
 57    public class ExportContext
 58    {
 59        public Scene scene;
 60        public Transform exportRoot;
 61        public bool exportMaterials = true;
 62        public bool exportNative = false;
 63        public float scale = 1.0f;
 64
 65        public BasisTransformation basisTransform = BasisTransformation.FastWithNegativeScale;
 66        public ActiveExportPolicy activePolicy = ActiveExportPolicy.ExportAsVisibility;
 67        public Dictionary<GameObject, ExportPlan> plans = new Dictionary<GameObject, ExportPlan>();
 68        public Dictionary<Material, string> matMap = new Dictionary<Material, string>();
 69
 70        public Dictionary<Transform, Transform> meshToSkelRoot = new Dictionary<Transform, Transform>();
 71        public Dictionary<Transform, Transform[]> meshToBones = new Dictionary<Transform, Transform[]>();
 72
 73        public Dictionary<Transform, List<string>> skelSortedMap = new Dictionary<Transform, List<string>>();
 74
 75        // Dictionary from <oldRoot> to <newRoot>
 76        public Dictionary<string, Transform> pathToBone = new Dictionary<string, Transform>();
 77        public Dictionary<Transform, Transform> boneToRoot = new Dictionary<Transform, Transform>();
 78        public Dictionary<Transform, Matrix4x4> bindPoses = new Dictionary<Transform, Matrix4x4>();
 79
 80        // Sample object instances, shared across multiple export methods.
 81        public Dictionary<Type, SampleBase> samples = new Dictionary<Type, SampleBase>();
 82    }
 83
 84    public class Exporter
 85    {
 86        // The USD path at which the Unity data will be written.
 87        public string path;
 88
 89        // The sample type to be used when exporting.
 90        public SampleBase sample;
 91
 92        // The export function which implements the logic to populate the sample.
 93        public ExportFunction exportFunc;
 94
 95        // Additional arguments required for export.
 96        public object data;
 97    }
 98
 99    // An export plan will be created for each path in the scene. Each ExportPlan will use one of
 100    // the fixed export functions. For example, when setting up export for a mesh, an ExportPlan
 101    // will be created for that path in the scenegraph and the ExportFunction will the one which is
 102    // capable of exporting a mesh.
 103    public class ExportPlan
 104    {
 105        // The functions to run when exporting this object.
 106        public List<Exporter> exporters = new List<Exporter>();
 107    }
 108
 109    /// <summary>
 110    /// The scene exporter can be used to export data to USD.
 111    /// </summary>
 112    public static class SceneExporter
 113    {
 114        // ------------------------------------------------------------------------------------------ //
 115        // Main Export Logic.
 116        // ------------------------------------------------------------------------------------------ //
 117
 118        public static void Export(GameObject root,
 119            Scene scene,
 120            BasisTransformation basisTransform,
 121            bool exportUnvarying,
 122            bool zeroRootTransform,
 123            bool exportMaterials = false,
 124            bool exportMonoBehaviours = false)
 9125        {
 9126            var context = new ExportContext();
 9127            context.scene = scene;
 9128            context.basisTransform = basisTransform;
 9129            context.exportRoot = root.transform.parent;
 8130            SyncExportContext(root, context);
 131
 132            // Since this is a one-shot convenience function, we will automatically split the export
 133            // into varying and unvarying data, unless the user explicitly requested unvarying.
 8134            if (exportUnvarying && scene.Time != null)
 6135            {
 6136                double? oldTime = scene.Time;
 6137                scene.Time = null;
 6138                Export(root, context, zeroRootTransform);
 6139                scene.Time = oldTime;
 6140            }
 141
 142            // Export data for the requested time.
 8143            context.exportMaterials = exportMaterials;
 8144            Export(root, context, zeroRootTransform);
 8145        }
 146
 147        public static void Export(GameObject root,
 148            ExportContext context,
 149            bool zeroRootTransform)
 82150        {
 151            // Remove parent transform effects while exporting.
 152            // This must be restored before returning from this function.
 82153            var parent = root.transform.parent;
 82154            if (zeroRootTransform)
 0155            {
 0156                root.transform.SetParent(null, worldPositionStays: false);
 0157            }
 158
 159            // Also zero out and restore local rotations on the root.
 82160            var localPos = root.transform.localPosition;
 82161            var localRot = root.transform.localRotation;
 82162            var localScale = root.transform.localScale;
 82163            if (zeroRootTransform)
 0164            {
 0165                root.transform.localPosition = Vector3.zero;
 0166                root.transform.localRotation = Quaternion.identity;
 0167                root.transform.localScale = Vector3.one;
 0168            }
 169
 170            // Scale overall scene for export (e.g. USDZ export needs scale 100)
 82171            root.transform.localScale *= context.scale;
 172
 82173            UnityEngine.Profiling.Profiler.BeginSample("USD: Export");
 174            try
 82175            {
 82176                ExportImpl(root, context);
 82177                var path = new pxr.SdfPath(UnityTypeConverter.GetPath(root.transform));
 82178                var prim = context.scene.Stage.GetPrimAtPath(path);
 82179                if (prim)
 82180                {
 82181                    context.scene.Stage.SetDefaultPrim(prim);
 82182                }
 82183            }
 184            finally
 82185            {
 82186                if (zeroRootTransform)
 0187                {
 0188                    root.transform.localPosition = localPos;
 0189                    root.transform.localRotation = localRot;
 0190                    root.transform.localScale = localScale;
 0191                    root.transform.SetParent(parent, worldPositionStays: false);
 0192                }
 193                else
 82194                {
 82195                    root.transform.localScale = localScale;
 82196                }
 197
 82198                UnityEngine.Profiling.Profiler.EndSample();
 82199            }
 82200        }
 201
 202        private static void ExportImpl(GameObject root,
 203            ExportContext context)
 82204        {
 82205            var scene = context.scene;
 82206            bool skipInactive = context.activePolicy == ActiveExportPolicy.DoNotExport;
 207
 82208            if (context.exportMaterials)
 7209            {
 210                // TODO: should account for skipped objects and also skip their materials.
 7211                UnityEngine.Profiling.Profiler.BeginSample("USD: Export Materials");
 33212                foreach (var kvp in context.matMap)
 6213                {
 6214                    Material mat = kvp.Key;
 6215                    string usdPath = kvp.Value;
 6216                    if (!mat || usdPath == null)
 0217                    {
 0218                        continue;
 219                    }
 220
 221                    try
 6222                    {
 6223                        MaterialExporter.ExportMaterial(scene, kvp.Key, kvp.Value);
 6224                    }
 0225                    catch (Exception ex)
 0226                    {
 0227                        Debug.LogException(new Exception("Error exporting material: " + kvp.Value, ex));
 0228                    }
 6229                }
 230
 7231                UnityEngine.Profiling.Profiler.EndSample();
 7232            }
 233
 82234            UnityEngine.Profiling.Profiler.BeginSample("USD: Process Export Plans");
 690235            foreach (var kvp in context.plans)
 222236            {
 222237                GameObject go = kvp.Key;
 222238                ExportPlan exportPlan = kvp.Value;
 239
 222240                if (!go || exportPlan == null)
 0241                {
 0242                    continue;
 243                }
 244
 222245                if (go != root && !go.transform.IsChildOf(root.transform))
 0246                {
 0247                    continue;
 248                }
 249
 222250                if (skipInactive && go.activeInHierarchy == false)
 0251                {
 0252                    continue;
 253                }
 254
 1554255                foreach (Exporter exporter in exportPlan.exporters)
 444256                {
 444257                    string path = exporter.path;
 444258                    SampleBase sample = exporter.sample;
 444259                    var objCtx = new ObjectContext
 260                    {
 261                        gameObject = go,
 262                        path = path,
 263                        sample = sample,
 264                        additionalData = exporter.data
 265                    };
 266
 267                    try
 444268                    {
 444269                        exporter.exportFunc(objCtx, context);
 444270                    }
 0271                    catch (Exception ex)
 0272                    {
 0273                        Debug.LogException(new Exception("Error exporting: " + path, ex));
 0274                        continue;
 275                    }
 276
 444277                    UnityEngine.Profiling.Profiler.BeginSample("USD: Process Visibility");
 278                    try
 444279                    {
 444280                        if (!go.gameObject.activeSelf)
 0281                        {
 0282                            switch (context.activePolicy)
 283                            {
 284                                case ActiveExportPolicy.Ignore:
 285                                    // Nothing to see here.
 0286                                    break;
 287
 288                                case ActiveExportPolicy.ExportAsVisibility:
 289                                    // Make the prim invisible.
 0290                                    var im = new pxr.UsdGeomImageable(scene.GetPrimAtPath(path));
 0291                                    if (im)
 0292                                    {
 0293                                        im.CreateVisibilityAttr().Set(pxr.UsdGeomTokens.invisible);
 0294                                    }
 295
 0296                                    break;
 297
 298                                case ActiveExportPolicy.ExportAsActive:
 299                                    // TODO: this may actually cause errors because exported prims will not exist in
 300                                    // the USD scene graph. Right now, that's too much responsibility on the caller,
 301                                    // because the error messages will be mysterious.
 302
 303                                    // Make the prim inactive.
 0304                                    scene.GetPrimAtPath(path).SetActive(false);
 0305                                    break;
 306                            }
 0307                        }
 444308                    }
 0309                    catch (Exception ex)
 0310                    {
 0311                        Debug.LogException(new Exception("Error setting visibility: " + path, ex));
 0312                        continue;
 313                    }
 314
 444315                    UnityEngine.Profiling.Profiler.EndSample();
 444316                } // foreach exporter
 222317            } // foreach plan
 318
 82319            UnityEngine.Profiling.Profiler.EndSample();
 82320        }
 321
 322        // ------------------------------------------------------------------------------------------ //
 323        // Init Hierarchy.
 324        // ------------------------------------------------------------------------------------------ //
 325
 326        static void Traverse(GameObject obj,
 327            ObjectProcessor processor,
 328            ExportContext context)
 14329        {
 14330            processor(obj, context);
 52331            foreach (Transform child in obj.transform)
 5332            {
 5333                Traverse(child.gameObject, processor, context);
 5334            }
 14335        }
 336
 337        static void AccumNestedBones(Transform curXf,
 338            List<Transform> children,
 339            ExportContext ctx)
 0340        {
 0341            if (ctx.bindPoses.ContainsKey(curXf))
 0342            {
 0343                children.Add(curXf);
 0344            }
 345
 0346            foreach (Transform child in curXf.transform)
 0347            {
 0348                AccumNestedBones(child, children, ctx);
 0349            }
 0350        }
 351
 352        static T CreateSample<T>(ExportContext context) where T : SampleBase, new()
 24353        {
 24354            return new T();
 355            /*
 356            SampleBase sb;
 357            if (context.samples.TryGetValue(typeof(T), out sb)) {
 358              return (T)sb;
 359            }
 360
 361            sb = (new T());
 362            context.samples[typeof(T)] = sb;
 363            return (T)sb;
 364            */
 24365        }
 366
 367        public static void SyncExportContext(GameObject exportRoot,
 368            ExportContext context)
 9369        {
 9370            context.exportRoot = exportRoot.transform.parent;
 9371            Traverse(exportRoot, InitExportableObjects, context);
 372
 9373            Transform expRoot = context.exportRoot;
 9374            var foundAnimators = new List<Transform>();
 27375            foreach (var rootBoneXf in context.meshToSkelRoot.Values.ToArray())
 0376            {
 0377                bool alreadyProcessed = false;
 0378                foreach (var xf in foundAnimators)
 0379                {
 0380                    if (rootBoneXf.IsChildOf(xf))
 0381                    {
 0382                        alreadyProcessed = true;
 0383                        break;
 384                    }
 0385                }
 386
 0387                if (alreadyProcessed)
 0388                {
 0389                    continue;
 390                }
 391
 0392                var animatorXf = rootBoneXf;
 393
 0394                while (animatorXf != null)
 0395                {
 396                    // If there is an animator, assume this is the root of the rig.
 397                    // This feels very ad hoc, it would be nice to not use a heuristic.
 0398                    var anim = animatorXf.GetComponent<Animator>();
 0399                    if (anim != null)
 0400                    {
 401                        // Any root bones under this animator will be merged into their most common ancestor,
 402                        // which is returned here and becomes the skeleton root.
 0403                        Transform skeletonRoot = MergeBonesBelowAnimator(animatorXf, context);
 404
 0405                        if (skeletonRoot == null)
 0406                        {
 0407                            animatorXf = animatorXf.parent;
 0408                            Debug.LogWarning("No children found under animator: " +
 409                                UnityTypeConverter.GetPath(animatorXf) + " Root bone XF: " +
 410                                UnityTypeConverter.GetPath(rootBoneXf));
 0411                            continue;
 412                        }
 413
 0414                        foundAnimators.Add(anim.transform);
 415
 416                        // The skeleton is exported at the skeleton root and UsdSkelAnimation is nested under
 417                        // this prim as a new prim called "_anim".
 0418                        SkelRootSample rootSample = CreateSample<SkelRootSample>(context);
 0419                        string skelRootPath = UnityTypeConverter.GetPath(animatorXf.transform, expRoot);
 0420                        string skelPath = UnityTypeConverter.GetPath(skeletonRoot, expRoot);
 0421                        string skelPathSuffix = "";
 0422                        string skelAnimSuffix = "/_anim";
 423
 424                        // When there is a collision between the SkelRoot and the Skeleton, make a new USD Prim
 425                        // for the Skeleton object. The reason this is safe is as follows: if the object was
 426                        // imported from USD, then the structure should already be correct and this code path will
 427                        // not be hit (and hence overrides, etc, will work correctly). If the object was created
 428                        // in Unity and there happened to be a collision, then we can safely create a new prim
 429                        // for the Skeleton prim because there will be no existing USD skeleton for which
 430                        // the namespace must match, hence adding a new prim is still safe.
 0431                        if (skelPath == skelRootPath)
 0432                        {
 0433                            Debug.LogWarning("SkelRoot and Skeleton have the same path, renaming Skeleton");
 0434                            skelPathSuffix = "/_skel";
 0435                        }
 436
 0437                        rootSample.animationSource = skelPath + skelAnimSuffix;
 438
 439                        // For any skinned mesh exported under this SkelRoot, pass along the skeleton path in
 440                        // the "additional data" member of the exporter. Note that this feels very ad hoc and
 441                        // should probably be formalized in some way (perhaps as a separate export event for
 442                        // which the SkinnedMesh exporter can explicitly register).
 443                        //
 444                        // While it is possible to bind the skel:skeleton relationship at the SkelRoot and
 445                        // have it inherit down namespace, the Apple importer did not respect this inheritance
 446                        // and it sometimes causes issues with geometry embedded in the bone hierarchy.
 0447                        foreach (var p in context.plans)
 0448                        {
 0449                            if (p.Key.transform.IsChildOf(animatorXf.transform))
 0450                            {
 0451                                foreach (var e in p.Value.exporters)
 0452                                {
 0453                                    if (e.exportFunc == MeshExporter.ExportSkinnedMesh)
 0454                                    {
 0455                                        e.data = skelPath + skelPathSuffix;
 0456                                    }
 0457                                }
 0458                            }
 0459                        }
 460
 0461                        CreateExportPlan(
 462                            animatorXf.gameObject,
 463                            rootSample,
 464                            SkeletonExporter.ExportSkelRoot,
 465                            context,
 466                            insertFirst: true);
 0467                        CreateExportPlan(
 468                            animatorXf.gameObject,
 469                            rootSample,
 470                            NativeExporter.ExportObject,
 471                            context,
 472                            insertFirst: false);
 473
 0474                        CreateExportPlan(
 475                            skeletonRoot.gameObject,
 476                            CreateSample<SkeletonSample>(context),
 477                            SkeletonExporter.ExportSkeleton,
 478                            context,
 479                            insertFirst: true,
 480                            pathSuffix: skelPathSuffix);
 0481                        CreateExportPlan(
 482                            skeletonRoot.gameObject,
 483                            CreateSample<SkeletonSample>(context),
 484                            NativeExporter.ExportObject,
 485                            context,
 486                            insertFirst: false,
 487                            pathSuffix: skelPathSuffix);
 488
 0489                        CreateExportPlan(
 490                            skeletonRoot.gameObject,
 491                            CreateSample<SkelAnimationSample>(context),
 492                            SkeletonExporter.ExportSkelAnimation,
 493                            context,
 494                            insertFirst: true,
 495                            pathSuffix: skelAnimSuffix);
 496
 497                        // Exporting animation is only possible while in-editor (in 2018 and earlier).
 498#if UNITY_EDITOR
 499#if false // Currently disabled, future work.
 500                        if (anim.layerCount > 0)
 501                        {
 502                            for (int l = 0; l < anim.layerCount; l++)
 503                            {
 504                                int clipCount = anim.GetCurrentAnimatorClipInfoCount(l);
 505                                var clipInfos = anim.GetCurrentAnimatorClipInfo(l);
 506                                foreach (var clipInfo in clipInfos)
 507                                {
 508                                    var bindings = UnityEditor.AnimationUtility.GetCurveBindings(clipInfo.clip);
 509                                    // Properties are expressed as individual values, for transforms this is:
 510                                    //   m_LocalPosition.x,y,z
 511                                    //   m_LocalScale.x,y,z
 512                                    //   m_LocalRotation.x,y,z,w
 513                                    // Which means they must be reaggregated into matrices.
 514                                    foreach (var binding in bindings)
 515                                    {
 516                                        if (binding.type != typeof(Transform))
 517                                        {
 518                                            continue;
 519                                        }
 520                                        Debug.Log(binding.path + "." + binding.propertyName);
 521                                        var knot = UnityEditor.AnimationUtility.GetEditorCurve(clipInfo.clip, binding);
 522                                    }
 523                                }
 524                            }
 525                        }
 526#endif // disabled.
 527#endif // Editor only.
 528
 0529                        break;
 530                    }
 531
 0532                    animatorXf = animatorXf.parent;
 0533                }
 0534            }
 9535        }
 536
 537        static void InitExportableObjects(GameObject go,
 538            ExportContext context)
 14539        {
 14540            var smr = go.GetComponent<SkinnedMeshRenderer>();
 14541            var mr = go.GetComponent<MeshRenderer>();
 14542            var mf = go.GetComponent<MeshFilter>();
 14543            var cam = go.GetComponent<Camera>();
 14544            Transform expRoot = context.exportRoot;
 545
 14546            var tmpPath = new pxr.SdfPath(UnityTypeConverter.GetPath(go.transform, expRoot));
 19547            while (!tmpPath.IsRootPrimPath())
 5548            {
 5549                tmpPath = tmpPath.GetParentPath();
 5550            }
 551
 552            // TODO: What if this path is in use?
 14553            string materialBasePath = tmpPath.ToString() + "/Materials/";
 554
 555            // Ensure the "Materials" prim is defined with a valid prim type.
 14556            context.scene.Write(materialBasePath.TrimEnd('/'), new ScopeSample());
 557
 14558            if (smr != null)
 0559            {
 0560                foreach (var mat in smr.sharedMaterials)
 0561                {
 0562                    if (!context.matMap.ContainsKey(mat))
 0563                    {
 0564                        string usdPath = materialBasePath +
 565                            pxr.UsdCs.TfMakeValidIdentifier(
 566                            mat.name + "_" + mat.GetInstanceID().ToString());
 0567                        context.matMap.Add(mat, usdPath);
 0568                    }
 0569                }
 570
 0571                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportSkinnedMesh, context);
 0572                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 573                    insertFirst: false);
 0574                if (smr.rootBone == null)
 0575                {
 0576                    Debug.LogWarning("No root bone at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 0577                }
 0578                else if (smr.bones == null || smr.bones.Length == 0)
 0579                {
 0580                    Debug.LogWarning("No bones at: " + UnityTypeConverter.GetPath(go.transform, expRoot));
 0581                }
 582                else
 0583                {
 584                    // Each mesh in a model may have a different root bone, which now must be merged into a
 585                    // single skeleton for export to USD.
 586                    try
 0587                    {
 0588                        MergeBonesSimple(smr.transform, smr.rootBone, smr.bones, smr.sharedMesh.bindposes, context);
 0589                    }
 0590                    catch (Exception ex)
 0591                    {
 0592                        Debug.LogException(
 593                            new Exception("Failed to merge bones for " + UnityTypeConverter.GetPath(smr.transform),
 594                                ex));
 0595                    }
 0596                }
 0597            }
 14598            else if (mf != null && mr != null)
 10599            {
 50600                foreach (var mat in mr.sharedMaterials)
 10601                {
 10602                    if (mat == null)
 0603                    {
 0604                        continue;
 605                    }
 606
 10607                    if (!context.matMap.ContainsKey(mat))
 6608                    {
 6609                        string usdPath = materialBasePath +
 610                            pxr.UsdCs.TfMakeValidIdentifier(
 611                            mat.name + "_" + mat.GetInstanceID().ToString());
 6612                        context.matMap.Add(mat, usdPath);
 6613                    }
 10614                }
 615
 10616                CreateExportPlan(go, CreateSample<MeshSample>(context), MeshExporter.ExportMesh, context);
 10617                CreateExportPlan(go, CreateSample<MeshSample>(context), NativeExporter.ExportObject, context,
 618                    insertFirst: false);
 10619            }
 4620            else if (cam)
 1621            {
 1622                CreateExportPlan(go, CreateSample<CameraSample>(context), CameraExporter.ExportCamera, context);
 1623                CreateExportPlan(go, CreateSample<CameraSample>(context), NativeExporter.ExportObject, context,
 624                    insertFirst: false);
 1625            }
 14626        }
 627
 628        static Transform MergeBonesBelowAnimator(Transform animator, ExportContext context)
 0629        {
 0630            var toRemove = new Dictionary<Transform, Transform>();
 0631            Transform commonRoot = null;
 632
 0633            foreach (var sourceAndRoot in context.meshToSkelRoot)
 0634            {
 0635                var meshXf = sourceAndRoot.Key;
 0636                var meshRootBone = sourceAndRoot.Value;
 0637                if (!meshRootBone.IsChildOf(animator))
 0638                {
 0639                    continue;
 640                }
 641
 0642                toRemove.Add(meshXf, meshRootBone);
 0643                if (commonRoot == null)
 0644                {
 645                    // We use the parent because the root bone is part of the skeleton and we're establishing
 646                    // the skeleton root here. If the root bone is used as the skeleton root, its transform
 647                    // will get applied twice after export to USD: once for the UsdPrim which is the skeleton
 648                    // root and once for the bone which is in the skeleton itself. The root bone could be
 649                    // excluded from the skeleton, but this seems simpler.
 0650                    commonRoot = meshRootBone.parent;
 0651                }
 0652                else if (meshRootBone.IsChildOf(commonRoot))
 0653                {
 654                    // Nothing to do.
 0655                }
 0656                else if (commonRoot.IsChildOf(meshRootBone))
 0657                {
 658                    // The new root is a parent of the current common root, use it as the root instead.
 0659                    commonRoot = meshRootBone.parent;
 0660                }
 661                else
 0662                {
 663                    // We have an animator which is a common parent of two disjoint skeletons, this is not
 664                    // desirable because it requires that the animator be the common root, however this
 665                    // root will be tagged as a guide, which will cuase the geometry not to render, which
 666                    // will be confusing. Another option would be to construct a new common parent in USD,
 667                    // but this will cause the asset namespace to change, which is almost never a good idea.
 0668                    commonRoot = animator;
 0669                }
 0670            }
 671
 0672            if (toRemove.Count == 0)
 0673            {
 0674                return null;
 675            }
 676
 677            // At this point, some number of root bones have been aggregated under some potentially new
 678            // common root. Next, we need to merge all these root bones and preserve the requirement that
 679            // the bones are in "parent first" order.
 0680            var allBones = new List<Transform>();
 681
 0682            foreach (var kvp in toRemove)
 0683            {
 0684                Transform curMeshXf = kvp.Key;
 0685                Transform rootBone = kvp.Value;
 686
 0687                allBones.AddRange(context.meshToBones[curMeshXf]);
 688
 689                // Downstream code will have a root bone and need to know how to make bone paths relative
 690                // to the new, arbitrary, common root which we have chosen.
 0691                context.boneToRoot[rootBone] = commonRoot;
 692
 0693                context.meshToSkelRoot.Remove(curMeshXf);
 0694                context.meshToBones.Remove(curMeshXf);
 0695            }
 696
 697            // Maintain a sorted list of bone names to ensure "parent first" ordering for UsdSkel.
 0698            var allNames = allBones.Select(boneXf => UnityTypeConverter.GetPath(boneXf))
 0699                .OrderBy(str => str)
 700                .Distinct()
 701                .ToList();
 0702            context.skelSortedMap[commonRoot] = allNames;
 703
 0704            return commonRoot;
 0705        }
 706
 707        static void MergeBonesSimple(Transform source,
 708            Transform rootBone,
 709            Transform[] bones,
 710            Matrix4x4[] bindPoses,
 711            ExportContext context)
 0712        {
 0713            context.meshToSkelRoot.Add(source, rootBone);
 0714            context.meshToBones.Add(source, bones);
 715            Matrix4x4 existingMatrix;
 0716            for (int i = 0; i < bones.Length; i++)
 0717            {
 0718                Transform bone = bones[i];
 0719                if (bone == null)
 0720                {
 0721                    var srcPath = UnityTypeConverter.GetPath(source);
 0722                    Debug.LogWarning("Null bone at in bones list at position (" + i + ") " + srcPath);
 0723                    continue;
 724                }
 725
 0726                var path = UnityTypeConverter.GetPath(bone);
 0727                context.pathToBone[path] = bone;
 0728                context.boneToRoot[bone] = rootBone;
 0729                context.bindPoses[bone] = bindPoses[i];
 0730                if (context.bindPoses.TryGetValue(bone, out existingMatrix) && existingMatrix != bindPoses[i])
 0731                {
 0732                    Debug.LogWarning("Duplicate bone with different bind poses: " + path + "\n" +
 733                        existingMatrix.ToString() + "\n" + bindPoses[i].ToString());
 0734                }
 0735            }
 0736        }
 737
 738        static void CreateExportPlan(GameObject go,
 739            SampleBase sample,
 740            ExportFunction exportFunc,
 741            ExportContext context,
 742            string pathSuffix = null,
 743            bool insertFirst = true)
 24744        {
 745            // This is an exportable object.
 24746            Transform expRoot = context.exportRoot;
 24747            string path = UnityTypeConverter.GetPath(go.transform, expRoot);
 24748            if (!string.IsNullOrEmpty(pathSuffix))
 0749            {
 0750                path += pathSuffix;
 0751            }
 752
 24753            if (!context.plans.ContainsKey(go))
 12754            {
 12755                context.plans.Add(go, new ExportPlan());
 12756            }
 757
 24758            var exp = new Exporter { exportFunc = exportFunc, sample = sample, path = path };
 24759            if (insertFirst)
 12760            {
 12761                context.plans[go].exporters.Insert(0, exp);
 12762            }
 763            else
 12764            {
 12765                context.plans[go].exporters.Add(exp);
 12766            }
 767
 768            // Include the parent xform hierarchy.
 769            // Note that the parent hierarchy is memoised, so despite looking expensive, the time
 770            // complexity is linear.
 24771            Transform xf = go.transform.parent;
 24772            if (xf != context.exportRoot && !context.plans.ContainsKey(xf.gameObject))
 1773            {
 774                // Since all GameObjects have a Transform, export all un-exported parents as transform.
 1775                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), XformExporter.ExportXform, context);
 1776                CreateExportPlan(xf.gameObject, CreateSample<XformSample>(context), NativeExporter.ExportObject,
 777                    context, insertFirst: false);
 1778            }
 24779        }
 780
 781        static Matrix4x4 ComputeWorldXf(Transform curBone, ExportContext context)
 0782        {
 0783            if (!context.bindPoses.ContainsKey(curBone))
 0784            {
 0785                return curBone.parent.localToWorldMatrix;
 786            }
 787
 0788            return context.bindPoses[curBone] * ComputeWorldXf(curBone.parent, context);
 0789        }
 790    }
 791}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImportOptions.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImportOptions.html new file mode 100644 index 000000000..75938f031 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImportOptions.html @@ -0,0 +1,267 @@ + + + + + + +Unity.Formats.USD.SceneImportOptions - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SceneImportOptions
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs
Covered lines:22
Uncovered lines:0
Coverable lines:22
Total lines:164
Line coverage:100% (22 of 22)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SceneImportOptions()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImportOptions.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15namespace Unity.Formats.USD
 16{
 17    public enum PayloadPolicy
 18    {
 19        DontLoadPayloads,
 20        LoadAll,
 21    }
 22
 23    /// <summary>
 24    /// How to transform from the USD basis (typically right-handed) to Unity (left-handed).
 25    /// </summary>
 26    public enum BasisTransformation
 27    {
 28        /// <summary>
 29        /// Apply a single negative scale and rotation at the root of the scene hierarchy.
 30        /// Fastest, but may introduce additional complications when later exporting.
 31        /// </summary>
 32        FastWithNegativeScale,
 33
 34        /// <summary>
 35        /// Transform to left-handed basis by processing all positions, triangles, transforms, and
 36        /// primvar data. While slower, this is the safest option.
 37        /// </summary>
 38        SlowAndSafe,
 39
 40        /// <summary>
 41        /// Transform to left-handed basis by processing all positions, triangles, transforms, and
 42        /// primvar data. It transforms to match the basis transformation of FBX which is from (X,Y,Z) to (-X,Y,Z)
 43        /// instead of the standard (SlowAndSafe option) (X,Y,Z) to (X,Y,-Z).
 44        /// This is not a conventional behavior and this option is here only to allow consistency between
 45        /// geometry importers.
 46        /// </summary>
 47        SlowAndSafeAsFBX,
 48
 49        /// <summary>
 50        /// Preform no transformation; should only be used when the USD file is known to contain
 51        /// data which was (non-portably) stored in a left-handed basis.
 52        /// </summary>
 53        None,
 54    }
 55
 56    /// <summary>
 57    /// Indicates how to handle import materials.
 58    /// </summary>
 59    [System.Serializable]
 60    public enum MaterialImportMode
 61    {
 62        /// <summary>
 63        /// Fully imports the material, parameters, and textures (may be slow).
 64        /// </summary>
 65        ImportPreviewSurface,
 66
 67        /// <summary>
 68        /// Ignores the bound material and only uses the object's displayColor.
 69        /// </summary>
 70        ImportDisplayColor,
 71
 72        /// <summary>
 73        /// Do not assign materials to imported objects.
 74        /// </summary>
 75        None,
 76    }
 77
 78    /// <summary>
 79    /// Indicates how the scene should be imported from USD to Unity.
 80    /// </summary>
 81    [System.Serializable]
 82    public class SceneImportOptions
 83    {
 84        /// <summary>
 85        /// The root location in the Unity project where imported files will be created.
 86        /// </summary>
 9687        public string projectAssetPath = "Assets/";
 88
 89        /// <summary>
 90        /// The path in the USD file at which to import/export.
 91        /// </summary>
 9692        public pxr.SdfPath usdRootPath = pxr.SdfPath.AbsoluteRootPath();
 93
 94        /// <summary>
 95        /// Force components and objects to be rebuilt, instead of reusing existing objects.
 96        /// </summary>
 9697        public bool forceRebuild = false;
 98
 9699        public PayloadPolicy payloadPolicy = PayloadPolicy.DontLoadPayloads;
 100
 96101        public bool importHierarchy = true;
 96102        public bool importCameras = true;
 96103        public bool importMeshes = true;
 96104        public bool importSkinning = true;
 96105        public bool importSkinWeights = true;
 96106        public bool importTransforms = true;
 96107        public bool importSceneInstances = true;
 96108        public bool importPointInstances = true;
 96109        public bool importMonoBehaviours = false;
 110
 111        /// <summary>
 112        /// Typically USD data is right-handed and Unity is left handed; this option indicates how
 113        /// that conversion should be handled.
 114        /// </summary>
 96115        public BasisTransformation changeHandedness = BasisTransformation.SlowAndSafe;
 116
 117        /// <summary>
 118        /// A uniform scale to apply to the entire imported scene.
 119        /// Note that this scale is baked into every object, which is required for the Unity skinned
 120        /// mesh renderer, since it uses a parent-relative mesh baking scheme.
 121        /// </summary>
 96122        public float scale = 1.0f;
 123
 124        /// <summary>
 125        /// Apply linear interpolation when requesting values between time samples.
 126        /// </summary>
 96127        public bool interpolate = true;
 128
 129        /// <summary>
 130        /// Enable GPU instancing on materials for point and scene instances. Note this may negatively
 131        /// impact framerate in some cases.
 132        /// </summary>
 96133        public bool enableGpuInstancing = false;
 134
 135        /// <summary>
 136        /// When no material is bound, setup a default material to consume the display color.
 137        /// If the object color is not imported, a default white material will be assigned.
 138        /// </summary>
 96139        public bool useDisplayColorAsFallbackMaterial = true;
 140
 141        /// <summary>
 142        /// Indicates how materials are handled, see enum for details.
 143        /// </summary>
 96144        public MaterialImportMode materialImportMode = MaterialImportMode.ImportDisplayColor;
 145
 146        /// <summary>
 147        /// A set of registered mappings from USD shader ID to Unity material.
 148        /// </summary>
 96149        [System.NonSerialized] public MaterialMap materialMap = new MaterialMap();
 150
 151        /// <summary>
 152        /// The default options for how to import meshes.
 153        /// </summary>
 96154        public MeshImportOptions meshOptions = new MeshImportOptions();
 155
 156        /// <summary>
 157        /// Indicates if the importer should attempt to bind materials.
 158        /// </summary>
 159        public bool ShouldBindMaterials
 160        {
 1245161            get { return materialImportMode == MaterialImportMode.ImportPreviewSurface; }
 162        }
 163    }
 164}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImporter.html new file mode 100644 index 000000000..58ad469c5 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SceneImporter.html @@ -0,0 +1,1405 @@ + + + + + + +Unity.Formats.USD.SceneImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SceneImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs
Covered lines:531
Uncovered lines:259
Coverable lines:790
Total lines:1277
Line coverage:67.2% (531 of 790)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ImportException()0%0000%
ImportException(...)0%0000%
ImportException(...)0%0000%
SceneImporter()0%000100%
SavePrefab(...)0%00043.24%
AddObjectsToAsset(...)0%00065.82%
ImportUsd(...)0%000100%
ImportUsd(...)0%00088.89%
BuildScene(...)0%000100%
RemoveComponent[T](...)0%000100%
BuildScene()0%00060.63%
ShouldYield(...)0%000100%
ResetTimer(...)0%000100%
IsSkinnedMesh(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/SceneImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections;
 16using System.Collections.Generic;
 17using UnityEngine;
 18using UnityEngine.Profiling;
 19using USD.NET;
 20using USD.NET.Unity;
 21using Unity.Jobs;
 22#if UNITY_EDITOR
 23using UnityEditor;
 24using System.IO;
 25
 26#endif
 27
 28namespace Unity.Formats.USD
 29{
 30    /// <summary>
 31    /// An interface for delegating import behavior to a third party.
 32    /// </summary>
 33    public interface IImporter
 34    {
 35        void BeginReading(Scene scene, PrimMap primMap, SceneImportOptions importOptions);
 36
 37        IEnumerator Import(Scene scene,
 38            PrimMap primMap,
 39            SceneImportOptions importOptions);
 40    }
 41
 42    /// <summary>
 43    /// Root entry point for importing an entire USD scene.
 44    /// </summary>
 45    public static class SceneImporter
 46    {
 47        public class ImportException : System.Exception
 48        {
 049            public ImportException() : base()
 050            {
 051            }
 52
 053            public ImportException(string message) : base(message)
 054            {
 055            }
 56
 57            public ImportException(string message, System.Exception innerException)
 058                : base(message, innerException)
 059            {
 060            }
 61        }
 62
 63        /// <summary>
 64        /// The active mesh importer to be used when ImportUsd is called.
 65        /// </summary>
 66        public static IImporter ActiveMeshImporter;
 67
 68        static SceneImporter()
 269        {
 270            SceneImporter.ActiveMeshImporter = new MeshImportStrategy(
 71                MeshImporter.BuildMesh,
 72                MeshImporter.BuildSkinnedMesh);
 273        }
 74
 75#if UNITY_EDITOR
 76        /// <summary>
 77        /// Custom importer. This works almost exactly as the ScriptedImporter, but does not require
 78        /// the new API.
 79        /// </summary>
 80        public static void SavePrefab(GameObject rootObject,
 81            string prefabPath,
 82            string playableClipName,
 83            SceneImportOptions importOptions)
 484        {
 485            Directory.CreateDirectory(Path.GetDirectoryName(prefabPath));
 86
 487            GameObject oldPrefab = AssetDatabase.LoadAssetAtPath<GameObject>(prefabPath);
 488            GameObject prefab = null;
 89
 490            if (oldPrefab == null)
 491            {
 92                // Create the prefab. At this point, the meshes do not yet exist and will be
 93                // dangling references
 494                prefab = PrefabUtility.SaveAsPrefabAsset(rootObject, prefabPath);
 95                HashSet<Mesh> meshes;
 96                HashSet<Material> materials;
 497                AddObjectsToAsset(rootObject, prefab, importOptions, out meshes, out materials);
 98
 1699                foreach (var mesh in meshes)
 2100                {
 2101                    AssetDatabase.AddObjectToAsset(mesh, prefab);
 2102                }
 103
 40104                foreach (var mat in materials)
 14105                {
 14106                    AssetDatabase.AddObjectToAsset(mat, prefab);
 14107                }
 108
 109                // Fix the dangling references.
 4110                prefab = PrefabUtility.SaveAsPrefabAsset(rootObject, prefabPath);
 4111                var playable = ScriptableObject.CreateInstance<UsdPlayableAsset>();
 112
 4113                playable.SourceUsdAsset.defaultValue = prefab.GetComponent<UsdAsset>();
 4114                playable.name = playableClipName;
 4115                AssetDatabase.AddObjectToAsset(playable, prefab);
 4116                prefab = PrefabUtility.SavePrefabAsset(prefab);
 4117            }
 118            else
 0119            {
 120                HashSet<Mesh> meshes;
 121                HashSet<Material> materials;
 122
 0123                oldPrefab = PrefabUtility.SaveAsPrefabAsset(rootObject, prefabPath);
 0124                AddObjectsToAsset(rootObject, oldPrefab, importOptions, out meshes, out materials);
 125
 126                // ReplacePrefab only removes the GameObjects from the asset.
 127                // Clear out all non-prefab junk (ie, meshes), because otherwise it piles up.
 128                // The main difference between LoadAllAssetRepresentations and LoadAllAssets
 129                // is that the former returns MonoBehaviours and the latter does not.
 0130                foreach (var obj in AssetDatabase.LoadAllAssetRepresentationsAtPath(prefabPath))
 0131                {
 0132                    if (obj is GameObject)
 0133                    {
 0134                        continue;
 135                    }
 136
 0137                    if (obj is Mesh && meshes.Contains((Mesh)obj))
 0138                    {
 0139                        meshes.Remove((Mesh)obj);
 0140                        continue;
 141                    }
 142
 0143                    if (obj is Material && materials.Contains((Material)obj))
 0144                    {
 0145                        materials.Remove((Material)obj);
 0146                        continue;
 147                    }
 148
 0149                    Object.DestroyImmediate(obj, allowDestroyingAssets: true);
 0150                }
 151
 0152                foreach (var mesh in meshes)
 0153                {
 0154                    AssetDatabase.AddObjectToAsset(mesh, oldPrefab);
 0155                }
 156
 0157                foreach (var mat in materials)
 0158                {
 0159                    AssetDatabase.AddObjectToAsset(mat, oldPrefab);
 0160                }
 161
 0162                prefab = PrefabUtility.SaveAsPrefabAsset(rootObject, prefabPath);
 163
 0164                var playable = ScriptableObject.CreateInstance<UsdPlayableAsset>();
 0165                playable.SourceUsdAsset.defaultValue = prefab.GetComponent<UsdAsset>();
 0166                playable.name = playableClipName;
 0167                AssetDatabase.AddObjectToAsset(playable, prefab);
 0168                PrefabUtility.SavePrefabAsset(prefab);
 0169            }
 170
 4171            AssetDatabase.ImportAsset(prefabPath, ImportAssetOptions.ForceUpdate);
 4172            AssetDatabase.SaveAssets();
 4173        }
 174
 175        static void AddObjectsToAsset(GameObject rootObject,
 176            Object asset,
 177            SceneImportOptions importOptions,
 178            out HashSet<Mesh> usedMeshes,
 179            out HashSet<Material> usedMaterials)
 4180        {
 4181            var meshes = new HashSet<Mesh>();
 4182            var materials = new HashSet<Material>();
 183
 4184            materials.Add(importOptions.materialMap.DisplayColorMaterial);
 4185            materials.Add(importOptions.materialMap.MetallicWorkflowMaterial);
 4186            materials.Add(importOptions.materialMap.SpecularWorkflowMaterial);
 187
 4188            var tempMat = importOptions.materialMap.DisplayColorMaterial;
 4189            if (tempMat != null && AssetDatabase.GetAssetPath(tempMat) == "")
 4190            {
 4191                materials.Add(tempMat);
 4192            }
 193
 4194            tempMat = importOptions.materialMap.MetallicWorkflowMaterial;
 4195            if (tempMat != null && AssetDatabase.GetAssetPath(tempMat) == "")
 4196            {
 4197                materials.Add(tempMat);
 4198            }
 199
 4200            tempMat = importOptions.materialMap.SpecularWorkflowMaterial;
 4201            if (tempMat != null && AssetDatabase.GetAssetPath(tempMat) == "")
 4202            {
 4203                materials.Add(tempMat);
 4204            }
 205
 16206            foreach (var mf in rootObject.GetComponentsInChildren<MeshFilter>())
 2207            {
 2208                if (!mf)
 0209                {
 0210                    continue;
 211                }
 212
 2213                if (mf.sharedMesh != null && meshes.Add(mf.sharedMesh))
 2214                {
 2215                    mf.sharedMesh.name = mf.name;
 2216                }
 2217            }
 218
 16219            foreach (var mf in rootObject.GetComponentsInChildren<MeshRenderer>())
 2220            {
 2221                if (!mf)
 0222                {
 0223                    continue;
 224                }
 225
 10226                foreach (var mat in mf.sharedMaterials)
 2227                {
 2228                    if (mat != null && !materials.Add(mat))
 0229                    {
 0230                        mat.name = mf.name;
 0231                        continue;
 232                    }
 2233                }
 2234            }
 235
 12236            foreach (var mf in rootObject.GetComponentsInChildren<SkinnedMeshRenderer>())
 0237            {
 0238                if (!mf)
 0239                {
 0240                    continue;
 241                }
 242
 0243                if (mf.sharedMesh != null && meshes.Add(mf.sharedMesh))
 0244                {
 0245                    mf.sharedMesh.name = mf.name;
 0246                }
 247
 0248                foreach (var mat in mf.sharedMaterials)
 0249                {
 0250                    if (mat != null && !materials.Add(mat))
 0251                    {
 0252                        mat.name = mf.name;
 0253                        continue;
 254                    }
 0255                }
 0256            }
 257
 4258            usedMeshes = meshes;
 4259            usedMaterials = materials;
 4260        }
 261
 262#endif
 263
 264        public static void ImportUsd(GameObject goRoot,
 265            Scene scene,
 266            PrimMap primMap,
 267            SceneImportOptions importOptions)
 70268        {
 70269            ImportUsd(goRoot, scene, primMap, false, importOptions);
 70270        }
 271
 272        public static void ImportUsd(GameObject goRoot,
 273            Scene scene,
 274            PrimMap primMap,
 275            bool composingSubtree,
 276            SceneImportOptions importOptions)
 73277        {
 73278            if (scene == null)
 0279            {
 0280                throw new ImportException("Null USD Scene");
 281            }
 282
 283            // The matrix to convert USD (right-handed) to Unity (left-handed) is different for the legacy FBX importer
 284            // and incorrectly swaps the X-axis rather than the Z-axis. This changes the basisChange matrix to match the
 285            // user options. <see cref="Unity.Formats.USD.SceneImportOptions.BasisTransformation"/> for additional detai
 286            // Note that in those specific cases, the inverse matrix are identical to the original one, in general,
 287            // UnityTypeConverter.inverseBasisChange should be equal to UnityTypeConverter.basisChange.inverse.
 73288            if (importOptions.changeHandedness == BasisTransformation.SlowAndSafeAsFBX)
 8289            {
 290                // To be consistent with FBX basis change, ensure it's the X axis that is inverted.
 8291                Vector3 matrixDiagonal = new Vector3(-1, 1, 1);
 8292                UnityTypeConverter.basisChange = Matrix4x4.Scale(matrixDiagonal);
 8293                UnityTypeConverter.inverseBasisChange = Matrix4x4.Scale(matrixDiagonal);
 8294            }
 295            else
 65296            {
 297                // Ensure it's the Z axis that is inverted.
 65298                Vector3 matrixDiagonal = new Vector3(1, 1, -1);
 65299                UnityTypeConverter.basisChange = Matrix4x4.Scale(matrixDiagonal);
 65300                UnityTypeConverter.inverseBasisChange = Matrix4x4.Scale(matrixDiagonal);
 65301            }
 302
 73303            scene.SetInterpolation(importOptions.interpolate
 304                ? Scene.InterpolationMode.Linear
 305                : Scene.InterpolationMode.Held);
 306
 73307            SceneImporter.BuildScene(scene,
 308                goRoot,
 309                importOptions,
 310                primMap,
 311                composingSubtree);
 73312        }
 313
 314        /// <summary>
 315        /// Rebuilds the USD scene as Unity GameObjects, maintaining a mapping from USD to Unity.
 316        /// </summary>
 317        public static PrimMap BuildScene(Scene scene,
 318            GameObject root,
 319            SceneImportOptions importOptions,
 320            PrimMap primMap,
 321            bool composingSubtree)
 73322        {
 323            try
 73324            {
 73325                Profiler.BeginSample("USD: Build Scene");
 73326                var builder = BuildScene(scene,
 327                    root,
 328                    importOptions,
 329                    primMap,
 330                    0,
 331                    composingSubtree);
 224332                while (builder.MoveNext())
 151333                {
 151334                }
 335
 73336                return primMap;
 337            }
 338            finally
 73339            {
 73340                Profiler.EndSample();
 73341            }
 73342        }
 343
 344        private static void RemoveComponent<T>(GameObject go)
 438345        {
 438346            var c = go.GetComponent<T>() as Component;
 438347            if (c == null)
 413348            {
 413349                return;
 350            }
 351#if UNITY_EDITOR
 25352            Component.DestroyImmediate(c);
 353#else
 354            Component.Destroy(c);
 355#endif
 438356        }
 357
 358        /// <summary>
 359        /// Rebuilds the USD scene as Unity GameObjects, with a limited budget per update.
 360        /// </summary>
 361        public static IEnumerator BuildScene(Scene scene,
 362            GameObject root,
 363            SceneImportOptions importOptions,
 364            PrimMap primMap,
 365            float targetFrameMilliseconds,
 366            bool composingSubtree)
 73367        {
 73368            var timer = new System.Diagnostics.Stopwatch();
 73369            var usdPrimRoot = new pxr.SdfPath(importOptions.usdRootPath);
 370
 371            // Setting an arbitrary fudge factor of 20% is very non-scientific, however it's better than
 372            // nothing. The correct way to hit a deadline is to predict how long each iteration actually
 373            // takes and then return early if the estimated time is over budget.
 73374            float targetTime = targetFrameMilliseconds * .8f;
 375
 73376            timer.Start();
 377
 378            // Reconstruct the USD hierarchy as Unity GameObjects.
 379            // A PrimMap is returned for tracking the USD <-> Unity mapping.
 73380            Profiler.BeginSample("USD: Build Hierarchy");
 73381            if (importOptions.importHierarchy || importOptions.forceRebuild)
 73382            {
 383                // When a USD file is fully RE-imported, all exsiting USD data must be removed. The old
 384                // assumption was that the root would never have much more than the UsdAsset component
 385                // itself, however it's now clear that the root may also have meaningful USD data added
 386                // too.
 387                //
 388                // TODO(jcowles): This feels like a workaround. What we really want here is an "undo"
 389                // process for changes made to the root GameObject. For example, to clean up non-USD
 390                // components which may have been added (e.g. what if a mesh is imported to the root?
 391                // currently the MeshRenderer etc will remain after re-import).
 73392                RemoveComponent<UsdAssemblyRoot>(root);
 73393                RemoveComponent<UsdVariantSet>(root);
 73394                RemoveComponent<UsdModelRoot>(root);
 73395                RemoveComponent<UsdLayerStack>(root);
 73396                RemoveComponent<UsdPayload>(root);
 73397                RemoveComponent<UsdPrimSource>(root);
 398
 73399                primMap.Clear();
 73400                HierarchyBuilder.BuildGameObjects(scene,
 401                    root,
 402                    usdPrimRoot,
 403                    scene.Find(usdPrimRoot.ToString(), "UsdSchemaBase"),
 404                    primMap,
 405                    importOptions);
 73406            }
 407
 73408            Profiler.EndSample();
 409
 73410            if (ShouldYield(targetTime, timer))
 49411            {
 49412                yield return null;
 49413                ResetTimer(timer);
 49414            }
 415
 73416            Profiler.BeginSample("USD: Post Process Hierarchy");
 219417            foreach (var processor in root.GetComponents<IImportPostProcessHierarchy>())
 0418            {
 419                try
 0420                {
 0421                    processor.PostProcessHierarchy(primMap, importOptions);
 0422                }
 0423                catch (System.Exception ex)
 0424                {
 0425                    Debug.LogException(ex);
 0426                }
 0427            }
 428
 73429            Profiler.EndSample();
 430
 73431            if (ShouldYield(targetTime, timer))
 1432            {
 1433                yield return null;
 1434                ResetTimer(timer);
 1435            }
 436
 437            //
 438            // Pre-process UsdSkelRoots.
 439            //
 440
 73441            var skelRoots = new List<pxr.UsdSkelRoot>();
 73442            if (importOptions.importSkinning)
 73443            {
 73444                Profiler.BeginSample("USD: Process UsdSkelRoots");
 225445                foreach (var path in primMap.SkelRoots)
 3446                {
 447                    try
 3448                    {
 3449                        var skelRootPrim = scene.GetPrimAtPath(path);
 3450                        if (!skelRootPrim)
 0451                        {
 0452                            Debug.LogWarning("SkelRoot prim not found: " + path);
 0453                            continue;
 454                        }
 455
 3456                        var skelRoot = new pxr.UsdSkelRoot(skelRootPrim);
 3457                        if (!skelRoot)
 0458                        {
 0459                            Debug.LogWarning("SkelRoot prim not SkelRoot type: " + path);
 0460                            continue;
 461                        }
 462
 3463                        skelRoots.Add(skelRoot);
 3464                        GameObject go = primMap[path];
 3465                        ImporterBase.GetOrAddComponent<Animator>(go, true);
 3466                    }
 0467                    catch (System.Exception ex)
 0468                    {
 0469                        Debug.LogException(
 470                            new ImportException("Error pre-processing SkelRoot <" + path + ">", ex));
 0471                    }
 472
 3473                    if (ShouldYield(targetTime, timer))
 0474                    {
 0475                        yield return null;
 0476                        ResetTimer(timer);
 0477                    }
 3478                }
 479
 73480                Profiler.EndSample();
 73481            }
 482
 483            //
 484            // Import known prim types.
 485            //
 486
 487            // Materials.
 73488            Profiler.BeginSample("USD: Build Materials");
 73489            if (importOptions.ShouldBindMaterials)
 1490            {
 5491                foreach (var pathAndSample in scene.ReadAll<MaterialSample>(primMap.Materials))
 1492                {
 493                    try
 1494                    {
 1495                        var mat = MaterialImporter.BuildMaterial(scene,
 496                            pathAndSample.path,
 497                            pathAndSample.sample,
 498                            importOptions);
 1499                        if (mat != null)
 1500                        {
 1501                            importOptions.materialMap[pathAndSample.path] = mat;
 1502                        }
 1503                    }
 0504                    catch (System.Exception ex)
 0505                    {
 0506                        Debug.LogException(
 507                            new ImportException("Error processing material <" + pathAndSample.path + ">", ex));
 0508                    }
 509
 1510                    if (ShouldYield(targetTime, timer))
 1511                    {
 1512                        yield return null;
 1513                        ResetTimer(timer);
 1514                    }
 1515                }
 1516            }
 517
 73518            Profiler.EndSample();
 519
 520            //
 521            // Start threads.
 522            //
 523            ReadAllJob<SanitizedXformSample> readXforms;
 73524            if (importOptions.importTransforms)
 73525            {
 73526                readXforms = new ReadAllJob<SanitizedXformSample>(scene, primMap.Xforms, importOptions);
 73527                readXforms.Schedule(primMap.Xforms.Length, 4);
 73528            }
 529
 73530            if (importOptions.importMeshes)
 73531            {
 73532                ActiveMeshImporter.BeginReading(scene, primMap, importOptions);
 73533            }
 534
 73535            JobHandle.ScheduleBatchedJobs();
 536
 537
 538            // Xforms.
 539            //
 540            // Note that we are specifically filtering on XformSample, not Xformable, this way only
 541            // Xforms are processed to avoid doing that work redundantly.
 73542            if (importOptions.importTransforms)
 73543            {
 73544                Profiler.BeginSample("USD: Build Xforms");
 521545                foreach (var pathAndSample in readXforms)
 151546                {
 547                    try
 151548                    {
 151549                        if (pathAndSample.path == usdPrimRoot)
 39550                        {
 551                            // Never read the xform from the USD root, that will be authored in Unity.
 39552                            continue;
 553                        }
 554
 112555                        GameObject go = primMap[pathAndSample.path];
 112556                        NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path), importOptions);
 112557                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 112558                    }
 0559                    catch (System.Exception ex)
 0560                    {
 0561                        Debug.LogException(
 562                            new ImportException("Error processing xform <" + pathAndSample.path + ">", ex));
 0563                    }
 564
 112565                    if (ShouldYield(targetTime, timer))
 9566                    {
 9567                        yield return null;
 9568                        ResetTimer(timer);
 9569                    }
 112570                }
 571
 225572                foreach (var pathAndSample in scene.ReadAll<XformSample>(primMap.SkelRoots))
 3573                {
 574                    try
 3575                    {
 3576                        if (pathAndSample.path == usdPrimRoot)
 3577                        {
 578                            // Never read the xform from the USD root, that will be authored in Unity.
 3579                            continue;
 580                        }
 581
 0582                        GameObject go = primMap[pathAndSample.path];
 0583                        NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path), importOptions);
 0584                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 0585                    }
 0586                    catch (System.Exception ex)
 0587                    {
 0588                        Debug.LogException(
 589                            new ImportException("Error processing xform <" + pathAndSample.path + ">", ex));
 0590                    }
 591
 0592                    if (ShouldYield(targetTime, timer))
 0593                    {
 0594                        yield return null;
 0595                        ResetTimer(timer);
 0596                    }
 0597                }
 598
 73599                if (importOptions.importSkinning)
 73600                {
 225601                    foreach (var pathAndSample in scene.ReadAll<XformSample>(primMap.Skeletons))
 3602                    {
 603                        try
 3604                        {
 3605                            if (pathAndSample.path == usdPrimRoot)
 0606                            {
 607                                // Never read the xform from the USD root, that will be authored in Unity.
 0608                                continue;
 609                            }
 610
 3611                            GameObject go = primMap[pathAndSample.path];
 3612                            NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 613                                importOptions);
 3614                            XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 615                                scene);
 3616                        }
 0617                        catch (System.Exception ex)
 0618                        {
 0619                            Debug.LogException(
 620                                new ImportException("Error processing xform <" + pathAndSample.path + ">", ex));
 0621                        }
 622
 3623                        if (ShouldYield(targetTime, timer))
 1624                        {
 1625                            yield return null;
 1626                            ResetTimer(timer);
 1627                        }
 3628                    }
 73629                }
 630
 73631                Profiler.EndSample();
 73632            }
 633
 634            // Meshes.
 73635            if (importOptions.importMeshes)
 73636            {
 73637                Profiler.BeginSample("USD: Build Meshes");
 73638                IEnumerator it = ActiveMeshImporter.Import(scene, primMap, importOptions);
 639
 194640                while (it.MoveNext())
 121641                {
 121642                    if (ShouldYield(targetTime, timer))
 49643                    {
 49644                        yield return null;
 49645                        ResetTimer(timer);
 49646                    }
 121647                }
 648
 73649                Profiler.EndSample();
 650
 651                // Cubes.
 73652                Profiler.BeginSample("USD: Build Cubes");
 223653                foreach (var pathAndSample in scene.ReadAll<CubeSample>(primMap.Cubes))
 2654                {
 655                    try
 2656                    {
 2657                        GameObject go = primMap[pathAndSample.path];
 2658                        pxr.UsdPrim prim = scene.GetPrimAtPath(pathAndSample.path);
 659
 2660                        NativeImporter.ImportObject(scene, go, prim, importOptions);
 2661                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 2662                        bool skinnedMesh = IsSkinnedMesh(prim, primMap, importOptions);
 2663                        CubeImporter.BuildCube(pathAndSample.sample, go, importOptions, skinnedMesh);
 2664                    }
 0665                    catch (System.Exception ex)
 0666                    {
 0667                        Debug.LogException(
 668                            new ImportException("Error processing cube <" + pathAndSample.path + ">", ex));
 0669                    }
 670
 2671                    if (ShouldYield(targetTime, timer))
 2672                    {
 2673                        yield return null;
 2674                        ResetTimer(timer);
 2675                    }
 2676                }
 677
 73678                Profiler.EndSample();
 679
 680                // Spheres.
 73681                Profiler.BeginSample("USD: Build Spheres");
 243682                foreach (var pathAndSample in scene.ReadAll<SphereSample>(primMap.Spheres))
 12683                {
 684                    try
 12685                    {
 12686                        GameObject go = primMap[pathAndSample.path];
 12687                        pxr.UsdPrim prim = scene.GetPrimAtPath(pathAndSample.path);
 688
 12689                        NativeImporter.ImportObject(scene, go, prim, importOptions);
 12690                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 12691                        bool skinnedMesh = IsSkinnedMesh(prim, primMap, importOptions);
 12692                        SphereImporter.BuildSphere(pathAndSample.sample, go, importOptions, skinnedMesh);
 12693                    }
 0694                    catch (System.Exception ex)
 0695                    {
 0696                        Debug.LogException(
 697                            new ImportException("Error processing sphere <" + pathAndSample.path + ">", ex));
 0698                    }
 699
 12700                    if (ShouldYield(targetTime, timer))
 11701                    {
 11702                        yield return null;
 11703                        ResetTimer(timer);
 11704                    }
 12705                }
 706
 73707                Profiler.EndSample();
 73708            }
 709
 710            // Cameras.
 73711            if (importOptions.importCameras)
 73712            {
 73713                Profiler.BeginSample("USD: Cameras");
 247714                foreach (var pathAndSample in scene.ReadAll<SanitizedCameraSample>(primMap.Cameras))
 14715                {
 716                    try
 14717                    {
 14718                        GameObject go = primMap[pathAndSample.path];
 14719                        pathAndSample.sample.Sanitize(scene, importOptions);
 14720                        NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path), importOptions);
 14721                        XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions, scene);
 722
 723                        // In order to match FBX importer buggy behavior, the camera xform need an extra rotation.
 724                        // FBX importer is fixed in 2020 though with an option to do an axis bake on import.
 725                        // If axis bake is used, no need to use the SlowAndSafeAsFBX mode.
 14726                        if (importOptions.changeHandedness == BasisTransformation.SlowAndSafeAsFBX)
 8727                        {
 8728                            go.transform.localRotation *= Quaternion.Euler(180.0f, 0.0f, 180.0f);
 8729                        }
 730
 731                        // The camera has many value-type parameters that need to be handled correctly when not
 732                        // not animated. For now, only the camera transform will animate, until this is fixed.
 14733                        if (scene.AccessMask == null || scene.IsPopulatingAccessMask)
 14734                        {
 14735                            CameraImporter.BuildCamera(pathAndSample.sample, go, importOptions);
 14736                        }
 14737                    }
 0738                    catch (System.Exception ex)
 0739                    {
 0740                        Debug.LogException(
 741                            new ImportException("Error processing camera <" + pathAndSample.path + ">", ex));
 0742                    }
 743
 14744                    if (ShouldYield(targetTime, timer))
 6745                    {
 6746                        yield return null;
 6747                        ResetTimer(timer);
 6748                    }
 14749                }
 750
 73751                Profiler.EndSample();
 73752            }
 753
 754            // Build out masters for instancing.
 73755            Profiler.BeginSample("USD: Build Instances");
 225756            foreach (var masterRootPath in primMap.GetMasterRootPaths())
 3757            {
 758                try
 3759                {
 3760                    Transform masterRootXf = primMap[masterRootPath].transform;
 761
 762                    // Transforms
 3763                    if (importOptions.importTransforms)
 3764                    {
 3765                        Profiler.BeginSample("USD: Build Xforms");
 9766                        foreach (var pathAndSample in scene.ReadAll<SanitizedXformSample>(masterRootPath))
 0767                        {
 768                            try
 0769                            {
 0770                                GameObject go = primMap[pathAndSample.path];
 0771                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 772                                    importOptions);
 0773                                pathAndSample.sample.Sanitize(scene, importOptions);
 0774                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 775                                    scene);
 0776                            }
 0777                            catch (System.Exception ex)
 0778                            {
 0779                                Debug.LogException(
 780                                    new ImportException("Error processing xform <" + pathAndSample.path + ">", ex));
 0781                            }
 0782                        }
 783
 9784                        foreach (var pathAndSample in scene.ReadAll<SanitizedXformSample>(primMap.Skeletons))
 0785                        {
 786                            try
 0787                            {
 0788                                GameObject go = primMap[pathAndSample.path];
 0789                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 790                                    importOptions);
 0791                                pathAndSample.sample.Sanitize(scene, importOptions);
 0792                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 793                                    scene);
 0794                            }
 0795                            catch (System.Exception ex)
 0796                            {
 0797                                Debug.LogException(
 798                                    new ImportException("Error processing xform <" + pathAndSample.path + ">", ex));
 0799                            }
 0800                        }
 801
 3802                        Profiler.EndSample();
 3803                    }
 804
 805                    // Meshes.
 3806                    if (importOptions.importMeshes)
 3807                    {
 3808                        Profiler.BeginSample("USD: Build Meshes");
 15809                        foreach (var pathAndSample in scene.ReadAll<SanitizedMeshSample>(masterRootPath))
 3810                        {
 811                            try
 3812                            {
 3813                                GameObject go = primMap[pathAndSample.path];
 3814                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 815                                    importOptions);
 3816                                pathAndSample.sample.Sanitize(scene, importOptions);
 3817                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 818                                    scene);
 3819                                var subsets = MeshImporter.ReadGeomSubsets(scene, pathAndSample.path);
 3820                                bool isDynamic = scene.AccessMask != null
 821                                    ? scene.AccessMask.Included.ContainsKey(pathAndSample.path)
 822                                    : false;
 3823                                MeshImporter.BuildMesh(pathAndSample.path, pathAndSample.sample, subsets, go,
 824                                    importOptions, isDynamic);
 3825                            }
 0826                            catch (System.Exception ex)
 0827                            {
 0828                                Debug.LogException(
 829                                    new ImportException("Error processing mesh <" + pathAndSample.path + ">", ex));
 0830                            }
 3831                        }
 832
 3833                        Profiler.EndSample();
 834
 835                        // Cubes.
 3836                        Profiler.BeginSample("USD: Build Cubes");
 9837                        foreach (var pathAndSample in scene.ReadAll<CubeSample>(masterRootPath))
 0838                        {
 839                            try
 0840                            {
 0841                                GameObject go = primMap[pathAndSample.path];
 0842                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 843                                    importOptions);
 0844                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 845                                    scene);
 0846                                CubeImporter.BuildCube(pathAndSample.sample, go, importOptions);
 0847                            }
 0848                            catch (System.Exception ex)
 0849                            {
 0850                                Debug.LogException(
 851                                    new ImportException("Error processing cube <" + pathAndSample.path + ">", ex));
 0852                            }
 0853                        }
 854
 3855                        Profiler.EndSample();
 856
 857                        // Spheres.
 3858                        Profiler.BeginSample("USD: Build Spheres");
 3859                        var sphereSamples = scene.ReadAll<SphereSample>(masterRootPath);
 9860                        foreach (var pathAndSample in sphereSamples)
 0861                        {
 862                            try
 0863                            {
 0864                                GameObject go = primMap[pathAndSample.path];
 0865                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 866                                    importOptions);
 0867                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 868                                    scene);
 0869                                SphereImporter.BuildSphere(pathAndSample.sample, go, importOptions);
 0870                            }
 0871                            catch (System.Exception ex)
 0872                            {
 0873                                Debug.LogException(
 874                                    new ImportException("Error processing sphere <" + pathAndSample.path + ">", ex));
 0875                            }
 0876                        }
 877
 3878                        Profiler.EndSample();
 3879                    }
 880
 881                    // Cameras.
 3882                    if (importOptions.importCameras)
 3883                    {
 3884                        Profiler.BeginSample("USD: Build Cameras");
 9885                        foreach (var pathAndSample in scene.ReadAll<SanitizedCameraSample>(masterRootPath))
 0886                        {
 887                            try
 0888                            {
 0889                                GameObject go = primMap[pathAndSample.path];
 0890                                pathAndSample.sample.Sanitize(scene, importOptions);
 0891                                NativeImporter.ImportObject(scene, go, scene.GetPrimAtPath(pathAndSample.path),
 892                                    importOptions);
 0893                                XformImporter.BuildXform(pathAndSample.path, pathAndSample.sample, go, importOptions,
 894                                    scene);
 0895                                CameraImporter.BuildCamera(pathAndSample.sample, go, importOptions);
 0896                            }
 0897                            catch (System.Exception ex)
 0898                            {
 0899                                Debug.LogException(
 900                                    new ImportException("Error processing camera <" + pathAndSample.path + ">", ex));
 0901                            }
 0902                        }
 903
 3904                        Profiler.EndSample();
 3905                    }
 3906                }
 0907                catch (System.Exception ex)
 0908                {
 0909                    Debug.LogException(
 910                        new ImportException("Error processing master <" + masterRootPath + ">", ex));
 0911                }
 912
 3913                if (ShouldYield(targetTime, timer))
 3914                {
 3915                    yield return null;
 3916                    ResetTimer(timer);
 3917                }
 3918            } // Instances.
 919
 73920            Profiler.EndSample();
 921
 922            //
 923            // Post-process dependencies: materials and bones.
 924            //
 925
 73926            Profiler.BeginSample("USD: Process Material Bindings");
 927            try
 73928            {
 929                // TODO: Currently ProcessMaterialBindings runs too long and will go over budget for any
 930                // large scene. However, pulling the loop into this code feels wrong in terms of
 931                // responsibilities.
 932
 933                // Process all material bindings in a single vectorized request.
 73934                MaterialImporter.ProcessMaterialBindings(scene, importOptions);
 73935            }
 0936            catch (System.Exception ex)
 0937            {
 0938                Debug.LogException(new ImportException("Failed in ProcessMaterialBindings", ex));
 0939            }
 940
 73941            Profiler.EndSample();
 942
 73943            if (ShouldYield(targetTime, timer))
 10944            {
 10945                yield return null;
 10946                ResetTimer(timer);
 10947            }
 948
 949            //
 950            // SkinnedMesh bone bindings.
 951            //
 73952            if (importOptions.importSkinning)
 73953            {
 73954                Profiler.BeginSample("USD: Build Skeletons");
 73955                var skeletonSamples = new Dictionary<pxr.SdfPath, SkeletonSample>();
 225956                foreach (var skelRoot in skelRoots)
 3957                {
 958                    try
 3959                    {
 3960                        var bindings = new pxr.UsdSkelBindingVector();
 3961                        if (!primMap.SkelBindings.TryGetValue(skelRoot.GetPath(), out bindings))
 0962                        {
 0963                            Debug.LogWarning("No bindings found skelRoot: " + skelRoot.GetPath());
 0964                        }
 965
 3966                        if (bindings.Count == 0)
 0967                        {
 0968                            Debug.LogWarning("No bindings found skelRoot: " + skelRoot.GetPath());
 0969                        }
 970
 15971                        foreach (var skelBinding in bindings)
 3972                        {
 973                            // The SkelRoot will likely have a skeleton binding, but it's inherited, so the bound
 974                            // skeleton isn't actually known until it's queried from the binding. Still, we would
 975                            // like not to reprocess skeletons redundantly, so skeletons are cached into a
 976                            // dictionary.
 977
 3978                            Profiler.BeginSample("Build Bind Transforms");
 3979                            var skelPath = skelBinding.GetSkeleton().GetPath();
 3980                            SkeletonSample skelSample = null;
 3981                            if (!skeletonSamples.TryGetValue(skelPath, out skelSample))
 3982                            {
 3983                                skelSample = new SkeletonSample();
 984
 3985                                Profiler.BeginSample("Read Skeleton");
 3986                                scene.Read(skelPath, skelSample);
 3987                                Profiler.EndSample();
 988
 3989                                skeletonSamples.Add(skelPath, skelSample);
 990
 991                                // The bind pose is bone's inverse transformation matrix. This is done once here, so eac
 992                                // skinned mesh doesn't need to do it redundantly.
 3993                                SkeletonImporter.BuildBindTransforms(skelPath, skelSample, importOptions);
 994
 995                                // Validate the binding transforms.
 3996                                var bindXforms = new pxr.VtMatrix4dArray();
 3997                                var prim = scene.GetPrimAtPath(skelPath);
 3998                                var skel = new pxr.UsdSkelSkeleton(prim);
 999
 31000                                Profiler.BeginSample("Get SkelQuery");
 31001                                pxr.UsdSkelSkeletonQuery skelQuery = primMap.SkelCache.GetSkelQuery(skel);
 31002                                Profiler.EndSample();
 1003
 31004                                Profiler.BeginSample("Get JointWorldBind Transforms");
 31005                                if (!skelQuery.GetJointWorldBindTransforms(bindXforms))
 01006                                {
 01007                                    throw new ImportException("Failed to compute binding transforms for <" + skelPath +
 1008                                        ">");
 1009                                }
 1010
 31011                                Profiler.EndSample();
 1012
 31013                                SkeletonImporter.BuildDebugBindTransforms(skelSample, primMap[skelPath], importOptions);
 31014                            }
 1015
 31016                            Profiler.EndSample();
 1017
 31018                            if (importOptions.importSkinWeights)
 31019                            {
 1020                                //
 1021                                // Apply skinning weights to each skinned mesh.
 1022                                //
 31023                                Profiler.BeginSample("Apply Skin Weights");
 271024                                foreach (var skinningQuery in skelBinding.GetSkinningTargetsAsVector())
 91025                                {
 91026                                    pxr.SdfPath meshPath = skinningQuery.GetPrim().GetPath();
 1027                                    try
 91028                                    {
 91029                                        var goMesh = primMap[meshPath];
 1030
 91031                                        Profiler.BeginSample("Build Skinned Mesh");
 91032                                        SkeletonImporter.BuildSkinnedMesh(
 1033                                            meshPath,
 1034                                            skelPath,
 1035                                            skelSample,
 1036                                            skinningQuery,
 1037                                            goMesh,
 1038                                            primMap,
 1039                                            importOptions);
 91040                                        Profiler.EndSample();
 1041
 1042                                        // In terms of performance, this is almost free.
 1043                                        // TODO: Check if this is correct or should be something specific (not always th
 91044                                        goMesh.GetComponent<SkinnedMeshRenderer>().rootBone =
 1045                                            primMap[skelPath].transform.GetChild(0);
 91046                                    }
 01047                                    catch (System.Exception ex)
 01048                                    {
 01049                                        Debug.LogException(new ImportException("Error skinning mesh: " + meshPath, ex));
 01050                                    }
 91051                                }
 1052
 31053                                Profiler.EndSample();
 31054                            }
 31055                        }
 31056                    }
 01057                    catch (System.Exception ex)
 01058                    {
 01059                        Debug.LogException(
 1060                            new ImportException("Error processing SkelRoot <" + skelRoot.GetPath() + ">", ex));
 01061                    }
 31062                } // foreach SkelRoot
 1063
 731064                Profiler.EndSample();
 1065
 731066                if (ShouldYield(targetTime, timer))
 21067                {
 21068                    yield return null;
 21069                    ResetTimer(timer);
 21070                }
 1071
 1072                //
 1073                // Bone transforms.
 1074                //
 731075                Profiler.BeginSample("USD: Pose Bones");
 2251076                foreach (var pathAndSample in skeletonSamples)
 31077                {
 31078                    var skelPath = pathAndSample.Key;
 1079
 1080                    try
 31081                    {
 31082                        var prim = scene.GetPrimAtPath(skelPath);
 31083                        var skel = new pxr.UsdSkelSkeleton(prim);
 1084
 31085                        pxr.UsdSkelSkeletonQuery skelQuery = primMap.SkelCache.GetSkelQuery(skel);
 31086                        var joints = skelQuery.GetJointOrder();
 31087                        var restXforms = new pxr.VtMatrix4dArray();
 31088                        var time = scene.Time.HasValue ? scene.Time.Value : pxr.UsdTimeCode.Default();
 1089
 31090                        Profiler.BeginSample("Compute Joint Local Transforms");
 31091                        if (!skelQuery.ComputeJointLocalTransforms(restXforms, time, atRest: false))
 01092                        {
 01093                            throw new ImportException("Failed to compute bind transforms for <" + skelPath + ">");
 1094                        }
 1095
 31096                        Profiler.EndSample();
 1097
 31098                        Profiler.BeginSample("Build Bones");
 301099                        for (int i = 0; i < joints.size(); i++)
 121100                        {
 121101                            var jointPath = scene.GetSdfPath(joints[i]);
 121102                            if (joints[i] == "/")
 01103                            {
 01104                                jointPath = skelPath;
 01105                            }
 121106                            else if (jointPath.IsAbsolutePath())
 01107                            {
 01108                                Debug.LogException(
 1109                                    new System.Exception("Unexpected absolute joint path: " + jointPath));
 01110                                jointPath = new pxr.SdfPath(joints[i].ToString().TrimStart('/'));
 01111                                jointPath = skelPath.AppendPath(jointPath);
 01112                            }
 1113                            else
 121114                            {
 121115                                jointPath = skelPath.AppendPath(jointPath);
 121116                            }
 1117
 121118                            var goBone = primMap[jointPath];
 1119
 121120                            Profiler.BeginSample("Convert Matrix");
 121121                            var restXform = UnityTypeConverter.FromMatrix(restXforms[i]);
 121122                            Profiler.EndSample();
 1123
 121124                            Profiler.BeginSample("Build Bone");
 121125                            SkeletonImporter.BuildSkeletonBone(skelPath, goBone, restXform, joints, importOptions);
 121126                            Profiler.EndSample();
 121127                        }
 1128
 31129                        Profiler.EndSample();
 31130                    }
 01131                    catch (System.Exception ex)
 01132                    {
 01133                        Debug.LogException(
 1134                            new ImportException("Error processing SkelRoot <" + skelPath + ">", ex));
 01135                    }
 1136
 31137                    if (ShouldYield(targetTime, timer))
 11138                    {
 11139                        yield return null;
 11140                        ResetTimer(timer);
 11141                    }
 31142                }
 1143
 731144                Profiler.EndSample();
 731145            }
 1146
 1147            //
 1148            // Apply instancing.
 1149            //
 731150            if (importOptions.importSceneInstances)
 731151            {
 731152                Profiler.BeginSample("USD: Build Scene-Instances");
 1153                try
 731154                {
 1155                    // Build scene instances.
 731156                    InstanceImporter.BuildSceneInstances(primMap, importOptions);
 731157                }
 01158                catch (System.Exception ex)
 01159                {
 01160                    Debug.LogException(new ImportException("Failed in BuildSceneInstances", ex));
 01161                }
 1162
 731163                Profiler.EndSample();
 731164            }
 1165
 731166            if (ShouldYield(targetTime, timer))
 41167            {
 41168                yield return null;
 41169                ResetTimer(timer);
 41170            }
 1171
 1172            // Build point instances.
 731173            if (importOptions.importPointInstances)
 731174            {
 731175                Profiler.BeginSample("USD: Build Point-Instances");
 1176                // TODO: right now all point instancer data is read, but we only need prototypes and indices.
 2231177                foreach (var pathAndSample in scene.ReadAll<PointInstancerSample>())
 21178                {
 1179                    try
 21180                    {
 21181                        GameObject instancerGo = primMap[pathAndSample.path];
 1182
 1183                        // Now build the point instances.
 21184                        InstanceImporter.BuildPointInstances(scene,
 1185                            primMap,
 1186                            pathAndSample.path,
 1187                            pathAndSample.sample,
 1188                            instancerGo,
 1189                            importOptions);
 21190                    }
 01191                    catch (System.Exception ex)
 01192                    {
 01193                        Debug.LogError("Error processing point instancer <" + pathAndSample.path + ">: " + ex.Message);
 01194                    }
 1195
 21196                    if (ShouldYield(targetTime, timer))
 21197                    {
 21198                        yield return null;
 21199                        ResetTimer(timer);
 21200                    }
 21201                }
 1202
 731203                Profiler.EndSample();
 731204            }
 1205
 1206            //
 1207            // Apply root transform corrections.
 1208            //
 731209            Profiler.BeginSample("USD: Build Root Transforms");
 731210            if (!composingSubtree)
 701211            {
 701212                if (!root)
 01213                {
 1214                    // There is no single root,
 1215                    // Apply root transform corrections to all imported root prims.
 01216                    foreach (KeyValuePair<pxr.SdfPath, GameObject> kvp in primMap)
 01217                    {
 01218                        if (kvp.Key.IsRootPrimPath() && kvp.Value != null)
 01219                        {
 1220                            // The root object at which the USD scene will be reconstructed.
 1221                            // It may need a Z-up to Y-up conversion and a right- to left-handed change of basis.
 01222                            XformImporter.BuildSceneRoot(scene, kvp.Value.transform, importOptions);
 01223                        }
 01224                    }
 01225                }
 1226                else
 701227                {
 1228                    // There is only one root, apply a single transform correction.
 701229                    XformImporter.BuildSceneRoot(scene, root.transform, importOptions);
 701230                }
 701231            }
 1232
 731233            Profiler.EndSample();
 1234
 731235            Profiler.BeginSample("USD: Post Process Components");
 2191236            foreach (var processor in root.GetComponents<IImportPostProcessComponents>())
 01237            {
 1238                try
 01239                {
 01240                    processor.PostProcessComponents(primMap, importOptions);
 01241                }
 01242                catch (System.Exception ex)
 01243                {
 01244                    Debug.LogException(ex);
 01245                }
 01246            }
 1247
 731248            Profiler.EndSample();
 731249        }
 1250
 1251        private static bool ShouldYield(float targetTime, System.Diagnostics.Stopwatch timer)
 6411252        {
 6411253            return timer.ElapsedMilliseconds > targetTime;
 6411254        }
 1255
 1256        private static void ResetTimer(System.Diagnostics.Stopwatch timer)
 1511257        {
 1511258            timer.Stop();
 1511259            timer.Reset();
 1511260            timer.Start();
 1511261        }
 1262
 1263        private static bool IsSkinnedMesh(pxr.UsdPrim prim, PrimMap primMap, SceneImportOptions importOptions)
 141264        {
 141265            bool skinnedMesh = false;
 1266
 141267            if (importOptions.importSkinning && primMap.SkelCache != null)
 141268            {
 141269                pxr.UsdSkelSkinningQuery skinningQuery = primMap.SkelCache.GetSkinningQuery(prim);
 141270                primMap.SkinningQueries[prim.GetPath()] = skinningQuery;
 141271                skinnedMesh = skinningQuery.IsValid();
 141272            }
 1273
 141274            return skinnedMesh;
 141275        }
 1276    }
 1277}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderExporterBase.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderExporterBase.html new file mode 100644 index 000000000..4bdb4709b --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderExporterBase.html @@ -0,0 +1,431 @@ + + + + + + +Unity.Formats.USD.ShaderExporterBase - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ShaderExporterBase
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/ShaderExporterBase.cs
Covered lines:0
Uncovered lines:155
Coverable lines:155
Total lines:329
Line coverage:0% (0 of 155)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetupTexture(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/ShaderExporterBase.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using pxr;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class ShaderExporterBase
 23    {
 24        public enum ConversionType
 25        {
 26            None,
 27            SwapRASmoothnessToBGRoughness,
 28            InvertAlpha,
 29            UnpackNormal,
 30            MaskMapToORM
 31        }
 32
 33        static Material _metalGlossChannelSwapMaterial = null;
 34        static Material _normalChannelMaterial = null;
 35
 36        /// <summary>
 37        /// Exports the given texture to the destination texture path and wires up the preview surface.
 38        /// </summary>
 39        /// <returns>
 40        /// Returns the path to the USD texture object.
 41        /// </returns>
 42        protected static string SetupTexture(Scene scene,
 43            string usdShaderPath,
 44            Material material,
 45            PreviewSurfaceSample surface,
 46            Vector4 scale,
 47            string destTexturePath,
 48            string textureName,
 49            string textureOutput,
 50            ConversionType conversionType = ConversionType.None)
 051        {
 52            // We have to handle multiple cases here:
 53            // - file exists on disk
 54            //   - file is a supported format => can be directly copied
 55            //   - file is not in a supported format => need to blit / export
 56            // - file is only in memory
 57            //   - a Texture2D
 58            //   - a Texture
 59            //   - a RenderTexture
 60            //   - needs special care if marked as Normal Map
 61            //     (can probably only be detected in an Editor context, and heuristically at runtime)
 62            //   => need to blit / export
 63            // - file is not supported at all (or not yet)
 64            //   - a 3D texture
 65            //   => needs to be ignored, log Warning
 66
 067            bool textureIsExported = false;
 68
 069            string filePath = null;
 070            string fileName = null;
 71
 072            var srcTexture2d = material.GetTexture(textureName);
 73
 074            bool needsConversion = false;
 075            switch (conversionType)
 76            {
 77                case ConversionType.None:
 078                    break;
 79                case ConversionType.UnpackNormal:
 80#if UNITY_EDITOR
 081                    if (UnityEditor.AssetDatabase.Contains(srcTexture2d))
 082                    {
 83                        // normal needs to be converted if the one on disk isn't really a normal map
 84                        // (e.g. created from greyscale)
 085                        UnityEditor.TextureImporter importer =
 86                            (UnityEditor.TextureImporter)UnityEditor.AssetImporter.GetAtPath(
 87                                UnityEditor.AssetDatabase.GetAssetPath(srcTexture2d));
 088                        if (importer.textureType != UnityEditor.TextureImporterType.NormalMap)
 089                        {
 090                            Debug.LogWarning("Texture " + textureName + " is set as NormalMap but isn't marked as such",
 91                                srcTexture2d);
 092                        }
 93
 094                        UnityEditor.TextureImporterSettings dst = new UnityEditor.TextureImporterSettings();
 095                        importer.ReadTextureSettings(dst);
 96                        // if this NormalMap is created from greyscale we will export the NormalMap from memory.
 097                        if (dst.convertToNormalMap)
 098                        {
 099                            needsConversion = true;
 0100                            break;
 101                        }
 0102                    }
 103#endif
 0104                    break;
 105                default:
 0106                    needsConversion = true;
 0107                    break;
 108            }
 109
 110#if UNITY_EDITOR
 111            // only export from disk if there's no need to do any type of data conversion here
 0112            if (!needsConversion)
 0113            {
 0114                var srcPath = UnityEditor.AssetDatabase.GetAssetPath(srcTexture2d);
 115
 0116                if (!string.IsNullOrEmpty(srcPath))
 0117                {
 118#if UNITY_2019_2_OR_GREATER
 119                    // Since textures might be inside of packages for various reasons we should support that.
 120                    // Usually this would just be "Path.GetFullPath(srcPath)", but USD export messes with the CWD (Worki
 121                    // and so we have to do a bit more path wrangling here.
 122                    if (srcPath.StartsWith("Packages"))
 123                    {
 124                        var pi = UnityEditor.PackageManager.PackageInfo.FindForAssetPath(srcPath);
 125                        srcPath = pi.resolvedPath + srcPath.Substring(("Packages/" + pi.name).Length);
 126                    }
 127#endif
 0128                    if (srcPath.StartsWith("Assets"))
 0129                    {
 0130                        srcPath = Application.dataPath + "/" + srcPath.Substring("Assets/".Length);
 0131                    }
 132
 0133                    fileName = System.IO.Path.GetFileName(srcPath);
 0134                    filePath = System.IO.Path.Combine(destTexturePath, fileName);
 135
 0136                    if (System.IO.File.Exists(srcPath))
 0137                    {
 138                        // USDZ officially only supports png / jpg / jpeg
 139                        // https://graphics.pixar.com/usd/docs/Usdz-File-Format-Specification.html
 140
 0141                        var ext = System.IO.Path.GetExtension(srcPath).ToLowerInvariant();
 0142                        if (ext == ".png" || ext == ".jpg" || ext == ".jpeg")
 0143                        {
 0144                            System.IO.File.Copy(srcPath, filePath, overwrite: true);
 0145                            if (System.IO.File.Exists(filePath))
 0146                            {
 0147                                textureIsExported = true;
 0148                            }
 0149                        }
 0150                    }
 0151                }
 0152            }
 153#endif
 154
 0155            if (!textureIsExported)
 0156            {
 157                // Since this is a texture we can't directly export from disk, we need to blit it and output it as PNG.
 158                // To avoid collisions, e.g. with multiple different textures named the same, each texture gets a pseudo
 159                // This will also avoid collisions when exporting multiple models to the same folder, e.g. with a a Rend
 160                // in each of them that might look different between exports.
 161                // TODO Future work could, if necessary, generate a texture content hash to avoid exporting identical te
 162                // (Unity's content hash isn't reliable for some types of textures unfortunately, e.g. RTs)
 163#if UNITY_EDITOR
 0164                if (srcTexture2d is Texture2D)
 0165                    fileName = srcTexture2d.name + "_" + srcTexture2d.imageContentsHash.ToString();
 166                else
 0167                    fileName = srcTexture2d.name + "_" + Random.Range(10000000, 99999999).ToString();
 168#else
 169                fileName = srcTexture2d.name + "_" + Random.Range(10000000, 99999999).ToString();
 170#endif
 0171                filePath = System.IO.Path.Combine(destTexturePath, fileName + ".png");
 172
 173                // TODO extra care has to be taken of Normal Maps etc., since these are in a converted format in memory 
 174                // An example of this conversion in a shader is in Khronos' UnityGLTF implementation.
 175                // Basically, the blit has do be done with the right unlit conversion shader to get a proper "file-based
 176
 177                // Blit the texture and get it back to CPU
 178                // Note: Can't use RenderTexture.GetTemporary because that doesn't properly clear alpha channel
 0179                bool preserveLinear = false;
 0180                switch (conversionType)
 181                {
 182                    case ConversionType.UnpackNormal:
 0183                        preserveLinear = true;
 0184                        break;
 185                }
 186
 0187                var rt = new RenderTexture(srcTexture2d.width, srcTexture2d.height, 0, RenderTextureFormat.ARGB32,
 188                    preserveLinear ? RenderTextureReadWrite.Linear : RenderTextureReadWrite.Default);
 0189                var resultTex2d = new Texture2D(srcTexture2d.width, srcTexture2d.height, TextureFormat.ARGB32, true,
 190                    preserveLinear ? true : false);
 0191                var activeRT = RenderTexture.active;
 192                try
 0193                {
 0194                    RenderTexture.active = rt;
 0195                    GL.Clear(true, true, Color.clear);
 196
 197                    // conversion material
 0198                    if (_metalGlossChannelSwapMaterial == null)
 0199                    {
 0200                        _metalGlossChannelSwapMaterial = new Material(Shader.Find("Hidden/USD/ChannelCombiner"));
 0201                    }
 202
 0203                    if (_normalChannelMaterial == null)
 0204                    {
 0205                        _normalChannelMaterial = new Material(Shader.Find("Hidden/USD/NormalChannel"));
 0206                    }
 207
 0208                    _metalGlossChannelSwapMaterial.SetTexture("_R", srcTexture2d);
 0209                    _metalGlossChannelSwapMaterial.SetTexture("_G", srcTexture2d);
 0210                    _metalGlossChannelSwapMaterial.SetTexture("_B", srcTexture2d);
 0211                    _metalGlossChannelSwapMaterial.SetTexture("_A", srcTexture2d);
 212
 0213                    switch (conversionType)
 214                    {
 215                        case ConversionType.None:
 0216                            Graphics.Blit(srcTexture2d, rt);
 0217                            break;
 218                        case ConversionType.SwapRASmoothnessToBGRoughness:
 0219                            _metalGlossChannelSwapMaterial.SetVector("_Invert",
 220                                new Vector4(0, 1, 0, 1)); // invert resulting g channel, make sure alpha is 1
 0221                            _metalGlossChannelSwapMaterial.SetVector("_RScale", new Vector4(0, 0, 0, 0));
 0222                            _metalGlossChannelSwapMaterial.SetVector("_GScale",
 223                                new Vector4(0, 0, 0, 1)); // use a channel from _G texture for resulting g
 0224                            _metalGlossChannelSwapMaterial.SetVector("_BScale",
 225                                new Vector4(1, 0, 0, 0)); // use r channel from _B texture for resulting b
 0226                            _metalGlossChannelSwapMaterial.SetVector("_AScale", new Vector4(0, 0, 0, 0));
 227
 0228                            Graphics.Blit(srcTexture2d, rt, _metalGlossChannelSwapMaterial);
 0229                            break;
 230                        case ConversionType.InvertAlpha:
 0231                            _metalGlossChannelSwapMaterial.SetVector("_Invert",
 232                                new Vector4(0, 0, 0, 1)); // invert alpha result
 0233                            _metalGlossChannelSwapMaterial.SetVector("_RScale",
 234                                new Vector4(1, 0, 0, 0)); // use all color channels as-is
 0235                            _metalGlossChannelSwapMaterial.SetVector("_GScale", new Vector4(0, 1, 0, 0));
 0236                            _metalGlossChannelSwapMaterial.SetVector("_BScale", new Vector4(0, 0, 1, 0));
 0237                            _metalGlossChannelSwapMaterial.SetVector("_AScale", new Vector4(0, 0, 0, 1));
 238
 0239                            Graphics.Blit(srcTexture2d, rt, _metalGlossChannelSwapMaterial);
 0240                            break;
 241                        case ConversionType.MaskMapToORM:
 242                            // Input is RGBA (Metallic, Occlusion, Detail, Smoothness)
 243                            // Output is RGB1 (Occlusion, Roughness = 1 - Smoothness, Metallic, 1)
 0244                            _metalGlossChannelSwapMaterial.SetVector("_Invert",
 245                                new Vector4(0, 1, 0, 1)); // smoothness to roughness, solid alpha
 0246                            _metalGlossChannelSwapMaterial.SetVector("_RScale", new Vector4(0, 1, 0, 0));
 0247                            _metalGlossChannelSwapMaterial.SetVector("_GScale", new Vector4(0, 0, 0, 1));
 0248                            _metalGlossChannelSwapMaterial.SetVector("_BScale", new Vector4(1, 0, 0, 0));
 0249                            _metalGlossChannelSwapMaterial.SetVector("_AScale", new Vector4(0, 0, 0, 0));
 250
 0251                            Graphics.Blit(srcTexture2d, rt, _metalGlossChannelSwapMaterial);
 0252                            break;
 253                        case ConversionType.UnpackNormal:
 0254                            Graphics.Blit(srcTexture2d, rt, _normalChannelMaterial);
 0255                            break;
 256                    }
 257
 0258                    resultTex2d.ReadPixels(new Rect(0, 0, srcTexture2d.width, srcTexture2d.height), 0, 0);
 0259                    resultTex2d.Apply();
 260
 0261                    System.IO.File.WriteAllBytes(filePath, resultTex2d.EncodeToPNG());
 0262                    if (System.IO.File.Exists(filePath))
 0263                    {
 0264                        textureIsExported = true;
 0265                    }
 0266                }
 267                finally
 0268                {
 0269                    RenderTexture.active = activeRT;
 0270                    rt.Release();
 0271                    GameObject.DestroyImmediate(rt);
 0272                    GameObject.DestroyImmediate(resultTex2d);
 0273                }
 0274            }
 275
 0276            if (!textureIsExported)
 0277            {
 0278                var tmpTex2d = new Texture2D(1, 1, TextureFormat.ARGB32, true);
 279                try
 0280                {
 0281                    tmpTex2d.SetPixel(0, 0, Color.white);
 0282                    tmpTex2d.Apply();
 0283                    System.IO.File.WriteAllBytes(filePath, tmpTex2d.EncodeToPNG());
 0284                    if (System.IO.File.Exists(filePath))
 0285                    {
 0286                        textureIsExported = true;
 0287                    }
 0288                }
 289                finally
 0290                {
 0291                    GameObject.DestroyImmediate(tmpTex2d);
 0292                }
 0293            }
 294
 0295            if (textureIsExported)
 0296            {
 297                // Make file path baked into USD relative to scene file and use forward slashes.
 0298                filePath = ImporterBase.MakeRelativePath(scene.FilePath, filePath);
 0299                filePath = filePath.Replace("\\", "/");
 300
 0301                var uvReader = new PrimvarReaderSample<Vector2>();
 0302                uvReader.varname.defaultValue = new TfToken("st");
 0303                scene.Write(usdShaderPath + "/uvReader", uvReader);
 0304                var usdTexReader = new TextureReaderSample(filePath, usdShaderPath + "/uvReader.outputs:result");
 0305                usdTexReader.wrapS =
 306                    new Connectable<TextureReaderSample.WrapMode>(
 307                        TextureReaderSample.GetWrapMode(srcTexture2d.wrapModeU));
 0308                usdTexReader.wrapT =
 309                    new Connectable<TextureReaderSample.WrapMode>(
 310                        TextureReaderSample.GetWrapMode(srcTexture2d.wrapModeV));
 0311                if (scale != Vector4.one)
 0312                {
 0313                    usdTexReader.scale = new Connectable<Vector4>(scale);
 0314                }
 315
 316                // usdTexReader.isSRGB = new Connectable<TextureReaderSample.SRGBMode>(TextureReaderSample.SRGBMode.Auto
 0317                scene.Write(usdShaderPath + "/" + textureName, usdTexReader);
 0318                return usdShaderPath + "/" + textureName + ".outputs:" + textureOutput;
 319            }
 320            else
 0321            {
 0322                Debug.LogError(
 323                    "Texture wasn't exported: " + srcTexture2d.name + " (" + textureName + " from material " + material,
 324                    srcTexture2d);
 0325                return null;
 326            }
 0327        }
 328    }
 329}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderImporterBase.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderImporterBase.html new file mode 100644 index 000000000..6ec153648 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_ShaderImporterBase.html @@ -0,0 +1,288 @@ + + + + + + +Unity.Formats.USD.ShaderImporterBase - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.ShaderImporterBase
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/ShaderImporterBase.cs
Covered lines:52
Uncovered lines:15
Coverable lines:67
Total lines:174
Line coverage:77.6% (52 of 67)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ShaderImporterBase(...)0%000100%
ImportColorOrMap(...)0%00072.73%
ImportValueOrMap[T](...)0%00070%
MergePrimvars(...)0%00050%
ImportParametersFromUsd(...)0%00086.67%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/ShaderImporterBase.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public abstract class ShaderImporterBase
 23    {
 224        public Material Material { get; private set; }
 325        public bool IsSpecularWorkflow { get; private set; }
 26
 27        public Color? Diffuse;
 28        public Texture2D DiffuseMap;
 29
 30        public Color? Specular;
 31        public Texture2D SpecularMap;
 32
 33        public Vector3? Normal;
 34        public Texture2D NormalMap;
 35
 36        public float? Displacement;
 37        public Texture2D DisplacementMap;
 38
 39        public float? Occlusion;
 40        public Texture2D OcclusionMap;
 41
 42        public Color? Emission;
 43        public Texture2D EmissionMap;
 44
 45        public float? Roughness;
 46        public Texture2D RoughnessMap;
 47
 48        public float? Metallic;
 49        public Texture2D MetallicMap;
 50
 51        public float? Clearcoat;
 52        public Texture2D ClearcoatMap;
 53
 54        public float? ClearcoatRoughness;
 55
 156        public ShaderImporterBase(Material material)
 157        {
 158            Material = material;
 159        }
 60
 61        abstract public void ImportFromUsd();
 62
 63        protected void ImportColorOrMap(Scene scene,
 64            Connectable<Vector3> usdParam,
 65            bool isNormalMap,
 66            SceneImportOptions options,
 67            ref Texture2D map,
 68            ref Color? value,
 69            out string uvPrimvar)
 370        {
 371            uvPrimvar = null;
 372            if (usdParam.IsConnected())
 073            {
 074                map = MaterialImporter.ImportConnectedTexture(scene, usdParam, isNormalMap, options, out uvPrimvar);
 075            }
 76            else
 377            {
 378                var rgb = usdParam.defaultValue;
 379                value = new Color(rgb.x, rgb.y, rgb.z).gamma;
 380            }
 381        }
 82
 83        protected void ImportValueOrMap<T>(Scene scene,
 84            Connectable<T> usdParam,
 85            bool isNormalMap,
 86            SceneImportOptions options,
 87            ref Texture2D map,
 88            ref T? value,
 89            out string uvPrimvar) where T : struct
 590        {
 591            uvPrimvar = null;
 592            if (usdParam.IsConnected())
 093            {
 094                map = MaterialImporter.ImportConnectedTexture(scene, usdParam, isNormalMap, options, out uvPrimvar);
 095            }
 96            else
 597            {
 598                value = usdParam.defaultValue;
 599            }
 5100        }
 101
 102        private void MergePrimvars(string newPrimvar, List<string> primvars)
 8103        {
 8104            if (string.IsNullOrEmpty(newPrimvar))
 8105            {
 8106                return;
 107            }
 108
 0109            string localName = newPrimvar;
 0110            if (!string.IsNullOrEmpty(primvars.Find(str => str == localName)))
 0111            {
 0112                return;
 113            }
 114
 0115            primvars.Add(localName);
 8116        }
 117
 118        public virtual void ImportParametersFromUsd(Scene scene,
 119            string materialPath,
 120            MaterialSample materialSample,
 121            PreviewSurfaceSample previewSurf,
 122            SceneImportOptions options)
 1123        {
 1124            var primvars = new List<string>();
 1125            string uvPrimvar = null;
 126
 1127            IsSpecularWorkflow = previewSurf.useSpecularWorkflow.defaultValue == 1;
 128
 1129            ImportColorOrMap(scene, previewSurf.diffuseColor, false, options, ref DiffuseMap, ref Diffuse,
 130                out uvPrimvar);
 1131            MergePrimvars(uvPrimvar, primvars);
 132
 1133            ImportColorOrMap(scene, previewSurf.emissiveColor, false, options, ref EmissionMap, ref Emission,
 134                out uvPrimvar);
 1135            MergePrimvars(uvPrimvar, primvars);
 136
 1137            ImportValueOrMap(scene, previewSurf.normal, true, options, ref NormalMap, ref Normal, out uvPrimvar);
 1138            MergePrimvars(uvPrimvar, primvars);
 139
 1140            ImportValueOrMap(scene, previewSurf.displacement, false, options, ref DisplacementMap, ref Displacement,
 141                out uvPrimvar);
 1142            MergePrimvars(uvPrimvar, primvars);
 143
 1144            ImportValueOrMap(scene, previewSurf.occlusion, false, options, ref OcclusionMap, ref Occlusion,
 145                out uvPrimvar);
 1146            MergePrimvars(uvPrimvar, primvars);
 147
 1148            ImportValueOrMap(scene, previewSurf.roughness, false, options, ref RoughnessMap, ref Roughness,
 149                out uvPrimvar);
 1150            MergePrimvars(uvPrimvar, primvars);
 151
 1152            ImportValueOrMap(scene, previewSurf.clearcoat, false, options, ref ClearcoatMap, ref Clearcoat,
 153                out uvPrimvar);
 1154            MergePrimvars(uvPrimvar, primvars);
 155
 1156            ClearcoatRoughness = previewSurf.clearcoatRoughness.defaultValue;
 157
 1158            if (IsSpecularWorkflow)
 1159            {
 1160                ImportColorOrMap(scene, previewSurf.specularColor, false, options, ref SpecularMap, ref Specular,
 161                    out uvPrimvar);
 1162                MergePrimvars(uvPrimvar, primvars);
 1163            }
 164            else
 0165            {
 0166                ImportValueOrMap(scene, previewSurf.metallic, false, options, ref MetallicMap, ref Metallic,
 167                    out uvPrimvar);
 0168                MergePrimvars(uvPrimvar, primvars);
 0169            }
 170
 1171            options.materialMap.SetPrimvars(materialPath, primvars);
 1172        }
 173    }
 174}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelBindingSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelBindingSample.html new file mode 100644 index 000000000..1a9391665 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelBindingSample.html @@ -0,0 +1,223 @@ + + + + + + +Unity.Formats.USD.SkelBindingSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkelBindingSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs
Covered lines:0
Uncovered lines:6
Coverable lines:6
Total lines:121
Line coverage:0% (0 of 6)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SkelBindingSample()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UnitySkeleton
 23    {
 24        public Transform rootBone;
 25        public Transform[] bones;
 26    }
 27
 28    [System.Serializable]
 29    public class SkelBindingSample : SampleBase
 30    {
 31        // Blend Shapes.
 32        [UsdNamespace("skel")]
 33        [UsdVariability(Variability.Uniform)]
 34        public string[] blendShapes;
 35
 036        [UsdNamespace("skel")] public Relationship blendShapeTargets = new Relationship();
 37
 38        // Skeleton & Animation Binding.
 039        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 40
 041        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 42
 43        // Skeleton Binding Data.
 44        [UsdNamespace("skel")]
 45        [UsdVariability(Variability.Uniform)]
 46        public string[] joints;
 47
 48        [UsdNamespace("skel")]
 49        [UsdVariability(Variability.Uniform)]
 050        public Primvar<int[]> jointIndices = new Primvar<int[]>();
 51
 52        [UsdNamespace("skel")]
 53        [UsdVariability(Variability.Uniform)]
 054        public Primvar<Matrix4x4> geomBindTransform = new Primvar<Matrix4x4>();
 55
 56        [UsdNamespace("skel")]
 57        [UsdVariability(Variability.Uniform)]
 058        public Primvar<float[]> jointWeights = new Primvar<float[]>();
 59    }
 60
 61    [System.Serializable]
 62    [UsdSchema("SkelRoot")]
 63    public class SkelRootSample : BoundableSample
 64    {
 65        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 66        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 67    }
 68
 69    [System.Serializable]
 70    [UsdSchema("Skeleton")]
 71    public class SkeletonSample : XformableSample
 72    {
 73        [UsdVariability(Variability.Uniform)] public string[] joints;
 74
 75        [UsdVariability(Variability.Uniform)] public Matrix4x4[] bindTransforms;
 76
 77        [UsdVariability(Variability.Uniform)] public Matrix4x4[] restTransforms;
 78    }
 79
 80    [System.Serializable]
 81    [UsdSchema("SkelAnimation")]
 82    public class SkelAnimationSample : SampleBase
 83    {
 84        [UsdVariability(Variability.Uniform)] public string[] joints;
 85
 86        // Intended to work with pxr.UsdCs.UsdSkelDecomposeTransforms()
 87        public Vector3[] translations;
 88
 89        public Quaternion[] rotations;
 90
 91        // TODO: How to support Vector3h?
 92        public pxr.VtVec3hArray scales;
 93
 94        [UsdVariability(Variability.Uniform)] public string[] blendShapes;
 95
 96        [UsdVariability(Variability.Uniform)] public float[] blendShapeWeights;
 97    }
 98
 99    [System.Serializable]
 100    [UsdSchema("BlendShape")]
 101    public class BlendShapeSample : SampleBase
 102    {
 103        public Vector3[] offsets;
 104        public uint[] pointIndices;
 105    }
 106
 107    public class SkeletonIo
 108    {
 109        private Dictionary<Transform, Transform[]> m_bindings = new Dictionary<Transform, Transform[]>();
 110
 111        public Transform[] GetBones(Transform rootBone)
 112        {
 113            return m_bindings[rootBone];
 114        }
 115
 116        public void RegisterSkeleton(Transform rootBone, Transform[] bones)
 117        {
 118            m_bindings.Add(rootBone, bones);
 119        }
 120    }
 121}
+
+
+
+

Methods/Properties

+SkelBindingSample()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelRootSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelRootSample.html new file mode 100644 index 000000000..bfd6b602a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkelRootSample.html @@ -0,0 +1,223 @@ + + + + + + +Unity.Formats.USD.SkelRootSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkelRootSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs
Covered lines:0
Uncovered lines:2
Coverable lines:2
Total lines:121
Line coverage:0% (0 of 2)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SkelRootSample()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UnitySkeleton
 23    {
 24        public Transform rootBone;
 25        public Transform[] bones;
 26    }
 27
 28    [System.Serializable]
 29    public class SkelBindingSample : SampleBase
 30    {
 31        // Blend Shapes.
 32        [UsdNamespace("skel")]
 33        [UsdVariability(Variability.Uniform)]
 34        public string[] blendShapes;
 35
 36        [UsdNamespace("skel")] public Relationship blendShapeTargets = new Relationship();
 37
 38        // Skeleton & Animation Binding.
 39        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 40
 41        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 42
 43        // Skeleton Binding Data.
 44        [UsdNamespace("skel")]
 45        [UsdVariability(Variability.Uniform)]
 46        public string[] joints;
 47
 48        [UsdNamespace("skel")]
 49        [UsdVariability(Variability.Uniform)]
 50        public Primvar<int[]> jointIndices = new Primvar<int[]>();
 51
 52        [UsdNamespace("skel")]
 53        [UsdVariability(Variability.Uniform)]
 54        public Primvar<Matrix4x4> geomBindTransform = new Primvar<Matrix4x4>();
 55
 56        [UsdNamespace("skel")]
 57        [UsdVariability(Variability.Uniform)]
 58        public Primvar<float[]> jointWeights = new Primvar<float[]>();
 59    }
 60
 61    [System.Serializable]
 62    [UsdSchema("SkelRoot")]
 63    public class SkelRootSample : BoundableSample
 64    {
 065        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 066        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 67    }
 68
 69    [System.Serializable]
 70    [UsdSchema("Skeleton")]
 71    public class SkeletonSample : XformableSample
 72    {
 73        [UsdVariability(Variability.Uniform)] public string[] joints;
 74
 75        [UsdVariability(Variability.Uniform)] public Matrix4x4[] bindTransforms;
 76
 77        [UsdVariability(Variability.Uniform)] public Matrix4x4[] restTransforms;
 78    }
 79
 80    [System.Serializable]
 81    [UsdSchema("SkelAnimation")]
 82    public class SkelAnimationSample : SampleBase
 83    {
 84        [UsdVariability(Variability.Uniform)] public string[] joints;
 85
 86        // Intended to work with pxr.UsdCs.UsdSkelDecomposeTransforms()
 87        public Vector3[] translations;
 88
 89        public Quaternion[] rotations;
 90
 91        // TODO: How to support Vector3h?
 92        public pxr.VtVec3hArray scales;
 93
 94        [UsdVariability(Variability.Uniform)] public string[] blendShapes;
 95
 96        [UsdVariability(Variability.Uniform)] public float[] blendShapeWeights;
 97    }
 98
 99    [System.Serializable]
 100    [UsdSchema("BlendShape")]
 101    public class BlendShapeSample : SampleBase
 102    {
 103        public Vector3[] offsets;
 104        public uint[] pointIndices;
 105    }
 106
 107    public class SkeletonIo
 108    {
 109        private Dictionary<Transform, Transform[]> m_bindings = new Dictionary<Transform, Transform[]>();
 110
 111        public Transform[] GetBones(Transform rootBone)
 112        {
 113            return m_bindings[rootBone];
 114        }
 115
 116        public void RegisterSkeleton(Transform rootBone, Transform[] bones)
 117        {
 118            m_bindings.Add(rootBone, bones);
 119        }
 120    }
 121}
+
+
+
+

Methods/Properties

+SkelRootSample()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonExporter.html new file mode 100644 index 000000000..bb750018e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonExporter.html @@ -0,0 +1,315 @@ + + + + + + +Unity.Formats.USD.SkeletonExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkeletonExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonExporter.cs
Covered lines:0
Uncovered lines:114
Coverable lines:114
Total lines:209
Line coverage:0% (0 of 114)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportSkeleton(...)0%0000%
ExportSkelRoot(...)0%0000%
ExportSkelAnimation(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17using USD.NET.Unity;
 18
 19namespace Unity.Formats.USD
 20{
 21    public static class SkeletonExporter
 22    {
 23        public static void ExportSkeleton(ObjectContext objContext, ExportContext exportContext)
 024        {
 025            var scene = exportContext.scene;
 026            var sample = (SkeletonSample)objContext.sample;
 027            var boneNames = exportContext.skelSortedMap[objContext.gameObject.transform];
 028            sample.joints = new string[boneNames.Count];
 029            sample.bindTransforms = new Matrix4x4[boneNames.Count];
 030            sample.restTransforms = new Matrix4x4[boneNames.Count];
 31
 032            string rootPath = UnityTypeConverter.GetPath(objContext.gameObject.transform);
 33
 034            sample.transform = XformExporter.GetLocalTransformMatrix(
 35                objContext.gameObject.transform,
 36                scene.UpAxis == Scene.UpAxes.Z,
 37                new pxr.SdfPath(rootPath).IsRootPrimPath(),
 38                exportContext.basisTransform);
 39
 040            int i = 0;
 041            foreach (string bonePath in boneNames)
 042            {
 043                if (string.IsNullOrEmpty(bonePath))
 044                {
 045                    sample.joints[i] = "";
 046                    i++;
 047                    continue;
 48                }
 49
 050                var bone = exportContext.pathToBone[bonePath];
 051                if (bonePath == rootPath)
 052                {
 053                    sample.joints[i] = "/";
 054                }
 55                else
 056                {
 057                    sample.joints[i] = bonePath.Replace(rootPath + "/", "");
 058                }
 59
 60                // TODO: When the bone bind transform contains the geomBindTransform from USD import, it
 61                // will be mixed into each bone. This transform should be saved in some way and removed
 62                // when exported as a skeleton.
 063                sample.bindTransforms[i] = exportContext.bindPoses[bone].inverse;
 064                sample.restTransforms[i] = XformExporter.GetLocalTransformMatrix(
 65                    bone, false, false, exportContext.basisTransform);
 66
 067                if (exportContext.basisTransform == BasisTransformation.SlowAndSafe)
 068                {
 069                    sample.bindTransforms[i] = UnityTypeConverter.ChangeBasis(sample.bindTransforms[i]);
 70                    // The restTransforms will get a change of basis from GetLocalTransformMatrix().
 071                }
 72
 073                i++;
 074            }
 75
 076            scene.Write(objContext.path, sample);
 77
 78            // Stop Skeleton from rendering bones in usdview by default.
 079            var im = new pxr.UsdGeomImageable(scene.GetPrimAtPath(objContext.path));
 080            im.CreatePurposeAttr().Set(pxr.UsdGeomTokens.guide);
 081        }
 82
 83        public static void ExportSkelRoot(ObjectContext objContext, ExportContext exportContext)
 084        {
 085            var sample = (SkelRootSample)objContext.sample;
 86
 87            // Compute bounds for the root, required by USD.
 088            bool first = true;
 89
 90            // Ensure the bounds are computed in root-local space.
 91            // This is required because USD expects the extent to be a local bound for the SkelRoot.
 092            var oldParent = objContext.gameObject.transform.parent;
 093            objContext.gameObject.transform.SetParent(null, worldPositionStays: false);
 94
 95            try
 096            {
 097                foreach (var r in objContext.gameObject.GetComponentsInChildren<Renderer>())
 098                {
 099                    if (first)
 0100                    {
 101                        // Ensure the bounds object starts growing from the first valid child bounds.
 0102                        first = false;
 0103                        sample.extent = r.bounds;
 0104                    }
 105                    else
 0106                    {
 0107                        sample.extent.Encapsulate(r.bounds);
 0108                    }
 0109                }
 0110            }
 111            finally
 0112            {
 113                // Restore the root parent.
 0114                objContext.gameObject.transform.SetParent(oldParent, worldPositionStays: false);
 0115            }
 116
 117            // Convert handedness if needed.
 0118            if (exportContext.basisTransform == BasisTransformation.SlowAndSafe)
 0119            {
 0120                sample.extent.center = UnityTypeConverter.ChangeBasis(sample.extent.center);
 0121            }
 122
 123            // Convert the transform
 0124            var path = new pxr.SdfPath(objContext.path);
 125
 126            // If exporting for Z-Up, rotate the world.
 0127            bool correctZUp = exportContext.scene.UpAxis == Scene.UpAxes.Z;
 128
 0129            sample.transform = XformExporter.GetLocalTransformMatrix(
 130                objContext.gameObject.transform,
 131                correctZUp,
 132                path.IsRootPrimPath(),
 133                exportContext.basisTransform);
 134
 0135            exportContext.scene.Write(objContext.path, sample);
 0136        }
 137
 138        public static void ExportSkelAnimation(ObjectContext objContext, ExportContext exportContext)
 0139        {
 0140            var scene = exportContext.scene;
 0141            var sample = (SkelAnimationSample)objContext.sample;
 0142            var go = objContext.gameObject;
 0143            var boneNames = exportContext.skelSortedMap[go.transform];
 0144            var skelRoot = go.transform;
 0145            sample.joints = new string[boneNames.Count];
 146
 0147            var worldXf = new Matrix4x4[boneNames.Count];
 0148            var worldXfInv = new Matrix4x4[boneNames.Count];
 149
 0150            string rootPath = UnityTypeConverter.GetPath(go.transform);
 151
 0152            var basisChange = Matrix4x4.identity;
 0153            basisChange[2, 2] = -1;
 154
 0155            for (int i = 0; i < boneNames.Count; i++)
 0156            {
 0157                var bonePath = boneNames[i];
 0158                if (!exportContext.pathToBone.ContainsKey(bonePath))
 0159                {
 0160                    sample.joints[i] = "";
 0161                    continue;
 162                }
 163
 0164                var bone = exportContext.pathToBone[bonePath];
 0165                sample.joints[i] = bonePath.Replace(rootPath + "/", "");
 166
 0167                worldXf[i] = bone.localToWorldMatrix;
 0168                if (exportContext.basisTransform == BasisTransformation.SlowAndSafe)
 0169                {
 0170                    worldXf[i] = UnityTypeConverter.ChangeBasis(worldXf[i]);
 0171                }
 172
 0173                worldXfInv[i] = worldXf[i].inverse;
 0174            }
 175
 0176            var rootXf = skelRoot.localToWorldMatrix.inverse;
 0177            if (exportContext.basisTransform == BasisTransformation.SlowAndSafe)
 0178            {
 0179                rootXf = UnityTypeConverter.ChangeBasis(rootXf);
 0180            }
 181
 0182            var skelWorldTransform = UnityTypeConverter.ToGfMatrix(rootXf);
 0183            pxr.VtMatrix4dArray vtJointsLS = new pxr.VtMatrix4dArray((uint)boneNames.Count);
 0184            pxr.VtMatrix4dArray vtJointsWS = UnityTypeConverter.ToVtArray(worldXf);
 0185            pxr.VtMatrix4dArray vtJointsWSInv = UnityTypeConverter.ToVtArray(worldXfInv);
 186
 0187            var translations = new pxr.VtVec3fArray();
 0188            var rotations = new pxr.VtQuatfArray();
 0189            sample.scales = new pxr.VtVec3hArray();
 190
 0191            var topo = new pxr.UsdSkelTopology(UnityTypeConverter.ToVtArray(sample.joints));
 0192            pxr.UsdCs.UsdSkelComputeJointLocalTransforms(topo,
 193                vtJointsWS,
 194                vtJointsWSInv,
 195                vtJointsLS,
 196                skelWorldTransform);
 197
 0198            pxr.UsdCs.UsdSkelDecomposeTransforms(
 199                vtJointsLS,
 200                translations,
 201                rotations,
 202                sample.scales);
 0203            sample.translations = UnityTypeConverter.FromVtArray(translations);
 0204            sample.rotations = UnityTypeConverter.FromVtArray(rotations);
 205
 0206            scene.Write(objContext.path, sample);
 0207        }
 208    }
 209}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonImporter.html new file mode 100644 index 000000000..86b7bceef --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonImporter.html @@ -0,0 +1,411 @@ + + + + + + +Unity.Formats.USD.SkeletonImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkeletonImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonImporter.cs
Covered lines:102
Uncovered lines:77
Coverable lines:179
Total lines:301
Line coverage:56.9% (102 of 179)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildSkeletonBone(...)0%00051.61%
BuildDebugBindTransforms(...)0%00016%
BuildBindTransforms(...)0%00084.62%
JointsMatch(...)0%00073.91%
BuildSkinnedMesh(...)0%00074.7%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using pxr;
 18using UnityEngine;
 19using USD.NET;
 20using USD.NET.Unity;
 21
 22namespace Unity.Formats.USD
 23{
 24    /// <summary>
 25    /// Import support for UsdSkelSkeleton
 26    /// </summary>
 27    public static class SkeletonImporter
 28    {
 29        public static void BuildSkeletonBone(string skelPath,
 30            GameObject go,
 31            Matrix4x4 restXform,
 32            VtTokenArray joints,
 33            SceneImportOptions importOptions)
 1234        {
 35            // Perform change of basis, if needed.
 1236            XformImporter.ImportXform(ref restXform, importOptions);
 37
 38            // Decompose into TSR.
 1239            Vector3 pos = Vector3.zero;
 1240            Quaternion rot = Quaternion.identity;
 1241            Vector3 scale = Vector3.one;
 1242            if (!UnityTypeConverter.Decompose(restXform, out pos, out rot, out scale))
 043            {
 044                throw new Exception("Failed to decompose bind transforms for <" + skelPath + ">");
 45            }
 46
 1247            go.transform.localScale = scale;
 1248            go.transform.localRotation = rot;
 1249            go.transform.localPosition = pos;
 50
 1251            var cubeDebugName = "usdSkel_restPose_debug_cube";
 1252            if (importOptions.meshOptions.debugShowSkeletonRestPose)
 053            {
 054                var cube = go.transform.Find(cubeDebugName);
 055                if (!cube)
 056                {
 057                    cube = GameObject.CreatePrimitive(PrimitiveType.Cube).transform;
 058                    cube.name = cubeDebugName;
 059                    cube.SetParent(go.transform, worldPositionStays: false);
 060                    cube.localScale = Vector3.one * 2;
 061                }
 062            }
 63            else
 1264            {
 1265                var existing = go.transform.Find(cubeDebugName);
 1266                if (existing)
 067                {
 068                    GameObject.DestroyImmediate(existing.gameObject);
 069                }
 1270            }
 1271        }
 72
 73        public static void BuildDebugBindTransforms(SkeletonSample skelSample,
 74            GameObject goSkeleton,
 75            SceneImportOptions options)
 376        {
 377            var debugPrefix = "usdSkel_bindPose_debug_cube";
 378            if (options.meshOptions.debugShowSkeletonBindPose)
 079            {
 080                int i = 0;
 081                foreach (var bindXf in skelSample.bindTransforms)
 082                {
 83                    // Undo the bindXf inversion for visualization.
 084                    var mat = bindXf.inverse;
 085                    var cubeName = debugPrefix + i++;
 086                    var cube = goSkeleton.transform.Find(cubeName);
 087                    if (!cube)
 088                    {
 089                        cube = GameObject.CreatePrimitive(PrimitiveType.Cube).transform;
 090                        cube.SetParent(goSkeleton.transform, worldPositionStays: false);
 091                        cube.name = cubeName;
 092                    }
 93
 94                    Vector3 t, s;
 95                    Quaternion r;
 096                    UnityTypeConverter.Decompose(mat, out t, out r, out s);
 097                    cube.localPosition = t;
 098                    cube.localScale = s;
 099                    cube.localRotation = r;
 0100                }
 0101            }
 102            else
 3103            {
 3104                var zero = goSkeleton.transform.Find(debugPrefix + 0);
 3105                if (zero)
 0106                {
 0107                    var toDelete = new List<GameObject>();
 0108                    foreach (Transform child in goSkeleton.transform)
 0109                    {
 0110                        if (child.name.StartsWith(debugPrefix))
 0111                        {
 0112                            toDelete.Add(child.gameObject);
 0113                        }
 0114                    }
 115
 0116                    foreach (var child in toDelete)
 0117                    {
 0118                        GameObject.DestroyImmediate(child);
 0119                    }
 0120                }
 3121            }
 3122        }
 123
 124        /// <summary>
 125        /// Unity expects bind transforms to be the bone's inverse transformation matrix.
 126        /// USD doesn't do that, so this function does it for us, prepping the data to be used in Unity.
 127        /// <summary>
 128        public static void BuildBindTransforms(string path,
 129            SkeletonSample skelSample,
 130            SceneImportOptions options)
 3131        {
 3132            if (skelSample.bindTransforms == null)
 0133            {
 0134                return;
 135            }
 136
 30137            for (int i = 0; i < skelSample.bindTransforms.Length; i++)
 12138            {
 12139                var xf = skelSample.bindTransforms[i];
 12140                XformImporter.ImportXform(ref xf, options);
 12141                skelSample.bindTransforms[i] = xf.inverse;
 12142            }
 3143        }
 144
 145        static bool JointsMatch(string[] lhs, string[] rhs)
 9146        {
 9147            if (lhs == null && rhs == null)
 0148            {
 0149                return true;
 150            }
 151
 9152            if (lhs == null || rhs == null)
 0153            {
 0154                return false;
 155            }
 156
 9157            if (lhs == rhs)
 0158            {
 0159                return true;
 160            }
 161
 162            // The prim can use a subset of the joints
 9163            if (lhs.Length != rhs.Length)
 3164            {
 3165                return false;
 166            }
 167
 168            // The prim can have a custom joint order if skel:joints is set on it
 42169            for (int i = 0; i < lhs.Length; i++)
 18170            {
 18171                if (lhs[i] != rhs[i])
 3172                {
 3173                    return false;
 174                }
 15175            }
 176
 3177            return true;
 9178        }
 179
 180        public static void BuildSkinnedMesh(string meshPath,
 181            string skelPath,
 182            SkeletonSample skeleton,
 183            UsdSkelSkinningQuery skinningQuery,
 184            GameObject go,
 185            PrimMap primMap,
 186            SceneImportOptions options)
 9187        {
 188            // The mesh renderer must already exist, since hte mesh also must already exist.
 9189            var smr = go.GetComponent<SkinnedMeshRenderer>();
 9190            if (!smr)
 0191            {
 0192                throw new Exception(
 193                    "Error importing " + meshPath + " SkinnnedMeshRenderer not present on GameObject");
 194            }
 195
 196            // Get and validate the local list of joints.
 9197            VtTokenArray jointsAttr = new VtTokenArray();
 9198            skinningQuery.GetJointOrder(jointsAttr);
 199
 200            // If jointsAttr wasn't define, GetJointOrder return an empty array and FromVtArray as well.
 9201            string[] joints = IntrinsicTypeConverter.FromVtArray(jointsAttr);
 202
 203            // WARNING: Do not mutate skeleton values.
 9204            string[] skelJoints = skeleton.joints;
 205
 9206            if (joints == null || joints.Length == 0)
 0207            {
 0208                if (skelJoints == null || skelJoints.Length == 0)
 0209                {
 0210                    throw new Exception("Joints array empty: " + meshPath);
 211                }
 212                else
 0213                {
 0214                    joints = skelJoints;
 0215                }
 0216            }
 217
 218            // TODO: bind transform attribute can be animated. It's not handled yet.
 9219            Matrix4x4 geomXf = UnityTypeConverter.FromMatrix(skinningQuery.GetGeomBindTransform());
 220
 221            // A mesh prim can have a custom joint definition order or use a subset of the joints.
 222            // If it's the case reconstruct the bindpose accordingly.
 223            // TODO: a better way of doing this would be to get a jointMapper with skinningQuery.GetJointMapper
 224            //       and use it to map the bindTransforms to the joints list. But the UsdSkelAnimMapper is not in the bi
 9225            var bindPoses = skeleton.bindTransforms;
 9226            if (!JointsMatch(skeleton.joints, joints))
 6227            {
 6228                var boneToPose = new Dictionary<string, Matrix4x4>();
 6229                bindPoses = new Matrix4x4[joints.Length];
 60230                for (int i = 0; i < skelJoints.Length; i++)
 24231                {
 24232                    boneToPose[skelJoints[i]] = skeleton.bindTransforms[i];
 24233                }
 234
 42235                for (int i = 0; i < joints.Length; i++)
 15236                {
 15237                    bindPoses[i] = boneToPose[joints[i]];
 15238                }
 6239            }
 240
 241            // When geomXf is identity, we can take a shortcut and just use the exact skeleton bindPoses.
 9242            if (!ImporterBase.ApproximatelyEqual(geomXf, Matrix4x4.identity))
 6243            {
 244                // Note that the bind poses were transformed when the skeleton was imported, but the
 245                // geomBindTransform is per-mesh, so it must be transformed here so it is in the same space
 246                // as the bind pose.
 6247                XformImporter.ImportXform(ref geomXf, options);
 248
 249                // Make a copy only if we haven't already copied the bind poses earlier.
 6250                if (bindPoses == skeleton.bindTransforms)
 3251                {
 3252                    var newBindPoses = new Matrix4x4[skeleton.bindTransforms.Length];
 3253                    Array.Copy(bindPoses, newBindPoses, bindPoses.Length);
 3254                    bindPoses = newBindPoses;
 3255                }
 256
 257                // Concatenate the geometry bind transform with the skeleton bind poses.
 60258                for (int i = 0; i < bindPoses.Length; i++)
 24259                {
 260                    // The geometry transform should be applied to the points before any other transform,
 261                    // hence the right hand multiply here.
 24262                    bindPoses[i] = bindPoses[i] * geomXf;
 24263                }
 6264            }
 9265            smr.sharedMesh.bindposes = bindPoses;
 266
 9267            var bones = new Transform[joints.Length];
 9268            var sdfSkelPath = new SdfPath(skelPath);
 72269            for (int i = 0; i < joints.Length; i++)
 27270            {
 27271                var jointPath = new SdfPath(joints[i]);
 272
 27273                if (joints[i] == "/")
 0274                {
 0275                    jointPath = sdfSkelPath;
 0276                }
 27277                else if (jointPath.IsAbsolutePath())
 0278                {
 0279                    Debug.LogException(new Exception("Unexpected absolute joint path: " + jointPath));
 0280                    jointPath = new SdfPath(joints[i].TrimStart('/'));
 0281                    jointPath = sdfSkelPath.AppendPath(jointPath);
 0282                }
 283                else
 27284                {
 27285                    jointPath = sdfSkelPath.AppendPath(jointPath);
 27286                }
 287
 27288                var jointGo = primMap[jointPath];
 27289                if (!jointGo)
 0290                {
 0291                    Debug.LogError("Error importing " + meshPath + " "
 292                        + "Joint not found: " + joints[i]);
 0293                    continue;
 294                }
 295
 27296                bones[i] = jointGo.transform;
 27297            }
 9298            smr.bones = bones;
 9299        }
 300    }
 301}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonIo.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonIo.html new file mode 100644 index 000000000..c7efdf6dc --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkeletonIo.html @@ -0,0 +1,227 @@ + + + + + + +Unity.Formats.USD.SkeletonIo - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkeletonIo
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:121
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SkeletonIo()0%0000%
GetBones(...)0%0000%
RegisterSkeleton(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Skel/SkeletonIo.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UnitySkeleton
 23    {
 24        public Transform rootBone;
 25        public Transform[] bones;
 26    }
 27
 28    [System.Serializable]
 29    public class SkelBindingSample : SampleBase
 30    {
 31        // Blend Shapes.
 32        [UsdNamespace("skel")]
 33        [UsdVariability(Variability.Uniform)]
 34        public string[] blendShapes;
 35
 36        [UsdNamespace("skel")] public Relationship blendShapeTargets = new Relationship();
 37
 38        // Skeleton & Animation Binding.
 39        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 40
 41        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 42
 43        // Skeleton Binding Data.
 44        [UsdNamespace("skel")]
 45        [UsdVariability(Variability.Uniform)]
 46        public string[] joints;
 47
 48        [UsdNamespace("skel")]
 49        [UsdVariability(Variability.Uniform)]
 50        public Primvar<int[]> jointIndices = new Primvar<int[]>();
 51
 52        [UsdNamespace("skel")]
 53        [UsdVariability(Variability.Uniform)]
 54        public Primvar<Matrix4x4> geomBindTransform = new Primvar<Matrix4x4>();
 55
 56        [UsdNamespace("skel")]
 57        [UsdVariability(Variability.Uniform)]
 58        public Primvar<float[]> jointWeights = new Primvar<float[]>();
 59    }
 60
 61    [System.Serializable]
 62    [UsdSchema("SkelRoot")]
 63    public class SkelRootSample : BoundableSample
 64    {
 65        [UsdNamespace("skel")] public Relationship skeleton = new Relationship();
 66        [UsdNamespace("skel")] public Relationship animationSource = new Relationship();
 67    }
 68
 69    [System.Serializable]
 70    [UsdSchema("Skeleton")]
 71    public class SkeletonSample : XformableSample
 72    {
 73        [UsdVariability(Variability.Uniform)] public string[] joints;
 74
 75        [UsdVariability(Variability.Uniform)] public Matrix4x4[] bindTransforms;
 76
 77        [UsdVariability(Variability.Uniform)] public Matrix4x4[] restTransforms;
 78    }
 79
 80    [System.Serializable]
 81    [UsdSchema("SkelAnimation")]
 82    public class SkelAnimationSample : SampleBase
 83    {
 84        [UsdVariability(Variability.Uniform)] public string[] joints;
 85
 86        // Intended to work with pxr.UsdCs.UsdSkelDecomposeTransforms()
 87        public Vector3[] translations;
 88
 89        public Quaternion[] rotations;
 90
 91        // TODO: How to support Vector3h?
 92        public pxr.VtVec3hArray scales;
 93
 94        [UsdVariability(Variability.Uniform)] public string[] blendShapes;
 95
 96        [UsdVariability(Variability.Uniform)] public float[] blendShapeWeights;
 97    }
 98
 99    [System.Serializable]
 100    [UsdSchema("BlendShape")]
 101    public class BlendShapeSample : SampleBase
 102    {
 103        public Vector3[] offsets;
 104        public uint[] pointIndices;
 105    }
 106
 107    public class SkeletonIo
 108    {
 0109        private Dictionary<Transform, Transform[]> m_bindings = new Dictionary<Transform, Transform[]>();
 110
 111        public Transform[] GetBones(Transform rootBone)
 0112        {
 0113            return m_bindings[rootBone];
 0114        }
 115
 116        public void RegisterSkeleton(Transform rootBone, Transform[] bones)
 0117        {
 0118            m_bindings.Add(rootBone, bones);
 0119        }
 120    }
 121}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUnityDiff.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUnityDiff.html new file mode 100644 index 000000000..2f683a655 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUnityDiff.html @@ -0,0 +1,271 @@ + + + + + + +Unity.Formats.USD.SkinnedMeshUnityDiff - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkinnedMeshUnityDiff
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Debugging/SkinnedMeshUnityDiff.cs
Covered lines:0
Uncovered lines:70
Coverable lines:70
Total lines:161
Line coverage:0% (0 of 70)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnEnable()0%0000%
Approximately(...)0%0000%
WeightsMatch(...)0%0000%
IndicesMatch(...)0%0000%
Update()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Debugging/SkinnedMeshUnityDiff.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16
 17namespace Unity.Formats.USD
 18{
 19    /// <summary>
 20    /// Compares two skinned meshes in Unity.
 21    /// </summary>
 22    [ExecuteInEditMode]
 23    public class SkinnedMeshUnityDiff : MonoBehaviour
 24    {
 25        [Tooltip("The USD skinned mesh to compare")]
 26        public SkinnedMeshRenderer m_usdMesh;
 27
 28        [Tooltip("The Unity skinned mesh to compare")]
 29        public SkinnedMeshRenderer m_unityMesh;
 30
 31        void OnEnable()
 032        {
 033            var usdSmr = m_usdMesh;
 034            var unitySmr = m_unityMesh;
 35
 036            if (!usdSmr || !unitySmr)
 037            {
 038                return;
 39            }
 40
 041            var usdMesh = usdSmr.sharedMesh;
 042            var unityMesh = unitySmr.sharedMesh;
 43
 044            Debug.Log("Processing legacy 4-bone rig");
 45
 046            if (usdMesh.boneWeights.Length != unityMesh.boneWeights.Length)
 047            {
 048                Debug.LogWarning("Bone index/weight counts do not match: USD mesh("
 49                    + usdMesh.boneWeights.Length + ") != Unity mesh("
 50                    + unityMesh.boneWeights.Length + ")");
 051            }
 52            else
 053            {
 054                for (int i = 0; i < usdMesh.boneWeights.Length; i++)
 055                {
 056                    if (!WeightsMatch(usdMesh.boneWeights[i], unityMesh.boneWeights[i]))
 057                    {
 058                        Debug.LogWarning("Bone weights do not match at index(" + i + "):\n"
 59                            + "USD mesh weights:   "
 60                            + usdMesh.boneWeights[i].weight0 + ", "
 61                            + usdMesh.boneWeights[i].weight1 + ", "
 62                            + usdMesh.boneWeights[i].weight2 + ", "
 63                            + usdMesh.boneWeights[i].weight3 + "\n"
 64                            + "Unity mesh weights: "
 65                            + unityMesh.boneWeights[i].weight0 + ", "
 66                            + unityMesh.boneWeights[i].weight1 + ", "
 67                            + unityMesh.boneWeights[i].weight2 + ", "
 68                            + unityMesh.boneWeights[i].weight3 + "\n");
 069                    }
 70
 071                    if (!IndicesMatch(usdMesh.boneWeights[i], unityMesh.boneWeights[i]))
 072                    {
 073                        Debug.LogWarning("Bone indices do not match at index(" + i + "):\n"
 74                            + "USD mesh indices:   "
 75                            + usdMesh.boneWeights[i].boneIndex0 + ", "
 76                            + usdMesh.boneWeights[i].boneIndex1 + ", "
 77                            + usdMesh.boneWeights[i].boneIndex2 + ", "
 78                            + usdMesh.boneWeights[i].boneIndex3 + "\n"
 79                            + "Unity mesh indices: "
 80                            + unityMesh.boneWeights[i].boneIndex0 + ", "
 81                            + unityMesh.boneWeights[i].boneIndex1 + ", "
 82                            + unityMesh.boneWeights[i].boneIndex2 + ", "
 83                            + unityMesh.boneWeights[i].boneIndex3 + "\n");
 084                    }
 085                }
 086            }
 87
 088            if (usdMesh.bindposes.Length != unityMesh.bindposes.Length)
 089            {
 090                Debug.LogWarning("Mesh bind pose counts do not match, USD mesh: "
 91                    + usdMesh.bindposes.Length + " Unity mesh: "
 92                    + unityMesh.bindposes.Length);
 093            }
 94            else
 095            {
 096                for (int i = 0; i < usdMesh.bindposes.Length; i++)
 097                {
 098                    if (!Approximately(usdMesh.bindposes[i], unityMesh.bindposes[i]))
 099                    {
 0100                        Debug.LogWarning("Mesh bind pose does not match at index(" + i + "):\n"
 101                            + "USD Pose:\n" + usdMesh.bindposes[i].ToString() + " "
 102                            + "Unity Pose:\n" + unityMesh.bindposes[i].ToString());
 0103                    }
 0104                }
 0105            }
 106
 0107            if (usdSmr.bones.Length != unitySmr.bones.Length)
 0108            {
 0109                Debug.LogWarning("Mesh bone counts do not match: "
 110                    + "USD mesh:   " + usdSmr.bones.Length + " "
 111                    + "Unity mesh: " + unitySmr.bones.Length);
 0112            }
 113            else
 0114            {
 0115                for (int i = 0; i < usdSmr.bones.Length; i++)
 0116                {
 0117                    if (pxr.UsdCs.TfMakeValidIdentifier(usdSmr.bones[i].name) !=
 118                        pxr.UsdCs.TfMakeValidIdentifier(unitySmr.bones[i].name))
 0119                    {
 0120                        Debug.LogWarning("Mesh bind pose does not match at index(" + i + "): "
 121                            + "USD bone: " + usdSmr.bones[i].ToString() + " "
 122                            + "Unity bone: " + unitySmr.bones[i].ToString());
 0123                    }
 0124                }
 0125            }
 0126        }
 127
 128        bool Approximately(Matrix4x4 rhs, Matrix4x4 lhs)
 0129        {
 0130            for (int i = 0; i < 16; i++)
 0131            {
 0132                if (!Mathf.Approximately(rhs[i], lhs[i]))
 0133                {
 0134                    return false;
 135                }
 0136            }
 137
 0138            return true;
 0139        }
 140
 141        bool WeightsMatch(BoneWeight w1, BoneWeight w2)
 0142        {
 0143            return Mathf.Approximately(w1.weight0, w2.weight0)
 144                && Mathf.Approximately(w1.weight1, w2.weight1)
 145                && Mathf.Approximately(w1.weight2, w2.weight2)
 146                && Mathf.Approximately(w1.weight3, w2.weight3);
 0147        }
 148
 149        bool IndicesMatch(BoneWeight w1, BoneWeight w2)
 0150        {
 0151            return w1.boneIndex0 == w2.boneIndex0
 152                && w1.boneIndex1 == w2.boneIndex1
 153                && w1.boneIndex2 == w2.boneIndex2
 154                && w1.boneIndex3 == w2.boneIndex3;
 0155        }
 156
 157        private void Update()
 0158        {
 0159        }
 160    }
 161}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUsdDiff.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUsdDiff.html new file mode 100644 index 000000000..d3c0d9447 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SkinnedMeshUsdDiff.html @@ -0,0 +1,481 @@ + + + + + + +Unity.Formats.USD.SkinnedMeshUsdDiff - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SkinnedMeshUsdDiff
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Debugging/SkinnedMeshUsdDiff.cs
Covered lines:0
Uncovered lines:215
Coverable lines:215
Total lines:369
Line coverage:0% (0 of 215)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnEnable()0%0000%
GetUsdBoneData[T](...)0%0000%
GetScene()0%0000%
ReadUsdWeights(...)0%0000%
ReadUsdSkeleton(...)0%0000%
Update()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Debugging/SkinnedMeshUsdDiff.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17using USD.NET.Unity;
 18
 19namespace Unity.Formats.USD
 20{
 21    /// <summary>
 22    /// Compares a skinned mesh in Unity to a skinned mesh in USD.
 23    /// </summary>
 24    [ExecuteInEditMode]
 25    [RequireComponent(typeof(SkinnedMeshRenderer))]
 26    public class SkinnedMeshUsdDiff : MonoBehaviour
 27    {
 28        [Tooltip("A path to a USD file for comparing weights")]
 29        public string m_usdFile;
 30
 31        [Tooltip("A prim path to the skinned mesh in the USD file")]
 32        public string m_usdMeshPath;
 33
 34        [Tooltip("How to convert transforms for comparison")]
 35        public BasisTransformation m_basisTransform;
 36
 37        void OnEnable()
 038        {
 039            InitUsd.Initialize();
 40
 041            if (string.IsNullOrEmpty(m_usdMeshPath))
 042            {
 043                m_usdMeshPath = UnityTypeConverter.GetPath(transform);
 044            }
 45
 046            var scene = GetScene();
 047            var binding = ReadUsdWeights(scene);
 48            string skelRootPath;
 049            var skeleton = ReadUsdSkeleton(scene, out skelRootPath);
 50
 051            if (binding == null)
 052            {
 053                binding = new SkelBindingSample();
 054            }
 55
 056            var mesh = GetComponent<SkinnedMeshRenderer>().sharedMesh;
 57
 58            // Process classic four-bone weights first.
 059            var sb = new System.Text.StringBuilder();
 60#if UNITY_2019_1_OR_NEWER
 061            var bonesPerVert = mesh.GetBonesPerVertex();
 062            int weightsPerBone = 0;
 063            foreach (int count in bonesPerVert)
 064            {
 065                weightsPerBone = weightsPerBone > count ? weightsPerBone : count;
 066            }
 67
 068            var boneWeights = mesh.GetAllBoneWeights();
 069            sb.AppendLine("Many-bone indices: (" + boneWeights.Length + " * 4)");
 070            int bone = 0;
 071            int bi = 0;
 072            int wi = 0;
 073            foreach (var weight in boneWeights)
 074            {
 075                if (wi == 0)
 076                {
 077                    sb.Append("i: " + bone + " [");
 078                }
 79
 080                sb.Append(weight.boneIndex + GetUsdBoneData(bi, wi, binding.jointIndices) + ",");
 81
 082                wi++;
 083                if (wi == weightsPerBone)
 084                {
 085                    sb.Append("]\n");
 086                    bi++;
 087                    wi = 0;
 088                }
 89
 090                if (bonesPerVert[bi] != weightsPerBone)
 091                {
 92                    // TODO: Unity supports a variable number of weights per bone, but USD does not.
 93                    // Therefore, the number of weights may be greater in USD than in Unity. Currently
 94                    // the way this works does not correctly handle that case.
 095                    Debug.LogWarning("Unity bone count issue, see code comment for details.");
 096                }
 97
 098                bone++;
 099            }
 100
 0101            Debug.Log(sb.ToString());
 102
 0103            bone = 0;
 0104            bi = 0;
 0105            wi = 0;
 0106            sb = new System.Text.StringBuilder();
 0107            sb.AppendLine("Many-bone weights: (" + boneWeights.Length + " * 4)");
 0108            foreach (var weight in boneWeights)
 0109            {
 0110                if (wi == 0)
 0111                {
 0112                    sb.Append("i: " + bone + " [");
 0113                }
 114
 0115                sb.Append(weight.weight + GetUsdBoneData(bi, wi, binding.jointWeights) + ",");
 116
 0117                wi++;
 0118                if (wi == weightsPerBone)
 0119                {
 0120                    sb.Append("]\n");
 0121                    bi++;
 0122                    wi = 0;
 0123                }
 124
 0125                bone++;
 0126            }
 127
 0128            Debug.Log(sb.ToString());
 129#else
 130            sb.AppendLine("Legacy 4-bone indices: (" + mesh.boneWeights.Length + " * 4)");
 131            int bone = 0;
 132            foreach (var weight in mesh.boneWeights)
 133            {
 134                sb.Append("[");
 135                sb.Append(weight.boneIndex0 + GetUsdBoneData(bone, 0, binding.jointIndices) + ",");
 136                sb.Append(weight.boneIndex1 + GetUsdBoneData(bone, 1, binding.jointIndices) + ",");
 137                sb.Append(weight.boneIndex2 + GetUsdBoneData(bone, 2, binding.jointIndices) + ",");
 138                sb.Append(weight.boneIndex3 + GetUsdBoneData(bone, 3, binding.jointIndices) + "]\n");
 139                bone++;
 140            }
 141            Debug.Log(sb.ToString());
 142
 143            bone = 0;
 144            sb = new System.Text.StringBuilder();
 145            sb.AppendLine("Legacy 4-bone weights: (" + mesh.boneWeights.Length + " * 4)");
 146            foreach (var weight in mesh.boneWeights)
 147            {
 148                sb.Append("[");
 149                sb.Append(weight.weight0 + GetUsdBoneData(bone, 0, binding.jointWeights) + ",");
 150                sb.Append(weight.weight1 + GetUsdBoneData(bone, 1, binding.jointWeights) + ",");
 151                sb.Append(weight.weight2 + GetUsdBoneData(bone, 2, binding.jointWeights) + ",");
 152                sb.Append(weight.weight3 + GetUsdBoneData(bone, 3, binding.jointWeights) + "]\n");
 153                bone++;
 154            }
 155            Debug.Log(sb.ToString());
 156#endif
 157
 158
 0159            sb = new System.Text.StringBuilder();
 0160            var bones = GetComponent<SkinnedMeshRenderer>().bones;
 0161            var rootBone = GetComponent<SkinnedMeshRenderer>().rootBone;
 0162            var root = UnityTypeConverter.GetPath(rootBone);
 0163            sb.AppendLine("Bones: (" + bones.Length + ")");
 0164            sb.AppendLine("Root Bone: " + root);
 0165            int i = 0;
 0166            foreach (var boneXf in bones)
 0167            {
 0168                sb.AppendLine(UnityTypeConverter.GetPath(boneXf));
 0169                if (binding.joints != null)
 0170                {
 0171                    sb.AppendLine(root + "\\" + binding.joints[i++] + "\n");
 0172                }
 0173            }
 174
 0175            Debug.Log(sb.ToString());
 176
 0177            sb = new System.Text.StringBuilder();
 0178            sb.AppendLine("Bind Transforms: (" + mesh.bindposes.Length + ")");
 0179            i = -1;
 0180            var options = new SceneImportOptions();
 0181            options.changeHandedness = m_basisTransform;
 0182            foreach (var boneXf in bones)
 0183            {
 0184                i++;
 0185                var bindPose = mesh.bindposes[i];
 0186                var bonePath = UnityTypeConverter.GetPath(boneXf);
 0187                sb.AppendLine("Pose[" + i + "] " + bonePath);
 0188                sb.AppendLine(bindPose.ToString());
 189
 0190                if (skeleton.bindTransforms != null)
 0191                {
 0192                    if (string.IsNullOrEmpty(skelRootPath))
 0193                    {
 0194                        continue;
 195                    }
 196
 0197                    bonePath = bonePath.Substring(skelRootPath.Length);
 0198                    bonePath = bonePath.TrimStart('/');
 0199                    foreach (var joint in skeleton.joints)
 0200                    {
 0201                        if (joint == bonePath)
 0202                        {
 0203                            var usdMat = skeleton.bindTransforms[i];
 0204                            XformImporter.ImportXform(ref usdMat, options);
 0205                            sb.AppendLine(usdMat.ToString() + "\n");
 0206                            bonePath = null;
 0207                            break;
 208                        }
 0209                    }
 210
 0211                    if (string.IsNullOrEmpty(bonePath))
 0212                    {
 0213                        continue;
 214                    }
 215
 0216                    sb.Append("Bone not found in USD: " + bonePath + "\n\n");
 0217                }
 0218            }
 219
 0220            Debug.Log(sb.ToString());
 0221        }
 222
 223        string GetUsdBoneData<T>(int bone, int weightIndex, Primvar<T[]> primvar)
 0224        {
 0225            if (primvar == null || primvar.value == null)
 0226            {
 0227                return string.Empty;
 228            }
 229
 0230            if (primvar.interpolation == PrimvarInterpolation.Constant)
 0231            {
 0232                if (weightIndex > primvar.elementSize - 1)
 0233                {
 0234                    return "";
 235                }
 236
 0237                if (weightIndex > primvar.value.Length - 1)
 0238                {
 0239                    Debug.LogWarning("USD file specifies " + primvar.elementSize
 240                        + " bone elements but array only contains "
 241                        + primvar.value.Length);
 0242                    return "";
 243                }
 244
 0245                return "(" + primvar.value[weightIndex].ToString() + ")  ";
 246            }
 247
 0248            int usdIndex = bone * primvar.elementSize + weightIndex;
 0249            if (usdIndex > primvar.value.Length - 1)
 0250            {
 0251                Debug.LogWarning("bone(" + bone + ") weight index(" + weightIndex + ") "
 252                    + "is out of bounds for the USD bone indices which has "
 253                    + "(" + primvar.elementSize + ") values per joint and "
 254                    + "(" + primvar.value.Length + ") total values");
 0255                return "";
 256            }
 257
 0258            return "(" + primvar.value[usdIndex].ToString() + ")  ";
 0259        }
 260
 261        Scene GetScene()
 0262        {
 0263            if (string.IsNullOrEmpty(m_usdFile) && string.IsNullOrEmpty(m_usdMeshPath))
 0264            {
 0265                return null;
 266            }
 267
 0268            if (string.IsNullOrEmpty(m_usdFile) || string.IsNullOrEmpty(m_usdMeshPath))
 0269            {
 0270                Debug.LogError("You must spcify both usdFile and usdMeshPath together");
 0271                return null;
 272            }
 273
 274            try
 0275            {
 0276                var scene = Scene.Open(m_usdFile);
 0277                if (scene == null)
 0278                {
 0279                    Debug.LogWarning("Failed to open file: " + m_usdFile);
 0280                    return null;
 281                }
 282
 0283                return scene;
 284            }
 0285            catch (System.Exception ex)
 0286            {
 0287                Debug.LogException(ex);
 0288                return null;
 289            }
 0290        }
 291
 292        SkelBindingSample ReadUsdWeights(Scene scene)
 0293        {
 0294            if (scene == null)
 0295            {
 0296                return null;
 297            }
 298
 299            try
 0300            {
 0301                var sample = new SkelBindingSample();
 0302                scene.Read(m_usdMeshPath, sample);
 0303                return sample;
 304            }
 0305            catch (System.Exception ex)
 0306            {
 0307                Debug.LogException(ex);
 0308                return null;
 309            }
 0310        }
 311
 312        SkeletonSample ReadUsdSkeleton(Scene scene, out string skelRootPath)
 0313        {
 0314            skelRootPath = null;
 0315            if (scene == null)
 0316            {
 0317                return null;
 318            }
 319
 320            try
 0321            {
 0322                var path = new pxr.SdfPath(m_usdMeshPath);
 0323                var absRoot = pxr.SdfPath.AbsoluteRootPath();
 0324                var skelRelName = new pxr.TfToken("skel:skeleton");
 325
 0326                while (path != absRoot)
 0327                {
 0328                    var prim = scene.GetPrimAtPath(path);
 0329                    path = path.GetParentPath();
 330
 0331                    if (prim.HasRelationship(skelRelName))
 0332                    {
 0333                        var targets = prim.GetRelationship(skelRelName).GetForwardedTargets();
 0334                        if (targets.Count == 0)
 0335                        {
 0336                            Debug.LogWarning("skel:skeleton has no targets at path: " + prim.GetPath());
 0337                            continue;
 338                        }
 339
 0340                        var skelTarget = scene.GetPrimAtPath(targets[0]);
 0341                        if (skelTarget == null)
 0342                        {
 0343                            Debug.LogWarning("prim <" + prim.GetPath() +
 344                                "> has skel:skeleton with missing target path: " + targets[0]);
 0345                            continue;
 346                        }
 347
 0348                        skelRootPath = skelTarget.GetPath().ToString();
 0349                        var sample = new SkeletonSample();
 0350                        scene.Read(skelTarget.GetPath(), sample);
 0351                        return sample;
 352                    }
 0353                }
 354
 0355                Debug.LogWarning("Skeleton not found for path: " + m_usdMeshPath);
 0356                return null;
 357            }
 0358            catch (System.Exception ex)
 0359            {
 0360                Debug.LogException(ex);
 0361                return null;
 362            }
 0363        }
 364
 365        private void Update()
 0366        {
 0367        }
 368    }
 369}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SphereImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SphereImporter.html new file mode 100644 index 000000000..8b029d87f --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_SphereImporter.html @@ -0,0 +1,263 @@ + + + + + + +Unity.Formats.USD.SphereImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.SphereImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/SphereImporter.cs
Covered lines:56
Uncovered lines:16
Coverable lines:72
Total lines:157
Line coverage:77.7% (56 of 72)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildSphere(...)0%00073.53%
ShouldImport(...)0%000100%
ShouldCompute(...)0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/SphereImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2019 Unity Technologies. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET.Unity;
 17
 18namespace Unity.Formats.USD
 19{
 20    /// <summary>
 21    /// A collection of methods used for importing USD Sphere data into Unity.
 22    /// </summary>
 23    public static class SphereImporter
 24    {
 25        /// <summary>
 26        /// Copy sphere data from USD to Unity with the given import options.
 27        /// </summary>
 28        /// <param name="skinnedMesh">
 29        /// Whether the Cube to build is skinned or not. This will allow to determine which Renderer to create
 30        /// on the GameObject (MeshRenderer or SkinnedMeshRenderer). Default value is false (not skinned).
 31        /// </param>
 32        public static void BuildSphere(SphereSample usdSphere,
 33            GameObject go,
 34            SceneImportOptions options,
 35            bool skinnedMesh = false)
 1236        {
 1237            Material mat = null;
 38
 1239            var sphereGo = GameObject.CreatePrimitive(PrimitiveType.Sphere);
 1240            var unityMesh = sphereGo.GetComponent<MeshFilter>().sharedMesh;
 1241            GameObject.DestroyImmediate(sphereGo);
 42
 43            // Because Unity only handle a sphere with a default size, the custom size of it is define by the localScale
 44            // transform. This also need to be taken into account while computing the Unity extent of the mesh (see bell
 45            // This is doable because xformable data are always handled before mesh data, so go.transform already
 46            // contains any transform of the geometry.
 1247            float size = (float)usdSphere.radius * 2;
 1248            go.transform.localScale = go.transform.localScale * size;
 49
 1250            bool changeHandedness = options.changeHandedness == BasisTransformation.SlowAndSafe;
 1251            bool hasBounds = usdSphere.extent.size.x > 0
 52                || usdSphere.extent.size.y > 0
 53                || usdSphere.extent.size.z > 0;
 54
 1255            if (ShouldImport(options.meshOptions.boundingBox) && hasBounds)
 756            {
 757                if (changeHandedness)
 758                {
 759                    usdSphere.extent.center = UnityTypeConverter.ChangeBasis(usdSphere.extent.center);
 60
 61                    // Divide the extent by the size of the cube. A custom size of the extent is define by
 62                    // the localScale transform (see above).
 763                    usdSphere.extent.extents = UnityTypeConverter.ChangeBasis(usdSphere.extent.extents) / size;
 764                }
 65
 766                unityMesh.bounds = usdSphere.extent;
 767            }
 568            else if (ShouldCompute(options.meshOptions.boundingBox))
 569            {
 570                unityMesh.RecalculateBounds();
 571            }
 72
 1273            if (usdSphere.colors != null && ShouldImport(options.meshOptions.color))
 1274            {
 75                // NOTE: The following color conversion assumes PlayerSettings.ColorSpace == Linear.
 76                // For best performance, convert color space to linear off-line and skip conversion.
 77
 1278                if (usdSphere.colors.Length == 1)
 779                {
 80                    // Constant color can just be set on the material.
 781                    mat = options.materialMap.InstantiateSolidColor(usdSphere.colors.value[0].gamma);
 782                }
 83                else
 584                {
 85                    // TODO: Improve logging by adding the path to the sphere prim. This would require that SphereSample
 86                    //       (and SampleBase class in general) allow to get the UsdPrim  back and it's path in the stage
 587                    Debug.LogWarning(
 88                        "Only constant color are supported for sphere: (can't handle "
 89                        + usdSphere.colors.Length
 90                        + " color values)"
 91                    );
 592                }
 1293            }
 94
 1295            if (mat == null)
 596            {
 597                mat = options.materialMap.InstantiateSolidColor(Color.white);
 598            }
 99
 100            // Create Unity mesh.
 101            // TODO: This code is a duplicate of the CubeImporter code. It requires refactoring.
 102            Renderer renderer;
 12103            if (skinnedMesh)
 0104            {
 0105                SkinnedMeshRenderer skinnedRenderer = ImporterBase.GetOrAddComponent<SkinnedMeshRenderer>(go);
 106
 0107                if (skinnedRenderer.sharedMesh == null)
 0108                {
 0109                    skinnedRenderer.sharedMesh = Mesh.Instantiate(unityMesh);
 0110                }
 111
 0112                renderer = skinnedRenderer;
 0113            }
 114            else
 12115            {
 12116                renderer = ImporterBase.GetOrAddComponent<MeshRenderer>(go);
 12117                MeshFilter meshFilter = ImporterBase.GetOrAddComponent<MeshFilter>(go);
 118
 12119                if (meshFilter.sharedMesh == null)
 12120                {
 12121                    meshFilter.sharedMesh = Mesh.Instantiate(unityMesh);
 12122                }
 12123            }
 124
 12125            if (unityMesh.subMeshCount == 1)
 12126            {
 12127                renderer.sharedMaterial = mat;
 12128            }
 129            else
 0130            {
 0131                var mats = new Material[unityMesh.subMeshCount];
 0132                for (int i = 0; i < mats.Length; i++)
 0133                {
 0134                    mats[i] = mat;
 0135                }
 136
 0137                renderer.sharedMaterials = mats;
 0138            }
 12139        }
 140
 141        /// <summary>
 142        /// Returns true if the mode is Import or ImportOrCompute.
 143        /// </summary>
 144        private static bool ShouldImport(ImportMode mode)
 24145        {
 24146            return mode == ImportMode.Import || mode == ImportMode.ImportOrCompute;
 24147        }
 148
 149        /// <summary>
 150        /// Returns true if the mode is Compute or ImportOrCompute.
 151        /// </summary>
 152        private static bool ShouldCompute(ImportMode mode)
 5153        {
 5154            return mode == ImportMode.Compute || mode == ImportMode.ImportOrCompute;
 5155        }
 156    }
 157}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderExporter.html new file mode 100644 index 000000000..07ebeb3c8 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderExporter.html @@ -0,0 +1,573 @@ + + + + + + +Unity.Formats.USD.StandardShaderExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.StandardShaderExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/StandardShaderExporter.cs
Covered lines:56
Uncovered lines:238
Coverable lines:294
Total lines:463
Line coverage:19% (56 of 294)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportStandardSpecular(...)0%0000%
ExportStandardRoughness(...)0%0000%
ExportStandard(...)0%00040.62%
ExportGeneric(...)0%0000%
ExportStandardCommon(...)0%00044.55%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/StandardShaderExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17
 18namespace Unity.Formats.USD
 19{
 20    public class StandardShaderExporter : ShaderExporterBase
 21    {
 22        public static void ExportStandardSpecular(Scene scene,
 23            string usdShaderPath,
 24            Material material,
 25            UnityPreviewSurfaceSample surface,
 26            string destTexturePath)
 027        {
 28            Color c;
 29
 030            ExportStandardCommon(scene, usdShaderPath, material, surface, destTexturePath);
 031            surface.useSpecularWorkflow.defaultValue = 1;
 032            surface.metallic.defaultValue = 0;
 33
 034            if (material.HasProperty("_SpecGlossMap") && material.GetTexture("_SpecGlossMap") != null)
 035            {
 036                var scale = Vector4.one;
 037                if (material.HasProperty("_SpecColor"))
 038                {
 039                    scale = material.GetColor("_SpecColor");
 040                }
 41
 042                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 43                    "_SpecGlossMap", "rgb");
 044                surface.specularColor.SetConnectedPath(newTex);
 045            }
 046            else if (material.HasProperty("_SpecColor"))
 047            {
 48                // If there is a spec color, then this is not metallic workflow.
 049                c = material.GetColor("_SpecColor").linear;
 050                surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 051            }
 52            else
 053            {
 054                c = new Color(.5f, .5f, .5f);
 055                surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 056            }
 57
 58            // TODO: Specular and roughness are combined and the shader configuration dictates
 59            // where the glossiness comes from (albedo or spec alpha).
 60
 061            if (material.HasProperty("_Glossiness"))
 062            {
 063                surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 064            }
 65            else
 066            {
 067                surface.roughness.defaultValue = 0.5f;
 068            }
 069        }
 70
 71        public static void ExportStandardRoughness(Scene scene,
 72            string usdShaderPath,
 73            Material material,
 74            UnityPreviewSurfaceSample surface,
 75            string destTexturePath)
 076        {
 077            ExportStandardCommon(scene, usdShaderPath, material, surface, destTexturePath);
 078            surface.useSpecularWorkflow.defaultValue = 0;
 79
 080            if (material.HasProperty("_MetallicGlossMap") && material.GetTexture("_MetallicGlossMap") != null)
 081            {
 082                var scale = Vector4.one;
 083                if (material.HasProperty("_Metallic"))
 084                {
 085                    scale.x = material.GetFloat("_Metallic");
 086                }
 87
 088                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 89                    "_MetallicGlossMap", "r");
 090                surface.metallic.SetConnectedPath(newTex);
 091                scale = Vector4.one;
 092                scale.x = 1 - material.GetFloat("_Glossiness");
 093                var roughnessTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 94                    "_MetallicGlossMap", "a");
 095                surface.roughness.SetConnectedPath(roughnessTex);
 096            }
 097            else if (material.HasProperty("_Metallic"))
 098            {
 099                surface.metallic.defaultValue = material.GetFloat("_Metallic");
 0100            }
 101            else
 0102            {
 0103                surface.metallic.defaultValue = .5f;
 0104            }
 105
 0106            if (material.HasProperty("_SpecGlossMap") && material.GetTexture("_SpecGlossMap") != null)
 0107            {
 0108                var scale = Vector4.one;
 0109                if (material.HasProperty("_Glossiness"))
 0110                {
 0111                    scale.x = 1 - material.GetFloat("_Glossiness");
 0112                }
 113
 0114                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 115                    "_SpecGlossMap", "r");
 0116                surface.roughness.SetConnectedPath(newTex);
 0117            }
 0118            else if (material.HasProperty("_Glossiness"))
 0119            {
 0120                surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 0121            }
 122            else
 0123            {
 0124                surface.roughness.defaultValue = 0.5f;
 0125            }
 0126        }
 127
 128        public static void ExportStandard(Scene scene,
 129            string usdShaderPath,
 130            Material material,
 131            UnityPreviewSurfaceSample surface,
 132            string destTexturePath)
 6133        {
 6134            ExportStandardCommon(scene, usdShaderPath, material, surface, destTexturePath);
 6135            surface.useSpecularWorkflow.defaultValue = 0;
 136
 6137            if (material.HasProperty("_MetallicGlossMap") && material.GetTexture("_MetallicGlossMap") != null)
 0138            {
 0139                var scale = Vector4.one;
 0140                if (material.HasProperty("_Metallic"))
 0141                {
 0142                    scale.x = material.GetFloat("_Metallic");
 0143                }
 144
 0145                var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 146                    "_MetallicGlossMap", "b", ConversionType.SwapRASmoothnessToBGRoughness);
 0147                surface.metallic.SetConnectedPath(newTex);
 0148                scale = Vector4.one;
 0149                scale.x = 1 - material.GetFloat("_Glossiness");
 0150                var roughnessTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 151                    "_MetallicGlossMap", "g", ConversionType.SwapRASmoothnessToBGRoughness);
 0152                surface.roughness.SetConnectedPath(roughnessTex);
 0153            }
 6154            else if (material.HasProperty("_Metallic"))
 6155            {
 6156                surface.metallic.defaultValue = material.GetFloat("_Metallic");
 6157            }
 158            else
 0159            {
 0160                surface.metallic.defaultValue = .5f;
 0161            }
 162
 6163            if (material.HasProperty("_Glossiness"))
 6164            {
 6165                surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 6166            }
 167            else
 0168            {
 0169                surface.roughness.defaultValue = 0.5f;
 0170            }
 6171        }
 172
 173        public static void ExportGeneric(Scene scene,
 174            string usdShaderPath,
 175            Material material,
 176            UnityPreviewSurfaceSample surface,
 177            string destTexturePath)
 0178        {
 179            Color c;
 0180            ExportStandardCommon(scene, usdShaderPath, material, surface, destTexturePath);
 181
 0182            if (material.HasProperty("_SpecColor"))
 0183            {
 184                // If there is a spec color, then this is not metallic workflow.
 0185                c = material.GetColor("_SpecColor").linear;
 0186            }
 187            else
 0188            {
 0189                c = new Color(.4f, .4f, .4f);
 0190            }
 191
 0192            surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 193
 0194            if (material.HasProperty("_Metallic"))
 0195            {
 0196                surface.metallic.defaultValue = material.GetFloat("_Metallic");
 0197            }
 198            else
 0199            {
 0200                surface.metallic.defaultValue = .5f;
 0201            }
 202
 203            // Gross heuristics to detect workflow.
 0204            if (material.IsKeywordEnabled("_SPECGLOSSMAP")
 205                || material.HasProperty("_SpecColor")
 206                || material.HasProperty("_SpecularColor")
 207                || material.shader.name.ToLower().Contains("specular"))
 0208            {
 0209                if (material.HasProperty("_SpecGlossMap") && material.GetTexture("_SpecGlossMap") != null)
 0210                {
 0211                    var scale = Vector4.one;
 0212                    if (material.HasProperty("_SpecularColor"))
 0213                    {
 0214                        scale = material.GetColor("_SpecularColor");
 0215                    }
 216
 0217                    var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 218                        "_SpecGlossMap", "rgb");
 0219                    surface.specularColor.SetConnectedPath(newTex);
 0220                }
 0221                else if (material.HasProperty("_SpecColor"))
 0222                {
 223                    // If there is a spec color, then this is not metallic workflow.
 0224                    c = material.GetColor("_SpecColor").linear;
 0225                    surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0226                }
 227                else
 0228                {
 0229                    c = new Color(.5f, .5f, .5f);
 0230                    surface.specularColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0231                }
 232
 0233                if (material.HasProperty("_Glossiness"))
 0234                {
 0235                    surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 0236                }
 237                else
 0238                {
 0239                    surface.roughness.defaultValue = 0.5f;
 0240                }
 241
 0242                surface.useSpecularWorkflow.defaultValue = 1;
 0243            }
 244            else
 0245            {
 0246                surface.useSpecularWorkflow.defaultValue = 0;
 0247                if (material.HasProperty("_MetallicGlossMap") && material.GetTexture("_MetallicGlossMap") != null)
 0248                {
 0249                    var scale = Vector4.one;
 0250                    if (material.HasProperty("_Metallic"))
 0251                    {
 0252                        scale.x = material.GetFloat("_Metallic");
 0253                    }
 254
 0255                    var newTex = SetupTexture(scene, usdShaderPath, material, surface, scale, destTexturePath,
 256                        "_MetallicGlossMap", "r");
 0257                    surface.metallic.SetConnectedPath(newTex);
 0258                }
 0259                else if (material.HasProperty("_Metallic"))
 0260                {
 0261                    surface.metallic.defaultValue = material.GetFloat("_Metallic");
 0262                }
 263                else
 0264                {
 0265                    surface.metallic.defaultValue = .5f;
 0266                }
 267
 0268                if (material.HasProperty("_Glossiness"))
 0269                {
 0270                    surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 0271                }
 272                else
 0273                {
 0274                    surface.roughness.defaultValue = 0.5f;
 0275                }
 0276            }
 277
 0278            if (material.HasProperty("_Smoothness"))
 0279            {
 0280                surface.roughness.defaultValue = 1 - material.GetFloat("_Smoothness");
 0281            }
 0282            else if (material.HasProperty("_Glossiness"))
 0283            {
 0284                surface.roughness.defaultValue = 1 - material.GetFloat("_Glossiness");
 0285            }
 0286            else if (material.HasProperty("_Roughness"))
 0287            {
 0288                surface.roughness.defaultValue = material.GetFloat("_Roughness");
 0289            }
 290            else
 0291            {
 0292                surface.roughness.defaultValue = 0.5f;
 0293            }
 0294        }
 295
 296        private static void ExportStandardCommon(Scene scene,
 297            string usdShaderPath,
 298            Material mat,
 299            UnityPreviewSurfaceSample surface,
 300            string destTexturePath)
 6301        {
 302            Color c;
 303
 304            // Export all generic parameter.
 305            // These are not useful to UsdPreviewSurface, but enable perfect round-tripping.
 6306            surface.unity.shaderName = mat.shader.name;
 6307            surface.unity.shaderKeywords = mat.shaderKeywords;
 308
 309            // Unfortunately, parameter names can only be discovered generically in-editor.
 310#if UNITY_EDITOR
 336311            for (int i = 0; i < UnityEditor.ShaderUtil.GetPropertyCount(mat.shader); i++)
 162312            {
 162313                string name = UnityEditor.ShaderUtil.GetPropertyName(mat.shader, i);
 162314                if (!mat.HasProperty(name))
 0315                {
 0316                    continue;
 317                }
 318
 319                // Note that for whatever reason, shader properties may be listed multiple times.
 320                // So dictionary assignment is used here, instead of Add().
 321
 162322                switch (UnityEditor.ShaderUtil.GetPropertyType(mat.shader, i))
 323                {
 324                    case UnityEditor.ShaderUtil.ShaderPropertyType.Color:
 12325                        surface.unity.colorArgs[name] = mat.GetColor(name).linear;
 12326                        break;
 327                    case UnityEditor.ShaderUtil.ShaderPropertyType.Float:
 328                    case UnityEditor.ShaderUtil.ShaderPropertyType.Range:
 96329                        surface.unity.floatArgs[name] = mat.GetFloat(name);
 96330                        break;
 331                    case UnityEditor.ShaderUtil.ShaderPropertyType.Vector:
 0332                        surface.unity.vectorArgs[name] = mat.GetVector(name);
 0333                        break;
 334                }
 162335            }
 336#endif
 337
 6338            if (mat.HasProperty("_MainTex") && mat.GetTexture("_MainTex") != null)
 0339            {
 0340                var scale = new Vector4(1, 1, 1, 1);
 0341                if (mat.HasProperty("_Color"))
 0342                    scale = mat.GetColor("_Color").linear;
 0343                var newTex = SetupTexture(scene, usdShaderPath, mat, surface, scale, destTexturePath, "_MainTex",
 344                    "rgb");
 0345                surface.diffuseColor.SetConnectedPath(newTex);
 0346            }
 6347            else if (mat.HasProperty("_Color"))
 6348            {
 349                // Standard.
 6350                c = mat.GetColor("_Color").linear;
 6351                surface.diffuseColor.defaultValue = new Vector3(c.r, c.g, c.b);
 6352            }
 353            else
 0354            {
 0355                c = Color.white;
 0356                surface.diffuseColor.defaultValue = new Vector3(c.r, c.g, c.b);
 0357            }
 358
 359            // Standard Shader has 4 modes (magic shader values internally defined in StandardShaderGUI.cs):
 360            // Opaque - no opacity/transparency
 361            // Cutout - opacityThreshold should be used to cut off based on alpha values (in _MainTex.a)
 362            // Fade - opacity should be used, but no opacityThreshold
 363            // Transparent - opacity should be used, but no opacityThreshold.
 364            // Note: not quite sure if and how the difference between Fade and Transparent should be handled in USD.
 6365            StandardShaderBlendMode shaderMode = StandardShaderBlendMode.Opaque;
 6366            if (mat.HasProperty("_Mode"))
 6367            {
 6368                shaderMode = (StandardShaderBlendMode)mat.GetFloat("_Mode");
 6369            }
 370
 6371            if (shaderMode != StandardShaderBlendMode.Opaque)
 0372            {
 0373                if (mat.HasProperty("_MainTex") && mat.GetTexture("_MainTex") != null)
 0374                {
 0375                    var scale = Vector4.one;
 0376                    if (mat.HasProperty("_BaseColor"))
 0377                        scale.w = mat.GetColor("_BaseColor").linear.a;
 0378                    var newTex = SetupTexture(scene, usdShaderPath, mat, surface, scale, destTexturePath, "_MainTex",
 379                        "a");
 0380                    surface.opacity.SetConnectedPath(newTex);
 0381                }
 0382                else if (mat.HasProperty("_Color"))
 0383                {
 0384                    c = mat.GetColor("_Color").linear;
 0385                    surface.opacity.defaultValue = c.a;
 0386                }
 387                else
 0388                {
 0389                    c = Color.white;
 0390                    surface.opacity.defaultValue = 1.0f;
 0391                }
 0392            }
 393            else
 6394            {
 6395                surface.opacity.defaultValue = 1.0f;
 6396            }
 397
 6398            if (shaderMode == StandardShaderBlendMode.Cutout && mat.HasProperty("_Cutoff"))
 0399            {
 0400                surface.opacityThreshold.defaultValue = mat.GetFloat("_Cutoff");
 0401            }
 402
 6403            surface.useSpecularWorkflow.defaultValue = 1;
 404
 6405            if (mat.HasProperty("_BumpMap") && mat.GetTexture("_BumpMap") != null)
 0406            {
 0407                var newTex = SetupTexture(scene, usdShaderPath, mat, surface, Vector4.one, destTexturePath, "_BumpMap",
 408                    "rgb", ConversionType.UnpackNormal);
 0409                surface.normal.SetConnectedPath(newTex);
 0410            }
 411
 6412            if (mat.HasProperty("_ParallaxMap") && mat.GetTexture("_ParallaxMap") != null)
 0413            {
 0414                var newTex = SetupTexture(scene, usdShaderPath, mat, surface, Vector4.one, destTexturePath,
 415                    "_ParallaxMap", "rgb");
 0416                surface.displacement.SetConnectedPath(newTex);
 0417            }
 418
 6419            if (mat.HasProperty("_OcclusionMap") && mat.GetTexture("_OcclusionMap") != null)
 0420            {
 0421                var newTex = SetupTexture(scene, usdShaderPath, mat, surface, Vector4.one, destTexturePath,
 422                    "_OcclusionMap", "r");
 0423                surface.occlusion.SetConnectedPath(newTex);
 0424            }
 425
 426            /*
 427            if (mat.HasProperty("_Metallic")) {
 428              surface.metallic.defaultValue = mat.GetFloat("_Metallic");
 429            } else {
 430              surface.metallic.defaultValue = .5f;
 431            }
 432            */
 433
 6434            if (mat.IsKeywordEnabled("_EMISSION"))
 6435            {
 6436                if (mat.HasProperty("_EmissionMap") && mat.GetTexture("_EmissionMap") != null)
 0437                {
 0438                    var scale = Vector4.one;
 0439                    if (mat.HasProperty("_EmissionColor"))
 0440                        scale = mat.GetColor("_EmissionColor").linear;
 0441                    var newTex = SetupTexture(scene, usdShaderPath, mat, surface, scale, destTexturePath,
 442                        "_EmissionMap", "rgb");
 0443                    surface.emissiveColor.SetConnectedPath(newTex);
 0444                }
 445
 6446                if (mat.HasProperty("_EmissionColor"))
 6447                {
 6448                    c = mat.GetColor("_EmissionColor").linear;
 6449                    surface.emissiveColor.defaultValue = new Vector3(c.r, c.g, c.b);
 6450                }
 6451            }
 6452        }
 453
 454        // local version of the internal BlendMode enum in https://github.com/Unity-Technologies/UnityCsReference/blob/m
 455        enum StandardShaderBlendMode
 456        {
 457            Opaque = 0,
 458            Cutout = 1,
 459            Fade = 2, // Old school alpha-blending mode, fresnel does not affect amount of transparency
 460            Transparent = 3 // Physically plausible transparency mode, implemented as alpha pre-multiply
 461        }
 462    }
 463}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderImporter.html new file mode 100644 index 000000000..483c51505 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_StandardShaderImporter.html @@ -0,0 +1,266 @@ + + + + + + +Unity.Formats.USD.StandardShaderImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.StandardShaderImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/StandardShaderImporter.cs
Covered lines:39
Uncovered lines:65
Coverable lines:104
Total lines:162
Line coverage:37.5% (39 of 104)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
StandardShaderImporter(...)0%000100%
ImportFromUsd()0%00035.64%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/StandardShaderImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16
 17namespace Unity.Formats.USD
 18{
 19    public class StandardShaderImporter : ShaderImporterBase
 20    {
 121        public StandardShaderImporter(Material material) : base(material)
 122        {
 123        }
 24
 25        public override void ImportFromUsd()
 126        {
 127            Material mat = Material;
 28
 129            if (DiffuseMap)
 030            {
 031                mat.SetTexture("_MainTex", DiffuseMap);
 32                // Albedo texture is modulated by the material color, so setting to white preserves the pure
 33                // texture color.
 034                mat.color = Color.white;
 035            }
 36            else
 137            {
 138                mat.color = Diffuse.GetValueOrDefault(mat.color);
 139            }
 40
 141            if (NormalMap)
 042            {
 043                mat.SetTexture("_BumpMap", NormalMap);
 044                mat.EnableKeyword("_NORMALMAP");
 045            }
 46            else
 147            {
 48                // TODO: Unity has no notion of a constant normal map.
 149            }
 50
 151            if (DisplacementMap)
 052            {
 053                mat.SetTexture("_ParallaxMap", DisplacementMap);
 054                mat.EnableKeyword("_PARALLAXMAP");
 055            }
 56            else
 157            {
 58                // TODO: Unity has no notion of a parallax map.
 159            }
 60
 161            if (OcclusionMap)
 062            {
 063                mat.SetTexture("_OcclusionMap", OcclusionMap);
 064            }
 65            else
 166            {
 67                // TODO: Unity has no notion of a constant occlusion value.
 168            }
 69
 170            if (EmissionMap)
 071            {
 072                mat.SetTexture("_EmissionMap", EmissionMap);
 073                mat.SetColor("_EmissionColor", Color.white);
 074                mat.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive;
 075                mat.EnableKeyword("_EMISSION");
 076            }
 77            else
 178            {
 179                var rgb = Emission.GetValueOrDefault(Color.black);
 180                mat.SetColor("_EmissionColor", rgb);
 181                if (rgb.r > 0 || rgb.g > 0 || rgb.b > 0)
 082                {
 083                    mat.EnableKeyword("_EMISSION");
 084                }
 185            }
 86
 187            if (IsSpecularWorkflow)
 188            {
 189                if (SpecularMap)
 090                {
 091                    mat.SetTexture("_SpecGlossMap", SpecularMap);
 092                    mat.EnableKeyword("_SPECGLOSSMAP");
 093                }
 94                else
 195                {
 196                    var rgb = Specular.GetValueOrDefault(Color.gray);
 197                    mat.SetColor("_SpecColor", rgb);
 198                }
 99
 1100                if (RoughnessMap)
 0101                {
 102                    // Roughness for spec setup is tricky, since it may require merging two textures.
 103                    // For now, just detect that case and issue a warning (e.g. when roughness has a map,
 104                    // but isn't the albedo or spec map).
 105                    // Roughness also needs to be converted to glossiness.
 0106                    if (RoughnessMap != SpecularMap && SpecularMap != null)
 0107                    {
 0108                        var specGlossTex = MaterialImporter.CombineRoughness(SpecularMap, RoughnessMap, "specGloss");
 0109                        mat.SetTexture("_SpecGlossMap", specGlossTex);
 0110                        mat.EnableKeyword("_SPECGLOSSMAP");
 0111                    }
 0112                    else if (SpecularMap == null && RoughnessMap != DiffuseMap)
 0113                    {
 0114                        var mainGlossTex = MaterialImporter.CombineRoughness(DiffuseMap, RoughnessMap, "specGloss");
 0115                        mat.SetTexture("_SpecGlossMap", mainGlossTex);
 0116                        mat.EnableKeyword("_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A");
 0117                    }
 118                    else
 0119                    {
 120                        // TODO: create a new texture with constant spec value, combined with roughness texture.
 0121                    }
 0122                }
 123                else
 1124                {
 1125                    float smoothness = 1 - Roughness.GetValueOrDefault(.5f);
 1126                    mat.SetFloat("_Glossiness", smoothness);
 1127                    mat.SetFloat("_GlossMapScale", smoothness);
 1128                }
 1129            }
 130            else
 0131            {
 0132                if (MetallicMap)
 0133                {
 0134                    mat.SetTexture("_MetallicGlossMap", MetallicMap);
 0135                    mat.EnableKeyword("_METALLICGLOSSMAP");
 0136                }
 137                else
 0138                {
 0139                    mat.SetFloat("_Metallic", Metallic.GetValueOrDefault(0));
 0140                }
 141
 0142                float smoothness = 1 - Roughness.GetValueOrDefault(.5f);
 0143                mat.SetFloat("_Glossiness", smoothness);
 0144                mat.SetFloat("_GlossMapScale", smoothness);
 145
 0146                if (RoughnessMap)
 0147                {
 0148                    var metalicRough = MaterialImporter.CombineRoughness(MetallicMap, RoughnessMap, "metalicRough");
 149                    // In this case roughness get its own map, but still must be converted to glossiness.
 0150                    mat.SetTexture("_MetallicGlossMap", metalicRough);
 0151                    mat.EnableKeyword("_METALLICGLOSSMAP");
 152
 153                    // The scalar Glossiness modulates the roughness/glossiness map, however USD has no
 154                    // concept of this, so setting it to 1.0 effectively disables the scalar effect when
 155                    // the map is present.
 0156                    mat.SetFloat("_Glossiness", 1.0f);
 0157                    mat.SetFloat("_GlossMapScale", 1.0f);
 0158                }
 0159            }
 1160        }
 161    }
 162}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityMaterialData.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityMaterialData.html new file mode 100644 index 000000000..b738529a0 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityMaterialData.html @@ -0,0 +1,140 @@ + + + + + + +Unity.Formats.USD.UnityMaterialData - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UnityMaterialData
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/UnityMaterialData.cs
Covered lines:3
Uncovered lines:0
Coverable lines:3
Total lines:38
Line coverage:100% (3 of 3)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UnityMaterialData()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/UnityMaterialData.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UnityMaterialData : SampleBase
 23    {
 24        public string shaderName;
 25        public string[] shaderKeywords;
 26
 727        [UsdNamespace("floats")] public Dictionary<string, float> floatArgs = new Dictionary<string, float>();
 28
 729        [UsdNamespace("colors")] public Dictionary<string, Color> colorArgs = new Dictionary<string, Color>();
 30
 731        [UsdNamespace("vectors")] public Dictionary<string, Vector4> vectorArgs = new Dictionary<string, Vector4>();
 32    }
 33
 34    public class UnityPreviewSurfaceSample : PreviewSurfaceSample
 35    {
 36        [UsdNamespace("unity")] public UnityMaterialData unity = new UnityMaterialData();
 37    }
 38}
+
+
+
+

Methods/Properties

+UnityMaterialData()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityPreviewSurfaceSample.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityPreviewSurfaceSample.html new file mode 100644 index 000000000..4e48da9ea --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UnityPreviewSurfaceSample.html @@ -0,0 +1,140 @@ + + + + + + +Unity.Formats.USD.UnityPreviewSurfaceSample - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UnityPreviewSurfaceSample
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/UnityMaterialData.cs
Covered lines:1
Uncovered lines:0
Coverable lines:1
Total lines:38
Line coverage:100% (1 of 1)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UnityPreviewSurfaceSample()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Materials/UnityMaterialData.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UnityMaterialData : SampleBase
 23    {
 24        public string shaderName;
 25        public string[] shaderKeywords;
 26
 27        [UsdNamespace("floats")] public Dictionary<string, float> floatArgs = new Dictionary<string, float>();
 28
 29        [UsdNamespace("colors")] public Dictionary<string, Color> colorArgs = new Dictionary<string, Color>();
 30
 31        [UsdNamespace("vectors")] public Dictionary<string, Vector4> vectorArgs = new Dictionary<string, Vector4>();
 32    }
 33
 34    public class UnityPreviewSurfaceSample : PreviewSurfaceSample
 35    {
 736        [UsdNamespace("unity")] public UnityMaterialData unity = new UnityMaterialData();
 37    }
 38}
+
+
+
+

Methods/Properties

+UnityPreviewSurfaceSample()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdAsset.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdAsset.html new file mode 100644 index 000000000..e3e7c534b --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdAsset.html @@ -0,0 +1,1093 @@ + + + + + + +Unity.Formats.USD.UsdAsset - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdAsset
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs
Covered lines:216
Uncovered lines:247
Coverable lines:463
Total lines:942
Line coverage:46.6% (216 of 463)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdAsset()0%000100%
GetPrefabObject(...)0%0000%
OnDestroy()0%000100%
GetPrefabAssetPath(...)0%00060%
OptionsToState(...)0%000100%
StateToOptions(...)0%000100%
SceneFileChanged()0%00066.67%
GetScene()0%00060.38%
OnReload()0%0000%
DestroyComponent(...)0%0000%
ClearLastData()0%000100%
RemoveAllUsdComponents()0%0000%
DestroyAllImportedObjects()0%000100%
Reload(...)0%00048.57%
GetFirstPrim(...)0%0000%
ExportOverrides(...)0%0000%
ComputeLength()0%0000%
SetTime(...)0%0000%
Update()0%00071.43%
PrepOptionsForTimeChange(...)0%0000%
ImportUsdAsCoroutine(...)0%0000%
SetPayloadState(...)0%00083.78%
ApplyVariantSelectionState(...)0%00076.19%
SetVariantSelection(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdAsset.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Linq;
 17using System.Collections.Generic;
 18using System.IO;
 19using UnityEngine;
 20using USD.NET;
 21using USD.NET.Unity;
 22
 23namespace Unity.Formats.USD
 24{
 25    /// <summary>
 26    /// Represents the point at which a UsdStage has been imported into the Unity scene.
 27    /// The goal is to make it easy to re-import the data and to export sparse overrides.
 28    /// </summary>
 29    [ExecuteInEditMode]
 30    public class UsdAsset : MonoBehaviour
 31    {
 32        /// <summary>
 33        /// The length of the USD playback time in seconds.
 34        /// </summary>
 35        public double Length
 36        {
 037            get { return ComputeLength(); }
 38        }
 39
 40        /// <summary>
 41        /// The absolute file path to the USD file from which this asset was created. This path may
 42        /// point to a location outside of the Unity project and may be any file type supported by
 43        /// USD (e.g. usd, usda, usdc, abc, ...). Setting this path will not trigger the asset to be
 44        /// reimported, Reload must be called explicitly.
 45        /// </summary>
 46        public string usdFullPath
 47        {
 18648            get { return string.IsNullOrEmpty(m_usdFile) ? string.Empty : (Path.GetFullPath(m_usdFile)); }
 16849            set { m_usdFile = value; }
 50        }
 51
 52        // ----------------------------------------------------------------------------------------- //
 53        // Source Asset.
 54        // ----------------------------------------------------------------------------------------- //
 55
 56        [Header("Source Asset")]
 57        [SerializeField]
 58        string m_usdFile;
 59
 60        [HideInInspector]
 61        [Tooltip("The Unity project path into which imported files (such as textures) will be placed.")]
 10062        public string m_projectAssetPath = "Assets/";
 63
 64        [Tooltip("The USD prim path in the USD scene at which to start the import process.")]
 10065        public string m_usdRootPath = "/";
 66
 67        [Tooltip("An offset applied to all data in the USD file")]
 68        public float m_usdTimeOffset;
 69
 70        [Tooltip("For assets with payloads authored, indicates if payloads should be loaded or unloaded by default.")]
 10071        public PayloadPolicy m_payloadPolicy = PayloadPolicy.DontLoadPayloads;
 72
 10073        [HideInInspector] public bool m_importHierarchy = true;
 74
 75        // ----------------------------------------------------------------------------------------- //
 76        // Conversions.
 77        // ----------------------------------------------------------------------------------------- //
 78
 79        [Header("Conversions")]
 80        [Tooltip("A scale to be applied to the root asset, useful for converting asset units to meters.")]
 81        public float m_scale;
 82
 83        // See enum for details.
 84        [Tooltip("Conversion method for right-handed (USD) to left-handed conversion (Unity) and vice versa.")]
 85        public BasisTransformation m_changeHandedness;
 86
 87        [Tooltip("Behavior to use when no value was authored at the requested time.")]
 88        public Scene.InterpolationMode m_interpolation;
 89
 90        // ----------------------------------------------------------------------------------------- //
 91        // Material Options.
 92        // ----------------------------------------------------------------------------------------- //
 93
 94        [Header("Material Options")]
 95        [Tooltip("If the original shader name is stored in USD, attempt to find that shader in this project.")]
 10096        public bool m_useOriginalShaderIfAvailable = true;
 97
 98        [Tooltip("The default material to use when importing materials as display color.")]
 99        public Material m_displayColorMaterial;
 100
 101        [Tooltip("The default material to use when importing specular workflow USD Preview Surface materials.")]
 102        public Material m_specularWorkflowMaterial;
 103
 104        [Tooltip("The default material to use when importing metallic workflow USD Preview Surface materials.")]
 105        public Material m_metallicWorkflowMaterial;
 106
 107        [HideInInspector]
 108        [Tooltip("When enabled, set the GPU Instancing flag on all materials.")]
 109        public bool m_enableGpuInstancing;
 110
 111        // ----------------------------------------------------------------------------------------- //
 112        // Mesh Options.
 113        // ----------------------------------------------------------------------------------------- //
 114
 115        [Header("Mesh Options")] public ImportMode m_points;
 116        public ImportMode m_topology;
 117        public ImportMode m_boundingBox;
 118
 119        [Tooltip("Combined import policy for primvars:displayColor and primvars:displayOpacity")]
 120        public ImportMode m_color;
 121
 122        [Tooltip("Import policy for normals, note that the 'normals' attribute is built-in, not a primvar")]
 123        public ImportMode m_normals;
 124
 125        [Tooltip("Import policy for primvars:tangent")]
 126        public ImportMode m_tangents;
 127
 128        // ----------------------------------------------------------------------------------------- //
 129        // Lightmap UV Unwrapping.
 130        // ----------------------------------------------------------------------------------------- //
 131
 132        [Header("Mesh Lightmap UV Unwrapping")]
 133        public bool m_generateLightmapUVs;
 134
 135        [Tooltip("Maximum allowed angle distortion")]
 136        [Range(0, 1)]
 100137        public float m_unwrapAngleError = .08f;
 138
 139        [Tooltip("Maximum allowed area distortion")]
 140        [Range(0, 1)]
 100141        public float m_unwrapAreaError = .15f;
 142
 143        [Tooltip("This angle (in degrees) or greater between triangles will cause seam to be created")]
 144        [Range(1, 359)]
 100145        public float m_unwrapHardAngle = 88;
 146
 147        [Tooltip("UV-island padding in pixels")]
 148        [Range(0, 32)]
 100149        public int m_unwrapPackMargin = 4;
 150
 151        // ----------------------------------------------------------------------------------------- //
 152        // Import Settings.
 153        // ----------------------------------------------------------------------------------------- //
 154
 155        [Header("Import Settings")]
 100156        public MaterialImportMode m_materialImportMode = MaterialImportMode.ImportDisplayColor;
 157
 100158        public bool m_importCameras = true;
 100159        public bool m_importMeshes = true;
 100160        public bool m_importSkinning = true;
 100161        public bool m_importTransforms = true;
 100162        public bool m_importSceneInstances = true;
 100163        public bool m_importPointInstances = true;
 100164        public bool m_importMonoBehaviors = false;
 165
 166#if false
 167        [Header("Export Settings")]
 168        public bool m_exportCameras = true;
 169        public bool m_exportMeshes = true;
 170        public bool m_exportSkinning = true;
 171        public bool m_exportTransforms = true;
 172        public bool m_exportSceneInstances = true;
 173        public bool m_exportPointInstances = true;
 174        public bool m_exportMonoBehaviors = true;
 175#endif
 176
 177        // ----------------------------------------------------------------------------------------- //
 178        // Debug Options.
 179        // ----------------------------------------------------------------------------------------- //
 180
 181        [Header("Debug Options")] public bool m_debugShowSkeletonBindPose;
 182        public bool m_debugShowSkeletonRestPose;
 183        public bool m_debugPrintVariabilityCache;
 184
 185        [Tooltip("Memorizes which attributes change over time, to speed up playback (trades time for memory)")]
 100186        public bool m_usdVariabilityCache = true;
 187
 188        [HideInInspector] public BasisTransformation LastHandedness;
 189        [HideInInspector] public float LastScale;
 190
 191        // ----------------------------------------------------------------------------------------- //
 192        // Private fields.
 193        // ----------------------------------------------------------------------------------------- //
 194
 195        private float m_lastTime;
 196        private Scene m_lastScene;
 100197        private PrimMap m_lastPrimMap = null;
 100198        private AccessMask m_lastAccessMask = null;
 199
 200#if UNITY_EDITOR
 201        /// <summary>
 202        /// Returns the underlying prefab object, or null.
 203        /// </summary>
 204        private GameObject GetPrefabObject(GameObject root)
 0205        {
 206            // This is a great resource for determining object type, but only covers new APIs:
 207            // https://github.com/Unity-Technologies/UniteLA2018Examples/blob/master/Assets/Scripts/GameObjectTypeLoggin
 0208            return UnityEditor.PrefabUtility.GetCorrespondingObjectFromSource(root);
 0209        }
 210
 211#endif
 212
 213        private void OnDestroy()
 55214        {
 55215            if (m_lastScene != null)
 14216            {
 14217                m_lastScene.Close();
 14218                m_lastScene = null;
 14219            }
 55220        }
 221
 222        /// <summary>
 223        /// Returns the project path to the prefab, or null. Always returns null in player.
 224        /// </summary>
 225        private string GetPrefabAssetPath(GameObject root)
 16226        {
 16227            string assetPath = null;
 228#if UNITY_EDITOR
 16229            if (!UnityEditor.EditorUtility.IsPersistent(root))
 16230            {
 231#if UNITY_2021_2_OR_NEWER
 16232                var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetPrefabStage(root);
 233#else
 234                var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetPrefabStage(root);
 235#endif
 16236                if (prefabStage != null)
 0237                {
 0238                    if (!UnityEditor.PrefabUtility.IsPartOfPrefabInstance(root))
 0239                    {
 240#if UNITY_2020_1_OR_NEWER
 0241                        assetPath = prefabStage.assetPath;
 242#else
 243                        assetPath = prefabStage.prefabAssetPath;
 244#endif
 245                        // This is a great resource for determining object type, but only covers new APIs:
 246                        // https://github.com/Unity-Technologies/UniteLA2018Examples/blob/master/Assets/Scripts/GameObje
 0247                    }
 0248                }
 16249            }
 250#endif
 16251            return assetPath;
 16252        }
 253
 254        /// <summary>
 255        /// Convert the SceneImportOptions to a serializable form.
 256        /// </summary>
 257        public void OptionsToState(SceneImportOptions options)
 56258        {
 56259            m_usdRootPath = options.usdRootPath;
 56260            m_projectAssetPath = options.projectAssetPath;
 56261            m_changeHandedness = options.changeHandedness;
 56262            m_scale = options.scale;
 56263            m_interpolation = options.interpolate ? Scene.InterpolationMode.Linear : Scene.InterpolationMode.Held;
 264
 265            // Scenegraph options.
 56266            m_payloadPolicy = options.payloadPolicy;
 56267            m_importCameras = options.importCameras;
 56268            m_importMeshes = options.importMeshes;
 56269            m_importSkinning = options.importSkinning;
 56270            m_importHierarchy = options.importHierarchy;
 56271            m_importTransforms = options.importTransforms;
 56272            m_importSceneInstances = options.importSceneInstances;
 56273            m_importPointInstances = options.importPointInstances;
 56274            m_importMonoBehaviors = options.importMonoBehaviours;
 275
 276            // Mesh options.
 56277            m_points = options.meshOptions.points;
 56278            m_topology = options.meshOptions.topology;
 56279            m_boundingBox = options.meshOptions.boundingBox;
 56280            m_color = options.meshOptions.color;
 56281            m_normals = options.meshOptions.normals;
 56282            m_tangents = options.meshOptions.tangents;
 56283            m_generateLightmapUVs = options.meshOptions.generateLightmapUVs;
 284
 56285            m_unwrapAngleError = options.meshOptions.unwrapAngleError;
 56286            m_unwrapAreaError = options.meshOptions.unwrapAreaError;
 56287            m_unwrapHardAngle = options.meshOptions.unwrapHardAngle;
 56288            m_unwrapPackMargin = options.meshOptions.unwrapPackMargin;
 289
 56290            m_debugShowSkeletonBindPose = options.meshOptions.debugShowSkeletonBindPose;
 56291            m_debugShowSkeletonRestPose = options.meshOptions.debugShowSkeletonRestPose;
 292
 293            // Materials & instancing.
 56294            m_useOriginalShaderIfAvailable = options.materialMap.useOriginalShaderIfAvailable;
 56295            m_materialImportMode = options.materialImportMode;
 56296            m_enableGpuInstancing = options.enableGpuInstancing;
 56297            m_displayColorMaterial = options.materialMap.DisplayColorMaterial;
 56298            m_specularWorkflowMaterial = options.materialMap.SpecularWorkflowMaterial;
 56299            m_metallicWorkflowMaterial = options.materialMap.MetallicWorkflowMaterial;
 56300        }
 301
 302        /// <summary>
 303        /// Converts the current component state into import options.
 304        /// </summary>
 305        public void StateToOptions(ref SceneImportOptions options)
 19306        {
 19307            options.usdRootPath = new pxr.SdfPath(m_usdRootPath);
 19308            options.projectAssetPath = m_projectAssetPath;
 19309            options.changeHandedness = m_changeHandedness;
 19310            options.scale = m_scale;
 19311            options.interpolate = m_interpolation == Scene.InterpolationMode.Linear;
 312
 313            // Scenegraph options.
 19314            options.payloadPolicy = m_payloadPolicy;
 315
 19316            options.importCameras = m_importCameras;
 19317            options.importMeshes = m_importMeshes;
 19318            options.importSkinning = m_importSkinning;
 19319            options.importHierarchy = m_importHierarchy;
 19320            options.importTransforms = m_importTransforms;
 19321            options.importSceneInstances = m_importSceneInstances;
 19322            options.importPointInstances = m_importPointInstances;
 19323            options.importMonoBehaviours = m_importMonoBehaviors;
 324
 325            // Mesh options.
 19326            options.meshOptions.points = m_points;
 19327            options.meshOptions.topology = m_topology;
 19328            options.meshOptions.boundingBox = m_boundingBox;
 19329            options.meshOptions.color = m_color;
 19330            options.meshOptions.normals = m_normals;
 19331            options.meshOptions.tangents = m_tangents;
 19332            options.meshOptions.generateLightmapUVs = m_generateLightmapUVs;
 333
 19334            options.meshOptions.unwrapAngleError = m_unwrapAngleError;
 19335            options.meshOptions.unwrapAreaError = m_unwrapAreaError;
 19336            options.meshOptions.unwrapHardAngle = m_unwrapHardAngle;
 19337            options.meshOptions.unwrapPackMargin = m_unwrapPackMargin;
 338
 19339            options.meshOptions.debugShowSkeletonBindPose = m_debugShowSkeletonBindPose;
 19340            options.meshOptions.debugShowSkeletonRestPose = m_debugShowSkeletonRestPose;
 341
 342            // Materials & Instancing.
 19343            options.materialMap.useOriginalShaderIfAvailable = m_useOriginalShaderIfAvailable;
 19344            options.materialImportMode = m_materialImportMode;
 19345            options.enableGpuInstancing = m_enableGpuInstancing;
 19346            options.materialMap.DisplayColorMaterial = m_displayColorMaterial;
 19347            options.materialMap.SpecularWorkflowMaterial = m_specularWorkflowMaterial;
 19348            options.materialMap.MetallicWorkflowMaterial = m_metallicWorkflowMaterial;
 19349        }
 350
 351        private bool SceneFileChanged()
 28352        {
 28353            if (m_lastScene == null)
 0354            {
 0355                return true;
 356            }
 357
 28358            return Path.GetFullPath(m_lastScene.FilePath).ToLower().Replace("\\", "/")
 359                != usdFullPath.ToLower().Replace("\\", "/");
 28360        }
 361
 362        /// <summary>
 363        /// Returns the USD.NET.Scene object for this USD file.
 364        /// The caller is NOT expected to close the scene.
 365        /// </summary>
 366        public Scene GetScene()
 45367        {
 45368            InitUsd.Initialize();
 369
 45370            if (m_lastScene?.Stage == null || SceneFileChanged())
 17371            {
 17372                pxr.UsdStage stage = null;
 17373                if (string.IsNullOrEmpty(usdFullPath))
 0374                {
 0375                    return null;
 376                }
 377
 17378                if (m_payloadPolicy == PayloadPolicy.DontLoadPayloads)
 13379                {
 13380                    stage = pxr.UsdStage.Open(usdFullPath, pxr.UsdStage.InitialLoadSet.LoadNone);
 13381                }
 382                else
 4383                {
 4384                    stage = pxr.UsdStage.Open(usdFullPath, pxr.UsdStage.InitialLoadSet.LoadAll);
 4385                }
 386
 17387                stage.Reload(); // Ensure the stage is reloaded in case it was already opened and cached.
 17388                m_lastScene = Scene.Open(stage);
 17389                m_lastPrimMap = null;
 17390                m_lastAccessMask = null;
 391
 392                // TODO: This is potentially horrible in terms of performance, LoadAndUnload should be used
 393                // instead, but the binding is not complete.
 51394                foreach (var payload in GetComponentsInParent<UsdPayload>())
 0395                {
 0396                    var primSrc = payload.GetComponent<UsdPrimSource>();
 0397                    if (payload.IsLoaded && m_payloadPolicy == PayloadPolicy.DontLoadPayloads)
 0398                    {
 0399                        var prim = m_lastScene.GetPrimAtPath(primSrc.m_usdPrimPath);
 0400                        if (prim == null || !prim)
 0401                        {
 0402                            continue;
 403                        }
 404
 0405                        prim.Load();
 0406                    }
 407                    else
 0408                    {
 0409                        var prim = m_lastScene.GetPrimAtPath(primSrc.m_usdPrimPath);
 0410                        if (prim == null || !prim)
 0411                        {
 0412                            continue;
 413                        }
 414
 0415                        prim.Unload();
 0416                    }
 0417                }
 418
 419                // Re-apply variant selection state, similar to prim load state.
 53420                foreach (var variants in GetComponentsInChildren<UsdVariantSet>())
 1421                {
 1422                    ApplyVariantSelectionState(m_lastScene, variants);
 1423                }
 17424            }
 425
 45426            m_lastScene.Time = m_usdTimeOffset;
 45427            m_lastScene.SetInterpolation(m_interpolation);
 45428            return m_lastScene;
 45429        }
 430
 431        /// <summary>
 432        /// A private event that fires whenever the USD scene was reimported.
 433        /// </summary>
 434        private void OnReload()
 0435        {
 0436            m_lastPrimMap = null;
 0437            m_lastAccessMask = null;
 0438            if (m_lastScene != null)
 0439            {
 0440                m_lastScene.Close();
 0441                m_lastScene = null;
 0442            }
 0443        }
 444
 445        /// <summary>
 446        /// A null-safe way of destroying components.
 447        /// </summary>
 448        private void DestroyComponent(Component comp)
 0449        {
 0450            if (!comp)
 0451            {
 0452                return;
 453            }
 454
 0455            Component.DestroyImmediate(comp);
 0456        }
 457
 458        /// <summary>
 459        /// Clear internal data.
 460        /// Call to <see cref="GetScene">GetScene()</see> to update them with the latest USD data.
 461        /// </summary>
 462        private void ClearLastData()
 16463        {
 16464            m_lastScene = null;
 16465            m_lastPrimMap = null;
 16466            m_lastAccessMask = null;
 16467        }
 468
 469        /// <summary>
 470        /// Finds all USD behaviors and destroys them, ignores the GameObject and other components.
 471        /// </summary>
 472        public void RemoveAllUsdComponents()
 0473        {
 0474            foreach (var src in GetComponentsInChildren<UsdPrimSource>(includeInactive: true))
 0475            {
 0476                if (src)
 0477                {
 0478                    var go = src.gameObject;
 0479                    DestroyComponent(go.GetComponent<UsdAssemblyRoot>());
 0480                    DestroyComponent(go.GetComponent<UsdAsset>());
 0481                    DestroyComponent(go.GetComponent<UsdLayerStack>());
 0482                    DestroyComponent(go.GetComponent<UsdModelRoot>());
 0483                    DestroyComponent(go.GetComponent<UsdPayload>());
 0484                    DestroyComponent(go.GetComponent<UsdVariantSet>());
 0485                    DestroyComponent(go.GetComponent<UsdPrimSource>());
 0486                }
 0487            }
 0488        }
 489
 490        /// <summary>
 491        /// Finds and destroys all GameObjects that were imported from USD.
 492        /// </summary>
 493        public void DestroyAllImportedObjects()
 26494        {
 298495            foreach (var src in GetComponentsInChildren<UsdPrimSource>(includeInactive: true))
 110496            {
 497                // Remove the object if it is valid, but never remove the UsdAsset root GameObject, which
 498                // is this.gameObject. The current workflow is to remove all objects EXCEPT the root, so
 499                // stubs of USD Assets can be left in the scene in the scene and imported only as needed.
 110500                if (src && src.gameObject != this.gameObject)
 16501                {
 16502                    GameObject.DestroyImmediate(src.gameObject);
 16503                }
 110504            }
 26505        }
 506
 507        /// <summary>
 508        /// Reimports the USD scene, either fully rebuilding every object or updating them in-place.
 509        /// </summary>
 510        /// <param name="forceRebuild">Destroys each GameObject before reimporting.</param>
 511        public void Reload(bool forceRebuild)
 16512        {
 16513            var options = new SceneImportOptions();
 16514            StateToOptions(ref options);
 515
 16516            options.forceRebuild = forceRebuild;
 517
 16518            if (string.IsNullOrEmpty(options.projectAssetPath))
 0519            {
 0520                options.projectAssetPath = "Assets/";
 0521                OptionsToState(options);
 0522            }
 523
 16524            var root = gameObject;
 525
 16526            string assetPath = GetPrefabAssetPath(root);
 527
 528            // The prefab asset path will be null for prefab instances.
 529            // When the assetPath is not null, the object is the prefab itself.
 16530            if (!string.IsNullOrEmpty(assetPath))
 0531            {
 0532                if (options.forceRebuild)
 0533                {
 0534                    DestroyAllImportedObjects();
 0535                }
 536
 0537                pxr.UsdStageLoadRules.Rule activeLoadRule = m_lastScene.Stage.GetLoadRules().GetEffectiveRuleForPath(new
 0538                if ((activeLoadRule == pxr.UsdStageLoadRules.Rule.AllRule && options.payloadPolicy == PayloadPolicy.Dont
 539                    || (activeLoadRule == pxr.UsdStageLoadRules.Rule.NoneRule && options.payloadPolicy == PayloadPolicy.
 0540                {
 0541                    ClearLastData();
 0542                }
 0543                SceneImporter.ImportUsd(root, GetScene(), new PrimMap(), options);
 544
 545#if UNITY_EDITOR
 0546                string clipName = Path.GetFileNameWithoutExtension(usdFullPath);
 547                // As an optimization, we could detect if any meshes or materials were created and only
 548                // rebuild the prefab in those cases.
 0549                SceneImporter.SavePrefab(root, assetPath, clipName, options);
 550#endif
 0551            }
 552            else
 16553            {
 554                // An instance of a prefab or a vanilla game object.
 555                // Just reload the scene into memory and let the user decide if they want to send those
 556                // changes back to the prefab or not.
 557
 16558                if (forceRebuild)
 13559                {
 560                    // First, destroy all existing USD game objects.
 13561                    DestroyAllImportedObjects();
 13562                }
 563
 16564                ClearLastData();
 16565                SceneImporter.ImportUsd(root, GetScene(), new PrimMap(), options);
 16566            }
 16567        }
 568
 569        /// <summary>
 570        /// Returns the first Prim on the USD stage or null.
 571        /// </summary>
 572        pxr.UsdPrim GetFirstPrim(Scene scene)
 0573        {
 0574            var children = scene.Stage.GetPseudoRoot().GetAllChildren().GetEnumerator();
 0575            if (!children.MoveNext())
 0576            {
 0577                return null;
 578            }
 579
 0580            return children.Current;
 0581        }
 582
 583        /// <summary>
 584        /// Writes overrides over the given scene. The given scene is referenced into the override
 585        /// scene being exported.
 586        /// </summary>
 587        /// <param name="sceneInWhichToStoreTransforms"></param>
 588        public void ExportOverrides(Scene sceneInWhichToStoreTransforms)
 0589        {
 0590            var sceneToReference = this;
 0591            var overs = sceneInWhichToStoreTransforms;
 592
 0593            if (overs == null)
 0594            {
 0595                return;
 596            }
 597
 0598            var baseLayer = sceneToReference.GetScene();
 0599            if (baseLayer == null)
 0600            {
 0601                throw new Exception("Could not open base layer: " + sceneToReference.usdFullPath);
 602            }
 603
 0604            overs.Time = baseLayer.Time;
 0605            overs.StartTime = baseLayer.StartTime;
 0606            overs.EndTime = baseLayer.EndTime;
 607
 0608            overs.WriteMode = Scene.WriteModes.Over;
 0609            overs.UpAxis = baseLayer.UpAxis;
 610
 611            try
 0612            {
 0613                SceneExporter.Export(sceneToReference.gameObject,
 614                    overs,
 615                    BasisTransformation.SlowAndSafe,
 616                    exportUnvarying: false,
 617                    zeroRootTransform: true);
 618
 0619                var rel = ImporterBase.MakeRelativePath(overs.FilePath, sceneToReference.usdFullPath);
 0620                GetFirstPrim(overs).GetReferences().AddReference(rel, GetFirstPrim(baseLayer).GetPath());
 0621            }
 0622            catch (System.Exception ex)
 0623            {
 0624                Debug.LogException(ex);
 0625                return;
 626            }
 627            finally
 0628            {
 0629                if (overs != null)
 0630                {
 0631                    overs.Save();
 0632                    overs.Close();
 0633                }
 0634            }
 0635        }
 636
 637        /// <summary>
 638        /// Computes the playback length of the USD scene in seconds.
 639        /// </summary>
 640        /// <returns></returns>
 641        private double ComputeLength()
 0642        {
 0643            var scene = GetScene();
 0644            if (scene == null)
 0645            {
 0646                return 0;
 647            }
 648
 0649            return (scene.EndTime - scene.StartTime) / (scene.Stage.GetTimeCodesPerSecond());
 0650        }
 651
 652        /// <summary>
 653        /// Applies the contents of this USD file to a foreign root object.
 654        /// </summary>
 655        /// <remarks>
 656        /// The idea here is that one may have many animation clips, but only a single GameObject in
 657        /// the Unity scenegraph.
 658        /// </remarks>
 659        public void SetTime(double time, UsdAsset foreignRoot, bool saveMeshUpdates)
 0660        {
 0661            var scene = GetScene();
 0662            if (scene == null)
 0663            {
 0664                Debug.LogWarning("Null scene from GetScene() at " + UnityTypeConverter.GetPath(transform));
 0665                return;
 666            }
 667
 668            // Careful not to update any local members here, if this data is driven from a prefab, we
 669            // dont want those changes to be baked back into the asset.
 0670            time += foreignRoot.m_usdTimeOffset;
 0671            float usdTime = (float)(scene.StartTime + time * scene.Stage.GetTimeCodesPerSecond());
 0672            if (usdTime > scene.EndTime)
 0673            {
 0674                return;
 675            }
 676
 0677            if (usdTime < scene.StartTime)
 0678            {
 0679                return;
 680            }
 681
 0682            scene.Time = usdTime;
 683
 0684            var options = new SceneImportOptions();
 0685            foreignRoot.StateToOptions(ref options);
 686
 0687            PrepOptionsForTimeChange(ref options);
 688
 0689            if (foreignRoot.m_lastPrimMap == null)
 0690            {
 0691                foreignRoot.m_lastPrimMap = new PrimMap();
 0692                options.importHierarchy = true;
 0693            }
 694
 0695            if (m_usdVariabilityCache)
 0696            {
 0697                if (m_lastAccessMask == null)
 0698                {
 0699                    m_lastAccessMask = new AccessMask();
 0700                    scene.IsPopulatingAccessMask = true;
 0701                }
 0702            }
 703            else
 0704            {
 0705                m_lastAccessMask = null;
 0706            }
 707
 0708            if (m_debugPrintVariabilityCache && m_lastAccessMask != null
 709                && !scene.IsPopulatingAccessMask)
 0710            {
 0711                var sb = new System.Text.StringBuilder();
 0712                foreach (var kvp in m_lastAccessMask.Included)
 0713                {
 0714                    sb.AppendLine(kvp.Key);
 0715                    foreach (var member in kvp.Value)
 0716                    {
 0717                        sb.AppendLine("  ." + member.Name);
 0718                    }
 719
 0720                    sb.AppendLine();
 0721                }
 722
 0723                Debug.Log(sb.ToString());
 0724            }
 725
 0726            scene.AccessMask = m_lastAccessMask;
 0727            SceneImporter.ImportUsd(foreignRoot.gameObject,
 728                scene,
 729                foreignRoot.m_lastPrimMap,
 730                options);
 0731            scene.AccessMask = null;
 732
 0733            if (m_lastAccessMask != null)
 0734            {
 0735                scene.IsPopulatingAccessMask = false;
 0736            }
 0737        }
 738
 739        private void Update()
 84740        {
 84741            if (m_lastTime == m_usdTimeOffset)
 84742            {
 84743                return;
 744            }
 745
 0746            m_lastTime = m_usdTimeOffset;
 0747            SetTime(m_usdTimeOffset, this, saveMeshUpdates: true);
 84748        }
 749
 750        /// <summary>
 751        /// Optimizes the given import options for fast playback. This assumes that the asset was
 752        /// previously imported, therefore it disables import of the material and scene hierarchy.
 753        /// </summary>
 754        public static void PrepOptionsForTimeChange(ref SceneImportOptions options)
 0755        {
 0756            options.forceRebuild = false;
 0757            options.materialImportMode = MaterialImportMode.None;
 0758            options.meshOptions.debugShowSkeletonBindPose = false;
 0759            options.meshOptions.debugShowSkeletonRestPose = false;
 760
 0761            options.meshOptions.generateLightmapUVs = false;
 0762            options.importSkinWeights = false;
 763
 764            // Note that tangent and Normals must be updated when the mesh deforms.
 0765            options.importHierarchy = false;
 0766        }
 767
 768        /// <summary>
 769        /// Imports the USD scene incrementally, setting a fixed time budget per frame for import
 770        /// operations. Uses StartCoroutine.
 771        /// </summary>
 772        public void ImportUsdAsCoroutine(GameObject goRoot,
 773            string usdFilePath,
 774            double time,
 775            SceneImportOptions importOptions,
 776            float targetFrameMilliseconds)
 0777        {
 0778            InitUsd.Initialize();
 0779            var scene = Scene.Open(usdFilePath);
 0780            if (scene == null)
 0781            {
 0782                throw new Exception("Failed to open: " + usdFilePath);
 783            }
 784
 0785            scene.Time = time;
 0786            if (scene == null)
 0787            {
 0788                throw new Exception("Null USD Scene");
 789            }
 790
 0791            scene.SetInterpolation(importOptions.interpolate
 792                ? Scene.InterpolationMode.Linear
 793                : Scene.InterpolationMode.Held);
 0794            var primMap = new PrimMap();
 0795            var importer = SceneImporter.BuildScene(scene,
 796                goRoot,
 797                importOptions,
 798                primMap,
 799                targetFrameMilliseconds,
 800                composingSubtree: false);
 0801            StartCoroutine(importer);
 0802        }
 803
 804        /// <summary>
 805        /// Loads or unloads the given payload object. Throws an exception if game object deos not have
 806        /// a UsdPrimSource behaviour.
 807        /// </summary>
 808        public void SetPayloadState(GameObject go, bool isLoaded)
 6809        {
 6810            var primSrc = go.GetComponent<UsdPrimSource>();
 6811            if (!primSrc)
 0812            {
 0813                throw new Exception("UsdPrimSource not found: " + UnityTypeConverter.GetPath(go.transform));
 814            }
 815
 6816            var usdPrimPath = primSrc.m_usdPrimPath;
 817
 6818            InitUsd.Initialize();
 6819            var scene = GetScene();
 6820            if (scene == null)
 0821            {
 0822                throw new Exception("Failed to open: " + usdFullPath);
 823            }
 824
 6825            var prim = scene.GetPrimAtPath(usdPrimPath);
 6826            if (prim == null || !prim)
 0827            {
 0828                throw new Exception("Prim not found: " + usdPrimPath);
 829            }
 830
 36831            foreach (var child in go.transform.GetComponentsInChildren<UsdPrimSource>().ToList())
 9832            {
 9833                if (!child || child.gameObject == go)
 6834                {
 6835                    continue;
 836                }
 837
 3838                GameObject.DestroyImmediate(child.gameObject);
 3839            }
 840
 6841            if (!isLoaded)
 3842            {
 3843                prim.Unload();
 3844                return;
 845            }
 846            else
 3847            {
 3848                prim.Load();
 3849            }
 850
 3851            SceneImportOptions importOptions = new SceneImportOptions();
 3852            this.StateToOptions(ref importOptions);
 3853            importOptions.usdRootPath = prim.GetPath();
 3854            SceneImporter.ImportUsd(go, scene, new PrimMap(), true, importOptions);
 6855        }
 856
 857        /// <summary>
 858        /// Applies changes to the USD variant selection made via UsdVariantSet behaviour. Objects will
 859        /// be destroyed and imported as a result.
 860        /// </summary>
 861        private void ApplyVariantSelectionState(Scene scene, UsdVariantSet variants)
 1862        {
 1863            var primSource = variants.GetComponent<UsdPrimSource>();
 1864            if (!primSource)
 0865            {
 0866                Debug.LogError("Null UsdPrimSource while applying variant selection state.");
 0867                return;
 868            }
 869
 1870            var selections = variants.GetVariantSelections();
 1871            var path = primSource.m_usdPrimPath;
 1872            var prim = scene.GetPrimAtPath(path);
 1873            var varSets = prim.GetVariantSets();
 5874            foreach (var sel in selections)
 1875            {
 1876                if (!varSets.HasVariantSet(sel.Key))
 0877                {
 0878                    throw new Exception("Unknown varient set: " + sel.Key + " at " + path);
 879                }
 880
 1881                varSets.GetVariantSet(sel.Key).SetVariantSelection(sel.Value);
 1882            }
 1883        }
 884
 885        /// <summary>
 886        /// Sets the variant selections in USD at the given prim path based on the selections parameter.
 887        /// </summary>
 888        /// <param name="go">The gameObject at the root of the variant set.</param>
 889        /// <param name="usdPrimPath">The USD prim at which to set the variant selection.</param>
 890        /// <param name="selections">A collection of (variant set, selection) pairs.</param>
 891        /// <remarks>
 892        /// A USD prim can have zero or more variant sets, for example a single prim amy have
 893        /// "modelingVariant" and "shadingVariant" sets. Each set can have their own slection.
 894        /// </remarks>
 895        /// <example>
 896        /// If two sets with selections are modelingVariant=CupWithHandle and shadingVariant=BrightBlue,
 897        /// resulting in a bright blue cup with a handle. In this example, the selections dictionary
 898        /// would contain:
 899        ///  { "modelingVariant" = "CupWithHandle",
 900        ///    "shadingVariant" = "BrightBlue" }
 901        /// </example>
 902        public void SetVariantSelection(GameObject go,
 903            string usdPrimPath,
 904            Dictionary<string, string> selections)
 0905        {
 0906            InitUsd.Initialize();
 0907            var scene = GetScene();
 0908            if (scene == null)
 0909            {
 0910                throw new Exception("Failed to open: " + usdFullPath);
 911            }
 912
 0913            var prim = scene.GetPrimAtPath(usdPrimPath);
 0914            if (prim == null || !prim)
 0915            {
 0916                throw new Exception("Prim not found: " + usdPrimPath);
 917            }
 918
 0919            var varSets = prim.GetVariantSets();
 0920            foreach (var sel in selections)
 0921            {
 0922                if (!varSets.HasVariantSet(sel.Key))
 0923                {
 0924                    throw new Exception("Unknown varient set: " + sel.Key + " at " + usdPrimPath);
 925                }
 926
 0927                varSets.GetVariantSet(sel.Key).SetVariantSelection(sel.Value);
 0928            }
 929
 930            // TODO: sparsely remove prims, rather than blowing away all the children.
 0931            foreach (Transform child in go.transform)
 0932            {
 0933                GameObject.DestroyImmediate(child.gameObject);
 0934            }
 935
 0936            SceneImportOptions importOptions = new SceneImportOptions();
 0937            this.StateToOptions(ref importOptions);
 0938            importOptions.usdRootPath = prim.GetPath();
 0939            SceneImporter.ImportUsd(go, scene, new PrimMap(), true, importOptions);
 0940        }
 941    }
 942}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdLayerStack.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdLayerStack.html new file mode 100644 index 000000000..d0a4b2939 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdLayerStack.html @@ -0,0 +1,233 @@ + + + + + + +Unity.Formats.USD.UsdLayerStack - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdLayerStack
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdLayerStack.cs
Covered lines:0
Uncovered lines:59
Coverable lines:59
Total lines:127
Line coverage:0% (0 of 59)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetupNewSubLayer(...)0%0000%
SaveLayerStack(...)0%0000%
SaveToLayer()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdLayerStack.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using UnityEngine;
 17using pxr;
 18using Scene = USD.NET.Scene;
 19
 20namespace Unity.Formats.USD
 21{
 22    /// <summary>
 23    /// A mechanism for managing USD layers in a multi-layer shot context.
 24    /// </summary>
 25    [RequireComponent(typeof(UsdAsset))]
 26    public class UsdLayerStack : MonoBehaviour
 27    {
 28        public string m_targetLayer;
 29        public string[] m_layerStack;
 30        public string[] m_mutedLayers;
 31
 32        /// <summary>
 33        /// Initialize a layer as a subLayer to be compatible with the parentLayer.
 34        /// </summary>
 35        private void SetupNewSubLayer(Scene parentScene, Scene subLayerScene)
 036        {
 037            if (parentScene == null)
 038            {
 039                throw new NullReferenceException("ParentScene is null");
 40            }
 41
 042            subLayerScene.WriteMode = Scene.WriteModes.Over;
 043            subLayerScene.UpAxis = parentScene.UpAxis;
 044        }
 45
 46        /// <summary>
 47        /// Ensure each layer path is expressed in the USD sub layer stack of the given scene,
 48        /// creating the sublayer USD files if needed.
 49        /// </summary>
 50        public void SaveLayerStack(Scene scene, string[] layerStack)
 051        {
 052            if (scene == null)
 053            {
 054                throw new NullReferenceException("Null scene provided to SaveLayerStack");
 55            }
 56
 057            SdfSubLayerProxy subLayers = scene.Stage.GetRootLayer().GetSubLayerPaths();
 058            for (int i = 0; i < m_layerStack.Length; i++)
 059            {
 060                string absoluteLayerPath = m_layerStack[i];
 061                string relativeLayerPath = ImporterBase.MakeRelativePath(scene.FilePath, absoluteLayerPath);
 062                if (!System.IO.File.Exists(absoluteLayerPath))
 063                {
 064                    var newSubLayer = Scene.Create(absoluteLayerPath);
 065                    SetupNewSubLayer(scene, newSubLayer);
 066                    newSubLayer.Save();
 067                    newSubLayer.Close();
 068                }
 69
 070                if (subLayers.Count(relativeLayerPath) == 0)
 071                {
 072                    subLayers.push_back(relativeLayerPath);
 073                }
 074            }
 75
 076            scene.Save();
 077        }
 78
 79        /// <summary>
 80        /// Writes overrides to the currently targeted subLayer.
 81        /// </summary>
 82        public void SaveToLayer()
 083        {
 084            var stageRoot = GetComponent<UsdAsset>();
 85
 086            Scene subLayerScene = Scene.Create(m_targetLayer);
 087            if (subLayerScene == null)
 088            {
 089                throw new NullReferenceException("Could not create layer: " + m_targetLayer);
 90            }
 91
 092            Scene rootScene = Scene.Open(stageRoot.usdFullPath);
 093            if (rootScene == null)
 094            {
 095                throw new NullReferenceException("Could not open base layer: " + stageRoot.usdFullPath);
 96            }
 97
 098            SetupNewSubLayer(rootScene, subLayerScene);
 99
 0100            rootScene.Close();
 0101            rootScene = null;
 102
 103            try
 0104            {
 0105                SceneExporter.Export(stageRoot.gameObject,
 106                    subLayerScene,
 107                    stageRoot.m_changeHandedness,
 108                    exportUnvarying: false,
 109                    zeroRootTransform: false);
 0110            }
 0111            catch (Exception ex)
 0112            {
 0113                Debug.LogException(ex);
 0114                return;
 115            }
 116            finally
 0117            {
 0118                if (subLayerScene != null)
 0119                {
 0120                    subLayerScene.Save();
 0121                    subLayerScene.Close();
 0122                    subLayerScene = null;
 0123                }
 0124            }
 0125        }
 126    }
 127}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPayload.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPayload.html new file mode 100644 index 000000000..049676f7c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPayload.html @@ -0,0 +1,197 @@ + + + + + + +Unity.Formats.USD.UsdPayload - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdPayload
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdPayload.cs
Covered lines:22
Uncovered lines:0
Coverable lines:22
Total lines:86
Line coverage:100% (22 of 22)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdPayload()0%000100%
Load()0%000100%
Unload()0%000100%
SetInitialState(...)0%000100%
Update()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdPayload.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEditor;
 16using UnityEngine;
 17
 18namespace Unity.Formats.USD
 19{
 20    [ExecuteInEditMode]
 21    public class UsdPayload : MonoBehaviour
 22    {
 23        [SerializeField]
 2324        private bool m_isLoaded = true;
 25
 26        // Variable used to track dirty load state.
 27        [SerializeField]
 28        [HideInInspector]
 2329        private bool m_wasLoaded = true;
 30
 31        /// <summary>
 32        /// Returns true of the prim is currently loaded. Note that this will return the currently
 33        /// requested load state, which may be pending to be applied on the next update.
 34        /// </summary>
 35        public bool IsLoaded
 36        {
 3637            get { return m_isLoaded; }
 38        }
 39
 40        /// <summary>
 41        /// Sets the current state to loaded. The actual chagne will be applied on next Update().
 42        /// </summary>
 43        public void Load()
 344        {
 345            m_isLoaded = true;
 346        }
 47
 48        /// <summary>
 49        /// Sets the current state to unloaded. The actual change will be applied on next Update().
 50        /// </summary>
 51        public void Unload()
 352        {
 353            m_isLoaded = false;
 354        }
 55
 56        /// <summary>
 57        /// Sets the current state without triggering load/unload operation from the USD scene state.
 58        /// </summary>
 59        /// <param name="loaded"></param>
 60        public void SetInitialState(bool loaded)
 2361        {
 2362            m_isLoaded = loaded;
 2363            m_wasLoaded = loaded;
 2364        }
 65
 66        /// <summary>
 67        /// Synchronize the current state in Unity into the USD scenegraph.
 68        /// </summary>
 69        public void Update()
 2670        {
 2671            if (m_isLoaded == m_wasLoaded)
 2072            {
 2073                return;
 74            }
 75
 676            m_wasLoaded = m_isLoaded;
 77
 78#if UNITY_EDITOR
 679            EditorUtility.SetDirty(this);
 80#endif
 81
 682            var stageRoot = transform.GetComponentInParent<UsdAsset>();
 683            stageRoot.SetPayloadState(this.gameObject, m_isLoaded);
 2684        }
 85    }
 86}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableAsset.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableAsset.html new file mode 100644 index 000000000..5f0d6475b --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableAsset.html @@ -0,0 +1,178 @@ + + + + + + +Unity.Formats.USD.UsdPlayableAsset - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdPlayableAsset
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableAsset.cs
Covered lines:0
Uncovered lines:27
Coverable lines:27
Total lines:72
Line coverage:0% (0 of 27)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GetUsdAsset(...)0%0000%
CreatePlayable(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableAsset.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEngine.Playables;
 17using UnityEngine.Timeline;
 18
 19namespace Unity.Formats.USD
 20{
 21    [System.Serializable]
 22    public class UsdPlayableAsset : PlayableAsset, ITimelineClipAsset
 23    {
 24        private UsdAsset m_sourceUsdAsset;
 25
 26        [Tooltip("USD Player to Control")] public ExposedReference<UsdAsset> SourceUsdAsset;
 27
 28        public ClipCaps clipCaps
 29        {
 030            get { return ClipCaps.Extrapolation | ClipCaps.Looping | ClipCaps.SpeedMultiplier | ClipCaps.ClipIn; }
 31        }
 32
 33        public UsdAsset GetUsdAsset(string usdRootPath)
 034        {
 035            m_sourceUsdAsset.m_usdRootPath = usdRootPath;
 036            return m_sourceUsdAsset;
 037        }
 38
 39        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
 040        {
 041            var usdPlayable = ScriptPlayable<UsdPlayableBehaviour>.Create(graph);
 042            UsdPlayableBehaviour behaviour = usdPlayable.GetBehaviour();
 043            m_sourceUsdAsset = SourceUsdAsset.Resolve(graph.GetResolver());
 44
 045            if (m_sourceUsdAsset != null)
 046            {
 047                behaviour.playableAsset = this;
 048                name = System.IO.Path.GetFileName(m_sourceUsdAsset.usdFullPath);
 049            }
 50
 051            return usdPlayable;
 052        }
 53
 54        public override double duration
 55        {
 56            get
 057            {
 058                double dur = 0;
 59                try
 060                {
 061                    dur = m_sourceUsdAsset == null ? 0 : m_sourceUsdAsset.Length;
 062                }
 063                catch (System.Exception ex)
 064                {
 065                    Debug.LogException(new System.Exception("Failed to read clip duration", ex));
 066                }
 67
 068                return dur;
 069            }
 70        }
 71    }
 72}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableBehaviour.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableBehaviour.html new file mode 100644 index 000000000..03f5fe88e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableBehaviour.html @@ -0,0 +1,210 @@ + + + + + + +Unity.Formats.USD.UsdPlayableBehaviour - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdPlayableBehaviour
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableBehaviour.cs
Covered lines:0
Uncovered lines:39
Coverable lines:39
Total lines:94
Line coverage:0% (0 of 39)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdPlayableBehaviour()0%0000%
OnGraphStart(...)0%0000%
OnGraphStop(...)0%0000%
OnBehaviourPlay(...)0%0000%
OnBehaviourPause(...)0%0000%
PrepareFrame(...)0%0000%
ProcessFrame(...)0%0000%
PrepareData(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableBehaviour.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine.Playables;
 16using UnityEngine;
 17
 18namespace Unity.Formats.USD
 19{
 20    // A behaviour that is attached to a playable
 21    public class UsdPlayableBehaviour : PlayableBehaviour
 22    {
 23        public UsdPlayableAsset playableAsset;
 24
 025        private bool m_errorOnce = true;
 26
 27        // Called when the owning graph starts playing
 28        public override void OnGraphStart(Playable playable)
 029        {
 030            InitUsd.Initialize();
 031        }
 32
 33        // Called when the owning graph stops playing
 34        public override void OnGraphStop(Playable playable)
 035        {
 036        }
 37
 38        // Called when the state of the playable is set to Play
 39        public override void OnBehaviourPlay(Playable playable, FrameData info)
 040        {
 041        }
 42
 43        // Called when the state of the playable is set to Paused
 44        public override void OnBehaviourPause(Playable playable, FrameData info)
 045        {
 046        }
 47
 48        // Called each frame while the state is set to Play
 49        public override void PrepareFrame(Playable playable, FrameData info)
 050        {
 051        }
 52
 53        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
 054        {
 055            if (playableAsset == null)
 056            {
 057                return;
 58            }
 59
 060            var targetUsdAsset = playerData as UsdAsset;
 061            if (targetUsdAsset == null)
 062            {
 063                if (m_errorOnce)
 064                {
 065                    Debug.LogError("Error: track data has no target UsdStageRoot");
 066                    m_errorOnce = false;
 067                }
 68
 069                return;
 70            }
 71            else
 072            {
 073                m_errorOnce = true;
 074            }
 75
 076            var sourceUsdAsset = playableAsset.GetUsdAsset(targetUsdAsset.m_usdRootPath);
 077            if (sourceUsdAsset == null)
 078            {
 079                return;
 80            }
 81
 082            if (!targetUsdAsset.isActiveAndEnabled)
 083            {
 084                return;
 85            }
 86
 087            sourceUsdAsset.SetTime(playable.GetTime(), targetUsdAsset, saveMeshUpdates: false);
 088        }
 89
 90        public override void PrepareData(Playable playable, FrameData info)
 091        {
 092        }
 93    }
 94}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableTrack.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableTrack.html new file mode 100644 index 000000000..a04ec00fa --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdPlayableTrack.html @@ -0,0 +1,133 @@ + + + + + + +Unity.Formats.USD.UsdPlayableTrack - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdPlayableTrack
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableTrack.cs
Covered lines:0
Uncovered lines:4
Coverable lines:4
Total lines:31
Line coverage:0% (0 of 4)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
OnCreateClip(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdPlayableTrack.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine.Timeline;
 16
 17namespace Unity.Formats.USD
 18{
 19    [TrackClipType(typeof(UsdPlayableAsset))]
 20    [TrackBindingType(typeof(UsdAsset))]
 21    [TrackColor(0.1f, 0.2f, 0.8f)]
 22    [System.Serializable]
 23    public class UsdPlayableTrack : TrackAsset
 24    {
 25        protected override void OnCreateClip(TimelineClip clip)
 026        {
 027            base.OnCreateClip(clip);
 028            clip.displayName = clip.asset.name;
 029        }
 30    }
 31}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderBehaviour.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderBehaviour.html new file mode 100644 index 000000000..d6696c8b6 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderBehaviour.html @@ -0,0 +1,441 @@ + + + + + + +Unity.Formats.USD.UsdRecorderBehaviour - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdRecorderBehaviour
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdRecorderBehaviour.cs
Covered lines:93
Uncovered lines:67
Coverable lines:160
Total lines:315
Line coverage:58.1% (93 of 160)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdRecorderBehaviour()0%000100%
BeginRecording(...)0%00047.62%
StopRecording(...)0%00061.76%
ProcessRecording(...)0%00050%
IsPlaying()0%000100%
OnPlayableCreate(...)0%000100%
OnPlayableDestroy(...)0%00066.67%
OnGraphStart(...)0%00066.67%
OnGraphStop(...)0%00066.67%
ProcessFrame(...)0%00054.55%
OnBehaviourPlay(...)0%000100%
OnBehaviourPause(...)0%000100%
OnFrameEnd(...)0%00066.67%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdRecorderBehaviour.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2019 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEngine.Playables;
 17using USD.NET;
 18using System.IO;
 19using pxr;
 20#if UNITY_EDITOR
 21using UnityEditor;
 22
 23#endif
 24
 25namespace Unity.Formats.USD
 26{
 27    public class UsdRecorderBehaviour : PlayableBehaviour
 28    {
 29        // Conversion to keyframes (60 frames per second) to work around QuickLook bug
 30        const int kExportFrameRate = 60;
 131        bool m_isPaused = false;
 32        public UsdRecorderClip Clip;
 33        string usdcFileName;
 34        string usdzFileName;
 35        string usdzFilePath;
 36        string currentDir;
 37        DirectoryInfo usdzTemporaryDir;
 38        GameObject _root;
 39
 40        // ------------------------------------------------------------------------------------------ //
 41        // Recording Control.
 42        // ------------------------------------------------------------------------------------------ //
 43
 44        public void BeginRecording(double currentTime, GameObject root)
 145        {
 146            InitUsd.Initialize();
 147            _root = root;
 48
 149            if (!root)
 050            {
 051                Debug.LogError("ExportRoot not assigned.");
 052                return;
 53            }
 54
 155            if (Clip.UsdScene != null)
 056            {
 057                Clip.UsdScene.Close();
 058                Clip.UsdScene = null;
 059            }
 60
 61            // Keep the current directory to restore it at the end.
 162            currentDir = Directory.GetCurrentDirectory();
 163            var localScale = root.transform.localScale;
 64            try
 165            {
 166                if (string.IsNullOrEmpty(Clip.m_usdFile))
 067                {
 068                    Clip.UsdScene = Scene.Create();
 069                }
 170                else if (Clip.IsUSDZ)
 071                {
 72                    // Setup a temporary directory to export the wanted USD file and zip it.
 073                    string tmpDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
 074                    usdzTemporaryDir = Directory.CreateDirectory(tmpDirPath);
 75
 76                    // Get the usd file name to export and the usdz file name of the archive.
 077                    usdcFileName = Path.GetFileNameWithoutExtension(Clip.m_usdFile) + ".usdc";
 078                    usdzFileName = Path.GetFileName(Clip.m_usdFile);
 079                    var fi = new FileInfo(Clip.m_usdFile);
 080                    usdzFilePath = fi.FullName;
 81
 82                    // Set the current working directory to the tmp directory to export with relative paths.
 083                    Directory.SetCurrentDirectory(tmpDirPath);
 84
 085                    Clip.UsdScene = ExportHelpers.InitForSave(Path.Combine(tmpDirPath, usdcFileName));
 086                }
 87                else
 188                {
 189                    Clip.UsdScene = Scene.Create(Clip.m_usdFile);
 190                }
 91
 92                // Set the frame rate in USD  as well.
 93                //
 94                // This both set the "time samples per second" and the playback rate.
 95                // Setting times samples per second allows the authoring code to express samples as integer
 96                // values, avoiding floating point error; so by setting FrameRate = 60, the samples written
 97                // at time=0 through time=59 represent the first second of playback.
 98                //
 99                // Stage.TimeCodesPerSecond is set implicitly to 1 / FrameRate.
 100                //m_usdScene.FrameRate = Clip.frame;
 101
 102                // When authoring in terms of seconds, at any frame rate the samles written at
 103                // time = 0.0 through time = 1.0 represent the first second of playback. The framerate
 104                // above will only be used as a target frame rate.
 105                //if (m_timeUnits == TimeCode.Seconds) {
 106                //  m_usdScene.Stage.SetTimeCodesPerSecond(1);
 107                //}
 108
 109                // Regardless of the actual sampling rate (e.g. Timeline playback speed), we are converting
 110                // the timecode from seconds to frames with a sampling rate of 60 FPS. This has the nice quality
 111                // of adding additional numerical stability.
 112                // In the event that the timeline is not configured for 60 FPS playback, we rely on USD's linear
 113                // interpolation mode to up-sample to 60 FPS.
 1114                Clip.UsdScene.FrameRate = kExportFrameRate;
 1115                Clip.UsdScene.Stage.SetInterpolationType(pxr.UsdInterpolationType.UsdInterpolationTypeLinear);
 116
 117                // For simplicity in this example, adding game objects while recording is not supported.
 1118                Clip.Context = new ExportContext();
 1119                Clip.Context.scene = Clip.UsdScene;
 1120                Clip.Context.basisTransform = Clip.m_convertHandedness;
 1121                Clip.Context.activePolicy = Clip.m_activePolicy;
 1122                Clip.Context.exportMaterials = Clip.m_exportMaterials;
 123                // USDZ is in centimeters.
 1124                Clip.Context.scale = Clip.IsUSDZ ? 100.0f : 1.0f;
 125
 1126                Clip.UsdScene.StartTime = currentTime * kExportFrameRate;
 127
 128                // Export the "default" frame, that is, all data which doesn't vary over time.
 1129                Clip.UsdScene.Time = null;
 130
 1131                SceneExporter.SyncExportContext(root, Clip.Context);
 1132                SceneExporter.Export(root,
 133                    Clip.Context,
 134                    zeroRootTransform: false);
 1135            }
 0136            catch
 0137            {
 0138                if (Clip.UsdScene != null)
 0139                {
 0140                    Debug.LogError("Set scene to null");
 0141                    Clip.UsdScene.Close();
 0142                    Clip.UsdScene = null;
 0143                }
 144
 0145                if (Clip.IsUSDZ)
 0146                {
 0147                    usdzTemporaryDir.Delete(recursive: true);
 0148                }
 149
 0150                throw;
 151            }
 152            finally
 1153            {
 1154                Directory.SetCurrentDirectory(currentDir);
 1155            }
 1156        }
 157
 158        public void StopRecording(double currentTime)
 2159        {
 2160            if (Clip.UsdScene == null)
 1161            {
 162                // If an error occured, avoid spewing on every frame.
 1163                return;
 164            }
 165
 166            try
 1167            {
 1168                if (Clip.IsUSDZ && usdzTemporaryDir != null)
 0169                    Directory.SetCurrentDirectory(usdzTemporaryDir.FullName);
 170
 1171                Clip.Context = new ExportContext();
 1172                Clip.UsdScene.EndTime = currentTime * kExportFrameRate;
 173                // In a real exporter, additional error handling should be added here.
 1174                if (!string.IsNullOrEmpty(Clip.m_usdFile))
 1175                {
 176                    // We could use SaveAs here, which is fine for small scenes, though it will require
 177                    // everything to fit in memory and another step where that memory is copied to disk.
 1178                    Clip.UsdScene.Save();
 1179                }
 180
 181                // Release memory associated with the scene.
 1182                Clip.UsdScene.Close();
 1183                Clip.UsdScene = null;
 1184                if (Clip.IsUSDZ)
 0185                {
 0186                    SdfAssetPath assetPath = new SdfAssetPath(usdcFileName);
 0187                    bool success = pxr.UsdCs.UsdUtilsCreateNewARKitUsdzPackage(assetPath, usdzFileName);
 188
 0189                    if (!success)
 0190                    {
 0191                        Debug.LogError("Couldn't export " + _root.name + " to the usdz file: " + usdzFilePath);
 0192                        return;
 193                    }
 194
 195                    // needed if we export into temp folder first
 0196                    File.Copy(usdzFileName, usdzFilePath, overwrite: true);
 0197                }
 1198            }
 199            finally
 1200            {
 201                // Clean up temp files.
 1202                Directory.SetCurrentDirectory(currentDir);
 1203                if (Clip.IsUSDZ && usdzTemporaryDir != null && usdzTemporaryDir.Exists)
 0204                {
 0205                    usdzTemporaryDir.Delete(recursive: true);
 0206                }
 1207            }
 2208        }
 209
 210        void ProcessRecording(double currentTime, GameObject root)
 67211        {
 67212            if (!root || m_isPaused)
 0213            {
 0214                return;
 215            }
 216
 67217            if (Clip.UsdScene == null)
 0218            {
 0219                Debug.LogError("Process: clip.scene is null");
 0220            }
 221
 67222            if (Clip.Context.scene == null)
 0223            {
 0224                Debug.LogError("Process: context.scene is null");
 0225            }
 226
 67227            Clip.UsdScene.Time = currentTime * kExportFrameRate;
 67228            Clip.Context.exportMaterials = false;
 67229            SceneExporter.Export(root, Clip.Context, zeroRootTransform: false);
 67230        }
 231
 232        bool IsPlaying()
 70233        {
 234#if UNITY_EDITOR
 70235            return EditorApplication.isPlaying;
 236#else
 237            return true;
 238#endif
 70239        }
 240
 241        // ------------------------------------------------------------------------------------------ //
 242        // Timeline Events.
 243        // ------------------------------------------------------------------------------------------ //
 244
 245        public override void OnPlayableCreate(Playable playable)
 1246        {
 1247        }
 248
 249        public override void OnPlayableDestroy(Playable playable)
 1250        {
 1251            if (!IsPlaying())
 0252            {
 0253                return;
 254            }
 255
 1256            StopRecording(playable.GetTime());
 1257        }
 258
 259        public override void OnGraphStart(Playable playable)
 1260        {
 1261            if (!IsPlaying())
 0262            {
 0263                return;
 264            }
 265
 1266            BeginRecording(playable.GetTime(), Clip.GetExportRoot(playable.GetGraph()));
 1267        }
 268
 269        public override void OnGraphStop(Playable playable)
 1270        {
 1271            if (!IsPlaying())
 0272            {
 0273                return;
 274            }
 275
 1276            StopRecording(playable.GetTime());
 1277        }
 278
 279        public override void ProcessFrame(Playable playable, FrameData info, object playerData)
 67280        {
 67281            if (!IsPlaying())
 0282            {
 0283                return;
 284            }
 285
 67286            var frameRate = Time.captureFramerate;
 67287            if (frameRate < 1)
 0288            {
 0289                frameRate = Application.targetFrameRate;
 0290            }
 291
 134292            UsdWaitForEndOfFrame.Add(() => OnFrameEnd(playable, info, playerData));
 67293        }
 294
 295        public override void OnBehaviourPlay(Playable playable, FrameData info)
 1296        {
 1297            m_isPaused = false;
 1298        }
 299
 300        public override void OnBehaviourPause(Playable playable, FrameData info)
 2301        {
 2302            m_isPaused = true;
 2303        }
 304
 305        public void OnFrameEnd(Playable playable, FrameData info, object playerData)
 67306        {
 67307            if (!playable.IsValid())
 0308            {
 0309                return;
 310            }
 311
 67312            ProcessRecording(playable.GetTime(), Clip.GetExportRoot(playable.GetGraph()));
 67313        }
 314    }
 315}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderClip.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderClip.html new file mode 100644 index 000000000..7d18ad2d8 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdRecorderClip.html @@ -0,0 +1,186 @@ + + + + + + +Unity.Formats.USD.UsdRecorderClip - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdRecorderClip
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdRecorderClip.cs
Covered lines:19
Uncovered lines:2
Coverable lines:21
Total lines:72
Line coverage:90.4% (19 of 21)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdRecorderClip()0%000100%
GetExportRoot(...)0%000100%
CreatePlayable(...)0%000100%
OnDestroy()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdRecorderClip.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2019 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using UnityEngine.Playables;
 17using UnityEngine.Timeline;
 18using USD.NET;
 19
 20namespace Unity.Formats.USD
 21{
 22    [System.ComponentModel.DisplayName("USD Recorder Clip")]
 23    public class UsdRecorderClip : PlayableAsset, ITimelineClipAsset
 24    {
 25        // The root GameObject to export to USD.
 26        public ExposedReference<GameObject> m_exportRoot;
 27        private GameObject[] m_trackedRoots;
 28
 129        public bool m_exportMaterials = true;
 130        public BasisTransformation m_convertHandedness = BasisTransformation.SlowAndSafe;
 131        public ActiveExportPolicy m_activePolicy = ActiveExportPolicy.ExportAsVisibility;
 32
 33        // The path to where the USD file will be written.
 34        // If null/empty, the file will be created in memory only.
 135        public string m_usdFile = "Assets/recording.usd";
 36
 37        // The scene object to which the recording will be saved.
 14738        public Scene UsdScene { get; set; }
 39
 140        ExportContext m_context = new ExportContext();
 41
 42        public ExportContext Context
 43        {
 62444            get { return m_context; }
 645            set { m_context = value; }
 46        }
 47
 48        public GameObject GetExportRoot(PlayableGraph graph)
 6849        {
 6850            return m_exportRoot.Resolve(graph.GetResolver());
 6851        }
 52
 53        public ClipCaps clipCaps
 54        {
 161755            get { return ClipCaps.None; }
 56        }
 57
 558        public bool IsUSDZ => !string.IsNullOrEmpty(m_usdFile) && m_usdFile.ToLowerInvariant().EndsWith(".usdz");
 59
 60        public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
 161        {
 162            var ret = ScriptPlayable<UsdRecorderBehaviour>.Create(graph);
 163            var behaviour = ret.GetBehaviour();
 164            behaviour.Clip = this;
 165            return ret;
 166        }
 67
 68        public virtual void OnDestroy()
 069        {
 070        }
 71    }
 72}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdVariantSet.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdVariantSet.html new file mode 100644 index 000000000..91200f310 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdVariantSet.html @@ -0,0 +1,198 @@ + + + + + + +Unity.Formats.USD.UsdVariantSet - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdVariantSet
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdVariantSet.cs
Covered lines:18
Uncovered lines:4
Coverable lines:22
Total lines:92
Line coverage:81.8% (18 of 22)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LoadFromUsd(...)0%000100%
ApplyVariantSelections()0%0000%
GetVariantSelections()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Behaviors/UsdVariantSet.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using System.Linq;
 17using UnityEngine;
 18
 19namespace Unity.Formats.USD
 20{
 21    /// <summary>
 22    /// Represents one or more USD variant sets. This object holds slection state and exposes
 23    /// access to the current selection as well as an API to apply selection changes (used by the
 24    /// editor).
 25    /// </summary>
 26    /// <remarks>
 27    /// Note that a singe asset can have multiple variant sets and each is independent. For example,
 28    /// the modelingVariant set may have two variants: CupWithHandle and CupWithoutHandle, while the
 29    /// shadingVariant set may have three variants: Red, Green, Blue. The full outer product of all
 30    /// variant selections is possible, e.g. Red, Green, or Blue CupWithHandle and Red, Green, or Blue
 31    /// CupWithoutHandle.
 32    ///
 33    /// For more details on USD variant sets and selections, see:
 34    /// https://graphics.pixar.com/usd/docs/USD-Glossary.html#USDGlossary-VariantSet
 35    /// </remarks>
 36    public class UsdVariantSet : MonoBehaviour
 37    {
 38        public string[] m_variantSetNames;
 39        public string[] m_selected;
 40        public string[] m_variants;
 41        public int[] m_variantCounts;
 42        public string m_primPath;
 43
 44        /// <summary>
 45        /// Loads the variant sets and selection state from USD into the UsdVariantSet behaviour.
 46        /// </summary>
 47        public void LoadFromUsd(pxr.UsdPrim prim)
 2348        {
 2349            var variantSets = prim.GetVariantSets();
 2350            var setNames = variantSets.GetNames();
 2351            m_variantSetNames = setNames.ToArray();
 4652            m_selected = m_variantSetNames.Select(setName => variantSets.GetVariantSelection(setName)).ToArray();
 4653            m_variants = m_variantSetNames.SelectMany(setName => variantSets.GetVariantSet(setName).GetVariantNames())
 54                .ToArray();
 2355            m_variantCounts = m_variantSetNames
 2356                .Select(setName => variantSets.GetVariantSet(setName).GetVariantNames().Count).ToArray();
 2357            m_primPath = prim.GetPath();
 2358        }
 59
 60        /// <summary>
 61        /// Syncs the current Unity state to USD and reimports any affected GameObjects. Note that this
 62        /// may result in the objects being destroyed and recreated.
 63        /// </summary>
 64        public void ApplyVariantSelections()
 065        {
 066            var stageRoot = GetComponentInParent<UsdAsset>();
 067            stageRoot.SetVariantSelection(gameObject, m_primPath, GetVariantSelections());
 068        }
 69
 70        /// <summary>
 71        /// Returns a collection of VariantSetName -> ActiveVariantSelectionName, which represents the
 72        /// active variant selection at the prim associated with this behaviour.
 73        /// </summary>
 74        /// <example>
 75        /// If two sets with selections are modelingVariant=CupWithHandle and shadingVariant=BrightBlue,
 76        /// resulting in a bright blue cup with a handle. In this example, the selections dictionary
 77        /// would contain:
 78        ///  { "modelingVariant" = "CupWithHandle",
 79        ///    "shadingVariant" = "BrightBlue" }
 80        /// </example>
 81        public Dictionary<string, string> GetVariantSelections()
 182        {
 183            var selections = new Dictionary<string, string>();
 484            for (int i = 0; i < m_variantSetNames.Length; i++)
 185            {
 186                selections.Add(m_variantSetNames[i], m_selected[i]);
 187            }
 88
 189            return selections;
 190        }
 91    }
 92}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdWaitForEndOfFrame.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdWaitForEndOfFrame.html new file mode 100644 index 000000000..dd7079ec7 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdWaitForEndOfFrame.html @@ -0,0 +1,188 @@ + + + + + + +Unity.Formats.USD.UsdWaitForEndOfFrame - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdWaitForEndOfFrame
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdWaitForEndOfFrame.cs
Covered lines:31
Uncovered lines:4
Coverable lines:35
Total lines:78
Line coverage:88.5% (31 of 35)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
UsdWaitForEndOfFrame()0%000100%
GetInstance()0%000100%
Add(...)0%000100%
WaitForEndOfFrame()0%00076.47%
LateUpdate()0%000100%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/Timeline/UsdWaitForEndOfFrame.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2019 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections;
 17using System.Collections.Generic;
 18using UnityEngine;
 19
 20namespace Unity.Formats.USD
 21{
 22    [ExecuteInEditMode]
 23    class UsdWaitForEndOfFrame : MonoBehaviour
 24    {
 125        List<Action> m_pending = new List<Action>();
 26
 27        static UsdWaitForEndOfFrame s_instance;
 28
 29        static UsdWaitForEndOfFrame GetInstance()
 6730        {
 6731            if (s_instance == null)
 132            {
 33#if UNITY_2023_1_OR_NEWER
 34                s_instance = GameObject.FindAnyObjectByType<UsdWaitForEndOfFrame>();
 35#else
 136                s_instance = GameObject.FindObjectOfType<UsdWaitForEndOfFrame>();
 37#endif
 138                if (s_instance == null)
 139                {
 140                    var go = new GameObject();
 141                    go.name = "UsdRecorderHelper";
 142                    go.hideFlags = HideFlags.HideAndDontSave;
 143                    s_instance = go.AddComponent<UsdWaitForEndOfFrame>();
 144                }
 145            }
 46
 6747            return s_instance;
 6748        }
 49
 50        public static void Add(Action callback)
 6751        {
 6752            GetInstance().m_pending.Add(callback);
 6753        }
 54
 55        IEnumerator WaitForEndOfFrame()
 66856        {
 66857            yield return new WaitForEndOfFrame();
 121158            foreach (var callback in m_pending)
 6759            {
 60                try
 6761                {
 6762                    callback();
 6763                }
 064                catch (Exception ex)
 065                {
 066                    Debug.LogException(ex);
 067                }
 6768            }
 69
 35970            m_pending.Clear();
 35971        }
 72
 73        void LateUpdate()
 66874        {
 66875            StartCoroutine(WaitForEndOfFrame());
 66876        }
 77    }
 78}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdzExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdzExporter.html new file mode 100644 index 000000000..4496c2c92 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_UsdzExporter.html @@ -0,0 +1,197 @@ + + + + + + +Unity.Formats.USD.UsdzExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.UsdzExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/UsdzExporter.cs
Covered lines:0
Uncovered lines:34
Coverable lines:34
Total lines:95
Line coverage:0% (0 of 34)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportUsdz(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Scene/UsdzExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.IO;
 16using UnityEngine;
 17using USD.NET;
 18using pxr;
 19
 20namespace Unity.Formats.USD
 21{
 22    public class UsdzExporter
 23    {
 24        public static void ExportUsdz(string usdzFilePath,
 25            GameObject root)
 026        {
 27            // Ensure USD is initialized before changing CWD.
 28            // This does not protect us against external changes to CWD, so we are actively looking for
 29            // a more robust solution with UPM devs.
 030            InitUsd.Initialize();
 31
 32            // Keep the current directory to restore it at the end.
 033            var currentDir = Directory.GetCurrentDirectory();
 34
 35            // Setup a temporary directory to export the wanted USD file and zip it.
 036            string tmpDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
 037            DirectoryInfo tmpDir = Directory.CreateDirectory(tmpDirPath);
 38
 39            // Get the usd file name to export and the usdz file name of the archive.
 040            string usdcFileName = Path.GetFileNameWithoutExtension(usdzFilePath) + ".usdc";
 041            string usdzFileName = Path.GetFileName(usdzFilePath);
 42
 43            try
 044            {
 45                // Set the current working directory to the tmp directory to export with relative paths.
 046                Directory.SetCurrentDirectory(tmpDirPath);
 47
 48                // Create the tmp .usd scene, into which the data will be exported.
 049                Scene scene = ExportHelpers.InitForSave(Path.Combine(tmpDirPath, usdcFileName));
 050                Vector3 localScale = root.transform.localScale;
 51
 52                try
 053                {
 54                    // USDZ is in centimeters.
 055                    root.transform.localScale = localScale * 100;
 56
 57                    // Export the temp scene.
 058                    SceneExporter.Export(root,
 59                        scene,
 60                        BasisTransformation.SlowAndSafe, // Required by ARKit
 61                        exportUnvarying: true,
 62                        zeroRootTransform: false,
 63                        exportMaterials: true);
 064                }
 65                finally
 066                {
 67                    // Undo temp scale.
 068                    root.transform.localScale = localScale;
 69
 70                    // Flush any in-flight edits and release the scene so the file can be deleted.
 071                    scene.Save();
 072                    scene.Close();
 073                    scene = null;
 074                }
 75
 076                SdfAssetPath assetPath = new SdfAssetPath(usdcFileName);
 077                bool success = pxr.UsdCs.UsdUtilsCreateNewARKitUsdzPackage(assetPath, usdzFileName);
 78
 079                if (!success)
 080                {
 081                    Debug.LogError("Couldn't export " + root.name + " to the usdz file: " + usdzFilePath);
 082                    return;
 83                }
 84
 085                File.Copy(usdzFileName, usdzFilePath, overwrite: true);
 086            }
 87            finally
 088            {
 89                // Clean up temp files.
 090                Directory.SetCurrentDirectory(currentDir);
 091                tmpDir.Delete(recursive: true);
 092            }
 093        }
 94    }
 95}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformExporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformExporter.html new file mode 100644 index 000000000..ce2d7856f --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformExporter.html @@ -0,0 +1,251 @@ + + + + + + +Unity.Formats.USD.XformExporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.XformExporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/XformExporter.cs
Covered lines:25
Uncovered lines:44
Coverable lines:69
Total lines:145
Line coverage:36.2% (25 of 69)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ExportXform(...)0%000100%
WriteSparseOverrides(...)0%0000%
GetLocalTransformMatrix(...)0%00057.14%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/XformExporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using UnityEngine;
 16using USD.NET;
 17using USD.NET.Unity;
 18
 19namespace Unity.Formats.USD
 20{
 21    public static class XformExporter
 22    {
 23        public static void ExportXform(ObjectContext objContext, ExportContext exportContext)
 224        {
 225            UnityEngine.Profiling.Profiler.BeginSample("USD: Xform Conversion");
 26
 227            XformSample sample = (XformSample)objContext.sample;
 228            var localRot = objContext.gameObject.transform.localRotation;
 229            var localScale = objContext.gameObject.transform.localScale;
 230            var path = new pxr.SdfPath(objContext.path);
 31
 32            // If exporting for Z-Up, rotate the world.
 233            bool correctZUp = exportContext.scene.UpAxis == Scene.UpAxes.Z;
 34
 235            sample.transform = GetLocalTransformMatrix(
 36                objContext.gameObject.transform,
 37                correctZUp,
 38                path.IsRootPrimPath(),
 39                exportContext.basisTransform);
 40
 241            UnityEngine.Profiling.Profiler.EndSample();
 42
 243            UnityEngine.Profiling.Profiler.BeginSample("USD: Xform Write");
 244            exportContext.scene.Write(objContext.path, sample);
 245            UnityEngine.Profiling.Profiler.EndSample();
 246        }
 47
 48        public static void WriteSparseOverrides(Scene scene,
 49            PrimMap primMap,
 50            BasisTransformation changeHandedness,
 51            float tolerance = 0.0001f)
 052        {
 053            var oldMode = scene.WriteMode;
 054            scene.WriteMode = Scene.WriteModes.Over;
 55
 56            try
 057            {
 058                foreach (var path in scene.Find<XformableSample>())
 059                {
 60                    GameObject go;
 061                    if (!primMap.TryGetValue(path, out go))
 062                    {
 063                        continue;
 64                    }
 65
 066                    var tx = go.transform;
 067                    var xfNew = XformSample.FromTransform(tx);
 068                    var xfOld = new XformSample();
 69
 070                    scene.Read(path, xfOld);
 71
 072                    bool areClose = true;
 073                    for (int i = 0; i < 16; i++)
 074                    {
 075                        if (Mathf.Abs(xfNew.transform[i] - xfOld.transform[i]) > tolerance)
 076                        {
 077                            areClose = false;
 078                            break;
 79                        }
 080                    }
 81
 082                    if (areClose)
 083                    {
 084                        continue;
 85                    }
 86
 087                    if (changeHandedness == BasisTransformation.SlowAndSafe)
 088                    {
 089                        xfNew.ConvertTransform();
 090                    }
 91
 092                    scene.Write(path, xfNew);
 093                }
 094            }
 95            finally
 096            {
 097                scene.WriteMode = oldMode;
 098            }
 099        }
 100
 101        public static Matrix4x4 GetLocalTransformMatrix(
 102            Transform tr,
 103            bool correctZUp,
 104            bool isRootPrim,
 105            BasisTransformation conversionType)
 220106        {
 220107            var localRot = tr.localRotation;
 220108            bool fastConvert = conversionType == BasisTransformation.FastWithNegativeScale;
 109
 220110            if (correctZUp && isRootPrim)
 0111            {
 0112                float invert = fastConvert ? 1 : -1;
 0113                localRot = localRot * Quaternion.AngleAxis(invert * 90, Vector3.right);
 0114            }
 115
 220116            var mat = Matrix4x4.TRS(tr.localPosition, localRot, tr.localScale);
 117
 118            // Unity uses a forward vector that matches DirectX, but USD matches OpenGL, so a change of
 119            // basis is required. There are shortcuts, but this is fully general.
 120            //
 121            // Here we can either put a partial conversion at the root (fast & dangerous) or convert the
 122            // entire hierarchy, along with the points, normals and triangle winding. The benefit of the
 123            // full conversion is that there are no negative scales left in the hierarchy.
 124            //
 125            // Note that this is the correct partial conversion for the root transforms, however the
 126            // camera and light matrices must contain the other half of the conversion
 127            // (e.g. mat * basisChangeInverse).
 220128            if (fastConvert && isRootPrim)
 0129            {
 130                // Partial change of basis.
 0131                var basisChange = Matrix4x4.identity;
 132                // Invert the forward vector.
 0133                basisChange[2, 2] = -1;
 0134                mat = basisChange * mat;
 0135            }
 220136            else if (!fastConvert)
 220137            {
 138                // Full change of basis.
 220139                mat = UnityTypeConverter.ChangeBasis(mat);
 220140            }
 141
 220142            return mat;
 220143        }
 144    }
 145}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformImporter.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformImporter.html new file mode 100644 index 000000000..11ce1e8ae --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.Runtime_XformImporter.html @@ -0,0 +1,306 @@ + + + + + + +Unity.Formats.USD.XformImporter - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.XformImporter
Assembly:Unity.Formats.USD.Runtime
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/XformImporter.cs
Covered lines:59
Uncovered lines:39
Coverable lines:98
Total lines:196
Line coverage:60.2% (59 of 98)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BuildXform(...)0%00036.36%
BuildXform(...)0%00078.57%
ImportXform(...)0%00066.67%
BuildSceneRoot(...)0%00081.63%
UndoRootTransform(...)0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Runtime/Scripts/IO/Geometry/XformImporter.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2018 Jeremy Cowles. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System.Collections.Generic;
 16using UnityEngine;
 17using USD.NET;
 18using USD.NET.Unity;
 19
 20namespace Unity.Formats.USD
 21{
 22    /// <summary>
 23    /// A collection of methods used for importing USD Xform data into Unity.
 24    /// </summary>
 25    public static class XformImporter
 26    {
 27        #region "Import API"
 28
 29        /// <summary>
 30        /// Copies the transform value from USD to Unity, optionally changing handedness in the
 31        /// process.
 32        /// </summary>
 33        public static void BuildXform(pxr.SdfPath path,
 34            XformableSample usdXf,
 35            GameObject go,
 36            SceneImportOptions options,
 37            Scene scene)
 26738        {
 39            // If there is an access mask and it's not initially being populated, check to see if the
 40            // transform for this object actually varies over time, if not, we can simply return.
 26741            if (scene.AccessMask != null && !scene.IsPopulatingAccessMask)
 042            {
 043                System.Reflection.MemberInfo transformMember = null;
 044                transformMember = usdXf.GetType().GetMember("transform")[0];
 45                HashSet<System.Reflection.MemberInfo> members;
 046                if (!scene.AccessMask.Included.TryGetValue(path, out members) ||
 47                    !members.Contains(transformMember))
 048                {
 049                    return;
 50                }
 051            }
 52
 26753            BuildXform(usdXf.transform, go, options);
 26754        }
 55
 56        public static void BuildXform(Matrix4x4 xf,
 57            GameObject go,
 58            SceneImportOptions options)
 46759        {
 60            Vector3 localPos;
 61            Quaternion localRot;
 62            Vector3 localScale;
 63
 46764            UnityEngine.Profiling.Profiler.BeginSample("Decompose Matrix");
 46765            bool success = UnityTypeConverter.Decompose(xf, out localPos, out localRot, out localScale);
 46766            UnityEngine.Profiling.Profiler.EndSample();
 67
 46768            if (!success)
 069            {
 070                Debug.LogError("Non-decomposable transform matrix for " + go.name);
 071                return;
 72            }
 73
 46774            UnityEngine.Profiling.Profiler.BeginSample("Assign Values");
 46775            go.transform.localPosition = localPos;
 46776            go.transform.localScale = localScale;
 46777            go.transform.localRotation = localRot;
 46778            UnityEngine.Profiling.Profiler.EndSample();
 46779        }
 80
 81        /// <summary>
 82        /// Imports a matrix transform, correctly handling the change of basis.
 83        /// </summary>
 84        public static void ImportXform(ref Matrix4x4 mat, SceneImportOptions options)
 3085        {
 3086            if (options.changeHandedness == BasisTransformation.FastWithNegativeScale)
 087            {
 088                return;
 89            }
 90
 3091            mat = UnityTypeConverter.ChangeBasis(mat);
 3092        }
 93
 94        /// <summary>
 95        /// Build the root of a scene under which more USD data will be imported. If the handedness
 96        /// is changed here, no subsequent changes are required below, however the root will contain
 97        /// a negative scale.
 98        /// </summary>
 99        public static void BuildSceneRoot(Scene scene, Transform root, SceneImportOptions options)
 72100        {
 72101            var stageRoot = root.GetComponent<UsdAsset>();
 72102            bool newStageRoot = false;
 103
 72104            if (stageRoot == null)
 56105            {
 56106                stageRoot = root.gameObject.AddComponent<UsdAsset>();
 56107                stageRoot.usdFullPath = scene.FilePath;
 56108                newStageRoot = true;
 56109                ImporterBase.MoveComponentFirst(stageRoot);
 56110                stageRoot.OptionsToState(options);
 56111            }
 112
 72113            if (newStageRoot
 114                || options.changeHandedness != stageRoot.LastHandedness
 115                || options.scale != stageRoot.LastScale
 116                || options.forceRebuild)
 69117            {
 69118                var localScale = root.transform.localScale;
 69119                var localRotation = root.transform.localRotation;
 120
 69121                if (options.forceRebuild)
 13122                {
 13123                    localScale = Vector3.one;
 13124                    localRotation = Quaternion.identity;
 13125                }
 56126                else if (!newStageRoot)
 0127                {
 128                    // Undo the previous transforms.
 0129                    UndoRootTransform(scene, stageRoot, ref localScale, ref localRotation);
 0130                }
 131
 69132                stageRoot.LastScale = options.scale;
 69133                stageRoot.LastHandedness = options.changeHandedness;
 134
 135                // Handle configurable up-axis (Y or Z).
 69136                float invert = options.changeHandedness == BasisTransformation.FastWithNegativeScale ? -1 : 1;
 69137                if (scene.UpAxis == Scene.UpAxes.Z)
 0138                {
 0139                    localRotation *= Quaternion.AngleAxis(invert * 90, Vector3.right);
 0140                }
 141
 69142                if (options.changeHandedness == BasisTransformation.FastWithNegativeScale)
 4143                {
 144                    // Convert from right-handed (USD) to left-handed (Unity).
 4145                    if (scene.UpAxis == Scene.UpAxes.Z)
 0146                    {
 0147                        localScale.y *= -1;
 0148                    }
 149                    else
 4150                    {
 4151                        localScale.z *= -1;
 4152                    }
 4153                }
 154
 69155                if (Mathf.Abs(options.scale - 1.0f) > 0.0001)
 14156                {
 157                    // Unilaterally setting the scale here is a little wrong, since it will stomp the root
 158                    // object scale if set in Unity.
 14159                    localScale *= options.scale;
 14160                }
 161
 69162                root.transform.localScale = localScale;
 69163                root.transform.localRotation = localRotation;
 69164            }
 72165        }
 166
 167        public static void UndoRootTransform(Scene scene,
 168            UsdAsset stageRoot,
 169            ref Vector3 localScale,
 170            ref Quaternion localRotation)
 0171        {
 0172            localScale /= stageRoot.LastScale;
 173
 0174            float invertPrev = stageRoot.LastHandedness == BasisTransformation.FastWithNegativeScale ? -1 : 1;
 0175            if (scene.UpAxis == Scene.UpAxes.Z)
 0176            {
 0177                localRotation *= Quaternion.AngleAxis(-1 * invertPrev * 90, Vector3.right);
 0178            }
 179
 0180            if (stageRoot.LastHandedness == BasisTransformation.FastWithNegativeScale)
 0181            {
 182                // Convert from right-handed (USD) to left-handed (Unity).
 0183                if (scene.UpAxis == Scene.UpAxes.Z)
 0184                {
 0185                    localScale.y *= -1;
 0186                }
 187                else
 0188                {
 0189                    localScale.z *= -1;
 0190                }
 0191            }
 0192        }
 193
 194        #endregion
 195    }
 196}
+
+
+ +
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.UsdTimelinePlayable_SetDefaultUSDMesh.html b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.UsdTimelinePlayable_SetDefaultUSDMesh.html new file mode 100644 index 000000000..f1bd4ed7f --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/Unity.Formats.USD.UsdTimelinePlayable_SetDefaultUSDMesh.html @@ -0,0 +1,140 @@ + + + + + + +Unity.Formats.USD.Examples.SetDefaultUSDMesh - Coverage Report + +
+

< Summary

+ ++++ + + + + + + + + + + + + +
Class:Unity.Formats.USD.Examples.SetDefaultUSDMesh
Assembly:Unity.Formats.USD.UsdTimelinePlayable
File(s):C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/UsdTimelinePlayable/SetDefaultUSDMesh.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:38
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0
+

Coverage History

+
+ +

Metrics

+ + + + + +
MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%0000%
+

File(s)

+

C:/UnitySrc/usd-unity-sdk/package/com.unity.formats.usd/Samples/UsdTimelinePlayable/SetDefaultUSDMesh.cs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#LineLine coverage
 1// Copyright 2017 Google Inc. All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using UnityEngine;
 17using System.IO;
 18using USD.NET;
 19
 20namespace Unity.Formats.USD.Examples
 21{
 22    /// <summary>Fill in a default USD Asset in case the user didn't choose one
 23    /// </summary>
 24    [ExecuteInEditMode, RequireComponent(typeof(UsdAsset))]
 25    public class SetDefaultUSDMesh : MonoBehaviour
 26    {
 27        private const string K_DEFAULT_MESH = "mesh.usd";
 28
 29        void Start()
 030        {
 031            var asset = GetComponent<UsdAsset>();
 032            if (string.IsNullOrEmpty(asset.usdFullPath))
 033            {
 034                asset.usdFullPath = Path.Combine(PackageUtils.GetCallerRelativeToProjectFolderPath(), K_DEFAULT_MESH);
 035            }
 036        }
 37    }
 38}
+
+
+
+

Methods/Properties

+Start()
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.png b/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.png new file mode 100644 index 000000000..1d320160d Binary files /dev/null and b/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.png differ diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.svg new file mode 100644 index 000000000..c9108aa92 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_branchcoverage.svg @@ -0,0 +1,88 @@ + + + Code coverage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generated by: ReportGenerator 4.8.9.0 + + + + Coverage + Coverage + + N/AN/A + + + + + Branch coverage + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_combined.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_combined.svg new file mode 100644 index 000000000..02f488f07 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_combined.svg @@ -0,0 +1,88 @@ + + + Code coverage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generated by: ReportGenerator 4.8.9.0 + + + + Coverage + Coverage + 38.5%38.5% + N/AN/A + + + + Line coverage + Branch coverage + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.png b/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.png new file mode 100644 index 000000000..d6044227c Binary files /dev/null and b/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.png differ diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.svg new file mode 100644 index 000000000..e7f0bb3b1 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_linecoverage.svg @@ -0,0 +1,88 @@ + + + Code coverage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Generated by: ReportGenerator 4.8.9.0 + + + + Coverage + Coverage + 38.5%38.5% + + + + + Line coverage + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_blue.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_blue.svg new file mode 100644 index 000000000..1f979ee07 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_blue.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_brightgreen.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_brightgreen.svg new file mode 100644 index 000000000..557dd8e5f --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_brightgreen.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_green.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_green.svg new file mode 100644 index 000000000..4538e30fd --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_green.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_lightgrey.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_lightgrey.svg new file mode 100644 index 000000000..d37419bdc --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_lightgrey.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_orange.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_orange.svg new file mode 100644 index 000000000..da158f169 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_orange.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_red.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_red.svg new file mode 100644 index 000000000..37453a465 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_red.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellow.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellow.svg new file mode 100644 index 000000000..fe3812a0d --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellow.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellowgreen.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellowgreen.svg new file mode 100644 index 000000000..45c827d8d --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_branchcoverage_yellowgreen.svg @@ -0,0 +1 @@ + coveragecoverage100%N/A \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_blue.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_blue.svg new file mode 100644 index 000000000..5d6875473 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_blue.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_brightgreen.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_brightgreen.svg new file mode 100644 index 000000000..db0cb0010 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_brightgreen.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_green.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_green.svg new file mode 100644 index 000000000..668047610 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_green.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_lightgrey.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_lightgrey.svg new file mode 100644 index 000000000..f726f0aec --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_lightgrey.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_orange.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_orange.svg new file mode 100644 index 000000000..eac6cf4d1 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_orange.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_red.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_red.svg new file mode 100644 index 000000000..d35b17347 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_red.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellow.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellow.svg new file mode 100644 index 000000000..5fc81e2c1 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellow.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellowgreen.svg b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellowgreen.svg new file mode 100644 index 000000000..2fb5faf95 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/badge_shieldsio_linecoverage_yellowgreen.svg @@ -0,0 +1 @@ + coveragecoverage100%38% \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/class.js b/TestProject/Usd-Development/CodeCoverage/Report/class.js new file mode 100644 index 000000000..dafc9a5cd --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/class.js @@ -0,0 +1,221 @@ +/* Chartist.js 0.11.0 + * Copyright © 2017 Gion Kunz + * Free to use under either the WTFPL license or the MIT license. + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT + */ + +!function (a, b) { "function" == typeof define && define.amd ? define("Chartist", [], function () { return a.Chartist = b() }) : "object" == typeof module && module.exports ? module.exports = b() : a.Chartist = b() }(this, function () { + var a = { version: "0.11.0" }; return function (a, b, c) { "use strict"; c.namespaces = { svg: "http://www.w3.org/2000/svg", xmlns: "http://www.w3.org/2000/xmlns/", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", ct: "http://gionkunz.github.com/chartist-js/ct" }, c.noop = function (a) { return a }, c.alphaNumerate = function (a) { return String.fromCharCode(97 + a % 26) }, c.extend = function (a) { var b, d, e; for (a = a || {}, b = 1; b < arguments.length; b++) { d = arguments[b]; for (var f in d) e = d[f], "object" != typeof e || null === e || e instanceof Array ? a[f] = e : a[f] = c.extend(a[f], e) } return a }, c.replaceAll = function (a, b, c) { return a.replace(new RegExp(b, "g"), c) }, c.ensureUnit = function (a, b) { return "number" == typeof a && (a += b), a }, c.quantity = function (a) { if ("string" == typeof a) { var b = /^(\d+)\s*(.*)$/g.exec(a); return { value: +b[1], unit: b[2] || void 0 } } return { value: a } }, c.querySelector = function (a) { return a instanceof Node ? a : b.querySelector(a) }, c.times = function (a) { return Array.apply(null, new Array(a)) }, c.sum = function (a, b) { return a + (b ? b : 0) }, c.mapMultiply = function (a) { return function (b) { return b * a } }, c.mapAdd = function (a) { return function (b) { return b + a } }, c.serialMap = function (a, b) { var d = [], e = Math.max.apply(null, a.map(function (a) { return a.length })); return c.times(e).forEach(function (c, e) { var f = a.map(function (a) { return a[e] }); d[e] = b.apply(null, f) }), d }, c.roundWithPrecision = function (a, b) { var d = Math.pow(10, b || c.precision); return Math.round(a * d) / d }, c.precision = 8, c.escapingMap = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, c.serialize = function (a) { return null === a || void 0 === a ? a : ("number" == typeof a ? a = "" + a : "object" == typeof a && (a = JSON.stringify({ data: a })), Object.keys(c.escapingMap).reduce(function (a, b) { return c.replaceAll(a, b, c.escapingMap[b]) }, a)) }, c.deserialize = function (a) { if ("string" != typeof a) return a; a = Object.keys(c.escapingMap).reduce(function (a, b) { return c.replaceAll(a, c.escapingMap[b], b) }, a); try { a = JSON.parse(a), a = void 0 !== a.data ? a.data : a } catch (b) { } return a }, c.createSvg = function (a, b, d, e) { var f; return b = b || "100%", d = d || "100%", Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function (a) { return a.getAttributeNS(c.namespaces.xmlns, "ct") }).forEach(function (b) { a.removeChild(b) }), f = new c.Svg("svg").attr({ width: b, height: d }).addClass(e), f._node.style.width = b, f._node.style.height = d, a.appendChild(f._node), f }, c.normalizeData = function (a, b, d) { var e, f = { raw: a, normalized: {} }; return f.normalized.series = c.getDataArray({ series: a.series || [] }, b, d), e = f.normalized.series.every(function (a) { return a instanceof Array }) ? Math.max.apply(null, f.normalized.series.map(function (a) { return a.length })) : f.normalized.series.length, f.normalized.labels = (a.labels || []).slice(), Array.prototype.push.apply(f.normalized.labels, c.times(Math.max(0, e - f.normalized.labels.length)).map(function () { return "" })), b && c.reverseData(f.normalized), f }, c.safeHasProperty = function (a, b) { return null !== a && "object" == typeof a && a.hasOwnProperty(b) }, c.isDataHoleValue = function (a) { return null === a || void 0 === a || "number" == typeof a && isNaN(a) }, c.reverseData = function (a) { a.labels.reverse(), a.series.reverse(); for (var b = 0; b < a.series.length; b++)"object" == typeof a.series[b] && void 0 !== a.series[b].data ? a.series[b].data.reverse() : a.series[b] instanceof Array && a.series[b].reverse() }, c.getDataArray = function (a, b, d) { function e(a) { if (c.safeHasProperty(a, "value")) return e(a.value); if (c.safeHasProperty(a, "data")) return e(a.data); if (a instanceof Array) return a.map(e); if (!c.isDataHoleValue(a)) { if (d) { var b = {}; return "string" == typeof d ? b[d] = c.getNumberOrUndefined(a) : b.y = c.getNumberOrUndefined(a), b.x = a.hasOwnProperty("x") ? c.getNumberOrUndefined(a.x) : b.x, b.y = a.hasOwnProperty("y") ? c.getNumberOrUndefined(a.y) : b.y, b } return c.getNumberOrUndefined(a) } } return a.series.map(e) }, c.normalizePadding = function (a, b) { return b = b || 0, "number" == typeof a ? { top: a, right: a, bottom: a, left: a } : { top: "number" == typeof a.top ? a.top : b, right: "number" == typeof a.right ? a.right : b, bottom: "number" == typeof a.bottom ? a.bottom : b, left: "number" == typeof a.left ? a.left : b } }, c.getMetaData = function (a, b) { var c = a.data ? a.data[b] : a[b]; return c ? c.meta : void 0 }, c.orderOfMagnitude = function (a) { return Math.floor(Math.log(Math.abs(a)) / Math.LN10) }, c.projectLength = function (a, b, c) { return b / c.range * a }, c.getAvailableHeight = function (a, b) { return Math.max((c.quantity(b.height).value || a.height()) - (b.chartPadding.top + b.chartPadding.bottom) - b.axisX.offset, 0) }, c.getHighLow = function (a, b, d) { function e(a) { if (void 0 !== a) if (a instanceof Array) for (var b = 0; b < a.length; b++)e(a[b]); else { var c = d ? +a[d] : +a; g && c > f.high && (f.high = c), h && c < f.low && (f.low = c) } } b = c.extend({}, b, d ? b["axis" + d.toUpperCase()] : {}); var f = { high: void 0 === b.high ? -Number.MAX_VALUE : +b.high, low: void 0 === b.low ? Number.MAX_VALUE : +b.low }, g = void 0 === b.high, h = void 0 === b.low; return (g || h) && e(a), (b.referenceValue || 0 === b.referenceValue) && (f.high = Math.max(b.referenceValue, f.high), f.low = Math.min(b.referenceValue, f.low)), f.high <= f.low && (0 === f.low ? f.high = 1 : f.low < 0 ? f.high = 0 : f.high > 0 ? f.low = 0 : (f.high = 1, f.low = 0)), f }, c.isNumeric = function (a) { return null !== a && isFinite(a) }, c.isFalseyButZero = function (a) { return !a && 0 !== a }, c.getNumberOrUndefined = function (a) { return c.isNumeric(a) ? +a : void 0 }, c.isMultiValue = function (a) { return "object" == typeof a && ("x" in a || "y" in a) }, c.getMultiValue = function (a, b) { return c.isMultiValue(a) ? c.getNumberOrUndefined(a[b || "y"]) : c.getNumberOrUndefined(a) }, c.rho = function (a) { function b(a, c) { return a % c === 0 ? c : b(c, a % c) } function c(a) { return a * a + 1 } if (1 === a) return a; var d, e = 2, f = 2; if (a % 2 === 0) return 2; do e = c(e) % a, f = c(c(f)) % a, d = b(Math.abs(e - f), a); while (1 === d); return d }, c.getBounds = function (a, b, d, e) { function f(a, b) { return a === (a += b) && (a *= 1 + (b > 0 ? o : -o)), a } var g, h, i, j = 0, k = { high: b.high, low: b.low }; k.valueRange = k.high - k.low, k.oom = c.orderOfMagnitude(k.valueRange), k.step = Math.pow(10, k.oom), k.min = Math.floor(k.low / k.step) * k.step, k.max = Math.ceil(k.high / k.step) * k.step, k.range = k.max - k.min, k.numberOfSteps = Math.round(k.range / k.step); var l = c.projectLength(a, k.step, k), m = l < d, n = e ? c.rho(k.range) : 0; if (e && c.projectLength(a, 1, k) >= d) k.step = 1; else if (e && n < k.step && c.projectLength(a, n, k) >= d) k.step = n; else for (; ;) { if (m && c.projectLength(a, k.step, k) <= d) k.step *= 2; else { if (m || !(c.projectLength(a, k.step / 2, k) >= d)) break; if (k.step /= 2, e && k.step % 1 !== 0) { k.step *= 2; break } } if (j++ > 1e3) throw new Error("Exceeded maximum number of iterations while optimizing scale step!") } var o = 2.221e-16; for (k.step = Math.max(k.step, o), h = k.min, i = k.max; h + k.step <= k.low;)h = f(h, k.step); for (; i - k.step >= k.high;)i = f(i, -k.step); k.min = h, k.max = i, k.range = k.max - k.min; var p = []; for (g = k.min; g <= k.max; g = f(g, k.step)) { var q = c.roundWithPrecision(g); q !== p[p.length - 1] && p.push(q) } return k.values = p, k }, c.polarToCartesian = function (a, b, c, d) { var e = (d - 90) * Math.PI / 180; return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) } }, c.createChartRect = function (a, b, d) { var e = !(!b.axisX && !b.axisY), f = e ? b.axisY.offset : 0, g = e ? b.axisX.offset : 0, h = a.width() || c.quantity(b.width).value || 0, i = a.height() || c.quantity(b.height).value || 0, j = c.normalizePadding(b.chartPadding, d); h = Math.max(h, f + j.left + j.right), i = Math.max(i, g + j.top + j.bottom); var k = { padding: j, width: function () { return this.x2 - this.x1 }, height: function () { return this.y1 - this.y2 } }; return e ? ("start" === b.axisX.position ? (k.y2 = j.top + g, k.y1 = Math.max(i - j.bottom, k.y2 + 1)) : (k.y2 = j.top, k.y1 = Math.max(i - j.bottom - g, k.y2 + 1)), "start" === b.axisY.position ? (k.x1 = j.left + f, k.x2 = Math.max(h - j.right, k.x1 + 1)) : (k.x1 = j.left, k.x2 = Math.max(h - j.right - f, k.x1 + 1))) : (k.x1 = j.left, k.x2 = Math.max(h - j.right, k.x1 + 1), k.y2 = j.top, k.y1 = Math.max(i - j.bottom, k.y2 + 1)), k }, c.createGrid = function (a, b, d, e, f, g, h, i) { var j = {}; j[d.units.pos + "1"] = a, j[d.units.pos + "2"] = a, j[d.counterUnits.pos + "1"] = e, j[d.counterUnits.pos + "2"] = e + f; var k = g.elem("line", j, h.join(" ")); i.emit("draw", c.extend({ type: "grid", axis: d, index: b, group: g, element: k }, j)) }, c.createGridBackground = function (a, b, c, d) { var e = a.elem("rect", { x: b.x1, y: b.y2, width: b.width(), height: b.height() }, c, !0); d.emit("draw", { type: "gridBackground", group: a, element: e }) }, c.createLabel = function (a, d, e, f, g, h, i, j, k, l, m) { var n, o = {}; if (o[g.units.pos] = a + i[g.units.pos], o[g.counterUnits.pos] = i[g.counterUnits.pos], o[g.units.len] = d, o[g.counterUnits.len] = Math.max(0, h - 10), l) { var p = b.createElement("span"); p.className = k.join(" "), p.setAttribute("xmlns", c.namespaces.xhtml), p.innerText = f[e], p.style[g.units.len] = Math.round(o[g.units.len]) + "px", p.style[g.counterUnits.len] = Math.round(o[g.counterUnits.len]) + "px", n = j.foreignObject(p, c.extend({ style: "overflow: visible;" }, o)) } else n = j.elem("text", o, k.join(" ")).text(f[e]); m.emit("draw", c.extend({ type: "label", axis: g, index: e, group: j, element: n, text: f[e] }, o)) }, c.getSeriesOption = function (a, b, c) { if (a.name && b.series && b.series[a.name]) { var d = b.series[a.name]; return d.hasOwnProperty(c) ? d[c] : b[c] } return b[c] }, c.optionsProvider = function (b, d, e) { function f(b) { var f = h; if (h = c.extend({}, j), d) for (i = 0; i < d.length; i++) { var g = a.matchMedia(d[i][0]); g.matches && (h = c.extend(h, d[i][1])) } e && b && e.emit("optionsChanged", { previousOptions: f, currentOptions: h }) } function g() { k.forEach(function (a) { a.removeListener(f) }) } var h, i, j = c.extend({}, b), k = []; if (!a.matchMedia) throw "window.matchMedia not found! Make sure you're using a polyfill."; if (d) for (i = 0; i < d.length; i++) { var l = a.matchMedia(d[i][0]); l.addListener(f), k.push(l) } return f(), { removeMediaQueryListeners: g, getCurrentOptions: function () { return c.extend({}, h) } } }, c.splitIntoSegments = function (a, b, d) { var e = { increasingX: !1, fillHoles: !1 }; d = c.extend({}, e, d); for (var f = [], g = !0, h = 0; h < a.length; h += 2)void 0 === c.getMultiValue(b[h / 2].value) ? d.fillHoles || (g = !0) : (d.increasingX && h >= 2 && a[h] <= a[h - 2] && (g = !0), g && (f.push({ pathCoordinates: [], valueData: [] }), g = !1), f[f.length - 1].pathCoordinates.push(a[h], a[h + 1]), f[f.length - 1].valueData.push(b[h / 2])); return f } }(window, document, a), function (a, b, c) { "use strict"; c.Interpolation = {}, c.Interpolation.none = function (a) { var b = { fillHoles: !1 }; return a = c.extend({}, b, a), function (b, d) { for (var e = new c.Svg.Path, f = !0, g = 0; g < b.length; g += 2) { var h = b[g], i = b[g + 1], j = d[g / 2]; void 0 !== c.getMultiValue(j.value) ? (f ? e.move(h, i, !1, j) : e.line(h, i, !1, j), f = !1) : a.fillHoles || (f = !0) } return e } }, c.Interpolation.simple = function (a) { var b = { divisor: 2, fillHoles: !1 }; a = c.extend({}, b, a); var d = 1 / Math.max(1, a.divisor); return function (b, e) { for (var f, g, h, i = new c.Svg.Path, j = 0; j < b.length; j += 2) { var k = b[j], l = b[j + 1], m = (k - f) * d, n = e[j / 2]; void 0 !== n.value ? (void 0 === h ? i.move(k, l, !1, n) : i.curve(f + m, g, k - m, l, k, l, !1, n), f = k, g = l, h = n) : a.fillHoles || (f = k = h = void 0) } return i } }, c.Interpolation.cardinal = function (a) { var b = { tension: 1, fillHoles: !1 }; a = c.extend({}, b, a); var d = Math.min(1, Math.max(0, a.tension)), e = 1 - d; return function f(b, g) { var h = c.splitIntoSegments(b, g, { fillHoles: a.fillHoles }); if (h.length) { if (h.length > 1) { var i = []; return h.forEach(function (a) { i.push(f(a.pathCoordinates, a.valueData)) }), c.Svg.Path.join(i) } if (b = h[0].pathCoordinates, g = h[0].valueData, b.length <= 4) return c.Interpolation.none()(b, g); for (var j, k = (new c.Svg.Path).move(b[0], b[1], !1, g[0]), l = 0, m = b.length; m - 2 * !j > l; l += 2) { var n = [{ x: +b[l - 2], y: +b[l - 1] }, { x: +b[l], y: +b[l + 1] }, { x: +b[l + 2], y: +b[l + 3] }, { x: +b[l + 4], y: +b[l + 5] }]; j ? l ? m - 4 === l ? n[3] = { x: +b[0], y: +b[1] } : m - 2 === l && (n[2] = { x: +b[0], y: +b[1] }, n[3] = { x: +b[2], y: +b[3] }) : n[0] = { x: +b[m - 2], y: +b[m - 1] } : m - 4 === l ? n[3] = n[2] : l || (n[0] = { x: +b[l], y: +b[l + 1] }), k.curve(d * (-n[0].x + 6 * n[1].x + n[2].x) / 6 + e * n[2].x, d * (-n[0].y + 6 * n[1].y + n[2].y) / 6 + e * n[2].y, d * (n[1].x + 6 * n[2].x - n[3].x) / 6 + e * n[2].x, d * (n[1].y + 6 * n[2].y - n[3].y) / 6 + e * n[2].y, n[2].x, n[2].y, !1, g[(l + 2) / 2]) } return k } return c.Interpolation.none()([]) } }, c.Interpolation.monotoneCubic = function (a) { var b = { fillHoles: !1 }; return a = c.extend({}, b, a), function d(b, e) { var f = c.splitIntoSegments(b, e, { fillHoles: a.fillHoles, increasingX: !0 }); if (f.length) { if (f.length > 1) { var g = []; return f.forEach(function (a) { g.push(d(a.pathCoordinates, a.valueData)) }), c.Svg.Path.join(g) } if (b = f[0].pathCoordinates, e = f[0].valueData, b.length <= 4) return c.Interpolation.none()(b, e); var h, i, j = [], k = [], l = b.length / 2, m = [], n = [], o = [], p = []; for (h = 0; h < l; h++)j[h] = b[2 * h], k[h] = b[2 * h + 1]; for (h = 0; h < l - 1; h++)o[h] = k[h + 1] - k[h], p[h] = j[h + 1] - j[h], n[h] = o[h] / p[h]; for (m[0] = n[0], m[l - 1] = n[l - 2], h = 1; h < l - 1; h++)0 === n[h] || 0 === n[h - 1] || n[h - 1] > 0 != n[h] > 0 ? m[h] = 0 : (m[h] = 3 * (p[h - 1] + p[h]) / ((2 * p[h] + p[h - 1]) / n[h - 1] + (p[h] + 2 * p[h - 1]) / n[h]), isFinite(m[h]) || (m[h] = 0)); for (i = (new c.Svg.Path).move(j[0], k[0], !1, e[0]), h = 0; h < l - 1; h++)i.curve(j[h] + p[h] / 3, k[h] + m[h] * p[h] / 3, j[h + 1] - p[h] / 3, k[h + 1] - m[h + 1] * p[h] / 3, j[h + 1], k[h + 1], !1, e[h + 1]); return i } return c.Interpolation.none()([]) } }, c.Interpolation.step = function (a) { var b = { postpone: !0, fillHoles: !1 }; return a = c.extend({}, b, a), function (b, d) { for (var e, f, g, h = new c.Svg.Path, i = 0; i < b.length; i += 2) { var j = b[i], k = b[i + 1], l = d[i / 2]; void 0 !== l.value ? (void 0 === g ? h.move(j, k, !1, l) : (a.postpone ? h.line(j, f, !1, g) : h.line(e, k, !1, l), h.line(j, k, !1, l)), e = j, f = k, g = l) : a.fillHoles || (e = f = g = void 0) } return h } } }(window, document, a), function (a, b, c) { "use strict"; c.EventEmitter = function () { function a(a, b) { d[a] = d[a] || [], d[a].push(b) } function b(a, b) { d[a] && (b ? (d[a].splice(d[a].indexOf(b), 1), 0 === d[a].length && delete d[a]) : delete d[a]) } function c(a, b) { d[a] && d[a].forEach(function (a) { a(b) }), d["*"] && d["*"].forEach(function (c) { c(a, b) }) } var d = []; return { addEventHandler: a, removeEventHandler: b, emit: c } } }(window, document, a), function (a, b, c) { "use strict"; function d(a) { var b = []; if (a.length) for (var c = 0; c < a.length; c++)b.push(a[c]); return b } function e(a, b) { var d = b || this.prototype || c.Class, e = Object.create(d); c.Class.cloneDefinitions(e, a); var f = function () { var a, b = e.constructor || function () { }; return a = this === c ? Object.create(e) : this, b.apply(a, Array.prototype.slice.call(arguments, 0)), a }; return f.prototype = e, f["super"] = d, f.extend = this.extend, f } function f() { var a = d(arguments), b = a[0]; return a.splice(1, a.length - 1).forEach(function (a) { Object.getOwnPropertyNames(a).forEach(function (c) { delete b[c], Object.defineProperty(b, c, Object.getOwnPropertyDescriptor(a, c)) }) }), b } c.Class = { extend: e, cloneDefinitions: f } }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d) { return a && (this.data = a || {}, this.data.labels = this.data.labels || [], this.data.series = this.data.series || [], this.eventEmitter.emit("data", { type: "update", data: this.data })), b && (this.options = c.extend({}, d ? this.options : this.defaultOptions, b), this.initializeTimeoutId || (this.optionsProvider.removeMediaQueryListeners(), this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter))), this.initializeTimeoutId || this.createChart(this.optionsProvider.getCurrentOptions()), this } function e() { return this.initializeTimeoutId ? a.clearTimeout(this.initializeTimeoutId) : (a.removeEventListener("resize", this.resizeListener), this.optionsProvider.removeMediaQueryListeners()), this } function f(a, b) { return this.eventEmitter.addEventHandler(a, b), this } function g(a, b) { return this.eventEmitter.removeEventHandler(a, b), this } function h() { a.addEventListener("resize", this.resizeListener), this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter), this.eventEmitter.addEventHandler("optionsChanged", function () { this.update() }.bind(this)), this.options.plugins && this.options.plugins.forEach(function (a) { a instanceof Array ? a[0](this, a[1]) : a(this) }.bind(this)), this.eventEmitter.emit("data", { type: "initial", data: this.data }), this.createChart(this.optionsProvider.getCurrentOptions()), this.initializeTimeoutId = void 0 } function i(a, b, d, e, f) { this.container = c.querySelector(a), this.data = b || {}, this.data.labels = this.data.labels || [], this.data.series = this.data.series || [], this.defaultOptions = d, this.options = e, this.responsiveOptions = f, this.eventEmitter = c.EventEmitter(), this.supportsForeignObject = c.Svg.isSupported("Extensibility"), this.supportsAnimations = c.Svg.isSupported("AnimationEventsAttribute"), this.resizeListener = function () { this.update() }.bind(this), this.container && (this.container.__chartist__ && this.container.__chartist__.detach(), this.container.__chartist__ = this), this.initializeTimeoutId = setTimeout(h.bind(this), 0) } c.Base = c.Class.extend({ constructor: i, optionsProvider: void 0, container: void 0, svg: void 0, eventEmitter: void 0, createChart: function () { throw new Error("Base chart type can't be instantiated!") }, update: d, detach: e, on: f, off: g, version: c.version, supportsForeignObject: !1 }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, d, e, f, g) { a instanceof Element ? this._node = a : (this._node = b.createElementNS(c.namespaces.svg, a), "svg" === a && this.attr({ "xmlns:ct": c.namespaces.ct })), d && this.attr(d), e && this.addClass(e), f && (g && f._node.firstChild ? f._node.insertBefore(this._node, f._node.firstChild) : f._node.appendChild(this._node)) } function e(a, b) { return "string" == typeof a ? b ? this._node.getAttributeNS(b, a) : this._node.getAttribute(a) : (Object.keys(a).forEach(function (b) { if (void 0 !== a[b]) if (b.indexOf(":") !== -1) { var d = b.split(":"); this._node.setAttributeNS(c.namespaces[d[0]], b, a[b]) } else this._node.setAttribute(b, a[b]) }.bind(this)), this) } function f(a, b, d, e) { return new c.Svg(a, b, d, this, e) } function g() { return this._node.parentNode instanceof SVGElement ? new c.Svg(this._node.parentNode) : null } function h() { for (var a = this._node; "svg" !== a.nodeName;)a = a.parentNode; return new c.Svg(a) } function i(a) { var b = this._node.querySelector(a); return b ? new c.Svg(b) : null } function j(a) { var b = this._node.querySelectorAll(a); return b.length ? new c.Svg.List(b) : null } function k() { return this._node } function l(a, d, e, f) { if ("string" == typeof a) { var g = b.createElement("div"); g.innerHTML = a, a = g.firstChild } a.setAttribute("xmlns", c.namespaces.xmlns); var h = this.elem("foreignObject", d, e, f); return h._node.appendChild(a), h } function m(a) { return this._node.appendChild(b.createTextNode(a)), this } function n() { for (; this._node.firstChild;)this._node.removeChild(this._node.firstChild); return this } function o() { return this._node.parentNode.removeChild(this._node), this.parent() } function p(a) { return this._node.parentNode.replaceChild(a._node, this._node), a } function q(a, b) { return b && this._node.firstChild ? this._node.insertBefore(a._node, this._node.firstChild) : this._node.appendChild(a._node), this } function r() { return this._node.getAttribute("class") ? this._node.getAttribute("class").trim().split(/\s+/) : [] } function s(a) { return this._node.setAttribute("class", this.classes(this._node).concat(a.trim().split(/\s+/)).filter(function (a, b, c) { return c.indexOf(a) === b }).join(" ")), this } function t(a) { var b = a.trim().split(/\s+/); return this._node.setAttribute("class", this.classes(this._node).filter(function (a) { return b.indexOf(a) === -1 }).join(" ")), this } function u() { return this._node.setAttribute("class", ""), this } function v() { return this._node.getBoundingClientRect().height } function w() { return this._node.getBoundingClientRect().width } function x(a, b, d) { return void 0 === b && (b = !0), Object.keys(a).forEach(function (e) { function f(a, b) { var f, g, h, i = {}; a.easing && (h = a.easing instanceof Array ? a.easing : c.Svg.Easing[a.easing], delete a.easing), a.begin = c.ensureUnit(a.begin, "ms"), a.dur = c.ensureUnit(a.dur, "ms"), h && (a.calcMode = "spline", a.keySplines = h.join(" "), a.keyTimes = "0;1"), b && (a.fill = "freeze", i[e] = a.from, this.attr(i), g = c.quantity(a.begin || 0).value, a.begin = "indefinite"), f = this.elem("animate", c.extend({ attributeName: e }, a)), b && setTimeout(function () { try { f._node.beginElement() } catch (b) { i[e] = a.to, this.attr(i), f.remove() } }.bind(this), g), d && f._node.addEventListener("beginEvent", function () { d.emit("animationBegin", { element: this, animate: f._node, params: a }) }.bind(this)), f._node.addEventListener("endEvent", function () { d && d.emit("animationEnd", { element: this, animate: f._node, params: a }), b && (i[e] = a.to, this.attr(i), f.remove()) }.bind(this)) } a[e] instanceof Array ? a[e].forEach(function (a) { f.bind(this)(a, !1) }.bind(this)) : f.bind(this)(a[e], b) }.bind(this)), this } function y(a) { var b = this; this.svgElements = []; for (var d = 0; d < a.length; d++)this.svgElements.push(new c.Svg(a[d])); Object.keys(c.Svg.prototype).filter(function (a) { return ["constructor", "parent", "querySelector", "querySelectorAll", "replace", "append", "classes", "height", "width"].indexOf(a) === -1 }).forEach(function (a) { b[a] = function () { var d = Array.prototype.slice.call(arguments, 0); return b.svgElements.forEach(function (b) { c.Svg.prototype[a].apply(b, d) }), b } }) } c.Svg = c.Class.extend({ constructor: d, attr: e, elem: f, parent: g, root: h, querySelector: i, querySelectorAll: j, getNode: k, foreignObject: l, text: m, empty: n, remove: o, replace: p, append: q, classes: r, addClass: s, removeClass: t, removeAllClasses: u, height: v, width: w, animate: x }), c.Svg.isSupported = function (a) { return b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#" + a, "1.1") }; var z = { easeInSine: [.47, 0, .745, .715], easeOutSine: [.39, .575, .565, 1], easeInOutSine: [.445, .05, .55, .95], easeInQuad: [.55, .085, .68, .53], easeOutQuad: [.25, .46, .45, .94], easeInOutQuad: [.455, .03, .515, .955], easeInCubic: [.55, .055, .675, .19], easeOutCubic: [.215, .61, .355, 1], easeInOutCubic: [.645, .045, .355, 1], easeInQuart: [.895, .03, .685, .22], easeOutQuart: [.165, .84, .44, 1], easeInOutQuart: [.77, 0, .175, 1], easeInQuint: [.755, .05, .855, .06], easeOutQuint: [.23, 1, .32, 1], easeInOutQuint: [.86, 0, .07, 1], easeInExpo: [.95, .05, .795, .035], easeOutExpo: [.19, 1, .22, 1], easeInOutExpo: [1, 0, 0, 1], easeInCirc: [.6, .04, .98, .335], easeOutCirc: [.075, .82, .165, 1], easeInOutCirc: [.785, .135, .15, .86], easeInBack: [.6, -.28, .735, .045], easeOutBack: [.175, .885, .32, 1.275], easeInOutBack: [.68, -.55, .265, 1.55] }; c.Svg.Easing = z, c.Svg.List = c.Class.extend({ constructor: y }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e, f, g) { var h = c.extend({ command: f ? a.toLowerCase() : a.toUpperCase() }, b, g ? { data: g } : {}); d.splice(e, 0, h) } function e(a, b) { a.forEach(function (c, d) { u[c.command.toLowerCase()].forEach(function (e, f) { b(c, e, d, f, a) }) }) } function f(a, b) { this.pathElements = [], this.pos = 0, this.close = a, this.options = c.extend({}, v, b) } function g(a) { return void 0 !== a ? (this.pos = Math.max(0, Math.min(this.pathElements.length, a)), this) : this.pos } function h(a) { return this.pathElements.splice(this.pos, a), this } function i(a, b, c, e) { return d("M", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this } function j(a, b, c, e) { return d("L", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this } function k(a, b, c, e, f, g, h, i) { return d("C", { x1: +a, y1: +b, x2: +c, y2: +e, x: +f, y: +g }, this.pathElements, this.pos++, h, i), this } function l(a, b, c, e, f, g, h, i, j) { return d("A", { rx: +a, ry: +b, xAr: +c, lAf: +e, sf: +f, x: +g, y: +h }, this.pathElements, this.pos++, i, j), this } function m(a) { var b = a.replace(/([A-Za-z])([0-9])/g, "$1 $2").replace(/([0-9])([A-Za-z])/g, "$1 $2").split(/[\s,]+/).reduce(function (a, b) { return b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a }, []); "Z" === b[b.length - 1][0].toUpperCase() && b.pop(); var d = b.map(function (a) { var b = a.shift(), d = u[b.toLowerCase()]; return c.extend({ command: b }, d.reduce(function (b, c, d) { return b[c] = +a[d], b }, {})) }), e = [this.pos, 0]; return Array.prototype.push.apply(e, d), Array.prototype.splice.apply(this.pathElements, e), this.pos += d.length, this } function n() { var a = Math.pow(10, this.options.accuracy); return this.pathElements.reduce(function (b, c) { var d = u[c.command.toLowerCase()].map(function (b) { return this.options.accuracy ? Math.round(c[b] * a) / a : c[b] }.bind(this)); return b + c.command + d.join(",") }.bind(this), "") + (this.close ? "Z" : "") } function o(a, b) { return e(this.pathElements, function (c, d) { c[d] *= "x" === d[0] ? a : b }), this } function p(a, b) { return e(this.pathElements, function (c, d) { c[d] += "x" === d[0] ? a : b }), this } function q(a) { return e(this.pathElements, function (b, c, d, e, f) { var g = a(b, c, d, e, f); (g || 0 === g) && (b[c] = g) }), this } function r(a) { var b = new c.Svg.Path(a || this.close); return b.pos = this.pos, b.pathElements = this.pathElements.slice().map(function (a) { return c.extend({}, a) }), b.options = c.extend({}, this.options), b } function s(a) { var b = [new c.Svg.Path]; return this.pathElements.forEach(function (d) { d.command === a.toUpperCase() && 0 !== b[b.length - 1].pathElements.length && b.push(new c.Svg.Path), b[b.length - 1].pathElements.push(d) }), b } function t(a, b, d) { for (var e = new c.Svg.Path(b, d), f = 0; f < a.length; f++)for (var g = a[f], h = 0; h < g.pathElements.length; h++)e.pathElements.push(g.pathElements[h]); return e } var u = { m: ["x", "y"], l: ["x", "y"], c: ["x1", "y1", "x2", "y2", "x", "y"], a: ["rx", "ry", "xAr", "lAf", "sf", "x", "y"] }, v = { accuracy: 3 }; c.Svg.Path = c.Class.extend({ constructor: f, position: g, remove: h, move: i, line: j, curve: k, arc: l, scale: o, translate: p, transform: q, parse: m, stringify: n, clone: r, splitByCommand: s }), c.Svg.Path.elementDescriptions = u, c.Svg.Path.join = t }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, c, d) { this.units = a, this.counterUnits = a === f.x ? f.y : f.x, this.chartRect = b, this.axisLength = b[a.rectEnd] - b[a.rectStart], this.gridOffset = b[a.rectOffset], this.ticks = c, this.options = d } function e(a, b, d, e, f) { var g = e["axis" + this.units.pos.toUpperCase()], h = this.ticks.map(this.projectValue.bind(this)), i = this.ticks.map(g.labelInterpolationFnc); h.forEach(function (j, k) { var l, m = { x: 0, y: 0 }; l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30), c.isFalseyButZero(i[k]) && "" !== i[k] || ("x" === this.units.pos ? (j = this.chartRect.x1 + j, m.x = e.axisX.labelOffset.x, "start" === e.axisX.position ? m.y = this.chartRect.padding.top + e.axisX.labelOffset.y + (d ? 5 : 20) : m.y = this.chartRect.y1 + e.axisX.labelOffset.y + (d ? 5 : 20)) : (j = this.chartRect.y1 - j, m.y = e.axisY.labelOffset.y - (d ? l : 0), "start" === e.axisY.position ? m.x = d ? this.chartRect.padding.left + e.axisY.labelOffset.x : this.chartRect.x1 - 10 : m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10), g.showGrid && c.createGrid(j, k, this, this.gridOffset, this.chartRect[this.counterUnits.len](), a, [e.classNames.grid, e.classNames[this.units.dir]], f), g.showLabel && c.createLabel(j, l, k, i, this, g.offset, m, b, [e.classNames.label, e.classNames[this.units.dir], "start" === g.position ? e.classNames[g.position] : e.classNames.end], d, f)) }.bind(this)) } var f = { x: { pos: "x", len: "width", dir: "horizontal", rectStart: "x1", rectEnd: "x2", rectOffset: "y2" }, y: { pos: "y", len: "height", dir: "vertical", rectStart: "y2", rectEnd: "y1", rectOffset: "x1" } }; c.Axis = c.Class.extend({ constructor: d, createGridAndLabels: e, projectValue: function (a, b, c) { throw new Error("Base axis can't be instantiated!") } }), c.Axis.units = f }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { var f = e.highLow || c.getHighLow(b, e, a.pos); this.bounds = c.getBounds(d[a.rectEnd] - d[a.rectStart], f, e.scaleMinSpace || 20, e.onlyInteger), this.range = { min: this.bounds.min, max: this.bounds.max }, c.AutoScaleAxis["super"].constructor.call(this, a, d, this.bounds.values, e) } function e(a) { return this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.bounds.min) / this.bounds.range } c.AutoScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { var f = e.highLow || c.getHighLow(b, e, a.pos); this.divisor = e.divisor || 1, this.ticks = e.ticks || c.times(this.divisor).map(function (a, b) { return f.low + (f.high - f.low) / this.divisor * b }.bind(this)), this.ticks.sort(function (a, b) { return a - b }), this.range = { min: f.low, max: f.high }, c.FixedScaleAxis["super"].constructor.call(this, a, d, this.ticks, e), this.stepLength = this.axisLength / this.divisor } function e(a) { return this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.range.min) / (this.range.max - this.range.min) } c.FixedScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { c.StepAxis["super"].constructor.call(this, a, d, e.ticks, e); var f = Math.max(1, e.ticks.length - (e.stretch ? 1 : 0)); this.stepLength = this.axisLength / f } function e(a, b) { return this.stepLength * b } c.StepAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a) { var b = c.normalizeData(this.data, a.reverseData, !0); this.svg = c.createSvg(this.container, a.width, a.height, a.classNames.chart); var d, e, g = this.svg.elem("g").addClass(a.classNames.gridGroup), h = this.svg.elem("g"), i = this.svg.elem("g").addClass(a.classNames.labelGroup), j = c.createChartRect(this.svg, a, f.padding); d = void 0 === a.axisX.type ? new c.StepAxis(c.Axis.units.x, b.normalized.series, j, c.extend({}, a.axisX, { ticks: b.normalized.labels, stretch: a.fullWidth })) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, j, a.axisX), e = void 0 === a.axisY.type ? new c.AutoScaleAxis(c.Axis.units.y, b.normalized.series, j, c.extend({}, a.axisY, { high: c.isNumeric(a.high) ? a.high : a.axisY.high, low: c.isNumeric(a.low) ? a.low : a.axisY.low })) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, j, a.axisY), d.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), e.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), a.showGridBackground && c.createGridBackground(g, j, a.classNames.gridBackground, this.eventEmitter), b.raw.series.forEach(function (f, g) { var i = h.elem("g"); i.attr({ "ct:series-name": f.name, "ct:meta": c.serialize(f.meta) }), i.addClass([a.classNames.series, f.className || a.classNames.series + "-" + c.alphaNumerate(g)].join(" ")); var k = [], l = []; b.normalized.series[g].forEach(function (a, h) { var i = { x: j.x1 + d.projectValue(a, h, b.normalized.series[g]), y: j.y1 - e.projectValue(a, h, b.normalized.series[g]) }; k.push(i.x, i.y), l.push({ value: a, valueIndex: h, meta: c.getMetaData(f, h) }) }.bind(this)); var m = { lineSmooth: c.getSeriesOption(f, a, "lineSmooth"), showPoint: c.getSeriesOption(f, a, "showPoint"), showLine: c.getSeriesOption(f, a, "showLine"), showArea: c.getSeriesOption(f, a, "showArea"), areaBase: c.getSeriesOption(f, a, "areaBase") }, n = "function" == typeof m.lineSmooth ? m.lineSmooth : m.lineSmooth ? c.Interpolation.monotoneCubic() : c.Interpolation.none(), o = n(k, l); if (m.showPoint && o.pathElements.forEach(function (b) { var h = i.elem("line", { x1: b.x, y1: b.y, x2: b.x + .01, y2: b.y }, a.classNames.point).attr({ "ct:value": [b.data.value.x, b.data.value.y].filter(c.isNumeric).join(","), "ct:meta": c.serialize(b.data.meta) }); this.eventEmitter.emit("draw", { type: "point", value: b.data.value, index: b.data.valueIndex, meta: b.data.meta, series: f, seriesIndex: g, axisX: d, axisY: e, group: i, element: h, x: b.x, y: b.y }) }.bind(this)), m.showLine) { var p = i.elem("path", { d: o.stringify() }, a.classNames.line, !0); this.eventEmitter.emit("draw", { type: "line", values: b.normalized.series[g], path: o.clone(), chartRect: j, index: g, series: f, seriesIndex: g, seriesMeta: f.meta, axisX: d, axisY: e, group: i, element: p }) } if (m.showArea && e.range) { var q = Math.max(Math.min(m.areaBase, e.range.max), e.range.min), r = j.y1 - e.projectValue(q); o.splitByCommand("M").filter(function (a) { return a.pathElements.length > 1 }).map(function (a) { var b = a.pathElements[0], c = a.pathElements[a.pathElements.length - 1]; return a.clone(!0).position(0).remove(1).move(b.x, r).line(b.x, b.y).position(a.pathElements.length + 1).line(c.x, r) }).forEach(function (c) { var h = i.elem("path", { d: c.stringify() }, a.classNames.area, !0); this.eventEmitter.emit("draw", { type: "area", values: b.normalized.series[g], path: c.clone(), series: f, seriesIndex: g, axisX: d, axisY: e, chartRect: j, index: g, group: i, element: h }) }.bind(this)) } }.bind(this)), this.eventEmitter.emit("created", { bounds: e.bounds, chartRect: j, axisX: d, axisY: e, svg: this.svg, options: a }) } function e(a, b, d, e) { c.Line["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e) } var f = { axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, type: void 0 }, axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, type: void 0, scaleMinSpace: 20, onlyInteger: !1 }, width: void 0, height: void 0, showLine: !0, showPoint: !0, showArea: !1, areaBase: 0, lineSmooth: !0, showGridBackground: !1, low: void 0, high: void 0, chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, fullWidth: !1, reverseData: !1, classNames: { chart: "ct-chart-line", label: "ct-label", labelGroup: "ct-labels", series: "ct-series", line: "ct-line", point: "ct-point", area: "ct-area", grid: "ct-grid", gridGroup: "ct-grids", gridBackground: "ct-grid-background", vertical: "ct-vertical", horizontal: "ct-horizontal", start: "ct-start", end: "ct-end" } }; c.Line = c.Base.extend({ constructor: e, createChart: d }) }(window, document, a), function (a, b, c) { + "use strict"; function d(a) { + var b, d; a.distributeSeries ? (b = c.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y"), b.normalized.series = b.normalized.series.map(function (a) { return [a] })) : b = c.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y"), this.svg = c.createSvg(this.container, a.width, a.height, a.classNames.chart + (a.horizontalBars ? " " + a.classNames.horizontalBars : "")); var e = this.svg.elem("g").addClass(a.classNames.gridGroup), g = this.svg.elem("g"), h = this.svg.elem("g").addClass(a.classNames.labelGroup); if (a.stackBars && 0 !== b.normalized.series.length) { + var i = c.serialMap(b.normalized.series, function () { + return Array.prototype.slice.call(arguments).map(function (a) { return a }).reduce(function (a, b) { return { x: a.x + (b && b.x) || 0, y: a.y + (b && b.y) || 0 } }, { x: 0, y: 0 }) + }); d = c.getHighLow([i], a, a.horizontalBars ? "x" : "y") + } else d = c.getHighLow(b.normalized.series, a, a.horizontalBars ? "x" : "y"); d.high = +a.high || (0 === a.high ? 0 : d.high), d.low = +a.low || (0 === a.low ? 0 : d.low); var j, k, l, m, n, o = c.createChartRect(this.svg, a, f.padding); k = a.distributeSeries && a.stackBars ? b.normalized.labels.slice(0, 1) : b.normalized.labels, a.horizontalBars ? (j = m = void 0 === a.axisX.type ? new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX, { highLow: d, referenceValue: 0 })) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX, { highLow: d, referenceValue: 0 })), l = n = void 0 === a.axisY.type ? new c.StepAxis(c.Axis.units.y, b.normalized.series, o, { ticks: k }) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) : (l = m = void 0 === a.axisX.type ? new c.StepAxis(c.Axis.units.x, b.normalized.series, o, { ticks: k }) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, a.axisX), j = n = void 0 === a.axisY.type ? new c.AutoScaleAxis(c.Axis.units.y, b.normalized.series, o, c.extend({}, a.axisY, { highLow: d, referenceValue: 0 })) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, c.extend({}, a.axisY, { highLow: d, referenceValue: 0 }))); var p = a.horizontalBars ? o.x1 + j.projectValue(0) : o.y1 - j.projectValue(0), q = []; l.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), j.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), a.showGridBackground && c.createGridBackground(e, o, a.classNames.gridBackground, this.eventEmitter), b.raw.series.forEach(function (d, e) { var f, h, i = e - (b.raw.series.length - 1) / 2; f = a.distributeSeries && !a.stackBars ? l.axisLength / b.normalized.series.length / 2 : a.distributeSeries && a.stackBars ? l.axisLength / 2 : l.axisLength / b.normalized.series[e].length / 2, h = g.elem("g"), h.attr({ "ct:series-name": d.name, "ct:meta": c.serialize(d.meta) }), h.addClass([a.classNames.series, d.className || a.classNames.series + "-" + c.alphaNumerate(e)].join(" ")), b.normalized.series[e].forEach(function (g, k) { var r, s, t, u; if (u = a.distributeSeries && !a.stackBars ? e : a.distributeSeries && a.stackBars ? 0 : k, r = a.horizontalBars ? { x: o.x1 + j.projectValue(g && g.x ? g.x : 0, k, b.normalized.series[e]), y: o.y1 - l.projectValue(g && g.y ? g.y : 0, u, b.normalized.series[e]) } : { x: o.x1 + l.projectValue(g && g.x ? g.x : 0, u, b.normalized.series[e]), y: o.y1 - j.projectValue(g && g.y ? g.y : 0, k, b.normalized.series[e]) }, l instanceof c.StepAxis && (l.options.stretch || (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)), r[l.units.pos] += a.stackBars || a.distributeSeries ? 0 : i * a.seriesBarDistance * (a.horizontalBars ? -1 : 1)), t = q[k] || p, q[k] = t - (p - r[l.counterUnits.pos]), void 0 !== g) { var v = {}; v[l.units.pos + "1"] = r[l.units.pos], v[l.units.pos + "2"] = r[l.units.pos], !a.stackBars || "accumulate" !== a.stackMode && a.stackMode ? (v[l.counterUnits.pos + "1"] = p, v[l.counterUnits.pos + "2"] = r[l.counterUnits.pos]) : (v[l.counterUnits.pos + "1"] = t, v[l.counterUnits.pos + "2"] = q[k]), v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2), v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2), v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1), v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1); var w = c.getMetaData(d, k); s = h.elem("line", v, a.classNames.bar).attr({ "ct:value": [g.x, g.y].filter(c.isNumeric).join(","), "ct:meta": c.serialize(w) }), this.eventEmitter.emit("draw", c.extend({ type: "bar", value: g, index: k, meta: w, series: d, seriesIndex: e, axisX: m, axisY: n, chartRect: o, group: h, element: s }, v)) } }.bind(this)) }.bind(this)), this.eventEmitter.emit("created", { bounds: j.bounds, chartRect: o, axisX: m, axisY: n, svg: this.svg, options: a }) + } function e(a, b, d, e) { c.Bar["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e) } var f = { axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, scaleMinSpace: 30, onlyInteger: !1 }, axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, scaleMinSpace: 20, onlyInteger: !1 }, width: void 0, height: void 0, high: void 0, low: void 0, referenceValue: 0, chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, seriesBarDistance: 15, stackBars: !1, stackMode: "accumulate", horizontalBars: !1, distributeSeries: !1, reverseData: !1, showGridBackground: !1, classNames: { chart: "ct-chart-bar", horizontalBars: "ct-horizontal-bars", label: "ct-label", labelGroup: "ct-labels", series: "ct-series", bar: "ct-bar", grid: "ct-grid", gridGroup: "ct-grids", gridBackground: "ct-grid-background", vertical: "ct-vertical", horizontal: "ct-horizontal", start: "ct-start", end: "ct-end" } }; c.Bar = c.Base.extend({ constructor: e, createChart: d }) + }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, c) { var d = b.x > a.x; return d && "explode" === c || !d && "implode" === c ? "start" : d && "implode" === c || !d && "explode" === c ? "end" : "middle" } function e(a) { var b, e, f, h, i, j = c.normalizeData(this.data), k = [], l = a.startAngle; this.svg = c.createSvg(this.container, a.width, a.height, a.donut ? a.classNames.chartDonut : a.classNames.chartPie), e = c.createChartRect(this.svg, a, g.padding), f = Math.min(e.width() / 2, e.height() / 2), i = a.total || j.normalized.series.reduce(function (a, b) { return a + b }, 0); var m = c.quantity(a.donutWidth); "%" === m.unit && (m.value *= f / 100), f -= a.donut && !a.donutSolid ? m.value / 2 : 0, h = "outside" === a.labelPosition || a.donut && !a.donutSolid ? f : "center" === a.labelPosition ? 0 : a.donutSolid ? f - m.value / 2 : f / 2, h += a.labelOffset; var n = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 }, o = 1 === j.raw.series.filter(function (a) { return a.hasOwnProperty("value") ? 0 !== a.value : 0 !== a }).length; j.raw.series.forEach(function (a, b) { k[b] = this.svg.elem("g", null, null) }.bind(this)), a.showLabel && (b = this.svg.elem("g", null, null)), j.raw.series.forEach(function (e, g) { if (0 !== j.normalized.series[g] || !a.ignoreEmptyValues) { k[g].attr({ "ct:series-name": e.name }), k[g].addClass([a.classNames.series, e.className || a.classNames.series + "-" + c.alphaNumerate(g)].join(" ")); var p = i > 0 ? l + j.normalized.series[g] / i * 360 : 0, q = Math.max(0, l - (0 === g || o ? 0 : .2)); p - q >= 359.99 && (p = q + 359.99); var r, s, t, u = c.polarToCartesian(n.x, n.y, f, q), v = c.polarToCartesian(n.x, n.y, f, p), w = new c.Svg.Path(!a.donut || a.donutSolid).move(v.x, v.y).arc(f, f, 0, p - l > 180, 0, u.x, u.y); a.donut ? a.donutSolid && (t = f - m.value, r = c.polarToCartesian(n.x, n.y, t, l - (0 === g || o ? 0 : .2)), s = c.polarToCartesian(n.x, n.y, t, p), w.line(r.x, r.y), w.arc(t, t, 0, p - l > 180, 1, s.x, s.y)) : w.line(n.x, n.y); var x = a.classNames.slicePie; a.donut && (x = a.classNames.sliceDonut, a.donutSolid && (x = a.classNames.sliceDonutSolid)); var y = k[g].elem("path", { d: w.stringify() }, x); if (y.attr({ "ct:value": j.normalized.series[g], "ct:meta": c.serialize(e.meta) }), a.donut && !a.donutSolid && (y._node.style.strokeWidth = m.value + "px"), this.eventEmitter.emit("draw", { type: "slice", value: j.normalized.series[g], totalDataSum: i, index: g, meta: e.meta, series: e, group: k[g], element: y, path: w.clone(), center: n, radius: f, startAngle: l, endAngle: p }), a.showLabel) { var z; z = 1 === j.raw.series.length ? { x: n.x, y: n.y } : c.polarToCartesian(n.x, n.y, h, l + (p - l) / 2); var A; A = j.normalized.labels && !c.isFalseyButZero(j.normalized.labels[g]) ? j.normalized.labels[g] : j.normalized.series[g]; var B = a.labelInterpolationFnc(A, g); if (B || 0 === B) { var C = b.elem("text", { dx: z.x, dy: z.y, "text-anchor": d(n, z, a.labelDirection) }, a.classNames.label).text("" + B); this.eventEmitter.emit("draw", { type: "label", index: g, group: b, element: C, text: "" + B, x: z.x, y: z.y }) } } l = p } }.bind(this)), this.eventEmitter.emit("created", { chartRect: e, svg: this.svg, options: a }) } function f(a, b, d, e) { c.Pie["super"].constructor.call(this, a, b, g, c.extend({}, g, d), e) } var g = { width: void 0, height: void 0, chartPadding: 5, classNames: { chartPie: "ct-chart-pie", chartDonut: "ct-chart-donut", series: "ct-series", slicePie: "ct-slice-pie", sliceDonut: "ct-slice-donut", sliceDonutSolid: "ct-slice-donut-solid", label: "ct-label" }, startAngle: 0, total: void 0, donut: !1, donutSolid: !1, donutWidth: 60, showLabel: !0, labelOffset: 0, labelPosition: "inside", labelInterpolationFnc: c.noop, labelDirection: "neutral", reverseData: !1, ignoreEmptyValues: !1 }; c.Pie = c.Base.extend({ constructor: f, createChart: e, determineAnchorPosition: d }) }(window, document, a), a +}); + +var i, l, selectedLine = null; + +/* Navigate to hash without browser history entry */ +var navigateToHash = function () { + if (window.history !== undefined && window.history.replaceState !== undefined) { + window.history.replaceState(undefined, undefined, this.getAttribute("href")); + } +}; + +var hashLinks = document.getElementsByClassName('navigatetohash'); +for (i = 0, l = hashLinks.length; i < l; i++) { + hashLinks[i].addEventListener('click', navigateToHash); +} + +/* Switch test method */ +var switchTestMethod = function () { + var method = this.getAttribute("value"); + console.log("Selected test method: " + method); + + var lines, i, l, coverageData, lineAnalysis, cells; + + lines = document.querySelectorAll('.lineAnalysis tr'); + + for (i = 1, l = lines.length; i < l; i++) { + coverageData = JSON.parse(lines[i].getAttribute('data-coverage').replace(/'/g, '"')); + lineAnalysis = coverageData[method]; + cells = lines[i].querySelectorAll('td'); + if (lineAnalysis === undefined) { + lineAnalysis = coverageData.AllTestMethods; + if (lineAnalysis.LVS !== 'gray') { + cells[0].setAttribute('class', 'red'); + cells[1].innerText = cells[1].textContent = '0'; + cells[4].setAttribute('class', 'lightred'); + } + } else { + cells[0].setAttribute('class', lineAnalysis.LVS); + cells[1].innerText = cells[1].textContent = lineAnalysis.VC; + cells[4].setAttribute('class', 'light' + lineAnalysis.LVS); + } + } +}; + +var testMethods = document.getElementsByClassName('switchtestmethod'); +for (i = 0, l = testMethods.length; i < l; i++) { + testMethods[i].addEventListener('change', switchTestMethod); +} + +/* Highlight test method by line */ +var toggleLine = function () { + if (selectedLine === this) { + selectedLine = null; + } else { + selectedLine = null; + unhighlightTestMethods(); + highlightTestMethods.call(this); + selectedLine = this; + } + +}; +var highlightTestMethods = function () { + if (selectedLine !== null) { + return; + } + + var lineAnalysis; + var coverageData = JSON.parse(this.getAttribute('data-coverage').replace(/'/g, '"')); + var testMethods = document.getElementsByClassName('testmethod'); + + for (i = 0, l = testMethods.length; i < l; i++) { + lineAnalysis = coverageData[testMethods[i].id]; + if (lineAnalysis === undefined) { + testMethods[i].className = testMethods[i].className.replace(/\s*light.+/g, ""); + } else { + testMethods[i].className += ' light' + lineAnalysis.LVS; + } + } +}; +var unhighlightTestMethods = function () { + if (selectedLine !== null) { + return; + } + + var testMethods = document.getElementsByClassName('testmethod'); + for (i = 0, l = testMethods.length; i < l; i++) { + testMethods[i].className = testMethods[i].className.replace(/\s*light.+/g, ""); + } +}; +var coverableLines = document.getElementsByClassName('coverableline'); +for (i = 0, l = coverableLines.length; i < l; i++) { + coverableLines[i].addEventListener('click', toggleLine); + coverableLines[i].addEventListener('mouseenter', highlightTestMethods); + coverableLines[i].addEventListener('mouseleave', unhighlightTestMethods); +} + +/* History charts */ +var renderChart = function (chart) { + // Remove current children (e.g. PNG placeholder) + while (chart.firstChild) { + chart.firstChild.remove(); + } + + var chartData = window[chart.getAttribute('data-data')]; + var options = { + axisY: { + type: undefined, + onlyInteger: true + }, + lineSmooth: false, + low: 0, + high: 100, + scaleMinSpace: 20, + onlyInteger: true, + fullWidth: true + }; + var lineChart = new Chartist.Line(chart, { + labels: [], + series: chartData.series + }, options); + + /* Zoom */ + var zoomButtonDiv = document.createElement("div"); + zoomButtonDiv.className = "toggleZoom"; + var zoomButtonLink = document.createElement("a"); + zoomButtonLink.setAttribute("href", ""); + var zoomButtonText = document.createElement("i"); + zoomButtonText.className = "icon-search-plus"; + + zoomButtonLink.appendChild(zoomButtonText); + zoomButtonDiv.appendChild(zoomButtonLink); + + chart.appendChild(zoomButtonDiv); + + zoomButtonDiv.addEventListener('click', function (event) { + event.preventDefault(); + + if (options.axisY.type === undefined) { + options.axisY.type = Chartist.AutoScaleAxis; + zoomButtonText.className = "icon-search-minus"; + } else { + options.axisY.type = undefined; + zoomButtonText.className = "icon-search-plus"; + } + + lineChart.update(null, options); + }); + + var tooltip = document.createElement("div"); + tooltip.className = "tooltip"; + + chart.appendChild(tooltip); + + /* Tooltips */ + var showToolTip = function () { + var point = this; + var index = [].slice.call(chart.getElementsByClassName('ct-point')).indexOf(point); + + tooltip.innerHTML = chartData.tooltips[index % chartData.tooltips.length]; + tooltip.style.display = 'block'; + }; + + var moveToolTip = function (event) { + var box = chart.getBoundingClientRect(); + var left = event.pageX - box.left - window.pageXOffset; + var top = event.pageY - box.top - window.pageYOffset; + + left = left + 20; + top = top - tooltip.offsetHeight / 2; + + if (left + tooltip.offsetWidth > box.width) { + left -= tooltip.offsetWidth + 40; + } + + if (top < 0) { + top = 0; + } + + if (top + tooltip.offsetHeight > box.height) { + top = box.height - tooltip.offsetHeight; + } + + tooltip.style.left = left + 'px'; + tooltip.style.top = top + 'px'; + }; + + var hideToolTip = function () { + tooltip.style.display = 'none'; + }; + chart.addEventListener('mousemove', moveToolTip); + + lineChart.on('created', function () { + var chartPoints = chart.getElementsByClassName('ct-point'); + for (i = 0, l = chartPoints.length; i < l; i++) { + chartPoints[i].addEventListener('mousemove', showToolTip); + chartPoints[i].addEventListener('mouseout', hideToolTip); + } + }); +}; + +var charts = document.getElementsByClassName('historychart'); +for (i = 0, l = charts.length; i < l; i++) { + renderChart(charts[i]); +} \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_cube.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_cube.svg new file mode 100644 index 000000000..3302443cc --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_cube.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_down-dir_active.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_down-dir_active.svg new file mode 100644 index 000000000..d11cf0413 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_down-dir_active.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_fork.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_fork.svg new file mode 100644 index 000000000..f0148b3a3 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_fork.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_info-circled.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_info-circled.svg new file mode 100644 index 000000000..252166bba --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_info-circled.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_minus.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_minus.svg new file mode 100644 index 000000000..3c30c365e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_minus.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_plus.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_plus.svg new file mode 100644 index 000000000..79327232c --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_plus.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_search-minus.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_search-minus.svg new file mode 100644 index 000000000..c174eb5e1 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_search-minus.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_search-plus.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_search-plus.svg new file mode 100644 index 000000000..04b24ecc3 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_search-plus.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_sponsor.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_sponsor.svg new file mode 100644 index 000000000..bf6d95913 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_sponsor.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_star.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_star.svg new file mode 100644 index 000000000..b23c54ea0 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_star.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir.svg new file mode 100644 index 000000000..567c11f3e --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir_active.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir_active.svg new file mode 100644 index 000000000..bb225544a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_up-dir_active.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/icon_wrench.svg b/TestProject/Usd-Development/CodeCoverage/Report/icon_wrench.svg new file mode 100644 index 000000000..b6aa318ce --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/icon_wrench.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/index.htm b/TestProject/Usd-Development/CodeCoverage/Report/index.htm new file mode 100644 index 000000000..ac5bf5d62 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/index.htm @@ -0,0 +1,199 @@ + + + + + + +Summary - Coverage Report + +
+

SummaryStarSponsor

+ ++++ + + + + + + + + + + + + + + +
Generated on:2023-02-14 - 2:32:54 PM
Parser:MultiReportParser (2x OpenCoverParser)
Assemblies:8
Classes:84
Files:75
Covered lines:3150
Uncovered lines:5012
Coverable lines:8162
Total lines:16244
Line coverage:38.5% (3150 of 8162)
Covered branches:0
Total branches:0
+

Coverage History

+
+ + + +

Coverage

+ + +++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameCoveredUncoveredCoverableTotalLine coverageCoveredTotalBranch coverage
Unity.Formats.USD.Editor100692792159612.6%
  
00
 
Unity.Formats.USD.PackageUtils133164981.2%
  
00
 
Unity.Formats.USD.UsdAssetEditor02132133500%
 
00
 
Unity.Formats.USD.UsdBuildPostProcess03434700%
 
00
 
Unity.Formats.USD.UsdLayerStackEditor02222590%
 
00
 
Unity.Formats.USD.UsdMenu287210024728%
  
00
 
Unity.Formats.USD.UsdPrimSourceEditor2617620236712.8%
  
00
 
Unity.Formats.USD.UsdVariantSetEditor337407682.5%
  
00
 
UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]01313280%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorder071711370%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInput01111290%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings02222500%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer01111230%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderSettings02929910%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor088200%
 
00
 
Unity.Formats.USD.ExportMesh01531533970%
 
00
 
Unity.Formats.USD.Examples.ExportMeshExample01091092910%
 
00
 
Unity.Formats.USD.Examples.ExportMeshExampleEditor02525550%
 
00
 
USD.NET.Examples.Explode01919510%
 
00
 
Unity.Formats.USD.HelloUsd02727710%
 
00
 
Unity.Formats.USD.Examples.HelloUsdExample02727710%
 
00
 
Unity.Formats.USD.ImportMaterials02192194150%
 
00
 
Unity.Formats.USD.Examples.ImportMaterialsExample02192194150%
 
00
 
Unity.Formats.USD.ImportMesh081812130%
 
00
 
Unity.Formats.USD.Examples.ImportMeshExample058581530%
 
00
 
Unity.Formats.USD.Examples.UsdImportMeshEditor02323600%
 
00
 
Unity.Formats.USD.ImportProcessor01261262970%
 
00
 
Unity.Formats.USD.Examples.CombineMeshes086861490%
 
00
 
Unity.Formats.USD.Examples.RegexImportProcessor01616760%
 
00
 
Unity.Formats.USD.Examples.SetHideFlags02424720%
 
00
 
Unity.Formats.USD.Runtime3050370767571774845.1%
  
00
 
Unity.Formats.USD.CameraExporter149236160.8%
  
00
 
Unity.Formats.USD.CameraImporter60638100%
 
00
 
Unity.Formats.USD.CubeImporter4912617529028%
  
00
 
Unity.Formats.USD.ExportContext14014791100%
 
00
 
Unity.Formats.USD.ExportHelpers297366080.5%
  
00
 
Unity.Formats.USD.ExportPlan101791100%
 
00
 
Unity.Formats.USD.HdrpShaderExporter01621622460%
 
00
 
Unity.Formats.USD.HdrpShaderImporter01211211900%
 
00
 
Unity.Formats.USD.HierarchyBuilder35415250688369.9%
  
00
 
Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]0338830%
 
00
 
Unity.Formats.USD.ImporterBase25244911651%
  
00
 
Unity.Formats.USD.ImportHelpers923612823771.8%
  
00
 
Unity.Formats.USD.InitUsd194239582.6%
  
00
 
Unity.Formats.USD.InstanceImporter49439217753.2%
  
00
 
Unity.Formats.USD.MaterialExporter4465011988%
  
00
 
Unity.Formats.USD.MaterialImporter5316722038924%
  
00
 
Unity.Formats.USD.MaterialMap65158021181.2%
  
00
 
Unity.Formats.USD.MeshExporter12013525548547%
  
00
 
Unity.Formats.USD.MeshImporter16815832681851.5%
  
00
 
Unity.Formats.USD.MeshImportOptions14014114100%
 
00
 
Unity.Formats.USD.MeshImportStrategy754812381860.9%
  
00
 
Unity.Formats.USD.NativeExporter5961012074.9%
  
00
 
Unity.Formats.USD.NativeImporter5981031844.8%
  
00
 
Unity.Formats.USD.NativeSerialization01821824050%
 
00
 
Unity.Formats.USD.PrimMap57268317168.6%
  
00
 
Unity.Formats.USD.ReadAllJob[T]55247917669.6%
  
00
 
Unity.Formats.USD.SanitizedCameraSample404484100%
 
00
 
Unity.Formats.USD.SanitizedMeshSample2263726348485.9%
  
00
 
Unity.Formats.USD.SanitizedXformSample404484100%
 
00
 
Unity.Formats.USD.SceneExporter15821937779141.9%
  
00
 
Unity.Formats.USD.SceneImporter531259790127767.2%
  
00
 
Unity.Formats.USD.SceneImportOptions22022164100%
 
00
 
Unity.Formats.USD.ShaderExporterBase01551553290%
 
00
 
Unity.Formats.USD.ShaderImporterBase52156717477.6%
  
00
 
Unity.Formats.USD.SkelBindingSample0661210%
 
00
 
Unity.Formats.USD.SkeletonExporter01141142090%
 
00
 
Unity.Formats.USD.SkeletonImporter1027717930156.9%
  
00
 
Unity.Formats.USD.SkeletonIo0771210%
 
00
 
Unity.Formats.USD.SkelRootSample0221210%
 
00
 
Unity.Formats.USD.SkinnedMeshUnityDiff070701610%
 
00
 
Unity.Formats.USD.SkinnedMeshUsdDiff02152153690%
 
00
 
Unity.Formats.USD.SphereImporter56167215777.7%
  
00
 
Unity.Formats.USD.StandardShaderExporter5623829446319%
  
00
 
Unity.Formats.USD.StandardShaderImporter396510416237.5%
  
00
 
Unity.Formats.USD.UnityMaterialData30338100%
 
00
 
Unity.Formats.USD.UnityPreviewSurfaceSample10138100%
 
00
 
Unity.Formats.USD.UsdAsset21624746394246.6%
  
00
 
Unity.Formats.USD.UsdLayerStack059591270%
 
00
 
Unity.Formats.USD.UsdPayload2202286100%
 
00
 
Unity.Formats.USD.UsdPlayableAsset02727720%
 
00
 
Unity.Formats.USD.UsdPlayableBehaviour03939940%
 
00
 
Unity.Formats.USD.UsdPlayableTrack044310%
 
00
 
Unity.Formats.USD.UsdRecorderBehaviour936716031558.1%
  
00
 
Unity.Formats.USD.UsdRecorderClip192217290.4%
  
00
 
Unity.Formats.USD.UsdVariantSet184229281.8%
  
00
 
Unity.Formats.USD.UsdWaitForEndOfFrame314357888.5%
  
00
 
Unity.Formats.USD.UsdzExporter03434950%
 
00
 
Unity.Formats.USD.XformExporter25446914536.2%
  
00
 
Unity.Formats.USD.XformImporter59399819660.2%
  
00
 
Unity.Formats.USD.UsdTimelinePlayable077380%
 
00
 
Unity.Formats.USD.Examples.SetDefaultUSDMesh077380%
 
00
 
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/index.html b/TestProject/Usd-Development/CodeCoverage/Report/index.html new file mode 100644 index 000000000..ac5bf5d62 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/index.html @@ -0,0 +1,199 @@ + + + + + + +Summary - Coverage Report + +
+

SummaryStarSponsor

+ ++++ + + + + + + + + + + + + + + +
Generated on:2023-02-14 - 2:32:54 PM
Parser:MultiReportParser (2x OpenCoverParser)
Assemblies:8
Classes:84
Files:75
Covered lines:3150
Uncovered lines:5012
Coverable lines:8162
Total lines:16244
Line coverage:38.5% (3150 of 8162)
Covered branches:0
Total branches:0
+

Coverage History

+
+ + + +

Coverage

+ + +++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameCoveredUncoveredCoverableTotalLine coverageCoveredTotalBranch coverage
Unity.Formats.USD.Editor100692792159612.6%
  
00
 
Unity.Formats.USD.PackageUtils133164981.2%
  
00
 
Unity.Formats.USD.UsdAssetEditor02132133500%
 
00
 
Unity.Formats.USD.UsdBuildPostProcess03434700%
 
00
 
Unity.Formats.USD.UsdLayerStackEditor02222590%
 
00
 
Unity.Formats.USD.UsdMenu287210024728%
  
00
 
Unity.Formats.USD.UsdPrimSourceEditor2617620236712.8%
  
00
 
Unity.Formats.USD.UsdVariantSetEditor337407682.5%
  
00
 
UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]01313280%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorder071711370%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInput01111290%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings02222500%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer01111230%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderSettings02929910%
 
00
 
UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor088200%
 
00
 
Unity.Formats.USD.ExportMesh01531533970%
 
00
 
Unity.Formats.USD.Examples.ExportMeshExample01091092910%
 
00
 
Unity.Formats.USD.Examples.ExportMeshExampleEditor02525550%
 
00
 
USD.NET.Examples.Explode01919510%
 
00
 
Unity.Formats.USD.HelloUsd02727710%
 
00
 
Unity.Formats.USD.Examples.HelloUsdExample02727710%
 
00
 
Unity.Formats.USD.ImportMaterials02192194150%
 
00
 
Unity.Formats.USD.Examples.ImportMaterialsExample02192194150%
 
00
 
Unity.Formats.USD.ImportMesh081812130%
 
00
 
Unity.Formats.USD.Examples.ImportMeshExample058581530%
 
00
 
Unity.Formats.USD.Examples.UsdImportMeshEditor02323600%
 
00
 
Unity.Formats.USD.ImportProcessor01261262970%
 
00
 
Unity.Formats.USD.Examples.CombineMeshes086861490%
 
00
 
Unity.Formats.USD.Examples.RegexImportProcessor01616760%
 
00
 
Unity.Formats.USD.Examples.SetHideFlags02424720%
 
00
 
Unity.Formats.USD.Runtime3050370767571774845.1%
  
00
 
Unity.Formats.USD.CameraExporter149236160.8%
  
00
 
Unity.Formats.USD.CameraImporter60638100%
 
00
 
Unity.Formats.USD.CubeImporter4912617529028%
  
00
 
Unity.Formats.USD.ExportContext14014791100%
 
00
 
Unity.Formats.USD.ExportHelpers297366080.5%
  
00
 
Unity.Formats.USD.ExportPlan101791100%
 
00
 
Unity.Formats.USD.HdrpShaderExporter01621622460%
 
00
 
Unity.Formats.USD.HdrpShaderImporter01211211900%
 
00
 
Unity.Formats.USD.HierarchyBuilder35415250688369.9%
  
00
 
Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]0338830%
 
00
 
Unity.Formats.USD.ImporterBase25244911651%
  
00
 
Unity.Formats.USD.ImportHelpers923612823771.8%
  
00
 
Unity.Formats.USD.InitUsd194239582.6%
  
00
 
Unity.Formats.USD.InstanceImporter49439217753.2%
  
00
 
Unity.Formats.USD.MaterialExporter4465011988%
  
00
 
Unity.Formats.USD.MaterialImporter5316722038924%
  
00
 
Unity.Formats.USD.MaterialMap65158021181.2%
  
00
 
Unity.Formats.USD.MeshExporter12013525548547%
  
00
 
Unity.Formats.USD.MeshImporter16815832681851.5%
  
00
 
Unity.Formats.USD.MeshImportOptions14014114100%
 
00
 
Unity.Formats.USD.MeshImportStrategy754812381860.9%
  
00
 
Unity.Formats.USD.NativeExporter5961012074.9%
  
00
 
Unity.Formats.USD.NativeImporter5981031844.8%
  
00
 
Unity.Formats.USD.NativeSerialization01821824050%
 
00
 
Unity.Formats.USD.PrimMap57268317168.6%
  
00
 
Unity.Formats.USD.ReadAllJob[T]55247917669.6%
  
00
 
Unity.Formats.USD.SanitizedCameraSample404484100%
 
00
 
Unity.Formats.USD.SanitizedMeshSample2263726348485.9%
  
00
 
Unity.Formats.USD.SanitizedXformSample404484100%
 
00
 
Unity.Formats.USD.SceneExporter15821937779141.9%
  
00
 
Unity.Formats.USD.SceneImporter531259790127767.2%
  
00
 
Unity.Formats.USD.SceneImportOptions22022164100%
 
00
 
Unity.Formats.USD.ShaderExporterBase01551553290%
 
00
 
Unity.Formats.USD.ShaderImporterBase52156717477.6%
  
00
 
Unity.Formats.USD.SkelBindingSample0661210%
 
00
 
Unity.Formats.USD.SkeletonExporter01141142090%
 
00
 
Unity.Formats.USD.SkeletonImporter1027717930156.9%
  
00
 
Unity.Formats.USD.SkeletonIo0771210%
 
00
 
Unity.Formats.USD.SkelRootSample0221210%
 
00
 
Unity.Formats.USD.SkinnedMeshUnityDiff070701610%
 
00
 
Unity.Formats.USD.SkinnedMeshUsdDiff02152153690%
 
00
 
Unity.Formats.USD.SphereImporter56167215777.7%
  
00
 
Unity.Formats.USD.StandardShaderExporter5623829446319%
  
00
 
Unity.Formats.USD.StandardShaderImporter396510416237.5%
  
00
 
Unity.Formats.USD.UnityMaterialData30338100%
 
00
 
Unity.Formats.USD.UnityPreviewSurfaceSample10138100%
 
00
 
Unity.Formats.USD.UsdAsset21624746394246.6%
  
00
 
Unity.Formats.USD.UsdLayerStack059591270%
 
00
 
Unity.Formats.USD.UsdPayload2202286100%
 
00
 
Unity.Formats.USD.UsdPlayableAsset02727720%
 
00
 
Unity.Formats.USD.UsdPlayableBehaviour03939940%
 
00
 
Unity.Formats.USD.UsdPlayableTrack044310%
 
00
 
Unity.Formats.USD.UsdRecorderBehaviour936716031558.1%
  
00
 
Unity.Formats.USD.UsdRecorderClip192217290.4%
  
00
 
Unity.Formats.USD.UsdVariantSet184229281.8%
  
00
 
Unity.Formats.USD.UsdWaitForEndOfFrame314357888.5%
  
00
 
Unity.Formats.USD.UsdzExporter03434950%
 
00
 
Unity.Formats.USD.XformExporter25446914536.2%
  
00
 
Unity.Formats.USD.XformImporter59399819660.2%
  
00
 
Unity.Formats.USD.UsdTimelinePlayable077380%
 
00
 
Unity.Formats.USD.Examples.SetDefaultUSDMesh077380%
 
00
 
+
+
+ + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/main.js b/TestProject/Usd-Development/CodeCoverage/Report/main.js new file mode 100644 index 000000000..337cb2e20 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/main.js @@ -0,0 +1,389 @@ +/* Chartist.js 0.11.0 + * Copyright © 2017 Gion Kunz + * Free to use under either the WTFPL license or the MIT license. + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL + * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT + */ + +!function (a, b) { "function" == typeof define && define.amd ? define("Chartist", [], function () { return a.Chartist = b() }) : "object" == typeof module && module.exports ? module.exports = b() : a.Chartist = b() }(this, function () { + var a = { version: "0.11.0" }; return function (a, b, c) { "use strict"; c.namespaces = { svg: "http://www.w3.org/2000/svg", xmlns: "http://www.w3.org/2000/xmlns/", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", ct: "http://gionkunz.github.com/chartist-js/ct" }, c.noop = function (a) { return a }, c.alphaNumerate = function (a) { return String.fromCharCode(97 + a % 26) }, c.extend = function (a) { var b, d, e; for (a = a || {}, b = 1; b < arguments.length; b++) { d = arguments[b]; for (var f in d) e = d[f], "object" != typeof e || null === e || e instanceof Array ? a[f] = e : a[f] = c.extend(a[f], e) } return a }, c.replaceAll = function (a, b, c) { return a.replace(new RegExp(b, "g"), c) }, c.ensureUnit = function (a, b) { return "number" == typeof a && (a += b), a }, c.quantity = function (a) { if ("string" == typeof a) { var b = /^(\d+)\s*(.*)$/g.exec(a); return { value: +b[1], unit: b[2] || void 0 } } return { value: a } }, c.querySelector = function (a) { return a instanceof Node ? a : b.querySelector(a) }, c.times = function (a) { return Array.apply(null, new Array(a)) }, c.sum = function (a, b) { return a + (b ? b : 0) }, c.mapMultiply = function (a) { return function (b) { return b * a } }, c.mapAdd = function (a) { return function (b) { return b + a } }, c.serialMap = function (a, b) { var d = [], e = Math.max.apply(null, a.map(function (a) { return a.length })); return c.times(e).forEach(function (c, e) { var f = a.map(function (a) { return a[e] }); d[e] = b.apply(null, f) }), d }, c.roundWithPrecision = function (a, b) { var d = Math.pow(10, b || c.precision); return Math.round(a * d) / d }, c.precision = 8, c.escapingMap = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, c.serialize = function (a) { return null === a || void 0 === a ? a : ("number" == typeof a ? a = "" + a : "object" == typeof a && (a = JSON.stringify({ data: a })), Object.keys(c.escapingMap).reduce(function (a, b) { return c.replaceAll(a, b, c.escapingMap[b]) }, a)) }, c.deserialize = function (a) { if ("string" != typeof a) return a; a = Object.keys(c.escapingMap).reduce(function (a, b) { return c.replaceAll(a, c.escapingMap[b], b) }, a); try { a = JSON.parse(a), a = void 0 !== a.data ? a.data : a } catch (b) { } return a }, c.createSvg = function (a, b, d, e) { var f; return b = b || "100%", d = d || "100%", Array.prototype.slice.call(a.querySelectorAll("svg")).filter(function (a) { return a.getAttributeNS(c.namespaces.xmlns, "ct") }).forEach(function (b) { a.removeChild(b) }), f = new c.Svg("svg").attr({ width: b, height: d }).addClass(e), f._node.style.width = b, f._node.style.height = d, a.appendChild(f._node), f }, c.normalizeData = function (a, b, d) { var e, f = { raw: a, normalized: {} }; return f.normalized.series = c.getDataArray({ series: a.series || [] }, b, d), e = f.normalized.series.every(function (a) { return a instanceof Array }) ? Math.max.apply(null, f.normalized.series.map(function (a) { return a.length })) : f.normalized.series.length, f.normalized.labels = (a.labels || []).slice(), Array.prototype.push.apply(f.normalized.labels, c.times(Math.max(0, e - f.normalized.labels.length)).map(function () { return "" })), b && c.reverseData(f.normalized), f }, c.safeHasProperty = function (a, b) { return null !== a && "object" == typeof a && a.hasOwnProperty(b) }, c.isDataHoleValue = function (a) { return null === a || void 0 === a || "number" == typeof a && isNaN(a) }, c.reverseData = function (a) { a.labels.reverse(), a.series.reverse(); for (var b = 0; b < a.series.length; b++)"object" == typeof a.series[b] && void 0 !== a.series[b].data ? a.series[b].data.reverse() : a.series[b] instanceof Array && a.series[b].reverse() }, c.getDataArray = function (a, b, d) { function e(a) { if (c.safeHasProperty(a, "value")) return e(a.value); if (c.safeHasProperty(a, "data")) return e(a.data); if (a instanceof Array) return a.map(e); if (!c.isDataHoleValue(a)) { if (d) { var b = {}; return "string" == typeof d ? b[d] = c.getNumberOrUndefined(a) : b.y = c.getNumberOrUndefined(a), b.x = a.hasOwnProperty("x") ? c.getNumberOrUndefined(a.x) : b.x, b.y = a.hasOwnProperty("y") ? c.getNumberOrUndefined(a.y) : b.y, b } return c.getNumberOrUndefined(a) } } return a.series.map(e) }, c.normalizePadding = function (a, b) { return b = b || 0, "number" == typeof a ? { top: a, right: a, bottom: a, left: a } : { top: "number" == typeof a.top ? a.top : b, right: "number" == typeof a.right ? a.right : b, bottom: "number" == typeof a.bottom ? a.bottom : b, left: "number" == typeof a.left ? a.left : b } }, c.getMetaData = function (a, b) { var c = a.data ? a.data[b] : a[b]; return c ? c.meta : void 0 }, c.orderOfMagnitude = function (a) { return Math.floor(Math.log(Math.abs(a)) / Math.LN10) }, c.projectLength = function (a, b, c) { return b / c.range * a }, c.getAvailableHeight = function (a, b) { return Math.max((c.quantity(b.height).value || a.height()) - (b.chartPadding.top + b.chartPadding.bottom) - b.axisX.offset, 0) }, c.getHighLow = function (a, b, d) { function e(a) { if (void 0 !== a) if (a instanceof Array) for (var b = 0; b < a.length; b++)e(a[b]); else { var c = d ? +a[d] : +a; g && c > f.high && (f.high = c), h && c < f.low && (f.low = c) } } b = c.extend({}, b, d ? b["axis" + d.toUpperCase()] : {}); var f = { high: void 0 === b.high ? -Number.MAX_VALUE : +b.high, low: void 0 === b.low ? Number.MAX_VALUE : +b.low }, g = void 0 === b.high, h = void 0 === b.low; return (g || h) && e(a), (b.referenceValue || 0 === b.referenceValue) && (f.high = Math.max(b.referenceValue, f.high), f.low = Math.min(b.referenceValue, f.low)), f.high <= f.low && (0 === f.low ? f.high = 1 : f.low < 0 ? f.high = 0 : f.high > 0 ? f.low = 0 : (f.high = 1, f.low = 0)), f }, c.isNumeric = function (a) { return null !== a && isFinite(a) }, c.isFalseyButZero = function (a) { return !a && 0 !== a }, c.getNumberOrUndefined = function (a) { return c.isNumeric(a) ? +a : void 0 }, c.isMultiValue = function (a) { return "object" == typeof a && ("x" in a || "y" in a) }, c.getMultiValue = function (a, b) { return c.isMultiValue(a) ? c.getNumberOrUndefined(a[b || "y"]) : c.getNumberOrUndefined(a) }, c.rho = function (a) { function b(a, c) { return a % c === 0 ? c : b(c, a % c) } function c(a) { return a * a + 1 } if (1 === a) return a; var d, e = 2, f = 2; if (a % 2 === 0) return 2; do e = c(e) % a, f = c(c(f)) % a, d = b(Math.abs(e - f), a); while (1 === d); return d }, c.getBounds = function (a, b, d, e) { function f(a, b) { return a === (a += b) && (a *= 1 + (b > 0 ? o : -o)), a } var g, h, i, j = 0, k = { high: b.high, low: b.low }; k.valueRange = k.high - k.low, k.oom = c.orderOfMagnitude(k.valueRange), k.step = Math.pow(10, k.oom), k.min = Math.floor(k.low / k.step) * k.step, k.max = Math.ceil(k.high / k.step) * k.step, k.range = k.max - k.min, k.numberOfSteps = Math.round(k.range / k.step); var l = c.projectLength(a, k.step, k), m = l < d, n = e ? c.rho(k.range) : 0; if (e && c.projectLength(a, 1, k) >= d) k.step = 1; else if (e && n < k.step && c.projectLength(a, n, k) >= d) k.step = n; else for (; ;) { if (m && c.projectLength(a, k.step, k) <= d) k.step *= 2; else { if (m || !(c.projectLength(a, k.step / 2, k) >= d)) break; if (k.step /= 2, e && k.step % 1 !== 0) { k.step *= 2; break } } if (j++ > 1e3) throw new Error("Exceeded maximum number of iterations while optimizing scale step!") } var o = 2.221e-16; for (k.step = Math.max(k.step, o), h = k.min, i = k.max; h + k.step <= k.low;)h = f(h, k.step); for (; i - k.step >= k.high;)i = f(i, -k.step); k.min = h, k.max = i, k.range = k.max - k.min; var p = []; for (g = k.min; g <= k.max; g = f(g, k.step)) { var q = c.roundWithPrecision(g); q !== p[p.length - 1] && p.push(q) } return k.values = p, k }, c.polarToCartesian = function (a, b, c, d) { var e = (d - 90) * Math.PI / 180; return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) } }, c.createChartRect = function (a, b, d) { var e = !(!b.axisX && !b.axisY), f = e ? b.axisY.offset : 0, g = e ? b.axisX.offset : 0, h = a.width() || c.quantity(b.width).value || 0, i = a.height() || c.quantity(b.height).value || 0, j = c.normalizePadding(b.chartPadding, d); h = Math.max(h, f + j.left + j.right), i = Math.max(i, g + j.top + j.bottom); var k = { padding: j, width: function () { return this.x2 - this.x1 }, height: function () { return this.y1 - this.y2 } }; return e ? ("start" === b.axisX.position ? (k.y2 = j.top + g, k.y1 = Math.max(i - j.bottom, k.y2 + 1)) : (k.y2 = j.top, k.y1 = Math.max(i - j.bottom - g, k.y2 + 1)), "start" === b.axisY.position ? (k.x1 = j.left + f, k.x2 = Math.max(h - j.right, k.x1 + 1)) : (k.x1 = j.left, k.x2 = Math.max(h - j.right - f, k.x1 + 1))) : (k.x1 = j.left, k.x2 = Math.max(h - j.right, k.x1 + 1), k.y2 = j.top, k.y1 = Math.max(i - j.bottom, k.y2 + 1)), k }, c.createGrid = function (a, b, d, e, f, g, h, i) { var j = {}; j[d.units.pos + "1"] = a, j[d.units.pos + "2"] = a, j[d.counterUnits.pos + "1"] = e, j[d.counterUnits.pos + "2"] = e + f; var k = g.elem("line", j, h.join(" ")); i.emit("draw", c.extend({ type: "grid", axis: d, index: b, group: g, element: k }, j)) }, c.createGridBackground = function (a, b, c, d) { var e = a.elem("rect", { x: b.x1, y: b.y2, width: b.width(), height: b.height() }, c, !0); d.emit("draw", { type: "gridBackground", group: a, element: e }) }, c.createLabel = function (a, d, e, f, g, h, i, j, k, l, m) { var n, o = {}; if (o[g.units.pos] = a + i[g.units.pos], o[g.counterUnits.pos] = i[g.counterUnits.pos], o[g.units.len] = d, o[g.counterUnits.len] = Math.max(0, h - 10), l) { var p = b.createElement("span"); p.className = k.join(" "), p.setAttribute("xmlns", c.namespaces.xhtml), p.innerText = f[e], p.style[g.units.len] = Math.round(o[g.units.len]) + "px", p.style[g.counterUnits.len] = Math.round(o[g.counterUnits.len]) + "px", n = j.foreignObject(p, c.extend({ style: "overflow: visible;" }, o)) } else n = j.elem("text", o, k.join(" ")).text(f[e]); m.emit("draw", c.extend({ type: "label", axis: g, index: e, group: j, element: n, text: f[e] }, o)) }, c.getSeriesOption = function (a, b, c) { if (a.name && b.series && b.series[a.name]) { var d = b.series[a.name]; return d.hasOwnProperty(c) ? d[c] : b[c] } return b[c] }, c.optionsProvider = function (b, d, e) { function f(b) { var f = h; if (h = c.extend({}, j), d) for (i = 0; i < d.length; i++) { var g = a.matchMedia(d[i][0]); g.matches && (h = c.extend(h, d[i][1])) } e && b && e.emit("optionsChanged", { previousOptions: f, currentOptions: h }) } function g() { k.forEach(function (a) { a.removeListener(f) }) } var h, i, j = c.extend({}, b), k = []; if (!a.matchMedia) throw "window.matchMedia not found! Make sure you're using a polyfill."; if (d) for (i = 0; i < d.length; i++) { var l = a.matchMedia(d[i][0]); l.addListener(f), k.push(l) } return f(), { removeMediaQueryListeners: g, getCurrentOptions: function () { return c.extend({}, h) } } }, c.splitIntoSegments = function (a, b, d) { var e = { increasingX: !1, fillHoles: !1 }; d = c.extend({}, e, d); for (var f = [], g = !0, h = 0; h < a.length; h += 2)void 0 === c.getMultiValue(b[h / 2].value) ? d.fillHoles || (g = !0) : (d.increasingX && h >= 2 && a[h] <= a[h - 2] && (g = !0), g && (f.push({ pathCoordinates: [], valueData: [] }), g = !1), f[f.length - 1].pathCoordinates.push(a[h], a[h + 1]), f[f.length - 1].valueData.push(b[h / 2])); return f } }(window, document, a), function (a, b, c) { "use strict"; c.Interpolation = {}, c.Interpolation.none = function (a) { var b = { fillHoles: !1 }; return a = c.extend({}, b, a), function (b, d) { for (var e = new c.Svg.Path, f = !0, g = 0; g < b.length; g += 2) { var h = b[g], i = b[g + 1], j = d[g / 2]; void 0 !== c.getMultiValue(j.value) ? (f ? e.move(h, i, !1, j) : e.line(h, i, !1, j), f = !1) : a.fillHoles || (f = !0) } return e } }, c.Interpolation.simple = function (a) { var b = { divisor: 2, fillHoles: !1 }; a = c.extend({}, b, a); var d = 1 / Math.max(1, a.divisor); return function (b, e) { for (var f, g, h, i = new c.Svg.Path, j = 0; j < b.length; j += 2) { var k = b[j], l = b[j + 1], m = (k - f) * d, n = e[j / 2]; void 0 !== n.value ? (void 0 === h ? i.move(k, l, !1, n) : i.curve(f + m, g, k - m, l, k, l, !1, n), f = k, g = l, h = n) : a.fillHoles || (f = k = h = void 0) } return i } }, c.Interpolation.cardinal = function (a) { var b = { tension: 1, fillHoles: !1 }; a = c.extend({}, b, a); var d = Math.min(1, Math.max(0, a.tension)), e = 1 - d; return function f(b, g) { var h = c.splitIntoSegments(b, g, { fillHoles: a.fillHoles }); if (h.length) { if (h.length > 1) { var i = []; return h.forEach(function (a) { i.push(f(a.pathCoordinates, a.valueData)) }), c.Svg.Path.join(i) } if (b = h[0].pathCoordinates, g = h[0].valueData, b.length <= 4) return c.Interpolation.none()(b, g); for (var j, k = (new c.Svg.Path).move(b[0], b[1], !1, g[0]), l = 0, m = b.length; m - 2 * !j > l; l += 2) { var n = [{ x: +b[l - 2], y: +b[l - 1] }, { x: +b[l], y: +b[l + 1] }, { x: +b[l + 2], y: +b[l + 3] }, { x: +b[l + 4], y: +b[l + 5] }]; j ? l ? m - 4 === l ? n[3] = { x: +b[0], y: +b[1] } : m - 2 === l && (n[2] = { x: +b[0], y: +b[1] }, n[3] = { x: +b[2], y: +b[3] }) : n[0] = { x: +b[m - 2], y: +b[m - 1] } : m - 4 === l ? n[3] = n[2] : l || (n[0] = { x: +b[l], y: +b[l + 1] }), k.curve(d * (-n[0].x + 6 * n[1].x + n[2].x) / 6 + e * n[2].x, d * (-n[0].y + 6 * n[1].y + n[2].y) / 6 + e * n[2].y, d * (n[1].x + 6 * n[2].x - n[3].x) / 6 + e * n[2].x, d * (n[1].y + 6 * n[2].y - n[3].y) / 6 + e * n[2].y, n[2].x, n[2].y, !1, g[(l + 2) / 2]) } return k } return c.Interpolation.none()([]) } }, c.Interpolation.monotoneCubic = function (a) { var b = { fillHoles: !1 }; return a = c.extend({}, b, a), function d(b, e) { var f = c.splitIntoSegments(b, e, { fillHoles: a.fillHoles, increasingX: !0 }); if (f.length) { if (f.length > 1) { var g = []; return f.forEach(function (a) { g.push(d(a.pathCoordinates, a.valueData)) }), c.Svg.Path.join(g) } if (b = f[0].pathCoordinates, e = f[0].valueData, b.length <= 4) return c.Interpolation.none()(b, e); var h, i, j = [], k = [], l = b.length / 2, m = [], n = [], o = [], p = []; for (h = 0; h < l; h++)j[h] = b[2 * h], k[h] = b[2 * h + 1]; for (h = 0; h < l - 1; h++)o[h] = k[h + 1] - k[h], p[h] = j[h + 1] - j[h], n[h] = o[h] / p[h]; for (m[0] = n[0], m[l - 1] = n[l - 2], h = 1; h < l - 1; h++)0 === n[h] || 0 === n[h - 1] || n[h - 1] > 0 != n[h] > 0 ? m[h] = 0 : (m[h] = 3 * (p[h - 1] + p[h]) / ((2 * p[h] + p[h - 1]) / n[h - 1] + (p[h] + 2 * p[h - 1]) / n[h]), isFinite(m[h]) || (m[h] = 0)); for (i = (new c.Svg.Path).move(j[0], k[0], !1, e[0]), h = 0; h < l - 1; h++)i.curve(j[h] + p[h] / 3, k[h] + m[h] * p[h] / 3, j[h + 1] - p[h] / 3, k[h + 1] - m[h + 1] * p[h] / 3, j[h + 1], k[h + 1], !1, e[h + 1]); return i } return c.Interpolation.none()([]) } }, c.Interpolation.step = function (a) { var b = { postpone: !0, fillHoles: !1 }; return a = c.extend({}, b, a), function (b, d) { for (var e, f, g, h = new c.Svg.Path, i = 0; i < b.length; i += 2) { var j = b[i], k = b[i + 1], l = d[i / 2]; void 0 !== l.value ? (void 0 === g ? h.move(j, k, !1, l) : (a.postpone ? h.line(j, f, !1, g) : h.line(e, k, !1, l), h.line(j, k, !1, l)), e = j, f = k, g = l) : a.fillHoles || (e = f = g = void 0) } return h } } }(window, document, a), function (a, b, c) { "use strict"; c.EventEmitter = function () { function a(a, b) { d[a] = d[a] || [], d[a].push(b) } function b(a, b) { d[a] && (b ? (d[a].splice(d[a].indexOf(b), 1), 0 === d[a].length && delete d[a]) : delete d[a]) } function c(a, b) { d[a] && d[a].forEach(function (a) { a(b) }), d["*"] && d["*"].forEach(function (c) { c(a, b) }) } var d = []; return { addEventHandler: a, removeEventHandler: b, emit: c } } }(window, document, a), function (a, b, c) { "use strict"; function d(a) { var b = []; if (a.length) for (var c = 0; c < a.length; c++)b.push(a[c]); return b } function e(a, b) { var d = b || this.prototype || c.Class, e = Object.create(d); c.Class.cloneDefinitions(e, a); var f = function () { var a, b = e.constructor || function () { }; return a = this === c ? Object.create(e) : this, b.apply(a, Array.prototype.slice.call(arguments, 0)), a }; return f.prototype = e, f["super"] = d, f.extend = this.extend, f } function f() { var a = d(arguments), b = a[0]; return a.splice(1, a.length - 1).forEach(function (a) { Object.getOwnPropertyNames(a).forEach(function (c) { delete b[c], Object.defineProperty(b, c, Object.getOwnPropertyDescriptor(a, c)) }) }), b } c.Class = { extend: e, cloneDefinitions: f } }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d) { return a && (this.data = a || {}, this.data.labels = this.data.labels || [], this.data.series = this.data.series || [], this.eventEmitter.emit("data", { type: "update", data: this.data })), b && (this.options = c.extend({}, d ? this.options : this.defaultOptions, b), this.initializeTimeoutId || (this.optionsProvider.removeMediaQueryListeners(), this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter))), this.initializeTimeoutId || this.createChart(this.optionsProvider.getCurrentOptions()), this } function e() { return this.initializeTimeoutId ? a.clearTimeout(this.initializeTimeoutId) : (a.removeEventListener("resize", this.resizeListener), this.optionsProvider.removeMediaQueryListeners()), this } function f(a, b) { return this.eventEmitter.addEventHandler(a, b), this } function g(a, b) { return this.eventEmitter.removeEventHandler(a, b), this } function h() { a.addEventListener("resize", this.resizeListener), this.optionsProvider = c.optionsProvider(this.options, this.responsiveOptions, this.eventEmitter), this.eventEmitter.addEventHandler("optionsChanged", function () { this.update() }.bind(this)), this.options.plugins && this.options.plugins.forEach(function (a) { a instanceof Array ? a[0](this, a[1]) : a(this) }.bind(this)), this.eventEmitter.emit("data", { type: "initial", data: this.data }), this.createChart(this.optionsProvider.getCurrentOptions()), this.initializeTimeoutId = void 0 } function i(a, b, d, e, f) { this.container = c.querySelector(a), this.data = b || {}, this.data.labels = this.data.labels || [], this.data.series = this.data.series || [], this.defaultOptions = d, this.options = e, this.responsiveOptions = f, this.eventEmitter = c.EventEmitter(), this.supportsForeignObject = c.Svg.isSupported("Extensibility"), this.supportsAnimations = c.Svg.isSupported("AnimationEventsAttribute"), this.resizeListener = function () { this.update() }.bind(this), this.container && (this.container.__chartist__ && this.container.__chartist__.detach(), this.container.__chartist__ = this), this.initializeTimeoutId = setTimeout(h.bind(this), 0) } c.Base = c.Class.extend({ constructor: i, optionsProvider: void 0, container: void 0, svg: void 0, eventEmitter: void 0, createChart: function () { throw new Error("Base chart type can't be instantiated!") }, update: d, detach: e, on: f, off: g, version: c.version, supportsForeignObject: !1 }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, d, e, f, g) { a instanceof Element ? this._node = a : (this._node = b.createElementNS(c.namespaces.svg, a), "svg" === a && this.attr({ "xmlns:ct": c.namespaces.ct })), d && this.attr(d), e && this.addClass(e), f && (g && f._node.firstChild ? f._node.insertBefore(this._node, f._node.firstChild) : f._node.appendChild(this._node)) } function e(a, b) { return "string" == typeof a ? b ? this._node.getAttributeNS(b, a) : this._node.getAttribute(a) : (Object.keys(a).forEach(function (b) { if (void 0 !== a[b]) if (b.indexOf(":") !== -1) { var d = b.split(":"); this._node.setAttributeNS(c.namespaces[d[0]], b, a[b]) } else this._node.setAttribute(b, a[b]) }.bind(this)), this) } function f(a, b, d, e) { return new c.Svg(a, b, d, this, e) } function g() { return this._node.parentNode instanceof SVGElement ? new c.Svg(this._node.parentNode) : null } function h() { for (var a = this._node; "svg" !== a.nodeName;)a = a.parentNode; return new c.Svg(a) } function i(a) { var b = this._node.querySelector(a); return b ? new c.Svg(b) : null } function j(a) { var b = this._node.querySelectorAll(a); return b.length ? new c.Svg.List(b) : null } function k() { return this._node } function l(a, d, e, f) { if ("string" == typeof a) { var g = b.createElement("div"); g.innerHTML = a, a = g.firstChild } a.setAttribute("xmlns", c.namespaces.xmlns); var h = this.elem("foreignObject", d, e, f); return h._node.appendChild(a), h } function m(a) { return this._node.appendChild(b.createTextNode(a)), this } function n() { for (; this._node.firstChild;)this._node.removeChild(this._node.firstChild); return this } function o() { return this._node.parentNode.removeChild(this._node), this.parent() } function p(a) { return this._node.parentNode.replaceChild(a._node, this._node), a } function q(a, b) { return b && this._node.firstChild ? this._node.insertBefore(a._node, this._node.firstChild) : this._node.appendChild(a._node), this } function r() { return this._node.getAttribute("class") ? this._node.getAttribute("class").trim().split(/\s+/) : [] } function s(a) { return this._node.setAttribute("class", this.classes(this._node).concat(a.trim().split(/\s+/)).filter(function (a, b, c) { return c.indexOf(a) === b }).join(" ")), this } function t(a) { var b = a.trim().split(/\s+/); return this._node.setAttribute("class", this.classes(this._node).filter(function (a) { return b.indexOf(a) === -1 }).join(" ")), this } function u() { return this._node.setAttribute("class", ""), this } function v() { return this._node.getBoundingClientRect().height } function w() { return this._node.getBoundingClientRect().width } function x(a, b, d) { return void 0 === b && (b = !0), Object.keys(a).forEach(function (e) { function f(a, b) { var f, g, h, i = {}; a.easing && (h = a.easing instanceof Array ? a.easing : c.Svg.Easing[a.easing], delete a.easing), a.begin = c.ensureUnit(a.begin, "ms"), a.dur = c.ensureUnit(a.dur, "ms"), h && (a.calcMode = "spline", a.keySplines = h.join(" "), a.keyTimes = "0;1"), b && (a.fill = "freeze", i[e] = a.from, this.attr(i), g = c.quantity(a.begin || 0).value, a.begin = "indefinite"), f = this.elem("animate", c.extend({ attributeName: e }, a)), b && setTimeout(function () { try { f._node.beginElement() } catch (b) { i[e] = a.to, this.attr(i), f.remove() } }.bind(this), g), d && f._node.addEventListener("beginEvent", function () { d.emit("animationBegin", { element: this, animate: f._node, params: a }) }.bind(this)), f._node.addEventListener("endEvent", function () { d && d.emit("animationEnd", { element: this, animate: f._node, params: a }), b && (i[e] = a.to, this.attr(i), f.remove()) }.bind(this)) } a[e] instanceof Array ? a[e].forEach(function (a) { f.bind(this)(a, !1) }.bind(this)) : f.bind(this)(a[e], b) }.bind(this)), this } function y(a) { var b = this; this.svgElements = []; for (var d = 0; d < a.length; d++)this.svgElements.push(new c.Svg(a[d])); Object.keys(c.Svg.prototype).filter(function (a) { return ["constructor", "parent", "querySelector", "querySelectorAll", "replace", "append", "classes", "height", "width"].indexOf(a) === -1 }).forEach(function (a) { b[a] = function () { var d = Array.prototype.slice.call(arguments, 0); return b.svgElements.forEach(function (b) { c.Svg.prototype[a].apply(b, d) }), b } }) } c.Svg = c.Class.extend({ constructor: d, attr: e, elem: f, parent: g, root: h, querySelector: i, querySelectorAll: j, getNode: k, foreignObject: l, text: m, empty: n, remove: o, replace: p, append: q, classes: r, addClass: s, removeClass: t, removeAllClasses: u, height: v, width: w, animate: x }), c.Svg.isSupported = function (a) { return b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#" + a, "1.1") }; var z = { easeInSine: [.47, 0, .745, .715], easeOutSine: [.39, .575, .565, 1], easeInOutSine: [.445, .05, .55, .95], easeInQuad: [.55, .085, .68, .53], easeOutQuad: [.25, .46, .45, .94], easeInOutQuad: [.455, .03, .515, .955], easeInCubic: [.55, .055, .675, .19], easeOutCubic: [.215, .61, .355, 1], easeInOutCubic: [.645, .045, .355, 1], easeInQuart: [.895, .03, .685, .22], easeOutQuart: [.165, .84, .44, 1], easeInOutQuart: [.77, 0, .175, 1], easeInQuint: [.755, .05, .855, .06], easeOutQuint: [.23, 1, .32, 1], easeInOutQuint: [.86, 0, .07, 1], easeInExpo: [.95, .05, .795, .035], easeOutExpo: [.19, 1, .22, 1], easeInOutExpo: [1, 0, 0, 1], easeInCirc: [.6, .04, .98, .335], easeOutCirc: [.075, .82, .165, 1], easeInOutCirc: [.785, .135, .15, .86], easeInBack: [.6, -.28, .735, .045], easeOutBack: [.175, .885, .32, 1.275], easeInOutBack: [.68, -.55, .265, 1.55] }; c.Svg.Easing = z, c.Svg.List = c.Class.extend({ constructor: y }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e, f, g) { var h = c.extend({ command: f ? a.toLowerCase() : a.toUpperCase() }, b, g ? { data: g } : {}); d.splice(e, 0, h) } function e(a, b) { a.forEach(function (c, d) { u[c.command.toLowerCase()].forEach(function (e, f) { b(c, e, d, f, a) }) }) } function f(a, b) { this.pathElements = [], this.pos = 0, this.close = a, this.options = c.extend({}, v, b) } function g(a) { return void 0 !== a ? (this.pos = Math.max(0, Math.min(this.pathElements.length, a)), this) : this.pos } function h(a) { return this.pathElements.splice(this.pos, a), this } function i(a, b, c, e) { return d("M", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this } function j(a, b, c, e) { return d("L", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this } function k(a, b, c, e, f, g, h, i) { return d("C", { x1: +a, y1: +b, x2: +c, y2: +e, x: +f, y: +g }, this.pathElements, this.pos++, h, i), this } function l(a, b, c, e, f, g, h, i, j) { return d("A", { rx: +a, ry: +b, xAr: +c, lAf: +e, sf: +f, x: +g, y: +h }, this.pathElements, this.pos++, i, j), this } function m(a) { var b = a.replace(/([A-Za-z])([0-9])/g, "$1 $2").replace(/([0-9])([A-Za-z])/g, "$1 $2").split(/[\s,]+/).reduce(function (a, b) { return b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a }, []); "Z" === b[b.length - 1][0].toUpperCase() && b.pop(); var d = b.map(function (a) { var b = a.shift(), d = u[b.toLowerCase()]; return c.extend({ command: b }, d.reduce(function (b, c, d) { return b[c] = +a[d], b }, {})) }), e = [this.pos, 0]; return Array.prototype.push.apply(e, d), Array.prototype.splice.apply(this.pathElements, e), this.pos += d.length, this } function n() { var a = Math.pow(10, this.options.accuracy); return this.pathElements.reduce(function (b, c) { var d = u[c.command.toLowerCase()].map(function (b) { return this.options.accuracy ? Math.round(c[b] * a) / a : c[b] }.bind(this)); return b + c.command + d.join(",") }.bind(this), "") + (this.close ? "Z" : "") } function o(a, b) { return e(this.pathElements, function (c, d) { c[d] *= "x" === d[0] ? a : b }), this } function p(a, b) { return e(this.pathElements, function (c, d) { c[d] += "x" === d[0] ? a : b }), this } function q(a) { return e(this.pathElements, function (b, c, d, e, f) { var g = a(b, c, d, e, f); (g || 0 === g) && (b[c] = g) }), this } function r(a) { var b = new c.Svg.Path(a || this.close); return b.pos = this.pos, b.pathElements = this.pathElements.slice().map(function (a) { return c.extend({}, a) }), b.options = c.extend({}, this.options), b } function s(a) { var b = [new c.Svg.Path]; return this.pathElements.forEach(function (d) { d.command === a.toUpperCase() && 0 !== b[b.length - 1].pathElements.length && b.push(new c.Svg.Path), b[b.length - 1].pathElements.push(d) }), b } function t(a, b, d) { for (var e = new c.Svg.Path(b, d), f = 0; f < a.length; f++)for (var g = a[f], h = 0; h < g.pathElements.length; h++)e.pathElements.push(g.pathElements[h]); return e } var u = { m: ["x", "y"], l: ["x", "y"], c: ["x1", "y1", "x2", "y2", "x", "y"], a: ["rx", "ry", "xAr", "lAf", "sf", "x", "y"] }, v = { accuracy: 3 }; c.Svg.Path = c.Class.extend({ constructor: f, position: g, remove: h, move: i, line: j, curve: k, arc: l, scale: o, translate: p, transform: q, parse: m, stringify: n, clone: r, splitByCommand: s }), c.Svg.Path.elementDescriptions = u, c.Svg.Path.join = t }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, c, d) { this.units = a, this.counterUnits = a === f.x ? f.y : f.x, this.chartRect = b, this.axisLength = b[a.rectEnd] - b[a.rectStart], this.gridOffset = b[a.rectOffset], this.ticks = c, this.options = d } function e(a, b, d, e, f) { var g = e["axis" + this.units.pos.toUpperCase()], h = this.ticks.map(this.projectValue.bind(this)), i = this.ticks.map(g.labelInterpolationFnc); h.forEach(function (j, k) { var l, m = { x: 0, y: 0 }; l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30), c.isFalseyButZero(i[k]) && "" !== i[k] || ("x" === this.units.pos ? (j = this.chartRect.x1 + j, m.x = e.axisX.labelOffset.x, "start" === e.axisX.position ? m.y = this.chartRect.padding.top + e.axisX.labelOffset.y + (d ? 5 : 20) : m.y = this.chartRect.y1 + e.axisX.labelOffset.y + (d ? 5 : 20)) : (j = this.chartRect.y1 - j, m.y = e.axisY.labelOffset.y - (d ? l : 0), "start" === e.axisY.position ? m.x = d ? this.chartRect.padding.left + e.axisY.labelOffset.x : this.chartRect.x1 - 10 : m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10), g.showGrid && c.createGrid(j, k, this, this.gridOffset, this.chartRect[this.counterUnits.len](), a, [e.classNames.grid, e.classNames[this.units.dir]], f), g.showLabel && c.createLabel(j, l, k, i, this, g.offset, m, b, [e.classNames.label, e.classNames[this.units.dir], "start" === g.position ? e.classNames[g.position] : e.classNames.end], d, f)) }.bind(this)) } var f = { x: { pos: "x", len: "width", dir: "horizontal", rectStart: "x1", rectEnd: "x2", rectOffset: "y2" }, y: { pos: "y", len: "height", dir: "vertical", rectStart: "y2", rectEnd: "y1", rectOffset: "x1" } }; c.Axis = c.Class.extend({ constructor: d, createGridAndLabels: e, projectValue: function (a, b, c) { throw new Error("Base axis can't be instantiated!") } }), c.Axis.units = f }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { var f = e.highLow || c.getHighLow(b, e, a.pos); this.bounds = c.getBounds(d[a.rectEnd] - d[a.rectStart], f, e.scaleMinSpace || 20, e.onlyInteger), this.range = { min: this.bounds.min, max: this.bounds.max }, c.AutoScaleAxis["super"].constructor.call(this, a, d, this.bounds.values, e) } function e(a) { return this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.bounds.min) / this.bounds.range } c.AutoScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { var f = e.highLow || c.getHighLow(b, e, a.pos); this.divisor = e.divisor || 1, this.ticks = e.ticks || c.times(this.divisor).map(function (a, b) { return f.low + (f.high - f.low) / this.divisor * b }.bind(this)), this.ticks.sort(function (a, b) { return a - b }), this.range = { min: f.low, max: f.high }, c.FixedScaleAxis["super"].constructor.call(this, a, d, this.ticks, e), this.stepLength = this.axisLength / this.divisor } function e(a) { return this.axisLength * (+c.getMultiValue(a, this.units.pos) - this.range.min) / (this.range.max - this.range.min) } c.FixedScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, d, e) { c.StepAxis["super"].constructor.call(this, a, d, e.ticks, e); var f = Math.max(1, e.ticks.length - (e.stretch ? 1 : 0)); this.stepLength = this.axisLength / f } function e(a, b) { return this.stepLength * b } c.StepAxis = c.Axis.extend({ constructor: d, projectValue: e }) }(window, document, a), function (a, b, c) { "use strict"; function d(a) { var b = c.normalizeData(this.data, a.reverseData, !0); this.svg = c.createSvg(this.container, a.width, a.height, a.classNames.chart); var d, e, g = this.svg.elem("g").addClass(a.classNames.gridGroup), h = this.svg.elem("g"), i = this.svg.elem("g").addClass(a.classNames.labelGroup), j = c.createChartRect(this.svg, a, f.padding); d = void 0 === a.axisX.type ? new c.StepAxis(c.Axis.units.x, b.normalized.series, j, c.extend({}, a.axisX, { ticks: b.normalized.labels, stretch: a.fullWidth })) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, j, a.axisX), e = void 0 === a.axisY.type ? new c.AutoScaleAxis(c.Axis.units.y, b.normalized.series, j, c.extend({}, a.axisY, { high: c.isNumeric(a.high) ? a.high : a.axisY.high, low: c.isNumeric(a.low) ? a.low : a.axisY.low })) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, j, a.axisY), d.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), e.createGridAndLabels(g, i, this.supportsForeignObject, a, this.eventEmitter), a.showGridBackground && c.createGridBackground(g, j, a.classNames.gridBackground, this.eventEmitter), b.raw.series.forEach(function (f, g) { var i = h.elem("g"); i.attr({ "ct:series-name": f.name, "ct:meta": c.serialize(f.meta) }), i.addClass([a.classNames.series, f.className || a.classNames.series + "-" + c.alphaNumerate(g)].join(" ")); var k = [], l = []; b.normalized.series[g].forEach(function (a, h) { var i = { x: j.x1 + d.projectValue(a, h, b.normalized.series[g]), y: j.y1 - e.projectValue(a, h, b.normalized.series[g]) }; k.push(i.x, i.y), l.push({ value: a, valueIndex: h, meta: c.getMetaData(f, h) }) }.bind(this)); var m = { lineSmooth: c.getSeriesOption(f, a, "lineSmooth"), showPoint: c.getSeriesOption(f, a, "showPoint"), showLine: c.getSeriesOption(f, a, "showLine"), showArea: c.getSeriesOption(f, a, "showArea"), areaBase: c.getSeriesOption(f, a, "areaBase") }, n = "function" == typeof m.lineSmooth ? m.lineSmooth : m.lineSmooth ? c.Interpolation.monotoneCubic() : c.Interpolation.none(), o = n(k, l); if (m.showPoint && o.pathElements.forEach(function (b) { var h = i.elem("line", { x1: b.x, y1: b.y, x2: b.x + .01, y2: b.y }, a.classNames.point).attr({ "ct:value": [b.data.value.x, b.data.value.y].filter(c.isNumeric).join(","), "ct:meta": c.serialize(b.data.meta) }); this.eventEmitter.emit("draw", { type: "point", value: b.data.value, index: b.data.valueIndex, meta: b.data.meta, series: f, seriesIndex: g, axisX: d, axisY: e, group: i, element: h, x: b.x, y: b.y }) }.bind(this)), m.showLine) { var p = i.elem("path", { d: o.stringify() }, a.classNames.line, !0); this.eventEmitter.emit("draw", { type: "line", values: b.normalized.series[g], path: o.clone(), chartRect: j, index: g, series: f, seriesIndex: g, seriesMeta: f.meta, axisX: d, axisY: e, group: i, element: p }) } if (m.showArea && e.range) { var q = Math.max(Math.min(m.areaBase, e.range.max), e.range.min), r = j.y1 - e.projectValue(q); o.splitByCommand("M").filter(function (a) { return a.pathElements.length > 1 }).map(function (a) { var b = a.pathElements[0], c = a.pathElements[a.pathElements.length - 1]; return a.clone(!0).position(0).remove(1).move(b.x, r).line(b.x, b.y).position(a.pathElements.length + 1).line(c.x, r) }).forEach(function (c) { var h = i.elem("path", { d: c.stringify() }, a.classNames.area, !0); this.eventEmitter.emit("draw", { type: "area", values: b.normalized.series[g], path: c.clone(), series: f, seriesIndex: g, axisX: d, axisY: e, chartRect: j, index: g, group: i, element: h }) }.bind(this)) } }.bind(this)), this.eventEmitter.emit("created", { bounds: e.bounds, chartRect: j, axisX: d, axisY: e, svg: this.svg, options: a }) } function e(a, b, d, e) { c.Line["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e) } var f = { axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, type: void 0 }, axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, type: void 0, scaleMinSpace: 20, onlyInteger: !1 }, width: void 0, height: void 0, showLine: !0, showPoint: !0, showArea: !1, areaBase: 0, lineSmooth: !0, showGridBackground: !1, low: void 0, high: void 0, chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, fullWidth: !1, reverseData: !1, classNames: { chart: "ct-chart-line", label: "ct-label", labelGroup: "ct-labels", series: "ct-series", line: "ct-line", point: "ct-point", area: "ct-area", grid: "ct-grid", gridGroup: "ct-grids", gridBackground: "ct-grid-background", vertical: "ct-vertical", horizontal: "ct-horizontal", start: "ct-start", end: "ct-end" } }; c.Line = c.Base.extend({ constructor: e, createChart: d }) }(window, document, a), function (a, b, c) { + "use strict"; function d(a) { + var b, d; a.distributeSeries ? (b = c.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y"), b.normalized.series = b.normalized.series.map(function (a) { return [a] })) : b = c.normalizeData(this.data, a.reverseData, a.horizontalBars ? "x" : "y"), this.svg = c.createSvg(this.container, a.width, a.height, a.classNames.chart + (a.horizontalBars ? " " + a.classNames.horizontalBars : "")); var e = this.svg.elem("g").addClass(a.classNames.gridGroup), g = this.svg.elem("g"), h = this.svg.elem("g").addClass(a.classNames.labelGroup); if (a.stackBars && 0 !== b.normalized.series.length) { + var i = c.serialMap(b.normalized.series, function () { + return Array.prototype.slice.call(arguments).map(function (a) { return a }).reduce(function (a, b) { return { x: a.x + (b && b.x) || 0, y: a.y + (b && b.y) || 0 } }, { x: 0, y: 0 }) + }); d = c.getHighLow([i], a, a.horizontalBars ? "x" : "y") + } else d = c.getHighLow(b.normalized.series, a, a.horizontalBars ? "x" : "y"); d.high = +a.high || (0 === a.high ? 0 : d.high), d.low = +a.low || (0 === a.low ? 0 : d.low); var j, k, l, m, n, o = c.createChartRect(this.svg, a, f.padding); k = a.distributeSeries && a.stackBars ? b.normalized.labels.slice(0, 1) : b.normalized.labels, a.horizontalBars ? (j = m = void 0 === a.axisX.type ? new c.AutoScaleAxis(c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX, { highLow: d, referenceValue: 0 })) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, c.extend({}, a.axisX, { highLow: d, referenceValue: 0 })), l = n = void 0 === a.axisY.type ? new c.StepAxis(c.Axis.units.y, b.normalized.series, o, { ticks: k }) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, a.axisY)) : (l = m = void 0 === a.axisX.type ? new c.StepAxis(c.Axis.units.x, b.normalized.series, o, { ticks: k }) : a.axisX.type.call(c, c.Axis.units.x, b.normalized.series, o, a.axisX), j = n = void 0 === a.axisY.type ? new c.AutoScaleAxis(c.Axis.units.y, b.normalized.series, o, c.extend({}, a.axisY, { highLow: d, referenceValue: 0 })) : a.axisY.type.call(c, c.Axis.units.y, b.normalized.series, o, c.extend({}, a.axisY, { highLow: d, referenceValue: 0 }))); var p = a.horizontalBars ? o.x1 + j.projectValue(0) : o.y1 - j.projectValue(0), q = []; l.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), j.createGridAndLabels(e, h, this.supportsForeignObject, a, this.eventEmitter), a.showGridBackground && c.createGridBackground(e, o, a.classNames.gridBackground, this.eventEmitter), b.raw.series.forEach(function (d, e) { var f, h, i = e - (b.raw.series.length - 1) / 2; f = a.distributeSeries && !a.stackBars ? l.axisLength / b.normalized.series.length / 2 : a.distributeSeries && a.stackBars ? l.axisLength / 2 : l.axisLength / b.normalized.series[e].length / 2, h = g.elem("g"), h.attr({ "ct:series-name": d.name, "ct:meta": c.serialize(d.meta) }), h.addClass([a.classNames.series, d.className || a.classNames.series + "-" + c.alphaNumerate(e)].join(" ")), b.normalized.series[e].forEach(function (g, k) { var r, s, t, u; if (u = a.distributeSeries && !a.stackBars ? e : a.distributeSeries && a.stackBars ? 0 : k, r = a.horizontalBars ? { x: o.x1 + j.projectValue(g && g.x ? g.x : 0, k, b.normalized.series[e]), y: o.y1 - l.projectValue(g && g.y ? g.y : 0, u, b.normalized.series[e]) } : { x: o.x1 + l.projectValue(g && g.x ? g.x : 0, u, b.normalized.series[e]), y: o.y1 - j.projectValue(g && g.y ? g.y : 0, k, b.normalized.series[e]) }, l instanceof c.StepAxis && (l.options.stretch || (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)), r[l.units.pos] += a.stackBars || a.distributeSeries ? 0 : i * a.seriesBarDistance * (a.horizontalBars ? -1 : 1)), t = q[k] || p, q[k] = t - (p - r[l.counterUnits.pos]), void 0 !== g) { var v = {}; v[l.units.pos + "1"] = r[l.units.pos], v[l.units.pos + "2"] = r[l.units.pos], !a.stackBars || "accumulate" !== a.stackMode && a.stackMode ? (v[l.counterUnits.pos + "1"] = p, v[l.counterUnits.pos + "2"] = r[l.counterUnits.pos]) : (v[l.counterUnits.pos + "1"] = t, v[l.counterUnits.pos + "2"] = q[k]), v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2), v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2), v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1), v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1); var w = c.getMetaData(d, k); s = h.elem("line", v, a.classNames.bar).attr({ "ct:value": [g.x, g.y].filter(c.isNumeric).join(","), "ct:meta": c.serialize(w) }), this.eventEmitter.emit("draw", c.extend({ type: "bar", value: g, index: k, meta: w, series: d, seriesIndex: e, axisX: m, axisY: n, chartRect: o, group: h, element: s }, v)) } }.bind(this)) }.bind(this)), this.eventEmitter.emit("created", { bounds: j.bounds, chartRect: o, axisX: m, axisY: n, svg: this.svg, options: a }) + } function e(a, b, d, e) { c.Bar["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e) } var f = { axisX: { offset: 30, position: "end", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, scaleMinSpace: 30, onlyInteger: !1 }, axisY: { offset: 40, position: "start", labelOffset: { x: 0, y: 0 }, showLabel: !0, showGrid: !0, labelInterpolationFnc: c.noop, scaleMinSpace: 20, onlyInteger: !1 }, width: void 0, height: void 0, high: void 0, low: void 0, referenceValue: 0, chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, seriesBarDistance: 15, stackBars: !1, stackMode: "accumulate", horizontalBars: !1, distributeSeries: !1, reverseData: !1, showGridBackground: !1, classNames: { chart: "ct-chart-bar", horizontalBars: "ct-horizontal-bars", label: "ct-label", labelGroup: "ct-labels", series: "ct-series", bar: "ct-bar", grid: "ct-grid", gridGroup: "ct-grids", gridBackground: "ct-grid-background", vertical: "ct-vertical", horizontal: "ct-horizontal", start: "ct-start", end: "ct-end" } }; c.Bar = c.Base.extend({ constructor: e, createChart: d }) + }(window, document, a), function (a, b, c) { "use strict"; function d(a, b, c) { var d = b.x > a.x; return d && "explode" === c || !d && "implode" === c ? "start" : d && "implode" === c || !d && "explode" === c ? "end" : "middle" } function e(a) { var b, e, f, h, i, j = c.normalizeData(this.data), k = [], l = a.startAngle; this.svg = c.createSvg(this.container, a.width, a.height, a.donut ? a.classNames.chartDonut : a.classNames.chartPie), e = c.createChartRect(this.svg, a, g.padding), f = Math.min(e.width() / 2, e.height() / 2), i = a.total || j.normalized.series.reduce(function (a, b) { return a + b }, 0); var m = c.quantity(a.donutWidth); "%" === m.unit && (m.value *= f / 100), f -= a.donut && !a.donutSolid ? m.value / 2 : 0, h = "outside" === a.labelPosition || a.donut && !a.donutSolid ? f : "center" === a.labelPosition ? 0 : a.donutSolid ? f - m.value / 2 : f / 2, h += a.labelOffset; var n = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 }, o = 1 === j.raw.series.filter(function (a) { return a.hasOwnProperty("value") ? 0 !== a.value : 0 !== a }).length; j.raw.series.forEach(function (a, b) { k[b] = this.svg.elem("g", null, null) }.bind(this)), a.showLabel && (b = this.svg.elem("g", null, null)), j.raw.series.forEach(function (e, g) { if (0 !== j.normalized.series[g] || !a.ignoreEmptyValues) { k[g].attr({ "ct:series-name": e.name }), k[g].addClass([a.classNames.series, e.className || a.classNames.series + "-" + c.alphaNumerate(g)].join(" ")); var p = i > 0 ? l + j.normalized.series[g] / i * 360 : 0, q = Math.max(0, l - (0 === g || o ? 0 : .2)); p - q >= 359.99 && (p = q + 359.99); var r, s, t, u = c.polarToCartesian(n.x, n.y, f, q), v = c.polarToCartesian(n.x, n.y, f, p), w = new c.Svg.Path(!a.donut || a.donutSolid).move(v.x, v.y).arc(f, f, 0, p - l > 180, 0, u.x, u.y); a.donut ? a.donutSolid && (t = f - m.value, r = c.polarToCartesian(n.x, n.y, t, l - (0 === g || o ? 0 : .2)), s = c.polarToCartesian(n.x, n.y, t, p), w.line(r.x, r.y), w.arc(t, t, 0, p - l > 180, 1, s.x, s.y)) : w.line(n.x, n.y); var x = a.classNames.slicePie; a.donut && (x = a.classNames.sliceDonut, a.donutSolid && (x = a.classNames.sliceDonutSolid)); var y = k[g].elem("path", { d: w.stringify() }, x); if (y.attr({ "ct:value": j.normalized.series[g], "ct:meta": c.serialize(e.meta) }), a.donut && !a.donutSolid && (y._node.style.strokeWidth = m.value + "px"), this.eventEmitter.emit("draw", { type: "slice", value: j.normalized.series[g], totalDataSum: i, index: g, meta: e.meta, series: e, group: k[g], element: y, path: w.clone(), center: n, radius: f, startAngle: l, endAngle: p }), a.showLabel) { var z; z = 1 === j.raw.series.length ? { x: n.x, y: n.y } : c.polarToCartesian(n.x, n.y, h, l + (p - l) / 2); var A; A = j.normalized.labels && !c.isFalseyButZero(j.normalized.labels[g]) ? j.normalized.labels[g] : j.normalized.series[g]; var B = a.labelInterpolationFnc(A, g); if (B || 0 === B) { var C = b.elem("text", { dx: z.x, dy: z.y, "text-anchor": d(n, z, a.labelDirection) }, a.classNames.label).text("" + B); this.eventEmitter.emit("draw", { type: "label", index: g, group: b, element: C, text: "" + B, x: z.x, y: z.y }) } } l = p } }.bind(this)), this.eventEmitter.emit("created", { chartRect: e, svg: this.svg, options: a }) } function f(a, b, d, e) { c.Pie["super"].constructor.call(this, a, b, g, c.extend({}, g, d), e) } var g = { width: void 0, height: void 0, chartPadding: 5, classNames: { chartPie: "ct-chart-pie", chartDonut: "ct-chart-donut", series: "ct-series", slicePie: "ct-slice-pie", sliceDonut: "ct-slice-donut", sliceDonutSolid: "ct-slice-donut-solid", label: "ct-label" }, startAngle: 0, total: void 0, donut: !1, donutSolid: !1, donutWidth: 60, showLabel: !0, labelOffset: 0, labelPosition: "inside", labelInterpolationFnc: c.noop, labelDirection: "neutral", reverseData: !1, ignoreEmptyValues: !1 }; c.Pie = c.Base.extend({ constructor: f, createChart: e, determineAnchorPosition: d }) }(window, document, a), a +}); + +var i, l, selectedLine = null; + +/* Navigate to hash without browser history entry */ +var navigateToHash = function () { + if (window.history !== undefined && window.history.replaceState !== undefined) { + window.history.replaceState(undefined, undefined, this.getAttribute("href")); + } +}; + +var hashLinks = document.getElementsByClassName('navigatetohash'); +for (i = 0, l = hashLinks.length; i < l; i++) { + hashLinks[i].addEventListener('click', navigateToHash); +} + +/* Switch test method */ +var switchTestMethod = function () { + var method = this.getAttribute("value"); + console.log("Selected test method: " + method); + + var lines, i, l, coverageData, lineAnalysis, cells; + + lines = document.querySelectorAll('.lineAnalysis tr'); + + for (i = 1, l = lines.length; i < l; i++) { + coverageData = JSON.parse(lines[i].getAttribute('data-coverage').replace(/'/g, '"')); + lineAnalysis = coverageData[method]; + cells = lines[i].querySelectorAll('td'); + if (lineAnalysis === undefined) { + lineAnalysis = coverageData.AllTestMethods; + if (lineAnalysis.LVS !== 'gray') { + cells[0].setAttribute('class', 'red'); + cells[1].innerText = cells[1].textContent = '0'; + cells[4].setAttribute('class', 'lightred'); + } + } else { + cells[0].setAttribute('class', lineAnalysis.LVS); + cells[1].innerText = cells[1].textContent = lineAnalysis.VC; + cells[4].setAttribute('class', 'light' + lineAnalysis.LVS); + } + } +}; + +var testMethods = document.getElementsByClassName('switchtestmethod'); +for (i = 0, l = testMethods.length; i < l; i++) { + testMethods[i].addEventListener('change', switchTestMethod); +} + +/* Highlight test method by line */ +var toggleLine = function () { + if (selectedLine === this) { + selectedLine = null; + } else { + selectedLine = null; + unhighlightTestMethods(); + highlightTestMethods.call(this); + selectedLine = this; + } + +}; +var highlightTestMethods = function () { + if (selectedLine !== null) { + return; + } + + var lineAnalysis; + var coverageData = JSON.parse(this.getAttribute('data-coverage').replace(/'/g, '"')); + var testMethods = document.getElementsByClassName('testmethod'); + + for (i = 0, l = testMethods.length; i < l; i++) { + lineAnalysis = coverageData[testMethods[i].id]; + if (lineAnalysis === undefined) { + testMethods[i].className = testMethods[i].className.replace(/\s*light.+/g, ""); + } else { + testMethods[i].className += ' light' + lineAnalysis.LVS; + } + } +}; +var unhighlightTestMethods = function () { + if (selectedLine !== null) { + return; + } + + var testMethods = document.getElementsByClassName('testmethod'); + for (i = 0, l = testMethods.length; i < l; i++) { + testMethods[i].className = testMethods[i].className.replace(/\s*light.+/g, ""); + } +}; +var coverableLines = document.getElementsByClassName('coverableline'); +for (i = 0, l = coverableLines.length; i < l; i++) { + coverableLines[i].addEventListener('click', toggleLine); + coverableLines[i].addEventListener('mouseenter', highlightTestMethods); + coverableLines[i].addEventListener('mouseleave', unhighlightTestMethods); +} + +/* History charts */ +var renderChart = function (chart) { + // Remove current children (e.g. PNG placeholder) + while (chart.firstChild) { + chart.firstChild.remove(); + } + + var chartData = window[chart.getAttribute('data-data')]; + var options = { + axisY: { + type: undefined, + onlyInteger: true + }, + lineSmooth: false, + low: 0, + high: 100, + scaleMinSpace: 20, + onlyInteger: true, + fullWidth: true + }; + var lineChart = new Chartist.Line(chart, { + labels: [], + series: chartData.series + }, options); + + /* Zoom */ + var zoomButtonDiv = document.createElement("div"); + zoomButtonDiv.className = "toggleZoom"; + var zoomButtonLink = document.createElement("a"); + zoomButtonLink.setAttribute("href", ""); + var zoomButtonText = document.createElement("i"); + zoomButtonText.className = "icon-search-plus"; + + zoomButtonLink.appendChild(zoomButtonText); + zoomButtonDiv.appendChild(zoomButtonLink); + + chart.appendChild(zoomButtonDiv); + + zoomButtonDiv.addEventListener('click', function (event) { + event.preventDefault(); + + if (options.axisY.type === undefined) { + options.axisY.type = Chartist.AutoScaleAxis; + zoomButtonText.className = "icon-search-minus"; + } else { + options.axisY.type = undefined; + zoomButtonText.className = "icon-search-plus"; + } + + lineChart.update(null, options); + }); + + var tooltip = document.createElement("div"); + tooltip.className = "tooltip"; + + chart.appendChild(tooltip); + + /* Tooltips */ + var showToolTip = function () { + var point = this; + var index = [].slice.call(chart.getElementsByClassName('ct-point')).indexOf(point); + + tooltip.innerHTML = chartData.tooltips[index % chartData.tooltips.length]; + tooltip.style.display = 'block'; + }; + + var moveToolTip = function (event) { + var box = chart.getBoundingClientRect(); + var left = event.pageX - box.left - window.pageXOffset; + var top = event.pageY - box.top - window.pageYOffset; + + left = left + 20; + top = top - tooltip.offsetHeight / 2; + + if (left + tooltip.offsetWidth > box.width) { + left -= tooltip.offsetWidth + 40; + } + + if (top < 0) { + top = 0; + } + + if (top + tooltip.offsetHeight > box.height) { + top = box.height - tooltip.offsetHeight; + } + + tooltip.style.left = left + 'px'; + tooltip.style.top = top + 'px'; + }; + + var hideToolTip = function () { + tooltip.style.display = 'none'; + }; + chart.addEventListener('mousemove', moveToolTip); + + lineChart.on('created', function () { + var chartPoints = chart.getElementsByClassName('ct-point'); + for (i = 0, l = chartPoints.length; i < l; i++) { + chartPoints[i].addEventListener('mousemove', showToolTip); + chartPoints[i].addEventListener('mouseout', hideToolTip); + } + }); +}; + +var charts = document.getElementsByClassName('historychart'); +for (i = 0, l = charts.length; i < l; i++) { + renderChart(charts[i]); +} + +var assemblies = [ + { + "name": "Unity.Formats.USD.Editor", + "classes": [ + { "name": "Unity.Formats.USD.PackageUtils", "rp": "Unity.Formats.USD.Editor_PackageUtils.html", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [81.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 13, "ucl": 3, "cal": 16, "tl": 49, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdAssetEditor", "rp": "Unity.Formats.USD.Editor_UsdAssetEditor.html", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 213, "cal": 213, "tl": 350, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdBuildPostProcess", "rp": "Unity.Formats.USD.Editor_UsdBuildPostProcess.html", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 70, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdLayerStackEditor", "rp": "Unity.Formats.USD.Editor_UsdLayerStackEditor.html", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 59, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdMenu", "rp": "Unity.Formats.USD.Editor_UsdMenu.html", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [28], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 28, "ucl": 72, "cal": 100, "tl": 247, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdPrimSourceEditor", "rp": "Unity.Formats.USD.Editor_UsdPrimSourceEditor.html", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [12.8,0,12.8], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 202, "cal": 202, "tl": 367, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 202, "cal": 202, "tl": 367, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 26, "ucl": 176, "cal": 202, "tl": 367, "lcq": 12.8, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdVariantSetEditor", "rp": "Unity.Formats.USD.Editor_UsdVariantSetEditor.html", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [82.5,0,82.5], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 40, "cal": 40, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 40, "cal": 40, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 33, "ucl": 7, "cal": 40, "tl": 76, "lcq": 82.5, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]", "rp": "Unity.Formats.USD.Editor_TargetedPropertyDrawer_T_.html", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 13, "cal": 13, "tl": 28, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorder", "rp": "Unity.Formats.USD.Editor_UsdRecorder.html", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 71, "cal": 71, "tl": 137, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorderInput", "rp": "Unity.Formats.USD.Editor_UsdRecorderInput.html", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 29, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings", "rp": "Unity.Formats.USD.Editor_UsdRecorderInputSettings.html", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 22, "cal": 22, "tl": 50, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer", "rp": "Unity.Formats.USD.Editor_UsdRecorderInputSettingsPropertyDrawer.html", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 11, "cal": 11, "tl": 23, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorderSettings", "rp": "Unity.Formats.USD.Editor_UsdRecorderSettings.html", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 29, "cal": 29, "tl": 91, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor", "rp": "Unity.Formats.USD.Editor_UsdRecorderSettingsEditor.html", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 8, "cal": 8, "tl": 20, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.ExportMesh", + "classes": [ + { "name": "Unity.Formats.USD.Examples.ExportMeshExample", "rp": "Unity.Formats.USD.ExportMesh_ExportMeshExample.html", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 109, "cal": 109, "tl": 291, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.Examples.ExportMeshExampleEditor", "rp": "Unity.Formats.USD.ExportMesh_ExportMeshExampleEditor.html", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 25, "cal": 25, "tl": 55, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "USD.NET.Examples.Explode", "rp": "Unity.Formats.USD.ExportMesh_Explode.html", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 19, "cal": 19, "tl": 51, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.HelloUsd", + "classes": [ + { "name": "Unity.Formats.USD.Examples.HelloUsdExample", "rp": "Unity.Formats.USD.HelloUsd_HelloUsdExample.html", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 71, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.ImportMaterials", + "classes": [ + { "name": "Unity.Formats.USD.Examples.ImportMaterialsExample", "rp": "Unity.Formats.USD.ImportMaterials_ImportMaterialsExample.html", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 219, "cal": 219, "tl": 415, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.ImportMesh", + "classes": [ + { "name": "Unity.Formats.USD.Examples.ImportMeshExample", "rp": "Unity.Formats.USD.ImportMesh_ImportMeshExample.html", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 58, "cal": 58, "tl": 153, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.Examples.UsdImportMeshEditor", "rp": "Unity.Formats.USD.ImportMesh_UsdImportMeshEditor.html", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 60, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.ImportProcessor", + "classes": [ + { "name": "Unity.Formats.USD.Examples.CombineMeshes", "rp": "Unity.Formats.USD.ImportProcessor_CombineMeshes.html", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 86, "cal": 86, "tl": 149, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.Examples.RegexImportProcessor", "rp": "Unity.Formats.USD.ImportProcessor_RegexImportProcessor.html", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 16, "cal": 16, "tl": 76, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.Examples.SetHideFlags", "rp": "Unity.Formats.USD.ImportProcessor_SetHideFlags.html", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 24, "cal": 24, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.Runtime", + "classes": [ + { "name": "Unity.Formats.USD.CameraExporter", "rp": "Unity.Formats.USD.Runtime_CameraExporter.html", "cl": 14, "ucl": 9, "cal": 23, "tl": 61, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0,60.8], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 61, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 61, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 61, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 61, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 23, "cal": 23, "tl": 61, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 14, "ucl": 9, "cal": 23, "tl": 61, "lcq": 60.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 14, "ucl": 9, "cal": 23, "tl": 61, "lcq": 60.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 14, "ucl": 9, "cal": 23, "tl": 61, "lcq": 60.8, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.CameraImporter", "rp": "Unity.Formats.USD.Runtime_CameraImporter.html", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 6, "ucl": 0, "cal": 6, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.CubeImporter", "rp": "Unity.Formats.USD.Runtime_CubeImporter.html", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [28], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 49, "ucl": 126, "cal": 175, "tl": 290, "lcq": 28, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ExportContext", "rp": "Unity.Formats.USD.Runtime_ExportContext.html", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ExportHelpers", "rp": "Unity.Formats.USD.Runtime_ExportHelpers.html", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [61.1,80.5], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 22, "ucl": 14, "cal": 36, "tl": 60, "lcq": 61.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 22, "ucl": 14, "cal": 36, "tl": 60, "lcq": 61.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 29, "ucl": 7, "cal": 36, "tl": 60, "lcq": 80.5, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ExportPlan", "rp": "Unity.Formats.USD.Runtime_ExportPlan.html", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 791, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.HdrpShaderExporter", "rp": "Unity.Formats.USD.Runtime_HdrpShaderExporter.html", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 162, "cal": 162, "tl": 246, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.HdrpShaderImporter", "rp": "Unity.Formats.USD.Runtime_HdrpShaderImporter.html", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 121, "cal": 121, "tl": 190, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.HierarchyBuilder", "rp": "Unity.Formats.USD.Runtime_HierarchyBuilder.html", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [62.8,63,69.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 318, "ucl": 188, "cal": 506, "tl": 883, "lcq": 62.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 319, "ucl": 187, "cal": 506, "tl": 883, "lcq": 63, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 354, "ucl": 152, "cal": 506, "tl": 883, "lcq": 69.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]", "rp": "Unity.Formats.USD.Runtime_HierarchyBuilderFindPathsJobQuery_T_.html", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 3, "cal": 3, "tl": 883, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ImporterBase", "rp": "Unity.Formats.USD.Runtime_ImporterBase.html", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [51], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 25, "ucl": 24, "cal": 49, "tl": 116, "lcq": 51, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ImportHelpers", "rp": "Unity.Formats.USD.Runtime_ImportHelpers.html", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [65.6,71.8], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 84, "ucl": 44, "cal": 128, "tl": 237, "lcq": 65.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 84, "ucl": 44, "cal": 128, "tl": 237, "lcq": 65.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 92, "ucl": 36, "cal": 128, "tl": 237, "lcq": 71.8, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.InitUsd", "rp": "Unity.Formats.USD.Runtime_InitUsd.html", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [21.7,82.6], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 5, "ucl": 18, "cal": 23, "tl": 95, "lcq": 21.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 19, "ucl": 4, "cal": 23, "tl": 95, "lcq": 82.6, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.InstanceImporter", "rp": "Unity.Formats.USD.Runtime_InstanceImporter.html", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [39.1,53.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 36, "ucl": 56, "cal": 92, "tl": 177, "lcq": 39.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 36, "ucl": 56, "cal": 92, "tl": 177, "lcq": 39.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 49, "ucl": 43, "cal": 92, "tl": 177, "lcq": 53.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MaterialExporter", "rp": "Unity.Formats.USD.Runtime_MaterialExporter.html", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [52,88], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 26, "ucl": 24, "cal": 50, "tl": 119, "lcq": 52, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 44, "ucl": 6, "cal": 50, "tl": 119, "lcq": 88, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MaterialImporter", "rp": "Unity.Formats.USD.Runtime_MaterialImporter.html", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [23.6,24], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 52, "ucl": 168, "cal": 220, "tl": 389, "lcq": 23.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 53, "ucl": 167, "cal": 220, "tl": 389, "lcq": 24, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MaterialMap", "rp": "Unity.Formats.USD.Runtime_MaterialMap.html", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [81.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 65, "ucl": 15, "cal": 80, "tl": 211, "lcq": 81.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MeshExporter", "rp": "Unity.Formats.USD.Runtime_MeshExporter.html", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [46.2,47], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 118, "ucl": 137, "cal": 255, "tl": 485, "lcq": 46.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 120, "ucl": 135, "cal": 255, "tl": 485, "lcq": 47, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MeshImporter", "rp": "Unity.Formats.USD.Runtime_MeshImporter.html", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [51.5], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 168, "ucl": 158, "cal": 326, "tl": 818, "lcq": 51.5, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MeshImportOptions", "rp": "Unity.Formats.USD.Runtime_MeshImportOptions.html", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 14, "ucl": 0, "cal": 14, "tl": 114, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.MeshImportStrategy", "rp": "Unity.Formats.USD.Runtime_MeshImportStrategy.html", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [56.9,60.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 70, "ucl": 53, "cal": 123, "tl": 818, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 75, "ucl": 48, "cal": 123, "tl": 818, "lcq": 60.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.NativeExporter", "rp": "Unity.Formats.USD.Runtime_NativeExporter.html", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [4.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 5, "ucl": 96, "cal": 101, "tl": 207, "lcq": 4.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.NativeImporter", "rp": "Unity.Formats.USD.Runtime_NativeImporter.html", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [4.8], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 5, "ucl": 98, "cal": 103, "tl": 184, "lcq": 4.8, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.NativeSerialization", "rp": "Unity.Formats.USD.Runtime_NativeSerialization.html", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 182, "cal": 182, "tl": 405, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.PrimMap", "rp": "Unity.Formats.USD.Runtime_PrimMap.html", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [60.2,68.6], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 50, "ucl": 33, "cal": 83, "tl": 171, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 50, "ucl": 33, "cal": 83, "tl": 171, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 57, "ucl": 26, "cal": 83, "tl": 171, "lcq": 68.6, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ReadAllJob[T]", "rp": "Unity.Formats.USD.Runtime_ReadAllJob_T_.html", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [53.1,65.8,69.6], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 42, "ucl": 37, "cal": 79, "tl": 176, "lcq": 53.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 52, "ucl": 27, "cal": 79, "tl": 176, "lcq": 65.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 55, "ucl": 24, "cal": 79, "tl": 176, "lcq": 69.6, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SanitizedCameraSample", "rp": "Unity.Formats.USD.Runtime_SanitizedCameraSample.html", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SanitizedMeshSample", "rp": "Unity.Formats.USD.Runtime_SanitizedMeshSample.html", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [76.4,85.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 201, "ucl": 62, "cal": 263, "tl": 484, "lcq": 76.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 201, "ucl": 62, "cal": 263, "tl": 484, "lcq": 76.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 226, "ucl": 37, "cal": 263, "tl": 484, "lcq": 85.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SanitizedXformSample", "rp": "Unity.Formats.USD.Runtime_SanitizedXformSample.html", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 4, "ucl": 0, "cal": 4, "tl": 484, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SceneExporter", "rp": "Unity.Formats.USD.Runtime_SceneExporter.html", "cl": 158, "ucl": 219, "cal": 377, "tl": 791, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [40.8,41.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 154, "ucl": 223, "cal": 377, "tl": 791, "lcq": 40.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 154, "ucl": 223, "cal": 377, "tl": 791, "lcq": 40.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 154, "ucl": 223, "cal": 377, "tl": 791, "lcq": 40.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 154, "ucl": 223, "cal": 377, "tl": 791, "lcq": 40.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 154, "ucl": 223, "cal": 377, "tl": 791, "lcq": 40.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 158, "ucl": 219, "cal": 377, "tl": 791, "lcq": 41.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 158, "ucl": 219, "cal": 377, "tl": 791, "lcq": 41.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 158, "ucl": 219, "cal": 377, "tl": 791, "lcq": 41.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SceneImporter", "rp": "Unity.Formats.USD.Runtime_SceneImporter.html", "cl": 531, "ucl": 259, "cal": 790, "tl": 1277, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [58.3,61.2,67.2,66.2,67.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 461, "ucl": 329, "cal": 790, "tl": 1277, "lcq": 58.3, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 484, "ucl": 306, "cal": 790, "tl": 1277, "lcq": 61.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 531, "ucl": 259, "cal": 790, "tl": 1277, "lcq": 67.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 531, "ucl": 259, "cal": 790, "tl": 1277, "lcq": 67.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 523, "ucl": 267, "cal": 790, "tl": 1277, "lcq": 66.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 523, "ucl": 267, "cal": 790, "tl": 1277, "lcq": 66.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 523, "ucl": 267, "cal": 790, "tl": 1277, "lcq": 66.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 531, "ucl": 259, "cal": 790, "tl": 1277, "lcq": 67.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SceneImportOptions", "rp": "Unity.Formats.USD.Runtime_SceneImportOptions.html", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 164, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ShaderExporterBase", "rp": "Unity.Formats.USD.Runtime_ShaderExporterBase.html", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 155, "cal": 155, "tl": 329, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.ShaderImporterBase", "rp": "Unity.Formats.USD.Runtime_ShaderImporterBase.html", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [77.6], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 52, "ucl": 15, "cal": 67, "tl": 174, "lcq": 77.6, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkelBindingSample", "rp": "Unity.Formats.USD.Runtime_SkelBindingSample.html", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 6, "cal": 6, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkeletonExporter", "rp": "Unity.Formats.USD.Runtime_SkeletonExporter.html", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 114, "cal": 114, "tl": 209, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkeletonImporter", "rp": "Unity.Formats.USD.Runtime_SkeletonImporter.html", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [56.9], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 102, "ucl": 77, "cal": 179, "tl": 301, "lcq": 56.9, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkeletonIo", "rp": "Unity.Formats.USD.Runtime_SkeletonIo.html", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkelRootSample", "rp": "Unity.Formats.USD.Runtime_SkelRootSample.html", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 2, "cal": 2, "tl": 121, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkinnedMeshUnityDiff", "rp": "Unity.Formats.USD.Runtime_SkinnedMeshUnityDiff.html", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 70, "cal": 70, "tl": 161, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SkinnedMeshUsdDiff", "rp": "Unity.Formats.USD.Runtime_SkinnedMeshUsdDiff.html", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 215, "cal": 215, "tl": 369, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.SphereImporter", "rp": "Unity.Formats.USD.Runtime_SphereImporter.html", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [77.7], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 56, "ucl": 16, "cal": 72, "tl": 157, "lcq": 77.7, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.StandardShaderExporter", "rp": "Unity.Formats.USD.Runtime_StandardShaderExporter.html", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [19], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 56, "ucl": 238, "cal": 294, "tl": 463, "lcq": 19, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.StandardShaderImporter", "rp": "Unity.Formats.USD.Runtime_StandardShaderImporter.html", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [37.5], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 39, "ucl": 65, "cal": 104, "tl": 162, "lcq": 37.5, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UnityMaterialData", "rp": "Unity.Formats.USD.Runtime_UnityMaterialData.html", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 3, "ucl": 0, "cal": 3, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UnityPreviewSurfaceSample", "rp": "Unity.Formats.USD.Runtime_UnityPreviewSurfaceSample.html", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 1, "ucl": 0, "cal": 1, "tl": 38, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdAsset", "rp": "Unity.Formats.USD.Runtime_UsdAsset.html", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [46.6], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 216, "ucl": 247, "cal": 463, "tl": 942, "lcq": 46.6, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdLayerStack", "rp": "Unity.Formats.USD.Runtime_UsdLayerStack.html", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 59, "cal": 59, "tl": 127, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdPayload", "rp": "Unity.Formats.USD.Runtime_UsdPayload.html", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [100,90.9,100], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 20, "ucl": 2, "cal": 22, "tl": 86, "lcq": 90.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 20, "ucl": 2, "cal": 22, "tl": 86, "lcq": 90.9, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 22, "ucl": 0, "cal": 22, "tl": 86, "lcq": 100, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdPlayableAsset", "rp": "Unity.Formats.USD.Runtime_UsdPlayableAsset.html", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 27, "cal": 27, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdPlayableBehaviour", "rp": "Unity.Formats.USD.Runtime_UsdPlayableBehaviour.html", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 39, "cal": 39, "tl": 94, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdPlayableTrack", "rp": "Unity.Formats.USD.Runtime_UsdPlayableTrack.html", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 4, "cal": 4, "tl": 31, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdRecorderBehaviour", "rp": "Unity.Formats.USD.Runtime_UsdRecorderBehaviour.html", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0,58.1], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 160, "cal": 160, "tl": 315, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 160, "cal": 160, "tl": 315, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 93, "ucl": 67, "cal": 160, "tl": 315, "lcq": 58.1, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdRecorderClip", "rp": "Unity.Formats.USD.Runtime_UsdRecorderClip.html", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0,90.4], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 21, "cal": 21, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 21, "cal": 21, "tl": 72, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 19, "ucl": 2, "cal": 21, "tl": 72, "lcq": 90.4, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdVariantSet", "rp": "Unity.Formats.USD.Runtime_UsdVariantSet.html", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [81.8], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 18, "ucl": 4, "cal": 22, "tl": 92, "lcq": 81.8, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdWaitForEndOfFrame", "rp": "Unity.Formats.USD.Runtime_UsdWaitForEndOfFrame.html", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0,88.5], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 35, "cal": 35, "tl": 78, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 35, "cal": 35, "tl": 78, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 31, "ucl": 4, "cal": 35, "tl": 78, "lcq": 88.5, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.UsdzExporter", "rp": "Unity.Formats.USD.Runtime_UsdzExporter.html", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 34, "cal": 34, "tl": 95, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.XformExporter", "rp": "Unity.Formats.USD.Runtime_XformExporter.html", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [36.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 25, "ucl": 44, "cal": 69, "tl": 145, "lcq": 36.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + { "name": "Unity.Formats.USD.XformImporter", "rp": "Unity.Formats.USD.Runtime_XformImporter.html", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [60.2], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 59, "ucl": 39, "cal": 98, "tl": 196, "lcq": 60.2, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, + { + "name": "Unity.Formats.USD.UsdTimelinePlayable", + "classes": [ + { "name": "Unity.Formats.USD.Examples.SetDefaultUSDMesh", "rp": "Unity.Formats.USD.UsdTimelinePlayable_SetDefaultUSDMesh.html", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "ct": "LineCoverage", "mc": "-", "cb": 0, "tb": 0, "lch": [0], "bch": [], "hc": [{ "et": "2023-02-13 - 1:28:17 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:20 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:06:41 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:15:03 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:16:09 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:30:23 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:31:10 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }, { "et": "2023-02-14 - 2:32:53 PM", "cl": 0, "ucl": 7, "cal": 7, "tl": 38, "lcq": 0, "cb": 0, "tb": 0, "bcq": 0 }] }, + ]}, +]; + +var historicCoverageExecutionTimes = ["2023-02-14 - 2:31:10 PM", "2023-02-14 - 2:30:23 PM", "2023-02-14 - 2:16:09 PM", "2023-02-14 - 2:15:03 PM", "2023-02-14 - 2:06:41 PM", "2023-02-14 - 2:06:20 PM", "2023-02-13 - 1:28:17 PM"]; + +var riskHotspotMetrics = [ +]; + +var riskHotspots = [ +]; + +var branchCoverageAvailable = true; + + +var translations = { +'top': 'Top:', +'all': 'All', +'assembly': 'Assembly', +'class': 'Class', +'method': 'Method', +'lineCoverage': 'LineCoverage', +'noGrouping': 'No grouping', +'byAssembly': 'By assembly', +'byNamespace': 'By namespace, Level:', +'all': 'All', +'collapseAll': 'Collapse all', +'expandAll': 'Expand all', +'grouping': 'Grouping:', +'filter': 'Filter:', +'name': 'Name', +'covered': 'Covered', +'uncovered': 'Uncovered', +'coverable': 'Coverable', +'total': 'Total', +'coverage': 'Line coverage', +'branchCoverage': 'Branch coverage', +'history': 'Coverage History', +'compareHistory': 'Compare with:', +'date': 'Date', +'allChanges': 'All changes', +'lineCoverageIncreaseOnly': 'Line coverage: Increase only', +'lineCoverageDecreaseOnly': 'Line coverage: Decrease only', +'branchCoverageIncreaseOnly': 'Branch coverage: Increase only', +'branchCoverageDecreaseOnly': 'Branch coverage: Decrease only' +}; + + +(()=>{"use strict";var r,e={},o={};function t(r){var a=o[r];if(void 0!==a)return a.exports;var n=o[r]={exports:{}};return e[r](n,n.exports,t),n.exports}t.m=e,r=[],t.O=(e,o,a,n)=>{if(!o){var p=1/0;for(v=0;v=n)&&Object.keys(t.O).every(r=>t.O[r](o[u]))?o.splice(u--,1):(l=!1,n0&&r[v-1][2]>n;v--)r[v]=r[v-1];r[v]=[o,a,n]},t.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return t.d(e,{a:e}),e},t.d=(r,e)=>{for(var o in e)t.o(e,o)&&!t.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={666:0};t.O.j=e=>0===r[e];var e=(e,o)=>{var a,n,[p,l,u]=o,v=0;for(a in l)t.o(l,a)&&(t.m[a]=l[a]);if(u)var f=u(t);for(e&&e(o);v{"use strict";!function(e){const t=e.performance;function n(e){t&&t.mark&&t.mark(e)}function o(e,n){t&&t.measure&&t.measure(e,n)}n("Zone");const r=e.__Zone_symbol_prefix||"__zone_symbol__";function s(e){return r+e}const a=!0===e[s("forceDuplicateZoneCheck")];if(e.Zone){if(a||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}class i{constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new l(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(e.Promise!==O.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let e=i.current;for(;e.parent;)e=e.parent;return e}static get current(){return z.zone}static get currentTask(){return j}static __load_patch(t,r,s=!1){if(O.hasOwnProperty(t)){if(!s&&a)throw Error("Already loaded patch: "+t)}else if(!e["__Zone_disable_"+t]){const s="Zone:"+t;n(s),O[t]=r(e,i,C),o(s,s)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),o=this;return function(){return o.runGuarded(n,this,arguments,t)}}run(e,t,n,o){z={parent:z,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,o)}finally{z=z.parent}}runGuarded(e,t=null,n,o){z={parent:z,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,o)}catch(r){if(this._zoneDelegate.handleError(this,r))throw r}}finally{z=z.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");if(e.state===v&&(e.type===P||e.type===D))return;const o=e.state!=E;o&&e._transitionTo(E,b),e.runCount++;const r=j;j=e,z={parent:z,zone:this};try{e.type==D&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(s){if(this._zoneDelegate.handleError(this,s))throw s}}finally{e.state!==v&&e.state!==Z&&(e.type==P||e.data&&e.data.isPeriodic?o&&e._transitionTo(b,E):(e.runCount=0,this._updateTaskCount(e,-1),o&&e._transitionTo(v,E,v))),z=z.parent,j=r}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(T,v);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(n){throw e._transitionTo(Z,T,v),this._zoneDelegate.handleError(this,n),n}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==T&&e._transitionTo(b,T),e}scheduleMicroTask(e,t,n,o){return this.scheduleTask(new u(S,e,t,n,o,void 0))}scheduleMacroTask(e,t,n,o,r){return this.scheduleTask(new u(D,e,t,n,o,r))}scheduleEventTask(e,t,n,o,r){return this.scheduleTask(new u(P,e,t,n,o,r))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");e._transitionTo(w,b,E);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(Z,w),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(v,w),e.runCount=0,e}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let o=0;oe.hasTask(n,o),onScheduleTask:(e,t,n,o)=>e.scheduleTask(n,o),onInvokeTask:(e,t,n,o,r,s)=>e.invokeTask(n,o,r,s),onCancelTask:(e,t,n,o)=>e.cancelTask(n,o)};class l{constructor(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const o=n&&n.onHasTask;(o||t&&t._hasTaskZS)&&(this._hasTaskZS=o?n:c,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=e,n.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this.zone),n.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this.zone),n.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this.zone))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new i(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,o,r){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,o,r):t.apply(n,o)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=S)throw new Error("Task is missing scheduleFn.");k(t)}return n}invokeTask(e,t,n,o){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,o):t.callback.apply(n,o)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(n){this.handleError(e,n)}}_updateTaskCount(e,t){const n=this._taskCounts,o=n[e],r=n[e]=o+t;if(r<0)throw new Error("More tasks executed then were scheduled.");0!=o&&0!=r||this.hasTask(this.zone,{microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})}}class u{constructor(t,n,o,r,s,a){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=t,this.source=n,this.data=r,this.scheduleFn=s,this.cancelFn=a,!o)throw new Error("callback is not defined");this.callback=o;const i=this;this.invoke=t===P&&r&&r.useG?u.invokeTask:function(){return u.invokeTask.call(e,i,this,arguments)}}static invokeTask(e,t,n){e||(e=this),I++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==I&&m(),I--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(v,T)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==v&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const h=s("setTimeout"),p=s("Promise"),f=s("then");let d,g=[],_=!1;function k(t){if(0===I&&0===g.length)if(d||e[p]&&(d=e[p].resolve(0)),d){let e=d[f];e||(e=d.then),e.call(d,m)}else e[h](m,0);t&&g.push(t)}function m(){if(!_){for(_=!0;g.length;){const t=g;g=[];for(let n=0;nz,onUnhandledError:R,microtaskDrainDone:R,scheduleMicroTask:k,showUncaughtError:()=>!i[s("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:R,patchMethod:()=>R,bindArguments:()=>[],patchThen:()=>R,patchMacroTask:()=>R,patchEventPrototype:()=>R,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>R,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>R,wrapWithCurrentZone:()=>R,filterProperties:()=>[],attachOriginToPatched:()=>R,_redefineProperty:()=>R,patchCallbacks:()=>R};let z={parent:null,zone:new i(null,null)},j=null,I=0;function R(){}o("Zone","Zone"),e.Zone=i}("undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global);const e=Object.getOwnPropertyDescriptor,t=Object.defineProperty,n=Object.getPrototypeOf,o=Object.create,r=Array.prototype.slice,s="addEventListener",a="removeEventListener",i=Zone.__symbol__(s),c=Zone.__symbol__(a),l="true",u="false",h=Zone.__symbol__("");function p(e,t){return Zone.current.wrap(e,t)}function f(e,t,n,o,r){return Zone.current.scheduleMacroTask(e,t,n,o,r)}const d=Zone.__symbol__,g="undefined"!=typeof window,_=g?window:void 0,k=g&&_||"object"==typeof self&&self||global,m=[null];function y(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=p(e[n],t+"_"+n));return e}function v(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const T="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,b=!("nw"in k)&&void 0!==k.process&&"[object process]"==={}.toString.call(k.process),E=!b&&!T&&!(!g||!_.HTMLElement),w=void 0!==k.process&&"[object process]"==={}.toString.call(k.process)&&!T&&!(!g||!_.HTMLElement),Z={},S=function(e){if(!(e=e||k.event))return;let t=Z[e.type];t||(t=Z[e.type]=d("ON_PROPERTY"+e.type));const n=this||e.target||k,o=n[t];let r;if(E&&n===_&&"error"===e.type){const t=e;r=o&&o.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===r&&e.preventDefault()}else r=o&&o.apply(this,arguments),null==r||r||e.preventDefault();return r};function D(n,o,r){let s=e(n,o);if(!s&&r&&e(r,o)&&(s={enumerable:!0,configurable:!0}),!s||!s.configurable)return;const a=d("on"+o+"patched");if(n.hasOwnProperty(a)&&n[a])return;delete s.writable,delete s.value;const i=s.get,c=s.set,l=o.substr(2);let u=Z[l];u||(u=Z[l]=d("ON_PROPERTY"+l)),s.set=function(e){let t=this;t||n!==k||(t=k),t&&(t[u]&&t.removeEventListener(l,S),c&&c.apply(t,m),"function"==typeof e?(t[u]=e,t.addEventListener(l,S,!1)):t[u]=null)},s.get=function(){let e=this;if(e||n!==k||(e=k),!e)return null;const t=e[u];if(t)return t;if(i){let t=i&&i.call(this);if(t)return s.set.call(this,t),"function"==typeof e.removeAttribute&&e.removeAttribute(o),t}return null},t(n,o,s),n[a]=!0}function P(e,t,n){if(t)for(let o=0;ofunction(t,o){const s=n(t,o);return s.cbIdx>=0&&"function"==typeof o[s.cbIdx]?f(s.name,o[s.cbIdx],s,r):e.apply(t,o)})}function I(e,t){e[d("OriginalDelegate")]=t}let R=!1,M=!1;function N(){try{const e=_.navigator.userAgent;if(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/"))return!0}catch(e){}return!1}function x(){if(R)return M;R=!0;try{const e=_.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(M=!0)}catch(e){}return M}Zone.__load_patch("ZoneAwarePromise",(e,t,n)=>{const o=Object.getOwnPropertyDescriptor,r=Object.defineProperty,s=n.symbol,a=[],i=!0===e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=s("Promise"),l=s("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;a.length;){const t=a.shift();try{t.zone.runGuarded(()=>{if(t.throwOriginal)throw t.rejection;throw t})}catch(e){h(e)}}};const u=s("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(o){}}function p(e){return e&&e.then}function f(e){return e}function d(e){return C.reject(e)}const g=s("state"),_=s("value"),k=s("finally"),m=s("parentPromiseValue"),y=s("parentPromiseState"),v=null,T=!0,b=!1;function E(e,t){return n=>{try{Z(e,t,n)}catch(o){Z(e,!1,o)}}}const w=s("currentTaskTrace");function Z(e,o,s){const c=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}}();if(e===s)throw new TypeError("Promise resolved with itself");if(e[g]===v){let h=null;try{"object"!=typeof s&&"function"!=typeof s||(h=s&&s.then)}catch(u){return c(()=>{Z(e,!1,u)})(),e}if(o!==b&&s instanceof C&&s.hasOwnProperty(g)&&s.hasOwnProperty(_)&&s[g]!==v)D(s),Z(e,s[g],s[_]);else if(o!==b&&"function"==typeof h)try{h.call(s,c(E(e,o)),c(E(e,!1)))}catch(u){c(()=>{Z(e,!1,u)})()}else{e[g]=o;const c=e[_];if(e[_]=s,e[k]===k&&o===T&&(e[g]=e[y],e[_]=e[m]),o===b&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&r(s,w,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t{try{const o=e[_],r=!!n&&k===n[k];r&&(n[m]=o,n[y]=s);const i=t.run(a,void 0,r&&a!==d&&a!==f?[]:[o]);Z(n,!0,i)}catch(o){Z(n,!1,o)}},n)}const O=function(){};class C{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return Z(new this(null),T,e)}static reject(e){return Z(new this(null),b,e)}static race(e){let t,n,o=new this((e,o)=>{t=e,n=o});function r(e){t(e)}function s(e){n(e)}for(let a of e)p(a)||(a=this.resolve(a)),a.then(r,s);return o}static all(e){return C.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof C?this:C).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,o,r=new this((e,t)=>{n=e,o=t}),s=2,a=0;const i=[];for(let l of e){p(l)||(l=this.resolve(l));const e=a;try{l.then(o=>{i[e]=t?t.thenCallback(o):o,s--,0===s&&n(i)},r=>{t?(i[e]=t.errorCallback(r),s--,0===s&&n(i)):o(r)})}catch(c){o(c)}s++,a++}return s-=2,0===s&&n(i),r}constructor(e){const t=this;if(!(t instanceof C))throw new Error("Must be an instanceof Promise.");t[g]=v,t[_]=[];try{e&&e(E(t,T),E(t,b))}catch(n){Z(t,!1,n)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return C}then(e,n){let o=this.constructor[Symbol.species];o&&"function"==typeof o||(o=this.constructor||C);const r=new o(O),s=t.current;return this[g]==v?this[_].push(s,r,e,n):P(this,s,r,e,n),r}catch(e){return this.then(null,e)}finally(e){let n=this.constructor[Symbol.species];n&&"function"==typeof n||(n=C);const o=new n(O);o[k]=k;const r=t.current;return this[g]==v?this[_].push(r,o,e,e):P(this,r,o,e,e),o}}C.resolve=C.resolve,C.reject=C.reject,C.race=C.race,C.all=C.all;const j=e[c]=e.Promise;e.Promise=C;const I=s("thenPatched");function R(e){const t=e.prototype,n=o(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const r=t.then;t[l]=r,e.prototype.then=function(e,t){return new C((e,t)=>{r.call(this,e,t)}).then(e,t)},e[I]=!0}return n.patchThen=R,j&&(R(j),z(e,"fetch",e=>{return t=e,function(e,n){let o=t.apply(e,n);if(o instanceof C)return o;let r=o.constructor;return r[I]||R(r),o};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=a,C}),Zone.__load_patch("toString",e=>{const t=Function.prototype.toString,n=d("OriginalDelegate"),o=d("Promise"),r=d("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[o];if(n)return t.call(n)}if(this===Error){const n=e[r];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const a=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":a.call(this)}});let L=!1;if("undefined"!=typeof window)try{const e=Object.defineProperty({},"passive",{get:function(){L=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(he){L=!1}const A={useG:!0},H={},F={},q=new RegExp("^"+h+"(\\w+)(true|false)$"),G=d("propagationStopped");function B(e,t){const n=(t?t(e):e)+u,o=(t?t(e):e)+l,r=h+n,s=h+o;H[e]={},H[e].false=r,H[e].true=s}function W(e,t,o){const r=o&&o.add||s,i=o&&o.rm||a,c=o&&o.listeners||"eventListeners",p=o&&o.rmAll||"removeAllListeners",f=d(r),g="."+r+":",_=function(e,t,n){if(e.isRemoved)return;const o=e.callback;"object"==typeof o&&o.handleEvent&&(e.callback=e=>o.handleEvent(e),e.originalDelegate=o),e.invoke(e,t,[n]);const r=e.options;r&&"object"==typeof r&&r.once&&t[i].call(t,n.type,e.originalDelegate?e.originalDelegate:e.callback,r)},k=function(t){if(!(t=t||e.event))return;const n=this||t.target||e,o=n[H[t.type].false];if(o)if(1===o.length)_(o[0],n,t);else{const e=o.slice();for(let o=0;ofunction(t,n){t[G]=!0,e&&e.apply(t,n)})}function $(e,t,n,o,r){const s=Zone.__symbol__(o);if(t[s])return;const a=t[s]=t[o];t[o]=function(s,i,c){return i&&i.prototype&&r.forEach(function(t){const r=`${n}.${o}::`+t,s=i.prototype;if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,r),e._redefineProperty(i.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],r))}),a.call(t,s,i,c)},e.attachOriginToPatched(t[o],a)}const X=["absolutedeviceorientation","afterinput","afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","devicelight","devicemotion","deviceorientation","deviceorientationabsolute","deviceproximity","hashchange","languagechange","message","mozbeforepaint","offline","online","paint","pageshow","pagehide","popstate","rejectionhandled","storage","unhandledrejection","unload","userproximity","vrdisplayconnected","vrdisplaydisconnected","vrdisplaypresentchange"],Y=["encrypted","waitingforkey","msneedkey","mozinterruptbegin","mozinterruptend"],J=["load"],K=["blur","error","focus","load","resize","scroll","messageerror"],Q=["bounce","finish","start"],ee=["loadstart","progress","abort","error","load","progress","timeout","loadend","readystatechange"],te=["upgradeneeded","complete","abort","success","error","blocked","versionchange","close"],ne=["close","error","open","message"],oe=["error","message"],re=["abort","animationcancel","animationend","animationiteration","auxclick","beforeinput","blur","cancel","canplay","canplaythrough","change","compositionstart","compositionupdate","compositionend","cuechange","click","close","contextmenu","curechange","dblclick","drag","dragend","dragenter","dragexit","dragleave","dragover","drop","durationchange","emptied","ended","error","focus","focusin","focusout","gotpointercapture","input","invalid","keydown","keypress","keyup","load","loadstart","loadeddata","loadedmetadata","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","orientationchange","pause","play","playing","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","mozpointerlockchange","webkitpointerlockerchange","pointerlockerror","mozpointerlockerror","webkitpointerlockerror","pointermove","pointout","pointerover","pointerup","progress","ratechange","reset","resize","scroll","seeked","seeking","select","selectionchange","selectstart","show","sort","stalled","submit","suspend","timeupdate","volumechange","touchcancel","touchmove","touchstart","touchend","transitioncancel","transitionend","waiting","wheel"].concat(["webglcontextrestored","webglcontextlost","webglcontextcreationerror"],["autocomplete","autocompleteerror"],["toggle"],["afterscriptexecute","beforescriptexecute","DOMContentLoaded","freeze","fullscreenchange","mozfullscreenchange","webkitfullscreenchange","msfullscreenchange","fullscreenerror","mozfullscreenerror","webkitfullscreenerror","msfullscreenerror","readystatechange","visibilitychange","resume"],X,["beforecopy","beforecut","beforepaste","copy","cut","paste","dragstart","loadend","animationstart","search","transitionrun","transitionstart","webkitanimationend","webkitanimationiteration","webkitanimationstart","webkittransitionend"],["activate","afterupdate","ariarequest","beforeactivate","beforedeactivate","beforeeditfocus","beforeupdate","cellchange","controlselect","dataavailable","datasetchanged","datasetcomplete","errorupdate","filterchange","layoutcomplete","losecapture","move","moveend","movestart","propertychange","resizeend","resizestart","rowenter","rowexit","rowsdelete","rowsinserted","command","compassneedscalibration","deactivate","help","mscontentzoom","msmanipulationstatechanged","msgesturechange","msgesturedoubletap","msgestureend","msgesturehold","msgesturestart","msgesturetap","msgotpointercapture","msinertiastart","mslostpointercapture","mspointercancel","mspointerdown","mspointerenter","mspointerhover","mspointerleave","mspointermove","mspointerout","mspointerover","mspointerup","pointerout","mssitemodejumplistitemremoved","msthumbnailclick","stop","storagecommit"]);function se(e,t,n){if(!n||0===n.length)return t;const o=n.filter(t=>t.target===e);if(!o||0===o.length)return t;const r=o[0].ignoreProperties;return t.filter(e=>-1===r.indexOf(e))}function ae(e,t,n,o){e&&P(e,se(e,t,n),o)}function ie(e,t){if(b&&!w)return;if(Zone[e.symbol("patchEvents")])return;const o="undefined"!=typeof WebSocket,r=t.__Zone_ignore_on_properties;if(E){const e=window,t=N()?[{target:e,ignoreProperties:["error"]}]:[];ae(e,re.concat(["messageerror"]),r?r.concat(t):r,n(e)),ae(Document.prototype,re,r),void 0!==e.SVGElement&&ae(e.SVGElement.prototype,re,r),ae(Element.prototype,re,r),ae(HTMLElement.prototype,re,r),ae(HTMLMediaElement.prototype,Y,r),ae(HTMLFrameSetElement.prototype,X.concat(K),r),ae(HTMLBodyElement.prototype,X.concat(K),r),ae(HTMLFrameElement.prototype,J,r),ae(HTMLIFrameElement.prototype,J,r);const o=e.HTMLMarqueeElement;o&&ae(o.prototype,Q,r);const s=e.Worker;s&&ae(s.prototype,oe,r)}const s=t.XMLHttpRequest;s&&ae(s.prototype,ee,r);const a=t.XMLHttpRequestEventTarget;a&&ae(a&&a.prototype,ee,r),"undefined"!=typeof IDBIndex&&(ae(IDBIndex.prototype,te,r),ae(IDBRequest.prototype,te,r),ae(IDBOpenDBRequest.prototype,te,r),ae(IDBDatabase.prototype,te,r),ae(IDBTransaction.prototype,te,r),ae(IDBCursor.prototype,te,r)),o&&ae(WebSocket.prototype,ne,r)}Zone.__load_patch("util",(n,i,c)=>{c.patchOnProperties=P,c.patchMethod=z,c.bindArguments=y,c.patchMacroTask=j;const f=i.__symbol__("BLACK_LISTED_EVENTS"),d=i.__symbol__("UNPATCHED_EVENTS");n[d]&&(n[f]=n[d]),n[f]&&(i[f]=i[d]=n[f]),c.patchEventPrototype=V,c.patchEventTarget=W,c.isIEOrEdge=x,c.ObjectDefineProperty=t,c.ObjectGetOwnPropertyDescriptor=e,c.ObjectCreate=o,c.ArraySlice=r,c.patchClass=C,c.wrapWithCurrentZone=p,c.filterProperties=se,c.attachOriginToPatched=I,c._redefineProperty=Object.defineProperty,c.patchCallbacks=$,c.getGlobalObjects=()=>({globalSources:F,zoneSymbolEventNames:H,eventNames:re,isBrowser:E,isMix:w,isNode:b,TRUE_STR:l,FALSE_STR:u,ZONE_SYMBOL_PREFIX:h,ADD_EVENT_LISTENER_STR:s,REMOVE_EVENT_LISTENER_STR:a})});const ce=d("zoneTask");function le(e,t,n,o){let r=null,s=null;n+=o;const a={};function i(t){const n=t.data;return n.args[0]=function(){return t.invoke.apply(this,arguments)},n.handleId=r.apply(e,n.args),t}function c(t){return s.call(e,t.data.handleId)}r=z(e,t+=o,n=>function(r,s){if("function"==typeof s[0]){const e={isPeriodic:"Interval"===o,delay:"Timeout"===o||"Interval"===o?s[1]||0:void 0,args:s},n=s[0];s[0]=function(){try{return n.apply(this,arguments)}finally{e.isPeriodic||("number"==typeof e.handleId?delete a[e.handleId]:e.handleId&&(e.handleId[ce]=null))}};const r=f(t,s[0],e,i,c);if(!r)return r;const l=r.data.handleId;return"number"==typeof l?a[l]=r:l&&(l[ce]=r),l&&l.ref&&l.unref&&"function"==typeof l.ref&&"function"==typeof l.unref&&(r.ref=l.ref.bind(l),r.unref=l.unref.bind(l)),"number"==typeof l||l?l:r}return n.apply(e,s)}),s=z(e,n,t=>function(n,o){const r=o[0];let s;"number"==typeof r?s=a[r]:(s=r&&r[ce],s||(s=r)),s&&"string"==typeof s.type?"notScheduled"!==s.state&&(s.cancelFn&&s.data.isPeriodic||0===s.runCount)&&("number"==typeof r?delete a[r]:r&&(r[ce]=null),s.zone.cancelTask(s)):t.apply(e,o)})}function ue(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:o,TRUE_STR:r,FALSE_STR:s,ZONE_SYMBOL_PREFIX:a}=t.getGlobalObjects();for(let c=0;c{const t=e[Zone.__symbol__("legacyPatch")];t&&t()}),Zone.__load_patch("queueMicrotask",(e,t,n)=>{n.patchMethod(e,"queueMicrotask",e=>function(e,n){t.current.scheduleMicroTask("queueMicrotask",n[0])})}),Zone.__load_patch("timers",e=>{const t="set",n="clear";le(e,t,n,"Timeout"),le(e,t,n,"Interval"),le(e,t,n,"Immediate")}),Zone.__load_patch("requestAnimationFrame",e=>{le(e,"request","cancel","AnimationFrame"),le(e,"mozRequest","mozCancel","AnimationFrame"),le(e,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let o=0;ofunction(o,s){return t.current.run(n,e,s,r)})}),Zone.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),ue(e,n);const o=e.XMLHttpRequestEventTarget;o&&o.prototype&&n.patchEventTarget(e,[o.prototype])}),Zone.__load_patch("MutationObserver",(e,t,n)=>{C("MutationObserver"),C("WebKitMutationObserver")}),Zone.__load_patch("IntersectionObserver",(e,t,n)=>{C("IntersectionObserver")}),Zone.__load_patch("FileReader",(e,t,n)=>{C("FileReader")}),Zone.__load_patch("on_property",(e,t,n)=>{ie(n,e)}),Zone.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:o}=t.getGlobalObjects();(n||o)&&e.customElements&&"customElements"in e&&t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback"])}(e,n)}),Zone.__load_patch("XHR",(e,t)=>{!function(e){const u=e.XMLHttpRequest;if(!u)return;const h=u.prototype;let p=h[i],g=h[c];if(!p){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;p=e[i],g=e[c]}}const _="readystatechange",k="scheduled";function m(e){const o=e.data,a=o.target;a[s]=!1,a[l]=!1;const u=a[r];p||(p=a[i],g=a[c]),u&&g.call(a,_,u);const h=a[r]=()=>{if(a.readyState===a.DONE)if(!o.aborted&&a[s]&&e.state===k){const n=a[t.__symbol__("loadfalse")];if(0!==a.status&&n&&n.length>0){const r=e.invoke;e.invoke=function(){const n=a[t.__symbol__("loadfalse")];for(let t=0;tfunction(e,t){return e[o]=0==t[2],e[a]=t[1],T.apply(e,t)}),b=d("fetchTaskAborting"),E=d("fetchTaskScheduling"),w=z(h,"send",()=>function(e,n){if(!0===t.current[E])return w.apply(e,n);if(e[o])return w.apply(e,n);{const t={target:e,url:e[a],isPeriodic:!1,args:n,aborted:!1},o=f("XMLHttpRequest.send",y,t,m,v);e&&!0===e[l]&&!t.aborted&&o.state===k&&o.invoke()}}),Z=z(h,"abort",()=>function(e,o){const r=e[n];if(r&&"string"==typeof r.type){if(null==r.cancelFn||r.data&&r.data.aborted)return;r.zone.cancelTask(r)}else if(!0===t.current[b])return Z.apply(e,o)})}(e);const n=d("xhrTask"),o=d("xhrSync"),r=d("xhrListener"),s=d("xhrScheduled"),a=d("xhrURL"),l=d("xhrErrorBeforeScheduled")}),Zone.__load_patch("geolocation",t=>{t.navigator&&t.navigator.geolocation&&function(t,n){const o=t.constructor.name;for(let r=0;r{const t=function(){return e.apply(this,y(arguments,o+"."+s))};return I(t,e),t})(a)}}}(t.navigator.geolocation,["getCurrentPosition","watchPosition"])}),Zone.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){U(e,t).forEach(o=>{const r=e.PromiseRejectionEvent;if(r){const e=new r(t,{promise:n.promise,reason:n.rejection});o.invoke(e)}})}}e.PromiseRejectionEvent&&(t[d("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[d("rejectionHandledHandler")]=n("rejectionhandled"))})},796:(e,t,n)=>{"use strict";n(167)}},e=>{"use strict";e(e.s=796)}]); + +(self.webpackChunkcoverage_app=self.webpackChunkcoverage_app||[]).push([[179],{255:t=>{function e(t){return Promise.resolve().then(()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e})}e.keys=()=>[],e.resolve=e,e.id=255,t.exports=e},520:(t,e,n)=>{"use strict";function s(t){return"function"==typeof t}let r=!1;const i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else r&&console.log("RxJS: Back to a better error behavior. Thank you. <3");r=t},get useDeprecatedSynchronousErrorHandling(){return r}};function o(t){setTimeout(()=>{throw t},0)}const l={closed:!0,next(t){},error(t){if(i.useDeprecatedSynchronousErrorHandling)throw t;o(t)},complete(){}},a=(()=>Array.isArray||(t=>t&&"number"==typeof t.length))();function c(t){return null!==t&&"object"==typeof t}const u=(()=>{function t(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t})();let h=(()=>{class t{constructor(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}unsubscribe(){let e;if(this.closed)return;let{_parentOrParents:n,_ctorUnsubscribe:r,_unsubscribe:i,_subscriptions:o}=this;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(let t=0;tt.concat(e instanceof u?e.errors:e),[])}const f=(()=>"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random())();class p extends h{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=l;break;case 1:if(!t){this.destination=l;break}if("object"==typeof t){t instanceof p?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new g(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new g(this,t,e,n)}}[f](){return this}static create(t,e,n){const s=new p(t,e,n);return s.syncErrorThrowable=!1,s}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parentOrParents:t}=this;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this}}class g extends p{constructor(t,e,n,r){let i;super(),this._parentSubscriber=t;let o=this;s(e)?i=e:e&&(i=e.next,n=e.error,r=e.complete,e!==l&&(o=Object.create(e),s(o.unsubscribe)&&this.add(o.unsubscribe.bind(o)),o.unsubscribe=this.unsubscribe.bind(this))),this._context=o,this._next=i,this._error=n,this._complete=r}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;i.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=i;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):o(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;o(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);i.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),i.useDeprecatedSynchronousErrorHandling)throw n;o(n)}}__tryOrSetError(t,e,n){if(!i.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(s){return i.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=s,t.syncErrorThrown=!0,!0):(o(s),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const v=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")();function y(t){return t}let _=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:s}=this,r=function(t,e,n){if(t){if(t instanceof p)return t;if(t[f])return t[f]()}return t||e||n?new p(t,e,n):new p(l)}(t,e,n);if(r.add(s?s.call(r,this.source):this.source||i.useDeprecatedSynchronousErrorHandling&&!r.syncErrorThrowable?this._subscribe(r):this._trySubscribe(r)),i.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable&&(r.syncErrorThrowable=!1,r.syncErrorThrown))throw r.syncErrorValue;return r}_trySubscribe(t){try{return this._subscribe(t)}catch(e){i.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:s}=t;if(e||s)return!1;t=n&&n instanceof p?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=m(e))((e,n)=>{let s;s=this.subscribe(e=>{try{t(e)}catch(r){n(r),s&&s.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[v](){return this}pipe(...t){return 0===t.length?this:(0===(e=t).length?y:1===e.length?e[0]:function(t){return e.reduce((t,e)=>e(t),t)})(this);var e}toPromise(t){return new(t=m(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function m(t){if(t||(t=i.Promise||Promise),!t)throw new Error("no Promise impl found");return t}const b=(()=>{function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t})();class C extends h{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class w extends p{constructor(t){super(t),this.destination=t}}let E=(()=>{class t extends _{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[f](){return new w(this)}lift(t){const e=new x(this,this);return e.operator=t,e}next(t){if(this.closed)throw new b;if(!this.isStopped){const{observers:e}=this,n=e.length,s=e.slice();for(let r=0;rnew x(t,e),t})();class x extends E{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):h.EMPTY}}function k(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new A(t,e))}}class A{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new O(t,this.project,this.thisArg))}}class O extends p{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}const I=t=>e=>{for(let n=0,s=t.length;nt&&"number"==typeof t.length&&"function"!=typeof t;function D(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const H=t=>{if(t&&"function"==typeof t[v])return n=t,t=>{const e=n[v]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(V(t))return I(t);if(D(t))return(t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,o),e))(t);if(t&&"function"==typeof t[T])return e=t,t=>{const n=e[T]();for(;;){let e;try{e=n.next()}catch(s){return t.error(s),t}if(e.done){t.complete();break}if(t.next(e.value),t.closed)break}return"function"==typeof n.return&&t.add(()=>{n.return&&n.return()}),t};{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}var e,n};function N(t,e){return new _(n=>{const s=new h;let r=0;return s.add(e.schedule(function(){r!==t.length?(n.next(t[r++]),n.closed||s.add(this.schedule())):n.complete()})),s})}function M(t,e){return e?function(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[v]}(t))return function(t,e){return new _(n=>{const s=new h;return s.add(e.schedule(()=>{const r=t[v]();s.add(r.subscribe({next(t){s.add(e.schedule(()=>n.next(t)))},error(t){s.add(e.schedule(()=>n.error(t)))},complete(){s.add(e.schedule(()=>n.complete()))}}))})),s})}(t,e);if(D(t))return function(t,e){return new _(n=>{const s=new h;return s.add(e.schedule(()=>t.then(t=>{s.add(e.schedule(()=>{n.next(t),s.add(e.schedule(()=>n.complete()))}))},t=>{s.add(e.schedule(()=>n.error(t)))}))),s})}(t,e);if(V(t))return N(t,e);if(function(t){return t&&"function"==typeof t[T]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new _(n=>{const s=new h;let r;return s.add(()=>{r&&"function"==typeof r.return&&r.return()}),s.add(e.schedule(()=>{r=t[T](),s.add(e.schedule(function(){if(n.closed)return;let t,e;try{const n=r.next();t=n.value,e=n.done}catch(s){return void n.error(s)}e?n.complete():(n.next(t),this.schedule())}))})),s})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}(t,e):t instanceof _?t:new _(H(t))}class P extends p{constructor(t){super(),this.parent=t}_next(t){this.parent.notifyNext(t)}_error(t){this.parent.notifyError(t),this.unsubscribe()}_complete(){this.parent.notifyComplete(),this.unsubscribe()}}class R extends p{notifyNext(t){this.destination.next(t)}notifyError(t){this.destination.error(t)}notifyComplete(){this.destination.complete()}}function j(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?s=>s.pipe(j((n,s)=>M(t(n,s)).pipe(k((t,r)=>e(n,t,s,r))),n)):("number"==typeof e&&(n=e),e=>e.lift(new F(t,n)))}class F{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new z(t,this.project,this.concurrent))}}class z extends R{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function L(...t){let e=Number.POSITIVE_INFINITY,n=null,s=t[t.length-1];var r;return(r=s)&&"function"==typeof r.schedule?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof s&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof _?t[0]:function(t=Number.POSITIVE_INFINITY){return j(y,t)}(e)(function(t,e){return e?N(t,e):new _(I(t))}(t,n))}function B(){return function(t){return t.lift(new $(t))}}class ${constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const s=new U(t,n),r=e.subscribe(s);return s.closed||(s.connection=n.connect()),r}}class U extends p{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,s=t._connection;this.connection=null,!s||n&&s!==n||s.unsubscribe()}}class Z extends _{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new h,t.add(this.source.subscribe(new W(this.getSubject(),this))),t.closed&&(this._connection=null,t=h.EMPTY)),t}refCount(){return B()(this)}}const q=(()=>{const t=Z.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}})();class W extends w{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function G(){return new E}function Q(t){for(let e in t)if(t[e]===Q)return e;throw Error("Could not find renamed property on target object.")}function J(t,e){for(const n in e)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n])}function K(t){if("string"==typeof t)return t;if(Array.isArray(t))return"["+t.map(K).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return`${t.overriddenName}`;if(t.name)return`${t.name}`;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function Y(t,e){return null==t||""===t?null===e?"":e:null==e||""===e?t:t+" "+e}const X=Q({__forward_ref__:Q});function tt(t){return t.__forward_ref__=tt,t.toString=function(){return K(this())},t}function et(t){return nt(t)?t():t}function nt(t){return"function"==typeof t&&t.hasOwnProperty(X)&&t.__forward_ref__===tt}class st extends Error{constructor(t,e){super(function(t,e){return`${t?`NG0${t}: `:""}${e}`}(t,e)),this.code=t}}function rt(t){return"string"==typeof t?t:null==t?"":String(t)}function it(t){return"function"==typeof t?t.name||t.toString():"object"==typeof t&&null!=t&&"function"==typeof t.type?t.type.name||t.type.toString():rt(t)}function ot(t,e){const n=e?` in ${e}`:"";throw new st("201",`No provider for ${it(t)} found${n}`)}function lt(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function at(t){return{providers:t.providers||[],imports:t.imports||[]}}function ct(t){return ut(t,dt)||ut(t,pt)}function ut(t,e){return t.hasOwnProperty(e)?t[e]:null}function ht(t){return t&&(t.hasOwnProperty(ft)||t.hasOwnProperty(gt))?t[ft]:null}const dt=Q({"\u0275prov":Q}),ft=Q({"\u0275inj":Q}),pt=Q({ngInjectableDef:Q}),gt=Q({ngInjectorDef:Q});var vt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});let yt;function _t(t){const e=yt;return yt=t,e}function mt(t,e,n){const s=ct(t);return s&&"root"==s.providedIn?void 0===s.value?s.value=s.factory():s.value:n&vt.Optional?null:void 0!==e?e:void ot(K(t),"Injector")}function bt(t){return{toString:t}.toString()}var Ct=function(t){return t[t.OnPush=0]="OnPush",t[t.Default=1]="Default",t}({}),wt=function(t){return t[t.Emulated=0]="Emulated",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({});const Et="undefined"!=typeof globalThis&&globalThis,xt="undefined"!=typeof window&&window,kt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,At="undefined"!=typeof global&&global,Ot=Et||At||xt||kt,It={},St=[],Tt=Q({"\u0275cmp":Q}),Vt=Q({"\u0275dir":Q}),Dt=Q({"\u0275pipe":Q}),Ht=Q({"\u0275mod":Q}),Nt=Q({"\u0275loc":Q}),Mt=Q({"\u0275fac":Q}),Pt=Q({__NG_ELEMENT_ID__:Q});let Rt=0;function jt(t){return bt(()=>{const e={},n={type:t.type,providersResolver:null,decls:t.decls,vars:t.vars,factory:null,template:t.template||null,consts:t.consts||null,ngContentSelectors:t.ngContentSelectors,hostBindings:t.hostBindings||null,hostVars:t.hostVars||0,hostAttrs:t.hostAttrs||null,contentQueries:t.contentQueries||null,declaredInputs:e,inputs:null,outputs:null,exportAs:t.exportAs||null,onPush:t.changeDetection===Ct.OnPush,directiveDefs:null,pipeDefs:null,selectors:t.selectors||St,viewQuery:t.viewQuery||null,features:t.features||null,data:t.data||{},encapsulation:t.encapsulation||wt.Emulated,id:"c",styles:t.styles||St,_:null,setInput:null,schemas:t.schemas||null,tView:null},s=t.directives,r=t.features,i=t.pipes;return n.id+=Rt++,n.inputs=$t(t.inputs,e),n.outputs=$t(t.outputs),r&&r.forEach(t=>t(n)),n.directiveDefs=s?()=>("function"==typeof s?s():s).map(Ft):null,n.pipeDefs=i?()=>("function"==typeof i?i():i).map(zt):null,n})}function Ft(t){return qt(t)||function(t){return t[Vt]||null}(t)}function zt(t){return function(t){return t[Dt]||null}(t)}const Lt={};function Bt(t){const e={type:t.type,bootstrap:t.bootstrap||St,declarations:t.declarations||St,imports:t.imports||St,exports:t.exports||St,transitiveCompileScopes:null,schemas:t.schemas||null,id:t.id||null};return null!=t.id&&bt(()=>{Lt[t.id]=t.type}),e}function $t(t,e){if(null==t)return It;const n={};for(const s in t)if(t.hasOwnProperty(s)){let r=t[s],i=r;Array.isArray(r)&&(i=r[1],r=r[0]),n[r]=s,e&&(e[r]=i)}return n}const Ut=jt;function Zt(t){return{type:t.type,name:t.name,factory:null,pure:!1!==t.pure,onDestroy:t.type.prototype.ngOnDestroy||null}}function qt(t){return t[Tt]||null}function Wt(t,e){const n=t[Ht]||null;if(!n&&!0===e)throw new Error(`Type ${K(t)} does not have '\u0275mod' property.`);return n}const Gt=20,Qt=10;function Jt(t){return Array.isArray(t)&&"object"==typeof t[1]}function Kt(t){return Array.isArray(t)&&!0===t[1]}function Yt(t){return 0!=(8&t.flags)}function Xt(t){return 2==(2&t.flags)}function te(t){return 1==(1&t.flags)}function ee(t){return null!==t.template}function ne(t,e){return t.hasOwnProperty(Mt)?t[Mt]:null}class se{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}function re(){return ie}function ie(t){return t.type.prototype.ngOnChanges&&(t.setInput=le),oe}function oe(){const t=ae(this),e=null==t?void 0:t.current;if(e){const n=t.previous;if(n===It)t.previous=e;else for(let t in e)n[t]=e[t];t.current=null,this.ngOnChanges(e)}}function le(t,e,n,s){const r=ae(t)||function(t,e){return t.__ngSimpleChanges__=e}(t,{previous:It,current:null}),i=r.current||(r.current={}),o=r.previous,l=this.declaredInputs[n],a=o[l];i[l]=new se(a&&a.currentValue,e,o===It),t[s]=e}function ae(t){return t.__ngSimpleChanges__||null}re.ngInherit=!0;const ce="http://www.w3.org/2000/svg";let ue;function he(t){return!!t.listen}const de={createRenderer:(t,e)=>void 0!==ue?ue:"undefined"!=typeof document?document:void 0};function fe(t){for(;Array.isArray(t);)t=t[0];return t}function pe(t,e){return fe(e[t])}function ge(t,e){return fe(e[t.index])}function ve(t,e){return t.data[e]}function ye(t,e){const n=e[t];return Jt(n)?n:n[0]}function _e(t){return 128==(128&t[2])}function me(t,e){return null==e?null:t[e]}function be(t){t[18]=0}function Ce(t,e){t[5]+=e;let n=t,s=t[3];for(;null!==s&&(1===e&&1===n[5]||-1===e&&0===n[5]);)s[5]+=e,n=s,s=s[3]}const we={lFrame:Ue(null),bindingsEnabled:!0,isInCheckNoChangesMode:!1};function Ee(){return we.bindingsEnabled}function xe(){return we.lFrame.lView}function ke(){return we.lFrame.tView}function Ae(t){return we.lFrame.contextLView=t,t[8]}function Oe(){let t=Ie();for(;null!==t&&64===t.type;)t=t.parent;return t}function Ie(){return we.lFrame.currentTNode}function Se(t,e){const n=we.lFrame;n.currentTNode=t,n.isParent=e}function Te(){return we.lFrame.isParent}function Ve(){we.lFrame.isParent=!1}function De(){return we.isInCheckNoChangesMode}function He(t){we.isInCheckNoChangesMode=t}function Ne(){const t=we.lFrame;let e=t.bindingRootIndex;return-1===e&&(e=t.bindingRootIndex=t.tView.bindingStartIndex),e}function Me(){return we.lFrame.bindingIndex++}function Pe(t){const e=we.lFrame,n=e.bindingIndex;return e.bindingIndex=e.bindingIndex+t,n}function Re(t,e){const n=we.lFrame;n.bindingIndex=n.bindingRootIndex=t,je(e)}function je(t){we.lFrame.currentDirectiveIndex=t}function Fe(t){we.lFrame.currentQueryIndex=t}function ze(t){const e=t[1];return 2===e.type?e.declTNode:1===e.type?t[6]:null}function Le(t,e,n){if(n&vt.SkipSelf){let s=e,r=t;for(;s=s.parent,!(null!==s||n&vt.Host||(s=ze(r),null===s)||(r=r[15],10&s.type)););if(null===s)return!1;e=s,t=r}const s=we.lFrame=$e();return s.currentTNode=e,s.lView=t,!0}function Be(t){const e=$e(),n=t[1];we.lFrame=e,e.currentTNode=n.firstChild,e.lView=t,e.tView=n,e.contextLView=t,e.bindingIndex=n.bindingStartIndex,e.inI18n=!1}function $e(){const t=we.lFrame,e=null===t?null:t.child;return null===e?Ue(t):e}function Ue(t){const e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:t,child:null,inI18n:!1};return null!==t&&(t.child=e),e}function Ze(){const t=we.lFrame;return we.lFrame=t.parent,t.currentTNode=null,t.lView=null,t}const qe=Ze;function We(){const t=Ze();t.isParent=!0,t.tView=null,t.selectedIndex=-1,t.contextLView=null,t.elementDepthCount=0,t.currentDirectiveIndex=-1,t.currentNamespace=null,t.bindingRootIndex=-1,t.bindingIndex=-1,t.currentQueryIndex=0}function Ge(){return we.lFrame.selectedIndex}function Qe(t){we.lFrame.selectedIndex=t}function Je(){const t=we.lFrame;return ve(t.tView,t.selectedIndex)}function Ke(t,e){for(let n=e.directiveStart,s=e.directiveEnd;n=s)break}else e[l]<0&&(t[18]+=65536),(o>11>16&&(3&t[2])===e){t[2]+=2048;try{i.call(o)}finally{}}}else try{i.call(o)}finally{}}const sn=-1;class rn{constructor(t,e,n){this.factory=t,this.resolving=!1,this.canSeeViewProviders=e,this.injectImpl=n}}function on(t,e,n){const s=he(t);let r=0;for(;re){o=i-1;break}}}for(;i>16,s=e;for(;n>0;)s=s[15],n--;return s}let fn=!0;function pn(t){const e=fn;return fn=t,e}let gn=0;function vn(t,e){const n=_n(t,e);if(-1!==n)return n;const s=e[1];s.firstCreatePass&&(t.injectorIndex=e.length,yn(s.data,t),yn(e,null),yn(s.blueprint,null));const r=mn(t,e),i=t.injectorIndex;if(un(r)){const t=hn(r),n=dn(r,e),s=n[1].data;for(let r=0;r<8;r++)e[i+r]=n[t+r]|s[t+r]}return e[i+8]=r,i}function yn(t,e){t.push(0,0,0,0,0,0,0,0,e)}function _n(t,e){return-1===t.injectorIndex||t.parent&&t.parent.injectorIndex===t.injectorIndex||null===e[t.injectorIndex+8]?-1:t.injectorIndex}function mn(t,e){if(t.parent&&-1!==t.parent.injectorIndex)return t.parent.injectorIndex;let n=0,s=null,r=e;for(;null!==r;){const t=r[1],e=t.type;if(s=2===e?t.declTNode:1===e?r[6]:null,null===s)return sn;if(n++,r=r[15],-1!==s.injectorIndex)return s.injectorIndex|n<<16}return sn}function bn(t,e,n){!function(t,e,n){let s;"string"==typeof n?s=n.charCodeAt(0)||0:n.hasOwnProperty(Pt)&&(s=n[Pt]),null==s&&(s=n[Pt]=gn++);const r=255&s;e.data[t+(r>>5)]|=1<=0?255&e:kn:e}(n);if("function"==typeof i){if(!Le(e,t,s))return s&vt.Host?Cn(r,n,s):wn(e,n,s,r);try{const t=i(s);if(null!=t||s&vt.Optional)return t;ot(n)}finally{qe()}}else if("number"==typeof i){let r=null,o=_n(t,e),l=sn,a=s&vt.Host?e[16][6]:null;for((-1===o||s&vt.SkipSelf)&&(l=-1===o?mn(t,e):e[o+8],l!==sn&&Sn(s,!1)?(r=e[1],o=hn(l),e=dn(l,e)):o=-1);-1!==o;){const t=e[1];if(In(i,o,t.data)){const t=An(o,e,n,r,s,a);if(t!==xn)return t}l=e[o+8],l!==sn&&Sn(s,e[1].data[o+8]===a)&&In(i,o,e)?(r=t,o=hn(l),e=dn(l,e)):o=-1}}}return wn(e,n,s,r)}const xn={};function kn(){return new Tn(Oe(),xe())}function An(t,e,n,s,r,i){const o=e[1],l=o.data[t+8],a=function(t,e,n,s,r){const i=t.providerIndexes,o=e.data,l=1048575&i,a=t.directiveStart,c=i>>20,u=r?l+c:t.directiveEnd;for(let h=s?l:l+c;h=a&&t.type===n)return h}if(r){const t=o[a];if(t&&ee(t)&&t.type===n)return a}return null}(l,o,n,null==s?Xt(l)&&fn:s!=o&&0!=(3&l.type),r&vt.Host&&i===l);return null!==a?On(e,o,a,l):xn}function On(t,e,n,s){let r=t[n];const i=e.data;if(r instanceof rn){const o=r;o.resolving&&function(t,e){throw new st("200",`Circular dependency in DI detected for ${t}`)}(it(i[n]));const l=pn(o.canSeeViewProviders);o.resolving=!0;const a=o.injectImpl?_t(o.injectImpl):null;Le(t,s,vt.Default);try{r=t[n]=o.factory(void 0,i,t,s),e.firstCreatePass&&n>=s.directiveStart&&function(t,e,n){const{ngOnChanges:s,ngOnInit:r,ngDoCheck:i}=e.type.prototype;if(s){const s=ie(e);(n.preOrderHooks||(n.preOrderHooks=[])).push(t,s),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,s)}r&&(n.preOrderHooks||(n.preOrderHooks=[])).push(0-t,r),i&&((n.preOrderHooks||(n.preOrderHooks=[])).push(t,i),(n.preOrderCheckHooks||(n.preOrderCheckHooks=[])).push(t,i))}(n,i[n],e)}finally{null!==a&&_t(a),pn(l),o.resolving=!1,qe()}}return r}function In(t,e,n){return!!(n[e+(t>>5)]&1<{const e=t.prototype.constructor,n=e[Mt]||Dn(e),s=Object.prototype;let r=Object.getPrototypeOf(t.prototype).constructor;for(;r&&r!==s;){const t=r[Mt]||Dn(r);if(t&&t!==n)return t;r=Object.getPrototypeOf(r)}return t=>new t})}function Dn(t){return nt(t)?()=>{const e=Dn(et(t));return e&&e()}:ne(t)}const Hn="__parameters__";function Nn(t,e,n){return bt(()=>{const s=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function r(...t){if(this instanceof r)return s.apply(this,t),this;const e=new r(...t);return n.annotation=e,n;function n(t,n,s){const r=t.hasOwnProperty(Hn)?t[Hn]:Object.defineProperty(t,Hn,{value:[]})[Hn];for(;r.length<=s;)r.push(null);return(r[s]=r[s]||[]).push(e),t}}return n&&(r.prototype=Object.create(n.prototype)),r.prototype.ngMetadataName=t,r.annotationCls=r,r})}class Mn{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.\u0275prov=lt({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return`InjectionToken ${this._desc}`}}function Pn(t,e){t.forEach(t=>Array.isArray(t)?Pn(t,e):e(t))}function Rn(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function jn(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}function Fn(t,e,n){let s=Ln(t,e);return s>=0?t[1|s]=n:(s=~s,function(t,e,n,s){let r=t.length;if(r==e)t.push(n,s);else if(1===r)t.push(s,t[0]),t[0]=n;else{for(r--,t.push(t[r-1],t[r]);r>e;)t[r]=t[r-2],r--;t[e]=n,t[e+1]=s}}(t,s,e,n)),s}function zn(t,e){const n=Ln(t,e);if(n>=0)return t[1|n]}function Ln(t,e){return function(t,e,n){let s=0,r=t.length>>1;for(;r!==s;){const n=s+(r-s>>1),i=t[n<<1];if(e===i)return n<<1;i>e?r=n:s=n+1}return~(r<<1)}(t,e)}const Bn={},$n=/\n/gm,Un="__source",Zn=Q({provide:String,useValue:Q});let qn;function Wn(t){const e=qn;return qn=t,e}function Gn(t,e=vt.Default){if(void 0===qn)throw new Error("inject() must be called from an injection context");return null===qn?mt(t,void 0,e):qn.get(t,e&vt.Optional?null:void 0,e)}function Qn(t,e=vt.Default){return(yt||Gn)(et(t),e)}function Jn(t){const e=[];for(let n=0;n({token:t})),-1),Xn=Kn(Nn("Optional"),8),ts=Kn(Nn("SkipSelf"),4);class es{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see https://g.co/ng/security#xss)`}}function ns(t){return t instanceof es?t.changingThisBreaksApplicationSecurity:t}const ss=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,rs=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;var is=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}({});function os(t){const e=function(){const t=xe();return t&&t[12]}();return e?e.sanitize(is.URL,t)||"":function(t,e){const n=function(t){return t instanceof es&&t.getTypeName()||null}(t);if(null!=n&&n!==e){if("ResourceURL"===n&&"URL"===e)return!0;throw new Error(`Required a safe ${e}, got a ${n} (see https://g.co/ng/security#xss)`)}return n===e}(t,"URL")?ns(t):(n=rt(t),(n=String(n)).match(ss)||n.match(rs)?n:"unsafe:"+n);var n}function ls(t,e){t.__ngContext__=e}function as(t){const e=function(t){return t.__ngContext__||null}(t);return e?Array.isArray(e)?e:e.lView:null}function cs(t){return t.ngDebugContext}function us(t){return t.ngOriginalError}function hs(t,...e){t.error(...e)}class ds{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),s=function(t){return t.ngErrorLogger||hs}(t);s(this._console,"ERROR",t),e&&s(this._console,"ORIGINAL ERROR",e),n&&s(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?cs(t)?cs(t):this._findContext(us(t)):null}_findOriginalError(t){let e=us(t);for(;e&&us(e);)e=us(e);return e}}const fs=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Ot))();function ps(t){return t.ownerDocument.defaultView}function gs(t){return t instanceof Function?t():t}var vs=function(t){return t[t.Important=1]="Important",t[t.DashCase=2]="DashCase",t}({});function ys(t,e){return(void 0)(t,e)}function _s(t){const e=t[3];return Kt(e)?e[3]:e}function ms(t){return Cs(t[13])}function bs(t){return Cs(t[4])}function Cs(t){for(;null!==t&&!Kt(t);)t=t[4];return t}function ws(t,e,n,s,r){if(null!=s){let i,o=!1;Kt(s)?i=s:Jt(s)&&(o=!0,s=s[0]);const l=fe(s);0===t&&null!==n?null==r?Ss(e,n,l):Is(e,n,l,r||null,!0):1===t&&null!==n?Is(e,n,l,r||null,!0):2===t?function(t,e,n){const s=Vs(t,e);s&&function(t,e,n,s){he(t)?t.removeChild(e,n,s):e.removeChild(n)}(t,s,e,n)}(e,l,o):3===t&&e.destroyNode(l),null!=i&&function(t,e,n,s,r){const i=n[7];i!==fe(n)&&ws(e,t,s,i,r);for(let o=Qt;o0&&(t[n-1][4]=s[4]);const o=jn(t,Qt+e);Rs(s[1],r=s,r[11],2,null,null),r[0]=null,r[6]=null;const l=o[19];null!==l&&l.detachView(o[1]),s[3]=null,s[4]=null,s[2]&=-129}var r;return s}function As(t,e){if(!(256&e[2])){const n=e[11];he(n)&&n.destroyNode&&Rs(t,e,n,3,null,null),function(t){let e=t[13];if(!e)return Os(t[1],t);for(;e;){let n=null;if(Jt(e))n=e[13];else{const t=e[10];t&&(n=t)}if(!n){for(;e&&!e[4]&&e!==t;)Jt(e)&&Os(e[1],e),e=e[3];null===e&&(e=t),Jt(e)&&Os(e[1],e),n=e&&e[4]}e=n}}(e)}}function Os(t,e){if(!(256&e[2])){e[2]&=-129,e[2]|=256,function(t,e){let n;if(null!=t&&null!=(n=t.destroyHooks))for(let s=0;s=0?s[r=a]():s[r=-a].unsubscribe(),i+=2}else{const t=s[r=n[i+1]];n[i].call(t)}if(null!==s){for(let t=r+1;ti?"":r[u+1].toLowerCase();const e=8&s?t:null;if(e&&-1!==Ls(e,c,0)||2&s&&c!==t){if(Ws(s))return!1;o=!0}}}}else{if(!o&&!Ws(s)&&!Ws(a))return!1;if(o&&Ws(a))continue;o=!1,s=a|1&s}}return Ws(s)||o}function Ws(t){return 0==(1&t)}function Gs(t,e,n,s){if(null===e)return-1;let r=0;if(s||!n){let n=!1;for(;r-1)for(n++;n0?'="'+e+'"':"")+"]"}else 8&s?r+="."+o:4&s&&(r+=" "+o);else""===r||Ws(o)||(e+=Js(i,r),r=""),s=o,i=i||!Ws(s);n++}return""!==r&&(e+=Js(i,r)),e}const Ys={};function Xs(t){tr(ke(),xe(),Ge()+t,De())}function tr(t,e,n,s){if(!s)if(3==(3&e[2])){const s=t.preOrderCheckHooks;null!==s&&Ye(e,s,n)}else{const s=t.preOrderHooks;null!==s&&Xe(e,s,0,n)}Qe(n)}function er(t,e){return t<<17|e<<2}function nr(t){return t>>17&32767}function sr(t){return 2|t}function rr(t){return(131068&t)>>2}function ir(t,e){return-131069&t|e<<2}function or(t){return 1|t}function lr(t,e){const n=t.contentQueries;if(null!==n)for(let s=0;sGt&&tr(t,e,Gt,De()),n(s,r)}finally{Qe(i)}}function gr(t,e,n){if(Yt(e)){const s=e.directiveEnd;for(let r=e.directiveStart;r0;){const n=t[--e];if("number"==typeof n&&n<0)return n}return 0})(n)!=i&&n.push(i),n.push(s,r,o)}}function xr(t,e){null!==t.hostBindings&&t.hostBindings(1,e)}function kr(t,e){e.flags|=2,(t.components||(t.components=[])).push(e.index)}function Ar(t,e,n){if(n){if(e.exportAs)for(let s=0;s0&&Nr(n)}}function Nr(t){for(let n=ms(t);null!==n;n=bs(n))for(let t=Qt;t0&&Nr(e)}const e=t[1].components;if(null!==e)for(let n=0;n0&&Nr(s)}}function Mr(t,e){const n=ye(e,t),s=n[1];!function(t,e){for(let n=e.length;nPromise.resolve(null))();function Br(t){return t[7]||(t[7]=[])}function $r(t){return t.cleanup||(t.cleanup=[])}function Ur(t,e){const n=t[9],s=n?n.get(ds,null):null;s&&s.handleError(e)}function Zr(t,e,n,s,r){for(let i=0;ithis.processProvider(n,t,e)),Pn([t],t=>this.processInjectorType(t,[],r)),this.records.set(Wr,ri(void 0,this));const i=this.records.get(Qr);this.scope=null!=i?i.value:null,this.source=s||("object"==typeof t?null:K(t))}get destroyed(){return this._destroyed}destroy(){this.assertNotDestroyed(),this._destroyed=!0;try{this.onDestroy.forEach(t=>t.ngOnDestroy())}finally{this.records.clear(),this.onDestroy.clear(),this.injectorDefTypes.clear()}}get(t,e=Bn,n=vt.Default){this.assertNotDestroyed();const s=Wn(this);try{if(!(n&vt.SkipSelf)){let e=this.records.get(t);if(void 0===e){const n=("function"==typeof(r=t)||"object"==typeof r&&r instanceof Mn)&&ct(t);e=n&&this.injectableDefInScope(n)?ri(ni(t),Jr):null,this.records.set(t,e)}if(null!=e)return this.hydrate(t,e)}return(n&vt.Self?Xr():this.parent).get(t,e=n&vt.Optional&&e===Bn?null:e)}catch(i){if("NullInjectorError"===i.name){if((i.ngTempTokenPath=i.ngTempTokenPath||[]).unshift(K(t)),s)throw i;return function(t,e,n,s){const r=t.ngTempTokenPath;throw e[Un]&&r.unshift(e[Un]),t.message=function(t,e,n,s=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let r=K(e);if(Array.isArray(e))r=e.map(K).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let s=e[n];t.push(n+":"+("string"==typeof s?JSON.stringify(s):K(s)))}r=`{${t.join(", ")}}`}return`${n}${s?"("+s+")":""}[${r}]: ${t.replace($n,"\n ")}`}("\n"+t.message,r,n,s),t.ngTokenPath=r,t.ngTempTokenPath=null,t}(i,t,"R3InjectorError",this.source)}throw i}finally{Wn(s)}var r}_resolveInjectorDefTypes(){this.injectorDefTypes.forEach(t=>this.get(t))}toString(){const t=[];return this.records.forEach((e,n)=>t.push(K(n))),`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new Error("Injector has already been destroyed.")}processInjectorType(t,e,n){if(!(t=et(t)))return!1;let s=ht(t);const r=null==s&&t.ngModule||void 0,i=void 0===r?t:r,o=-1!==n.indexOf(i);if(void 0!==r&&(s=ht(r)),null==s)return!1;if(null!=s.imports&&!o){let t;n.push(i);try{Pn(s.imports,s=>{this.processInjectorType(s,e,n)&&(void 0===t&&(t=[]),t.push(s))})}finally{}if(void 0!==t)for(let e=0;ethis.processProvider(t,n,s||St))}}this.injectorDefTypes.add(i);const l=ne(i)||(()=>new i);this.records.set(i,ri(l,Jr));const a=s.providers;if(null!=a&&!o){const e=t;Pn(a,t=>this.processProvider(t,e,a))}return void 0!==r&&void 0!==t.providers}processProvider(t,e,n){let s=oi(t=et(t))?t:et(t&&t.provide);const r=function(t,e,n){return ii(t)?ri(void 0,t.useValue):ri(si(t),Jr)}(t);if(oi(t)||!0!==t.multi)this.records.get(s);else{let e=this.records.get(s);e||(e=ri(void 0,Jr,!0),e.factory=()=>Jn(e.multi),this.records.set(s,e)),s=t,e.multi.push(t)}this.records.set(s,r)}hydrate(t,e){var n;return e.value===Jr&&(e.value=Kr,e.value=e.factory()),"object"==typeof e.value&&e.value&&null!==(n=e.value)&&"object"==typeof n&&"function"==typeof n.ngOnDestroy&&this.onDestroy.add(e.value),e.value}injectableDefInScope(t){if(!t.providedIn)return!1;const e=et(t.providedIn);return"string"==typeof e?"any"===e||e===this.scope:this.injectorDefTypes.has(e)}}function ni(t){const e=ct(t),n=null!==e?e.factory:ne(t);if(null!==n)return n;if(t instanceof Mn)throw new Error(`Token ${K(t)} is missing a \u0275prov definition.`);if(t instanceof Function)return function(t){const e=t.length;if(e>0){const n=function(t,e){const n=[];for(let s=0;sn.factory(t):()=>new t}(t);throw new Error("unreachable")}function si(t,e,n){let s;if(oi(t)){const e=et(t);return ne(e)||ni(e)}if(ii(t))s=()=>et(t.useValue);else if((r=t)&&r.useFactory)s=()=>t.useFactory(...Jn(t.deps||[]));else if(function(t){return!(!t||!t.useExisting)}(t))s=()=>Qn(et(t.useExisting));else{const e=et(t&&(t.useClass||t.provide));if(!function(t){return!!t.deps}(t))return ne(e)||ni(e);s=()=>new e(...Jn(t.deps))}var r;return s}function ri(t,e,n=!1){return{factory:t,value:e,multi:n?[]:void 0}}function ii(t){return null!==t&&"object"==typeof t&&Zn in t}function oi(t){return"function"==typeof t}const li=function(t,e,n){return function(t,e=null,n=null,s){const r=ti(t,e,n,s);return r._resolveInjectorDefTypes(),r}({name:n},e,t,n)};let ai=(()=>{class t{static create(t,e){return Array.isArray(t)?li(t,e,""):li(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=Bn,t.NULL=new Gr,t.\u0275prov=lt({token:t,providedIn:"any",factory:()=>Qn(Wr)}),t.__NG_ELEMENT_ID__=-1,t})();function ci(t,e){Ke(as(t)[1],Oe())}function ui(t){let e=Object.getPrototypeOf(t.type.prototype).constructor,n=!0;const s=[t];for(;e;){let r;if(ee(t))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new Error("Directives cannot inherit Components");r=e.\u0275dir}if(r){if(n){s.push(r);const e=t;e.inputs=hi(t.inputs),e.declaredInputs=hi(t.declaredInputs),e.outputs=hi(t.outputs);const n=r.hostBindings;n&&pi(t,n);const i=r.viewQuery,o=r.contentQueries;if(i&&di(t,i),o&&fi(t,o),J(t.inputs,r.inputs),J(t.declaredInputs,r.declaredInputs),J(t.outputs,r.outputs),ee(r)&&r.data.animation){const e=t.data;e.animation=(e.animation||[]).concat(r.data.animation)}}const e=r.features;if(e)for(let s=0;s=0;s--){const r=t[s];r.hostVars=e+=r.hostVars,r.hostAttrs=an(r.hostAttrs,n=an(n,r.hostAttrs))}}(s)}function hi(t){return t===It?{}:t===St?[]:t}function di(t,e){const n=t.viewQuery;t.viewQuery=n?(t,s)=>{e(t,s),n(t,s)}:e}function fi(t,e){const n=t.contentQueries;t.contentQueries=n?(t,s,r)=>{e(t,s,r),n(t,s,r)}:e}function pi(t,e){const n=t.hostBindings;t.hostBindings=n?(t,s)=>{e(t,s),n(t,s)}:e}let gi=null;function vi(){if(!gi){const t=Ot.Symbol;if(t&&t.iterator)gi=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;el(fe(t[s.index])):s.index;if(he(n)){let o=null;if(!l&&a&&(o=function(t,e,n,s){const r=t.cleanup;if(null!=r)for(let i=0;in?t[n]:null}"string"==typeof t&&(i+=2)}return null}(t,e,r,s.index)),null!==o)(o.__ngLastListenerFn__||o).__ngNextListenerFn__=i,o.__ngLastListenerFn__=i,h=!1;else{i=Fi(s,e,0,i,!1);const t=n.listen(f,r,i);u.push(i,t),c&&c.push(r,g,p,p+1)}}else i=Fi(s,e,0,i,!0),f.addEventListener(r,i,o),u.push(i),c&&c.push(r,g,p,o)}else i=Fi(s,e,0,i,!1);const d=s.outputs;let f;if(h&&null!==d&&(f=d[r])){const t=f.length;if(t)for(let n=0;n0;)e=e[15],t--;return e}(t,we.lFrame.contextLView))[8]}(t)}function Li(t,e,n){return Bi(t,"",e,"",n),Li}function Bi(t,e,n,s,r){const i=xe(),o=xi(i,e,n,s);return o!==Ys&&Cr(ke(),Je(),i,t,o,i[11],r,!1),Bi}function $i(t,e,n,s,r){const i=t[n+1],o=null===e;let l=s?nr(i):rr(i),a=!1;for(;0!==l&&(!1===a||o);){const n=t[l+1];Ui(t[l],e)&&(a=!0,t[l+1]=s?or(n):sr(n)),l=s?nr(n):rr(n)}a&&(t[n+1]=s?sr(i):or(i))}function Ui(t,e){return null===t||null==e||(Array.isArray(t)?t[1]:t)===e||!(!Array.isArray(t)||"string"!=typeof e)&&Ln(t,e)>=0}const Zi={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function qi(t){return t.substring(Zi.key,Zi.keyEnd)}function Wi(t,e){const n=Zi.textEnd;return n===e?-1:(e=Zi.keyEnd=function(t,e,n){for(;e32;)e++;return e}(t,Zi.key=e,n),Gi(t,e,n))}function Gi(t,e,n){for(;e=0;n=Wi(e,n))Fn(t,qi(e),!0)}function Ki(t,e){return e>=t.expandoStartIndex}function Yi(t,e,n,s){const r=t.data;if(null===r[n+1]){const i=r[Ge()],o=Ki(t,n);ro(i,s)&&null===e&&!o&&(e=!1),e=function(t,e,n,s){const r=function(t){const e=we.lFrame.currentDirectiveIndex;return-1===e?null:t[e]}(t);let i=s?e.residualClasses:e.residualStyles;if(null===r)0===(s?e.classBindings:e.styleBindings)&&(n=to(n=Xi(null,t,e,n,s),e.attrs,s),i=null);else{const o=e.directiveStylingLast;if(-1===o||t[o]!==r)if(n=Xi(r,t,e,n,s),null===i){let n=function(t,e,n){const s=n?e.classBindings:e.styleBindings;if(0!==rr(s))return t[nr(s)]}(t,e,s);void 0!==n&&Array.isArray(n)&&(n=Xi(null,t,e,n[1],s),n=to(n,e.attrs,s),function(t,e,n,s){t[nr(n?e.classBindings:e.styleBindings)]=s}(t,e,s,n))}else i=function(t,e,n){let s;const r=e.directiveEnd;for(let i=1+e.directiveStylingLast;i0)&&(u=!0)}else c=n;if(r)if(0!==a){const e=nr(t[l+1]);t[s+1]=er(e,l),0!==e&&(t[e+1]=ir(t[e+1],s)),t[l+1]=131071&t[l+1]|s<<17}else t[s+1]=er(l,0),0!==l&&(t[l+1]=ir(t[l+1],s)),l=s;else t[s+1]=er(a,0),0===l?l=s:t[a+1]=ir(t[a+1],s),a=s;u&&(t[s+1]=sr(t[s+1])),$i(t,c,s,!0),$i(t,c,s,!1),function(t,e,n,s,r){const i=r?t.residualClasses:t.residualStyles;null!=i&&"string"==typeof e&&Ln(i,e)>=0&&(n[s+1]=or(n[s+1]))}(e,c,t,s,i),o=er(l,a),i?e.classBindings=o:e.styleBindings=o}(r,i,e,n,o,s)}}function Xi(t,e,n,s,r){let i=null;const o=n.directiveEnd;let l=n.directiveStylingLast;for(-1===l?l=n.directiveStart:l++;l0;){const e=t[r],i=Array.isArray(e),a=i?e[1]:e,c=null===a;let u=n[r+1];u===Ys&&(u=c?St:void 0);let h=c?zn(u,s):a===s?u:void 0;if(i&&!so(h)&&(h=zn(e,s)),so(h)&&(l=h,o))return l;const d=t[r+1];r=o?nr(d):rr(d)}if(null!==e){let t=i?e.residualClasses:e.residualStyles;null!=t&&(l=zn(t,s))}return l}function so(t){return void 0!==t}function ro(t,e){return 0!=(t.flags&(e?16:32))}function io(t,e=""){const n=xe(),s=ke(),r=t+Gt,i=s.firstCreatePass?cr(s,r,1,e,null):s.data[r],o=n[r]=function(t,e){return he(t)?t.createText(e):t.createTextNode(e)}(n[11],e);Ds(s,n,o,i),Se(i,!1)}function oo(t){return lo("",t,""),oo}function lo(t,e,n){const s=xe(),r=xi(s,t,e,n);return r!==Ys&&function(t,e,n){const s=pe(e,t);!function(t,e,n){he(t)?t.setValue(e,n):e.textContent=n}(t[11],s,n)}(s,Ge(),r),lo}function ao(t,e,n){!function(t,e,n,s){const r=ke(),i=Pe(2);r.firstUpdatePass&&Yi(r,null,i,s);const o=xe();if(n!==Ys&&Ci(o,i,n)){const l=r.data[Ge()];if(ro(l,s)&&!Ki(r,i)){let t=l.classesWithoutHost;null!==t&&(n=Y(t,n||"")),Ii(r,l,o,n,s)}else!function(t,e,n,s,r,i,o,l){r===Ys&&(r=St);let a=0,c=0,u=0 null != ${e} <=Actual]`)}(n,e),"string"==typeof t&&(vo=t.toLowerCase().replace(/_/g,"-"))}function _o(t,e,n,s,r){if(t=et(t),Array.isArray(t))for(let i=0;i>20;if(oi(t)||!t.multi){const s=new rn(a,r,Ai),f=Co(l,e,r?u:u+d,h);-1===f?(bn(vn(c,o),i,l),mo(i,t,e.length),e.push(l),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(s),o.push(s)):(n[f]=s,o[f]=s)}else{const f=Co(l,e,u+d,h),p=Co(l,e,u,u+d),g=f>=0&&n[f],v=p>=0&&n[p];if(r&&!v||!r&&!g){bn(vn(c,o),i,l);const u=function(t,e,n,s,r){const i=new rn(t,n,Ai);return i.multi=[],i.index=e,i.componentProviders=0,bo(i,r,s&&!n),i}(r?Eo:wo,n.length,r,s,a);!r&&v&&(n[p].providerFactory=u),mo(i,t,e.length,0),e.push(l),c.directiveStart++,c.directiveEnd++,r&&(c.providerIndexes+=1048576),n.push(u),o.push(u)}else mo(i,t,f>-1?f:p,bo(n[r?p:f],a,!r&&s));!r&&s&&v&&n[p].componentProviders++}}}function mo(t,e,n,s){const r=oi(e);if(r||e.useClass){const i=(e.useClass||e).prototype.ngOnDestroy;if(i){const o=t.destroyHooks||(t.destroyHooks=[]);if(!r&&e.multi){const t=o.indexOf(n);-1===t?o.push(n,[s,i]):o[t+1].push(s,i)}else o.push(n,i)}}}function bo(t,e,n){return n&&t.componentProviders++,t.multi.push(e)-1}function Co(t,e,n,s){for(let r=n;r{n.providersResolver=(n,s)=>function(t,e,n){const s=ke();if(s.firstCreatePass){const r=ee(t);_o(n,s.data,s.blueprint,r,!0),_o(e,s.data,s.blueprint,r,!1)}}(n,s?s(t):t,e)}}class Ao{}class Oo{resolveComponentFactory(t){throw function(t){const e=Error(`No component factory found for ${K(t)}. Did you add it to @NgModule.entryComponents?`);return e.ngComponent=t,e}(t)}}let Io=(()=>{class t{}return t.NULL=new Oo,t})();function So(...t){}function To(t,e){return new Do(ge(t,e))}const Vo=function(){return To(Oe(),xe())};let Do=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=Vo,t})();class Ho{}let No=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Mo(),t})();const Mo=function(){const t=xe(),e=ye(Oe().index,t);return function(t){return t[11]}(Jt(e)?e:t)};let Po=(()=>{class t{}return t.\u0275prov=lt({token:t,providedIn:"root",factory:()=>null}),t})();class Ro{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const jo=new Ro("12.0.1");class Fo{constructor(){}supports(t){return _i(t)}create(t){return new Lo(t)}}const zo=(t,e)=>e;class Lo{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||zo}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,s=0,r=null;for(;e||n;){const i=!n||e&&e.currentIndex{s=this._trackByFn(e,t),null!==r&&Object.is(r.trackById,s)?(i&&(r=this._verifyReinsertion(r,t,s,e)),Object.is(r.item,t)||this._addIdentityChange(r,t)):(r=this._mismatch(r,t,s,e),i=!0),r=r._next,e++}),this.length=e;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,s){let r;return null===t?r=this._itTail:(r=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,r,s)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,s))?(Object.is(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,r,s)):t=this._addAfter(new Bo(e,n),r,s),t}_verifyReinsertion(t,e,n,s){let r=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==r?t=this._reinsertAfter(r,t._prev,s):t.currentIndex!=s&&(t.currentIndex=s,this._addToMoves(t,s)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const s=t._prevRemoved,r=t._nextRemoved;return null===s?this._removalsHead=r:s._nextRemoved=r,null===r?this._removalsTail=s:r._prevRemoved=s,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const s=null===e?this._itHead:e._next;return t._next=s,t._prev=e,null===s?this._itTail=t:s._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new Uo),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Uo),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class Bo{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class $o{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Object.is(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class Uo{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new $o,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function Zo(t,e,n){const s=t.previousIndex;if(null===s)return s;let r=0;return n&&s{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const s=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,s)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const s=n._prev,r=n._next;return s&&(s._next=r),r&&(r._prev=s),n._next=null,n._prev=null,n}const n=new Go(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Object.is(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class Go{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}function Qo(){return new Jo([new Fo])}let Jo=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Qo()),deps:[[t,new ts,new Xn]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:Qo}),t})();function Ko(){return new Yo([new qo])}let Yo=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>t.create(e,n||Ko()),deps:[[t,new ts,new Xn]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.\u0275prov=lt({token:t,providedIn:"root",factory:Ko}),t})();function Xo(t,e,n,s,r=!1){for(;null!==n;){const i=e[n.index];if(null!==i&&s.push(fe(i)),Kt(i))for(let t=Qt;t-1&&(ks(t,n),jn(e,n))}this._attachedToViewContainer=!1}As(this._lView[1],this._lView)}onDestroy(t){!function(t,e,n,s){const r=Br(e);r.push(s)}(0,this._lView,0,t)}markForCheck(){Rr(this._cdRefInjectingView||this._lView)}detach(){this._lView[2]&=-129}reattach(){this._lView[2]|=128}detectChanges(){jr(this._lView[1],this._lView,this.context)}checkNoChanges(){!function(t,e,n){He(!0);try{jr(t,e,n)}finally{He(!1)}}(this._lView[1],this._lView,this.context)}attachToViewContainerRef(){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._attachedToViewContainer=!0}detachFromAppRef(){var t;this._appRef=null,Rs(this._lView[1],t=this._lView,t[11],2,null,null)}attachToAppRef(t){if(this._attachedToViewContainer)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}}class el extends tl{constructor(t){super(t),this._view=t}detectChanges(){Fr(this._view)}checkNoChanges(){!function(t){He(!0);try{Fr(t)}finally{He(!1)}}(this._view)}get context(){return null}}const nl=[new qo],sl=new Jo([new Fo]),rl=new Yo(nl),il=function(){return t=Oe(),e=xe(),4&t.type?new al(e,t,To(t,e)):null;var t,e};let ol=(()=>{class t{}return t.__NG_ELEMENT_ID__=il,t})();const ll=ol,al=class extends ll{constructor(t,e,n){super(),this._declarationLView=t,this._declarationTContainer=e,this.elementRef=n}createEmbeddedView(t){const e=this._declarationTContainer.tViews,n=ar(this._declarationLView,e,t,16,null,e.declTNode,null,null,null,null);n[17]=this._declarationLView[this._declarationTContainer.index];const s=this._declarationLView[19];return null!==s&&(n[19]=s.createEmbeddedView(e)),hr(e,n,t),new tl(n)}};class cl{}const ul=function(){return function(t,e){let n;const s=e[t.index];if(Kt(s))n=s;else{let r;if(8&t.type)r=fe(s);else{const n=e[11];r=n.createComment("");const s=ge(t,e);Is(n,Vs(n,s),r,function(t,e){return he(t)?t.nextSibling(e):e.nextSibling}(n,s),!1)}e[t.index]=n=Dr(s,e,r,t),Pr(e,n)}return new fl(n,t,e)}(Oe(),xe())};let hl=(()=>{class t{}return t.__NG_ELEMENT_ID__=ul,t})();const dl=hl,fl=class extends dl{constructor(t,e,n){super(),this._lContainer=t,this._hostTNode=e,this._hostLView=n}get element(){return To(this._hostTNode,this._hostLView)}get injector(){return new Tn(this._hostTNode,this._hostLView)}get parentInjector(){const t=mn(this._hostTNode,this._hostLView);if(un(t)){const e=dn(t,this._hostLView),n=hn(t);return new Tn(e[1].data[n+8],e)}return new Tn(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const e=pl(this._lContainer);return null!==e&&e[t]||null}get length(){return this._lContainer.length-Qt}createEmbeddedView(t,e,n){const s=t.createEmbeddedView(e||{});return this.insert(s,n),s}createComponent(t,e,n,s,r){const i=n||this.parentInjector;if(!r&&null==t.ngModule&&i){const t=i.get(cl,null);t&&(r=t)}const o=t.create(i,s,void 0,r);return this.insert(o.hostView,e),o}insert(t,e){const n=t._lView,s=n[1];if(Kt(n[3])){const e=this.indexOf(t);if(-1!==e)this.detach(e);else{const e=n[3],s=new fl(e,e[6],e[3]);s.detach(s.indexOf(t))}}const r=this._adjustIndex(e),i=this._lContainer;!function(t,e,n,s){const r=Qt+s,i=n.length;s>0&&(n[r-1][4]=e),sfs});class bl extends Ao{constructor(t,e){super(),this.componentDef=t,this.ngModule=e,this.componentType=t.type,this.selector=t.selectors.map(Ks).join(","),this.ngContentSelectors=t.ngContentSelectors?t.ngContentSelectors:[],this.isBoundToModule=!!e}get inputs(){return _l(this.componentDef.inputs)}get outputs(){return _l(this.componentDef.outputs)}create(t,e,n,s){const r=(s=s||this.ngModule)?function(t,e){return{get:(n,s,r)=>{const i=t.get(n,vl,r);return i!==vl||s===vl?i:e.get(n,s,r)}}}(t,s.injector):t,i=r.get(Ho,de),o=r.get(Po,null),l=i.createRenderer(null,this.componentDef),a=this.componentDef.selectors[0][0]||"div",c=n?function(t,e,n){if(he(t))return t.selectRootElement(e,n===wt.ShadowDom);let s="string"==typeof e?t.querySelector(e):e;return s.textContent="",s}(l,n,this.componentDef.encapsulation):Es(i.createRenderer(null,this.componentDef),a,function(t){const e=t.toLowerCase();return"svg"===e?ce:"math"===e?"http://www.w3.org/1998/MathML/":null}(a)),u=this.componentDef.onPush?576:528,h={components:[],scheduler:fs,clean:Lr,playerHandler:null,flags:0},d=mr(0,null,null,1,0,null,null,null,null,null),f=ar(null,d,h,u,null,null,i,l,o,r);let p,g;Be(f);try{const t=function(t,e,n,s,r,i){const o=n[1];n[20]=t;const l=cr(o,20,2,"#host",null),a=l.mergedAttrs=e.hostAttrs;null!==a&&(qr(l,a,!0),null!==t&&(on(r,t,a),null!==l.classes&&zs(r,t,l.classes),null!==l.styles&&Fs(r,t,l.styles)));const c=s.createRenderer(t,e),u=ar(n,_r(e),null,e.onPush?64:16,n[20],l,s,c,null,null);return o.firstCreatePass&&(bn(vn(l,n),o,e.type),kr(o,l),Or(l,n.length,1)),Pr(n,u),n[20]=u}(c,this.componentDef,f,i,l);if(c)if(n)on(l,c,["ng-version",jo.full]);else{const{attrs:t,classes:e}=function(t){const e=[],n=[];let s=1,r=2;for(;s0&&zs(l,c,e.join(" "))}if(g=ve(d,Gt),void 0!==e){const t=g.projection=[];for(let n=0;nt(o,e)),e.contentQueries){const t=Oe();e.contentQueries(1,o,t.directiveStart)}const l=Oe();return!i.firstCreatePass||null===e.hostBindings&&null===e.hostAttrs||(Qe(l.index),Er(n[1],l,0,l.directiveStart,l.directiveEnd,e),xr(e,o)),o}(t,this.componentDef,f,h,[ci]),hr(d,f,null)}finally{We()}return new Cl(this.componentType,p,To(g,f),f,g)}}class Cl extends class{}{constructor(t,e,n,s,r){super(),this.location=n,this._rootLView=s,this._tNode=r,this.instance=e,this.hostView=this.changeDetectorRef=new el(s),this.componentType=t}get injector(){return new Tn(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}}const wl=new Map;class El extends cl{constructor(t,e){super(),this._parent=e,this._bootstrapComponents=[],this.injector=this,this.destroyCbs=[],this.componentFactoryResolver=new yl(this);const n=Wt(t),s=t[Nt]||null;s&&yo(s),this._bootstrapComponents=gs(n.bootstrap),this._r3Injector=ti(t,e,[{provide:cl,useValue:this},{provide:Io,useValue:this.componentFactoryResolver}],K(t)),this._r3Injector._resolveInjectorDefTypes(),this.instance=this.get(t)}get(t,e=ai.THROW_IF_NOT_FOUND,n=vt.Default){return t===ai||t===cl||t===Wr?this:this._r3Injector.get(t,e,n)}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class xl extends class{}{constructor(t){super(),this.moduleType=t,null!==Wt(t)&&function(t){const e=new Set;!function t(n){const s=Wt(n,!0),r=s.id;null!==r&&(function(t,e,n){if(e&&e!==n)throw new Error(`Duplicate module registered for ${t} - ${K(e)} vs ${K(e.name)}`)}(r,wl.get(r),n),wl.set(r,n));const i=gs(s.imports);for(const o of i)e.has(o)||(e.add(o),t(o))}(t)}(t)}create(t){return new El(this.moduleType,t)}}function kl(t,e,n,s){return function(t,e,n,s,r,i){const o=e+n;return Ci(t,o,r)?bi(t,o+1,i?s.call(i,r):s(r)):Il(t,o+1)}(xe(),Ne(),t,e,n,s)}function Al(t,e,n,s,r){return function(t,e,n,s,r,i,o){const l=e+n;return wi(t,l,r,i)?bi(t,l+2,o?s.call(o,r,i):s(r,i)):Il(t,l+2)}(xe(),Ne(),t,e,n,s,r)}function Ol(t,e,n,s,r,i){return Sl(xe(),Ne(),t,e,n,s,r,i)}function Il(t,e){const n=t[e];return n===Ys?void 0:n}function Sl(t,e,n,s,r,i,o,l){const a=e+n;return function(t,e,n,s,r){const i=wi(t,e,n,s);return Ci(t,e+2,r)||i}(t,a,r,i,o)?bi(t,a+3,l?s.call(l,r,i,o):s(r,i,o)):Il(t,a+3)}function Tl(t){return e=>{setTimeout(t,void 0,e)}}const Vl=class extends E{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){var s,r,i;let o=t,l=e||(()=>null),a=n;if(t&&"object"==typeof t){const e=t;o=null===(s=e.next)||void 0===s?void 0:s.bind(e),l=null===(r=e.error)||void 0===r?void 0:r.bind(e),a=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}this.__isAsync&&(l=Tl(l),o&&(o=Tl(o)),a&&(a=Tl(a)));const c=super.subscribe({next:o,error:l,complete:a});return t instanceof h&&t.add(c),c}},Dl=new Mn("Application Initializer");let Hl=(()=>{class t{constructor(t){this.appInits=t,this.resolve=So,this.reject=So,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n{e.subscribe({complete:t,error:n})});t.push(n)}}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}return t.\u0275fac=function(e){return new(e||t)(Qn(Dl,8))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Nl=new Mn("AppId"),Ml={provide:Nl,useFactory:function(){return`${Pl()}${Pl()}${Pl()}`},deps:[]};function Pl(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Rl=new Mn("Platform Initializer"),jl=new Mn("Platform ID"),Fl=new Mn("appBootstrapListener");let zl=(()=>{class t{log(t){console.log(t)}warn(t){console.warn(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Ll=new Mn("LocaleId"),Bl=new Mn("DefaultCurrencyCode");class $l{constructor(t,e){this.ngModuleFactory=t,this.componentFactories=e}}const Ul=function(t){return new xl(t)},Zl=Ul,ql=function(t){return Promise.resolve(Ul(t))},Wl=function(t){const e=Ul(t),n=gs(Wt(t).declarations).reduce((t,e)=>{const n=qt(e);return n&&t.push(new bl(n)),t},[]);return new $l(e,n)},Gl=Wl,Ql=function(t){return Promise.resolve(Wl(t))};let Jl=(()=>{class t{constructor(){this.compileModuleSync=Zl,this.compileModuleAsync=ql,this.compileModuleAndAllComponentsSync=Gl,this.compileModuleAndAllComponentsAsync=Ql}clearCache(){}clearCacheFor(t){}getModuleId(t){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Kl=(()=>Promise.resolve(0))();function Yl(t){"undefined"==typeof Zone?Kl.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Xl{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:e=!1,shouldCoalesceRunChangeDetection:n=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new Vl(!1),this.onMicrotaskEmpty=new Vl(!1),this.onStable=new Vl(!1),this.onError=new Vl(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!n&&e,s.shouldCoalesceRunChangeDetection=n,s.lastRequestAnimationFrameId=-1,s.nativeRequestAnimationFrame=function(){let t=Ot.requestAnimationFrame,e=Ot.cancelAnimationFrame;if("undefined"!=typeof Zone&&t&&e){const n=t[Zone.__symbol__("OriginalDelegate")];n&&(t=n);const s=e[Zone.__symbol__("OriginalDelegate")];s&&(e=s)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:e}}().nativeRequestAnimationFrame,function(t){const e=()=>{!function(t){t.isCheckStableRunning||-1!==t.lastRequestAnimationFrameId||(t.lastRequestAnimationFrameId=t.nativeRequestAnimationFrame.call(Ot,()=>{t.fakeTopEventTask||(t.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{t.lastRequestAnimationFrameId=-1,na(t),t.isCheckStableRunning=!0,ea(t),t.isCheckStableRunning=!1},void 0,()=>{},()=>{})),t.fakeTopEventTask.invoke()}),na(t))}(t)};t._inner=t._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(n,s,r,i,o,l)=>{try{return sa(t),n.invokeTask(r,i,o,l)}finally{(t.shouldCoalesceEventChangeDetection&&"eventTask"===i.type||t.shouldCoalesceRunChangeDetection)&&e(),ra(t)}},onInvoke:(n,s,r,i,o,l,a)=>{try{return sa(t),n.invoke(r,i,o,l,a)}finally{t.shouldCoalesceRunChangeDetection&&e(),ra(t)}},onHasTask:(e,n,s,r)=>{e.hasTask(s,r),n===s&&("microTask"==r.change?(t._hasPendingMicrotasks=r.microTask,na(t),ea(t)):"macroTask"==r.change&&(t.hasPendingMacrotasks=r.macroTask))},onHandleError:(e,n,s,r)=>(e.handleError(s,r),t.runOutsideAngular(()=>t.onError.emit(r)),!1)})}(s)}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Xl.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Xl.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,s){const r=this._inner,i=r.scheduleEventTask("NgZoneEvent: "+s,t,ta,So,So);try{return r.runTask(i,e,n)}finally{r.cancelTask(i)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}const ta={};function ea(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function na(t){t.hasPendingMicrotasks=!!(t._hasPendingMicrotasks||(t.shouldCoalesceEventChangeDetection||t.shouldCoalesceRunChangeDetection)&&-1!==t.lastRequestAnimationFrameId)}function sa(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function ra(t){t._nesting--,ea(t)}class ia{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new Vl,this.onMicrotaskEmpty=new Vl,this.onStable=new Vl,this.onError=new Vl}run(t,e,n){return t.apply(e,n)}runGuarded(t,e,n){return t.apply(e,n)}runOutsideAngular(t){return t()}runTask(t,e,n,s){return t.apply(e,n)}}let oa=(()=>{class t{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Xl.assertNotInAngularZone(),Yl(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())Yl(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let s=-1;e&&e>0&&(s=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==s),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:s,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}return t.\u0275fac=function(e){return new(e||t)(Qn(Xl))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),la=(()=>{class t{constructor(){this._applications=new Map,ua.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return ua.findTestabilityInTree(this,t,e)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class aa{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let ca,ua=new aa,ha=!0,da=!1;const fa=new Mn("AllowMultipleToken");function pa(t,e,n=[]){const s=`Platform: ${e}`,r=new Mn(s);return(e=[])=>{let i=ga();if(!i||i.injector.get(fa,!1))if(t)t(n.concat(e).concat({provide:r,useValue:!0}));else{const t=n.concat(e).concat({provide:r,useValue:!0},{provide:Qr,useValue:"platform"});!function(t){if(ca&&!ca.destroyed&&!ca.injector.get(fa,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ca=t.get(va);const e=t.get(Rl,null);e&&e.forEach(t=>t())}(ai.create({providers:t,name:s}))}return function(t){const e=ga();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(r)}}function ga(){return ca&&!ca.destroyed?ca:null}let va=(()=>{class t{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t,e){let n;return n="noop"===t?new ia:("zone.js"===t?void 0:t)||new Xl({enableLongStackTrace:(da=!0,ha),shouldCoalesceEventChangeDetection:!!(null==e?void 0:e.ngZoneEventCoalescing),shouldCoalesceRunChangeDetection:!!(null==e?void 0:e.ngZoneRunCoalescing)}),n}(e?e.ngZone:void 0,{ngZoneEventCoalescing:e&&e.ngZoneEventCoalescing||!1,ngZoneRunCoalescing:e&&e.ngZoneRunCoalescing||!1}),s=[{provide:Xl,useValue:n}];return n.run(()=>{const e=ai.create({providers:s,parent:this.injector,name:t.moduleType.name}),r=t.create(e),i=r.injector.get(ds,null);if(!i)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.runOutsideAngular(()=>{const t=n.onError.subscribe({next:t=>{i.handleError(t)}});r.onDestroy(()=>{ma(this._modules,r),t.unsubscribe()})}),function(t,e,n){try{const s=n();return Mi(s)?s.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):s}catch(s){throw e.runOutsideAngular(()=>t.handleError(s)),s}}(i,n,()=>{const t=r.injector.get(Hl);return t.runInitializers(),t.donePromise.then(()=>(yo(r.injector.get(Ll,go)||go),this._moduleDoBootstrap(r),r))})})}bootstrapModule(t,e=[]){const n=ya({},e);return function(t,e,n){const s=new xl(n);return Promise.resolve(s)}(0,0,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(_a);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${K(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}return t.\u0275fac=function(e){return new(e||t)(Qn(ai))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ya(t,e){return Array.isArray(e)?e.reduce(ya,t):Object.assign(Object.assign({},t),e)}let _a=(()=>{class t{constructor(t,e,n,s,r){this._zone=t,this._injector=e,this._exceptionHandler=n,this._componentFactoryResolver=s,this._initStatus=r,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._onMicrotaskEmptySubscription=this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const i=new _(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),o=new _(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Xl.assertNotInAngularZone(),Yl(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Xl.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=L(i,o.pipe(t=>{return B()((e=G,function(t){let n;n="function"==typeof e?e:function(){return e};const s=Object.create(t,q);return s.source=t,s.subjectFactory=n,s})(t));var e}))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof Ao?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const s=n.isBoundToModule?void 0:this._injector.get(cl),r=n.create(ai.NULL,[],e||n.selector,s),i=r.location.nativeElement,o=r.injector.get(oa,null),l=o&&r.injector.get(la);return o&&l&&l.registerApplication(i,o),r.onDestroy(()=>{this.detachView(r.hostView),ma(this.components,r),l&&l.unregisterApplication(i)}),this._loadComponent(r),r}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");try{this._runningTick=!0;for(let t of this._views)t.detectChanges()}catch(t){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(t))}finally{this._runningTick=!1}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;ma(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Fl,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy()),this._onMicrotaskEmptySubscription.unsubscribe()}get viewCount(){return this._views.length}}return t.\u0275fac=function(e){return new(e||t)(Qn(Xl),Qn(ai),Qn(ds),Qn(Io),Qn(Hl))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function ma(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ba=pa(null,"core",[{provide:jl,useValue:"unknown"},{provide:va,deps:[ai]},{provide:la,deps:[]},{provide:zl,deps:[]}]),Ca=[{provide:_a,useClass:_a,deps:[Xl,ai,ds,Io,Hl]},{provide:ml,deps:[Xl],useFactory:function(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}},{provide:Hl,useClass:Hl,deps:[[new Xn,Dl]]},{provide:Jl,useClass:Jl,deps:[]},Ml,{provide:Jo,useFactory:function(){return sl},deps:[]},{provide:Yo,useFactory:function(){return rl},deps:[]},{provide:Ll,useFactory:function(t){return yo(t=t||"undefined"!=typeof $localize&&$localize.locale||go),t},deps:[[new Yn(Ll),new Xn,new ts]]},{provide:Bl,useValue:"USD"}];let wa=(()=>{class t{constructor(t){}}return t.\u0275fac=function(e){return new(e||t)(Qn(_a))},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({providers:Ca}),t})(),Ea=null;function xa(){return Ea}const ka=new Mn("DocumentToken");var Aa=function(t){return t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other",t}({});class Oa{}let Ia=(()=>{class t extends Oa{constructor(t){super(),this.locale=t}getPluralCategory(t,e){switch(function(t){return function(t){const e=function(t){return t.toLowerCase().replace(/_/g,"-")}(t);let n=fo(e);if(n)return n;const s=e.split("-")[0];if(n=fo(s),n)return n;if("en"===s)return uo;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[po.PluralCase]}(e||this.locale)(t)){case Aa.Zero:return"zero";case Aa.One:return"one";case Aa.Two:return"two";case Aa.Few:return"few";case Aa.Many:return"many";default:return"other"}}}return t.\u0275fac=function(e){return new(e||t)(Qn(Ll))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Sa=(()=>{class t{constructor(t,e,n,s){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=s,this._iterableDiffer=null,this._keyValueDiffer=null,this._initialClasses=[],this._rawClass=null}set klass(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)}set ngClass(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(_i(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())}ngDoCheck(){if(this._iterableDiffer){const t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){const t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}}_applyKeyValueChanges(t){t.forEachAddedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachChangedItem(t=>this._toggleClass(t.key,t.currentValue)),t.forEachRemovedItem(t=>{t.previousValue&&this._toggleClass(t.key,!1)})}_applyIterableChanges(t){t.forEachAddedItem(t=>{if("string"!=typeof t.item)throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${K(t.item)}`);this._toggleClass(t.item,!0)}),t.forEachRemovedItem(t=>this._toggleClass(t.item,!1))}_applyClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!0)):Object.keys(t).forEach(e=>this._toggleClass(e,!!t[e])))}_removeClasses(t){t&&(Array.isArray(t)||t instanceof Set?t.forEach(t=>this._toggleClass(t,!1)):Object.keys(t).forEach(t=>this._toggleClass(t,!1)))}_toggleClass(t,e){(t=t.trim())&&t.split(/\s+/g).forEach(t=>{e?this._renderer.addClass(this._ngEl.nativeElement,t):this._renderer.removeClass(this._ngEl.nativeElement,t)})}}return t.\u0275fac=function(e){return new(e||t)(Ai(Jo),Ai(Yo),Ai(Do),Ai(No))},t.\u0275dir=Ut({type:t,selectors:[["","ngClass",""]],inputs:{klass:["class","klass"],ngClass:"ngClass"}}),t})();class Ta{constructor(t,e,n,s){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=s}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let Va=(()=>{class t{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,s)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new Ta(null,this._ngForOf,-1,-1),null===s?void 0:s),r=new Da(t,n);e.push(r)}else if(null==s)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const r=this._viewContainer.get(n);this._viewContainer.move(r,s);const i=new Da(t,r);e.push(i)}});for(let n=0;n{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ai(hl),Ai(ol),Ai(Jo))},t.\u0275dir=Ut({type:t,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}}),t})();class Da{constructor(t,e){this.record=t,this.view=e}}let Ha=(()=>{class t{constructor(t,e){this._viewContainer=t,this._context=new Na,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){Ma("ngIfThen",t),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){Ma("ngIfElse",t),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngTemplateContextGuard(t,e){return!0}}return t.\u0275fac=function(e){return new(e||t)(Ai(hl),Ai(ol))},t.\u0275dir=Ut({type:t,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}}),t})();class Na{constructor(){this.$implicit=null,this.ngIf=null}}function Ma(t,e){if(e&&!e.createEmbeddedView)throw new Error(`${t} must be a TemplateRef, but received '${K(e)}'.`)}let Pa=(()=>{class t{transform(e,n,s){if(null==e)return null;if(!this.supports(e))throw function(t,e){return Error(`InvalidPipeArgument: '${e}' for pipe '${K(t)}'`)}(t,e);return e.slice(n,s)}supports(t){return"string"==typeof t||Array.isArray(t)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275pipe=Zt({name:"slice",type:t,pure:!1}),t})(),Ra=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({providers:[{provide:Oa,useClass:Ia}]}),t})();class ja extends class extends class{}{constructor(){super(...arguments),this.supportsDOMEvents=!0}}{static makeCurrent(){var t;t=new ja,Ea||(Ea=t)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getBaseHref(t){const e=(za=za||document.querySelector("base"),za?za.getAttribute("href"):null);return null==e?null:function(t){Fa=Fa||document.createElement("a"),Fa.setAttribute("href",t);const e=Fa.pathname;return"/"===e.charAt(0)?e:`/${e}`}(e)}resetBaseElement(){za=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[s,r]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(s.trim()===e)return decodeURIComponent(r)}return null}(document.cookie,t)}}let Fa,za=null;const La=new Mn("TRANSITION_ID"),Ba=[{provide:Dl,useFactory:function(t,e,n){return()=>{n.get(Hl).donePromise.then(()=>{const n=xa();Array.prototype.slice.apply(e.querySelectorAll("style[ng-transition]")).filter(e=>e.getAttribute("ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[La,ka,ai],multi:!0}];class $a{static init(){var t;t=new $a,ua=t}addToWindow(t){Ot.getAngularTestability=(e,n=!0)=>{const s=t.findTestabilityInTree(e,n);if(null==s)throw new Error("Could not find testability for element.");return s},Ot.getAllAngularTestabilities=()=>t.getAllTestabilities(),Ot.getAllAngularRootElements=()=>t.getAllRootElements(),Ot.frameworkStabilizers||(Ot.frameworkStabilizers=[]),Ot.frameworkStabilizers.push(t=>{const e=Ot.getAllAngularTestabilities();let n=e.length,s=!1;const r=function(e){s=s||e,n--,0==n&&t(s)};e.forEach(function(t){t.whenStable(r)})})}findTestabilityInTree(t,e,n){if(null==e)return null;const s=t.getTestability(e);return null!=s?s:n?xa().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}}let Ua=(()=>{class t{build(){return new XMLHttpRequest}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const Za=new Mn("EventManagerPlugins");let qa=(()=>{class t{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let s=0;s{class t{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})(),Qa=(()=>{class t extends Ga{constructor(t){super(),this._doc=t,this._hostNodes=new Map,this._hostNodes.set(t.head,[])}_addStylesToHost(t,e,n){t.forEach(t=>{const s=this._doc.createElement("style");s.textContent=t,n.push(e.appendChild(s))})}addHost(t){const e=[];this._addStylesToHost(this._stylesSet,t,e),this._hostNodes.set(t,e)}removeHost(t){const e=this._hostNodes.get(t);e&&e.forEach(Ja),this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach((e,n)=>{this._addStylesToHost(t,n,e)})}ngOnDestroy(){this._hostNodes.forEach(t=>t.forEach(Ja))}}return t.\u0275fac=function(e){return new(e||t)(Qn(ka))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Ja(t){xa().remove(t)}const Ka={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ya=/%COMP%/g;function Xa(t,e,n){for(let s=0;s{if("__ngUnwrap__"===e)return t;!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}let ec=(()=>{class t{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new nc(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case wt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new sc(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case 1:case wt.ShadowDom:return new rc(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Xa(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}return t.\u0275fac=function(e){return new(e||t)(Qn(qa),Qn(Qa),Qn(Nl))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();class nc{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Ka[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,s){if(s){e=s+":"+e;const r=Ka[s];r?t.setAttributeNS(r,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const s=Ka[n];s?t.removeAttributeNS(s,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,s){s&(vs.DashCase|vs.Important)?t.style.setProperty(e,n,s&vs.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&vs.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,tc(n)):this.eventManager.addEventListener(t,e,tc(n))}}class sc extends nc{constructor(t,e,n,s){super(t),this.component=n;const r=Xa(s+"-"+n.id,n.styles,[]);e.addStyles(r),this.contentAttr="_ngcontent-%COMP%".replace(Ya,s+"-"+n.id),this.hostAttr="_nghost-%COMP%".replace(Ya,s+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class rc extends nc{constructor(t,e,n,s){super(t),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const r=Xa(s.id,s.styles,[]);for(let i=0;i{class t extends Wa{constructor(t){super(t)}supports(t){return!0}addEventListener(t,e,n){return t.addEventListener(e,n,!1),()=>this.removeEventListener(t,e,n)}removeEventListener(t,e,n){return t.removeEventListener(e,n)}}return t.\u0275fac=function(e){return new(e||t)(Qn(ka))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const oc=["alt","control","meta","shift"],lc={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},ac={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},cc={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};let uc=(()=>{class t extends Wa{constructor(t){super(t)}supports(e){return null!=t.parseEventName(e)}addEventListener(e,n,s){const r=t.parseEventName(n),i=t.eventCallback(r.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>xa().onAndCancel(e,r.domEventName,i))}static parseEventName(e){const n=e.toLowerCase().split("."),s=n.shift();if(0===n.length||"keydown"!==s&&"keyup"!==s)return null;const r=t._normalizeKey(n.pop());let i="";if(oc.forEach(t=>{const e=n.indexOf(t);e>-1&&(n.splice(e,1),i+=t+".")}),i+=r,0!=n.length||0===r.length)return null;const o={};return o.domEventName=s,o.fullKey=i,o}static getEventFullKey(t){let e="",n=function(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&ac.hasOwnProperty(e)&&(e=ac[e]))}return lc[e]||e}(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),oc.forEach(s=>{s!=n&&(0,cc[s])(t)&&(e+=s+".")}),e+=n,e}static eventCallback(e,n,s){return r=>{t.getEventFullKey(r)===e&&s.runGuarded(()=>n(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}return t.\u0275fac=function(e){return new(e||t)(Qn(ka))},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();const hc=pa(ba,"browser",[{provide:jl,useValue:"browser"},{provide:Rl,useValue:function(){ja.makeCurrent(),$a.init()},multi:!0},{provide:ka,useFactory:function(){return function(t){ue=t}(document),document},deps:[]}]),dc=[[],{provide:Qr,useValue:"root"},{provide:ds,useFactory:function(){return new ds},deps:[]},{provide:Za,useClass:ic,multi:!0,deps:[ka,Xl,jl]},{provide:Za,useClass:uc,multi:!0,deps:[ka]},[],{provide:ec,useClass:ec,deps:[qa,Qa,Nl]},{provide:Ho,useExisting:ec},{provide:Ga,useExisting:Qa},{provide:Qa,useClass:Qa,deps:[ka]},{provide:oa,useClass:oa,deps:[Xl]},{provide:qa,useClass:qa,deps:[Za,Xl]},{provide:class{},useClass:Ua,deps:[]},[]];let fc=(()=>{class t{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(e){return{ngModule:t,providers:[{provide:Nl,useValue:e.appId},{provide:La,useExisting:Nl},Ba]}}}return t.\u0275fac=function(e){return new(e||t)(Qn(t,12))},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({providers:dc,imports:[Ra,wa]}),t})();function pc(t,e){return new _(n=>{const s=t.length;if(0===s)return void n.complete();const r=new Array(s);let i=0,o=0;for(let l=0;l{c||(c=!0,o++),r[l]=t},error:t=>n.error(t),complete:()=>{i++,i!==s&&c||(o===s&&n.next(e?e.reduce((t,e,n)=>(t[e]=r[n],t),{}):r),n.complete())}}))}})}"undefined"!=typeof window&&window;let gc=(()=>{class t{constructor(t,e){this._renderer=t,this._elementRef=e,this.onChange=t=>{},this.onTouched=()=>{}}setProperty(t,e){this._renderer.setProperty(this._elementRef.nativeElement,t,e)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}}return t.\u0275fac=function(e){return new(e||t)(Ai(No),Ai(Do))},t.\u0275dir=Ut({type:t}),t})(),vc=(()=>{class t extends gc{}return t.\u0275fac=function(){let e;return function(n){return(e||(e=Vn(t)))(n||t)}}(),t.\u0275dir=Ut({type:t,features:[ui]}),t})();const yc=new Mn("NgValueAccessor"),_c={provide:yc,useExisting:tt(()=>bc),multi:!0},mc=new Mn("CompositionEventMode");let bc=(()=>{class t extends gc{constructor(t,e,n){super(t,e),this._compositionMode=n,this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const t=xa()?xa().getUserAgent():"";return/android (\d+)/.test(t.toLowerCase())}())}writeValue(t){this.setProperty("value",null==t?"":t)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}}return t.\u0275fac=function(e){return new(e||t)(Ai(No),Ai(Do),Ai(mc,8))},t.\u0275dir=Ut({type:t,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(t,e){1&t&&Ri("input",function(t){return e._handleInput(t.target.value)})("blur",function(){return e.onTouched()})("compositionstart",function(){return e._compositionStart()})("compositionend",function(t){return e._compositionEnd(t.target.value)})},features:[ko([_c]),ui]}),t})();const Cc=new Mn("NgValidators"),wc=new Mn("NgAsyncValidators");function Ec(t){return null!=t}function xc(t){const e=Mi(t)?M(t):t;return Pi(e),e}function kc(t){let e={};return t.forEach(t=>{e=null!=t?Object.assign(Object.assign({},e),t):e}),0===Object.keys(e).length?null:e}function Ac(t,e){return e.map(e=>e(t))}function Oc(t){return t.map(t=>function(t){return!t.validate}(t)?t:e=>t.validate(e))}function Ic(t){return null!=t?function(t){if(!t)return null;const e=t.filter(Ec);return 0==e.length?null:function(t){return kc(Ac(t,e))}}(Oc(t)):null}function Sc(t){return null!=t?function(t){if(!t)return null;const e=t.filter(Ec);return 0==e.length?null:function(t){return function(...t){if(1===t.length){const e=t[0];if(a(e))return pc(e,null);if(c(e)&&Object.getPrototypeOf(e)===Object.prototype){const t=Object.keys(e);return pc(t.map(t=>e[t]),t)}}if("function"==typeof t[t.length-1]){const e=t.pop();return pc(t=1===t.length&&a(t[0])?t[0]:t,null).pipe(k(t=>e(...t)))}return pc(t,null)}(Ac(t,e).map(xc)).pipe(k(kc))}}(Oc(t)):null}function Tc(t,e){return null===t?[e]:Array.isArray(t)?[...t,e]:[t,e]}let Vc=(()=>{class t{constructor(){this._rawValidators=[],this._rawAsyncValidators=[],this._onDestroyCallbacks=[]}get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=Ic(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Sc(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t){this.control&&this.control.reset(t)}hasError(t,e){return!!this.control&&this.control.hasError(t,e)}getError(t,e){return this.control?this.control.getError(t,e):null}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275dir=Ut({type:t}),t})(),Dc=(()=>{class t extends Vc{get formDirective(){return null}get path(){return null}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=Vn(t)))(n||t)}}(),t.\u0275dir=Ut({type:t,features:[ui]}),t})();class Hc extends Vc{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null}}let Nc=(()=>{class t extends class{constructor(t){this._cd=t}is(t){var e,n;return!!(null===(n=null===(e=this._cd)||void 0===e?void 0:e.control)||void 0===n?void 0:n[t])}}{constructor(t){super(t)}}return t.\u0275fac=function(e){return new(e||t)(Ai(Hc,2))},t.\u0275dir=Ut({type:t,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(t,e){2&t&&Qi("ng-untouched",e.is("untouched"))("ng-touched",e.is("touched"))("ng-pristine",e.is("pristine"))("ng-dirty",e.is("dirty"))("ng-valid",e.is("valid"))("ng-invalid",e.is("invalid"))("ng-pending",e.is("pending"))},features:[ui]}),t})();function Mc(t,e){t.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function Pc(t,e){t._pendingDirty&&t.markAsDirty(),t.setValue(t._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1}function Rc(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const jc="VALID",Fc="INVALID",zc="PENDING",Lc="DISABLED";function Bc(t){return(qc(t)?t.validators:t)||null}function $c(t){return Array.isArray(t)?Ic(t):t||null}function Uc(t,e){return(qc(e)?e.asyncValidators:t)||null}function Zc(t){return Array.isArray(t)?Sc(t):t||null}function qc(t){return null!=t&&!Array.isArray(t)&&"object"==typeof t}class Wc{constructor(t,e){this._hasOwnPendingAsyncValidator=!1,this._onCollectionChange=()=>{},this._parent=null,this.pristine=!0,this.touched=!1,this._onDisabledChange=[],this._rawValidators=t,this._rawAsyncValidators=e,this._composedValidatorFn=$c(this._rawValidators),this._composedAsyncValidatorFn=Zc(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get valid(){return this.status===jc}get invalid(){return this.status===Fc}get pending(){return this.status==zc}get disabled(){return this.status===Lc}get enabled(){return this.status!==Lc}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._rawValidators=t,this._composedValidatorFn=$c(t)}setAsyncValidators(t){this._rawAsyncValidators=t,this._composedAsyncValidatorFn=Zc(t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){this.touched=!0,this._parent&&!t.onlySelf&&this._parent.markAsTouched(t)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(t=>t.markAllAsTouched())}markAsUntouched(t={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(t=>{t.markAsUntouched({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}markAsDirty(t={}){this.pristine=!1,this._parent&&!t.onlySelf&&this._parent.markAsDirty(t)}markAsPristine(t={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(t=>{t.markAsPristine({onlySelf:!0})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}markAsPending(t={}){this.status=zc,!1!==t.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!t.onlySelf&&this._parent.markAsPending(t)}disable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=Lc,this.errors=null,this._forEachChild(e=>{e.disable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this._updateValue(),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!0))}enable(t={}){const e=this._parentMarkedDirty(t.onlySelf);this.status=jc,this._forEachChild(e=>{e.enable(Object.assign(Object.assign({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(Object.assign(Object.assign({},t),{skipPristineCheck:e})),this._onDisabledChange.forEach(t=>t(!1))}_updateAncestors(t){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(t){this._parent=t}updateValueAndValidity(t={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),this.status!==jc&&this.status!==zc||this._runAsyncValidator(t.emitEvent)),!1!==t.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(t)}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?Lc:jc}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t){if(this.asyncValidator){this.status=zc,this._hasOwnPendingAsyncValidator=!0;const e=xc(this.asyncValidator(this));this._asyncValidationSubscription=e.subscribe(e=>{this._hasOwnPendingAsyncValidator=!1,this.setErrors(e,{emitEvent:t})})}}_cancelExistingSubscription(){this._asyncValidationSubscription&&(this._asyncValidationSubscription.unsubscribe(),this._hasOwnPendingAsyncValidator=!1)}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(!1!==e.emitEvent)}get(t){return function(t,e,n){if(null==e)return null;if(Array.isArray(e)||(e=e.split(".")),Array.isArray(e)&&0===e.length)return null;let s=t;return e.forEach(t=>{s=s instanceof Qc?s.controls.hasOwnProperty(t)?s.controls[t]:null:s instanceof Jc&&s.at(t)||null}),s}(this,t)}getError(t,e){const n=e?this.get(e):this;return n&&n.errors?n.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(t)}_initObservables(){this.valueChanges=new Vl,this.statusChanges=new Vl}_calculateStatus(){return this._allControlsDisabled()?Lc:this.errors?Fc:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(zc)?zc:this._anyControlsHaveStatus(Fc)?Fc:jc}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t={}){this.pristine=!this._anyControlsDirty(),this._parent&&!t.onlySelf&&this._parent._updatePristine(t)}_updateTouched(t={}){this.touched=this._anyControlsTouched(),this._parent&&!t.onlySelf&&this._parent._updateTouched(t)}_isBoxedValue(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t}_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){qc(t)&&null!=t.updateOn&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){return!t&&!(!this._parent||!this._parent.dirty)&&!this._parent._anyControlsDirty()}}class Gc extends Wc{constructor(t=null,e,n){super(Bc(e),Uc(n,e)),this._onChange=[],this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(t=>t(this.value,!1!==e.emitViewToModelChange)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=null,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Rc(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Rc(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(t){this._isBoxedValue(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}}class Qc extends Wc{constructor(t,e,n){super(Bc(e),Uc(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,n={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){this._checkAllValuesPresent(t),Object.keys(t).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(Object.keys(t).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(t[n],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((n,s)=>{n.reset(t[s],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this._reduceChildren({},(t,e,n)=>(t[n]=e instanceof Gc?e.value:e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(t,e)=>!!e._syncPendingControls()||t);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error(`Cannot find form control with name: ${t}.`)}_forEachChild(t){Object.keys(this.controls).forEach(e=>{const n=this.controls[e];n&&t(n,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(const e of Object.keys(this.controls)){const n=this.controls[e];if(this.contains(e)&&t(n))return!0}return!1}_reduceValue(){return this._reduceChildren({},(t,e,n)=>((e.enabled||this.disabled)&&(t[n]=e.value),t))}_reduceChildren(t,e){let n=t;return this._forEachChild((t,s)=>{n=e(n,t,s)}),n}_allControlsDisabled(){for(const t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class Jc extends Wc{constructor(t,e,n){super(Bc(e),Uc(n,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!n})}at(t){return this.controls[t]}push(t,e={}){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}insert(t,e,n={}){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity({emitEvent:n.emitEvent})}removeAt(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),this.updateValueAndValidity({emitEvent:e.emitEvent})}setControl(t,e,n={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity({emitEvent:n.emitEvent}),this._onCollectionChange()}get length(){return this.controls.length}setValue(t,e={}){this._checkAllValuesPresent(t),t.forEach((t,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){null!=t&&(t.forEach((t,n)=>{this.at(n)&&this.at(n).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t=[],e={}){this._forEachChild((n,s)=>{n.reset(t[s],{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e),this._updateTouched(e),this.updateValueAndValidity(e)}getRawValue(){return this.controls.map(t=>t instanceof Gc?t.value:t.getRawValue())}clear(t={}){this.controls.length<1||(this._forEachChild(t=>t._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity({emitEvent:t.emitEvent}))}_syncPendingControls(){let t=this.controls.reduce((t,e)=>!!e._syncPendingControls()||t,!1);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_throwIfControlMissing(t){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(t))throw new Error(`Cannot find form control at index ${t}`)}_forEachChild(t){this.controls.forEach((e,n)=>{t(e,n)})}_updateValue(){this.value=this.controls.filter(t=>t.enabled||this.disabled).map(t=>t.value)}_anyControls(t){return this.controls.some(e=>e.enabled&&t(e))}_setUpControls(){this._forEachChild(t=>this._registerControl(t))}_checkAllValuesPresent(t){this._forEachChild((e,n)=>{if(void 0===t[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const t of this.controls)if(t.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)}}const Kc={provide:Hc,useExisting:tt(()=>Xc)},Yc=(()=>Promise.resolve(null))();let Xc=(()=>{class t extends Hc{constructor(t,e,n,s){super(),this.control=new Gc,this._registered=!1,this.update=new Vl,this._parent=t,this._setValidators(e),this._setAsyncValidators(n),this.valueAccessor=function(t,e){if(!e)return null;let n,s,r;return Array.isArray(e),e.forEach(t=>{t.constructor===bc?n=t:Object.getPrototypeOf(t.constructor)===vc?s=t:r=t}),r||s||n||null}(0,s)}ngOnChanges(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),function(t,e){if(!t.hasOwnProperty("model"))return!1;const n=t.model;return!!n.isFirstChange()||!Object.is(e,n.currentValue)}(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._parent?[...this._parent.path,this.name]:[this.name]}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!(!this.options||!this.options.standalone)}_setUpStandalone(){var t,e;(function(t,e){const n=function(t){return t._rawValidators}(t);null!==e.validator?t.setValidators(Tc(n,e.validator)):"function"==typeof n&&t.setValidators([n]);const s=function(t){return t._rawAsyncValidators}(t);null!==e.asyncValidator?t.setAsyncValidators(Tc(s,e.asyncValidator)):"function"==typeof s&&t.setAsyncValidators([s]);const r=()=>t.updateValueAndValidity();Mc(e._rawValidators,r),Mc(e._rawAsyncValidators,r)})(t=this.control,e=this),e.valueAccessor.writeValue(t.value),function(t,e){e.valueAccessor.registerOnChange(n=>{t._pendingValue=n,t._pendingChange=!0,t._pendingDirty=!0,"change"===t.updateOn&&Pc(t,e)})}(t,e),function(t,e){const n=(t,n)=>{e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)};t.registerOnChange(n),e._registerOnDestroy(()=>{t._unregisterOnChange(n)})}(t,e),function(t,e){e.valueAccessor.registerOnTouched(()=>{t._pendingTouched=!0,"blur"===t.updateOn&&t._pendingChange&&Pc(t,e),"submit"!==t.updateOn&&t.markAsTouched()})}(t,e),function(t,e){if(e.valueAccessor.setDisabledState){const n=t=>{e.valueAccessor.setDisabledState(t)};t.registerOnDisabledChange(n),e._registerOnDestroy(()=>{t._unregisterOnDisabledChange(n)})}}(t,e),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._isStandalone()||this._checkParentType(),this._checkName()}_checkParentType(){}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()}_updateValue(t){Yc.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1})})}_updateDisabled(t){const e=t.isDisabled.currentValue,n=""===e||e&&"false"!==e;Yc.then(()=>{n&&!this.control.disabled?this.control.disable():!n&&this.control.disabled&&this.control.enable()})}}return t.\u0275fac=function(e){return new(e||t)(Ai(Dc,9),Ai(Cc,10),Ai(wc,10),Ai(yc,10))},t.\u0275dir=Ut({type:t,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:["disabled","isDisabled"],model:["ngModel","model"],options:["ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],features:[ko([Kc]),ui,re]}),t})(),tu=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({}),t})();const eu={provide:yc,useExisting:tt(()=>nu),multi:!0};let nu=(()=>{class t extends vc{writeValue(t){this.setProperty("value",parseFloat(t))}registerOnChange(t){this.onChange=e=>{t(""==e?null:parseFloat(e))}}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=Vn(t)))(n||t)}}(),t.\u0275dir=Ut({type:t,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(t,e){1&t&&Ri("change",function(t){return e.onChange(t.target.value)})("input",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},features:[ko([eu]),ui]}),t})();const su={provide:yc,useExisting:tt(()=>iu),multi:!0};function ru(t,e){return null==t?`${e}`:(e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let iu=(()=>{class t extends vc{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){this.value=t;const e=this._getOptionId(t);null==e&&this.setProperty("selectedIndex",-1);const n=ru(e,t);this.setProperty("value",n)}registerOnChange(t){this.onChange=e=>{this.value=this._getOptionValue(e),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(const e of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(e),t))return e;return null}_getOptionValue(t){const e=function(t){return t.split(":")[0]}(t);return this._optionMap.has(e)?this._optionMap.get(e):t}}return t.\u0275fac=function(){let e;return function(n){return(e||(e=Vn(t)))(n||t)}}(),t.\u0275dir=Ut({type:t,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(t,e){1&t&&Ri("change",function(t){return e.onChange(t.target.value)})("blur",function(){return e.onTouched()})},inputs:{compareWith:"compareWith"},features:[ko([su]),ui]}),t})(),ou=(()=>{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}set ngValue(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(ru(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ai(Do),Ai(No),Ai(iu,9))},t.\u0275dir=Ut({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})();const lu={provide:yc,useExisting:tt(()=>cu),multi:!0};function au(t,e){return null==t?`${e}`:("string"==typeof e&&(e=`'${e}'`),e&&"object"==typeof e&&(e="Object"),`${t}: ${e}`.slice(0,50))}let cu=(()=>{class t extends vc{constructor(){super(...arguments),this._optionMap=new Map,this._idCounter=0,this._compareWith=Object.is}set compareWith(t){this._compareWith=t}writeValue(t){let e;if(this.value=t,Array.isArray(t)){const n=t.map(t=>this._getOptionId(t));e=(t,e)=>{t._setSelected(n.indexOf(e.toString())>-1)}}else e=(t,e)=>{t._setSelected(!1)};this._optionMap.forEach(e)}registerOnChange(t){this.onChange=e=>{const n=[];if(void 0!==e.selectedOptions){const t=e.selectedOptions;for(let e=0;e{class t{constructor(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){null!=this._select&&(this._value=t,this._setElementValue(au(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(au(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}}return t.\u0275fac=function(e){return new(e||t)(Ai(Do),Ai(No),Ai(cu,9))},t.\u0275dir=Ut({type:t,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"}}),t})(),hu=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({imports:[[tu]]}),t})(),du=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Bt({type:t}),t.\u0275inj=at({imports:[hu]}),t})();class fu{constructor(){this.riskHotspotsSettings=null,this.coverageInfoSettings=null}}class pu{constructor(){this.groupingMaximum=0,this.grouping=0,this.historyComparisionDate="",this.historyComparisionType="",this.filter="",this.sortBy="name",this.sortOrder="asc",this.collapseStates=[]}}class gu{constructor(t){this.et="",this.et=t.et,this.cl=t.cl,this.ucl=t.ucl,this.cal=t.cal,this.tl=t.tl,this.lcq=t.lcq,this.cb=t.cb,this.tb=t.tb,this.bcq=t.bcq}get coverageRatioText(){return 0===this.tl?"-":this.cl+"/"+this.cal}get branchCoverageRatioText(){return 0===this.tb?"-":this.cb+"/"+this.tb}}class vu{static roundNumber(t,e){return Math.floor(t*Math.pow(10,e))/Math.pow(10,e)}static getNthOrLastIndexOf(t,e,n){let s=0,r=-1,i=-1;for(;s{this.historicCoverages.push(new gu(t))})}get coverage(){return 0===this.coverableLines?"-"!==this.methodCoverage?parseFloat(this.methodCoverage):NaN:vu.roundNumber(100*this.coveredLines/this.coverableLines,1)}get coverageType(){return 0===this.coverableLines?"-"!==this.methodCoverage?this._coverageType:"":this._coverageType}visible(t,e){if(""!==t&&-1===this.name.toLowerCase().indexOf(t.toLowerCase()))return!1;if(""===e||null===this.currentHistoricCoverage)return!0;if("allChanges"===e){if(this.coveredLines===this.currentHistoricCoverage.cl&&this.uncoveredLines===this.currentHistoricCoverage.ucl&&this.coverableLines===this.currentHistoricCoverage.cal&&this.totalLines===this.currentHistoricCoverage.tl&&this.coveredBranches===this.currentHistoricCoverage.cb&&this.totalBranches===this.currentHistoricCoverage.tb)return!1}else if("lineCoverageIncreaseOnly"===e){let t=this.coverage;if(isNaN(t)||t<=this.currentHistoricCoverage.lcq)return!1}else if("lineCoverageDecreaseOnly"===e){let t=this.coverage;if(isNaN(t)||t>=this.currentHistoricCoverage.lcq)return!1}else if("branchCoverageIncreaseOnly"===e){let t=this.branchCoverage;if(isNaN(t)||t<=this.currentHistoricCoverage.bcq)return!1}else if("branchCoverageDecreaseOnly"===e){let t=this.branchCoverage;if(isNaN(t)||t>=this.currentHistoricCoverage.bcq)return!1}return!0}updateCurrentHistoricCoverage(t){if(this.currentHistoricCoverage=null,""!==t)for(let e=0;e-1&&null===e}visible(t,e){if(""!==t&&this.name.toLowerCase().indexOf(t.toLowerCase())>-1)return!0;for(let n=0;n{class t{get nativeWindow(){return window}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=lt({token:t,factory:t.\u0275fac}),t})();function Cu(t,e){1&t&&Vi(0,"td",3)}function wu(t,e){1&t&&Vi(0,"td"),2&t&&ao("green ",zi().greenClass,"")}function Eu(t,e){1&t&&Vi(0,"td"),2&t&&ao("red ",zi().redClass,"")}let xu=(()=>{class t{constructor(){this.grayVisible=!0,this.greenVisible=!1,this.redVisible=!1,this.greenClass="",this.redClass="",this._percentage=NaN}get percentage(){return this._percentage}set percentage(t){this._percentage=t,this.grayVisible=isNaN(t),this.greenVisible=!isNaN(t)&&Math.round(t)>0,this.redVisible=!isNaN(t)&&100-Math.round(t)>0,this.greenClass="covered"+Math.round(t),this.redClass="covered"+(100-Math.round(t))}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=jt({type:t,selectors:[["coverage-bar"]],inputs:{percentage:"percentage"},decls:4,vars:3,consts:[[1,"coverage"],["class","gray covered100",4,"ngIf"],[3,"class",4,"ngIf"],[1,"gray","covered100"]],template:function(t,e){1&t&&(Si(0,"table",0),ki(1,Cu,1,0,"td",1),ki(2,wu,1,3,"td",2),ki(3,Eu,1,3,"td",2),Ti()),2&t&&(Xs(1),Oi("ngIf",e.grayVisible),Xs(1),Oi("ngIf",e.greenVisible),Xs(1),Oi("ngIf",e.redVisible))},directives:[Ha],encapsulation:2,changeDetection:0}),t})();const ku=["codeelement-row",""];function Au(t,e){if(1&t&&(Si(0,"th",2),io(1),Ti()),2&t){const t=zi();Xs(1),oo(t.element.coveredBranches)}}function Ou(t,e){if(1&t&&(Si(0,"th",2),io(1),Ti()),2&t){const t=zi();Xs(1),oo(t.element.totalBranches)}}function Iu(t,e){if(1&t&&(Si(0,"th",3),io(1),Ti()),2&t){const t=zi();Oi("title",t.element.branchCoverageRatioText),Xs(1),oo(t.element.branchCoveragePercentage)}}function Su(t,e){if(1&t&&(Si(0,"th",2),Vi(1,"coverage-bar",4),Ti()),2&t){const t=zi();Xs(1),Oi("percentage",t.element.branchCoverage)}}const Tu=function(t,e){return{"icon-plus":t,"icon-minus":e}};let Vu=(()=>{class t{constructor(){this.collapsed=!1,this.branchCoverageAvailable=!1}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=jt({type:t,selectors:[["","codeelement-row",""]],inputs:{element:"element",collapsed:"collapsed",branchCoverageAvailable:"branchCoverageAvailable"},attrs:ku,decls:20,vars:16,consts:[["href","#",3,"click"],[3,"ngClass"],[1,"right"],[1,"right",3,"title"],[3,"percentage"],["class","right",4,"ngIf"],["class","right",3,"title",4,"ngIf"]],template:function(t,e){1&t&&(Si(0,"th"),Si(1,"a",0),Ri("click",function(t){return e.element.toggleCollapse(t)}),Vi(2,"i",1),io(3),Ti(),Ti(),Si(4,"th",2),io(5),Ti(),Si(6,"th",2),io(7),Ti(),Si(8,"th",2),io(9),Ti(),Si(10,"th",2),io(11),Ti(),Si(12,"th",3),io(13),Ti(),Si(14,"th",2),Vi(15,"coverage-bar",4),Ti(),ki(16,Au,2,1,"th",5),ki(17,Ou,2,1,"th",5),ki(18,Iu,2,2,"th",6),ki(19,Su,2,1,"th",5)),2&t&&(Xs(2),Oi("ngClass",Al(13,Tu,e.element.collapsed,!e.element.collapsed)),Xs(1),lo(" ",e.element.name,""),Xs(2),oo(e.element.coveredLines),Xs(2),oo(e.element.uncoveredLines),Xs(2),oo(e.element.coverableLines),Xs(2),oo(e.element.totalLines),Xs(1),Oi("title",e.element.coverageRatioText),Xs(1),oo(e.element.coveragePercentage),Xs(2),Oi("percentage",e.element.coverage),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable))},directives:[Sa,xu,Ha],encapsulation:2,changeDetection:0}),t})();const Du=["coverage-history-chart",""];let Hu=(()=>{class t{constructor(){this.path=null,this._historicCoverages=[]}get historicCoverages(){return this._historicCoverages}set historicCoverages(t){if(this._historicCoverages=t,t.length>1){let e="";for(let n=0;n1),Xs(1),Oi("ngIf",null!==t.clazz.currentHistoricCoverage),Xs(1),Oi("ngIf",null===t.clazz.currentHistoricCoverage)}}function ih(t,e){if(1&t&&(Si(0,"td",2),Vi(1,"coverage-bar",5),Ti()),2&t){const t=zi();Xs(1),Oi("percentage",t.clazz.branchCoverage)}}let oh=(()=>{class t{constructor(){this.translations={},this.branchCoverageAvailable=!1,this.historyComparisionDate=""}getClassName(t,e){return t>e?"lightgreen":t1),Xs(1),Oi("ngIf",null!==e.clazz.currentHistoricCoverage),Xs(1),Oi("ngIf",null===e.clazz.currentHistoricCoverage),Xs(2),Oi("percentage",e.clazz.coverage),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable),Xs(1),Oi("ngIf",e.branchCoverageAvailable))},directives:[Ha,xu,Hu,Sa],encapsulation:2,changeDetection:0}),t})();function lh(t,e){if(1&t&&(Di(0),io(1),Hi()),2&t){const t=zi(2);Xs(1),oo(t.translations.noGrouping)}}function ah(t,e){if(1&t&&(Di(0),io(1),Hi()),2&t){const t=zi(2);Xs(1),oo(t.translations.byAssembly)}}function ch(t,e){if(1&t&&(Di(0),io(1),Hi()),2&t){const t=zi(2);Xs(1),oo(t.translations.byNamespace+" "+t.settings.grouping)}}function uh(t,e){if(1&t&&(Si(0,"option",26),io(1),Ti()),2&t){const t=e.$implicit;Oi("value",t),Xs(1),oo(t)}}function hh(t,e){1&t&&Vi(0,"br")}function dh(t,e){if(1&t&&(Si(0,"option",32),io(1),Ti()),2&t){const t=zi(4);Xs(1),lo(" ",t.translations.branchCoverageIncreaseOnly," ")}}function fh(t,e){if(1&t&&(Si(0,"option",33),io(1),Ti()),2&t){const t=zi(4);Xs(1),lo(" ",t.translations.branchCoverageDecreaseOnly," ")}}function ph(t,e){if(1&t){const t=Ni();Si(0,"div"),Si(1,"select",23),Ri("ngModelChange",function(e){return Ae(t),zi(3).settings.historyComparisionType=e}),Si(2,"option",24),io(3),Ti(),Si(4,"option",27),io(5),Ti(),Si(6,"option",28),io(7),Ti(),Si(8,"option",29),io(9),Ti(),ki(10,dh,2,1,"option",30),ki(11,fh,2,1,"option",31),Ti(),Ti()}if(2&t){const t=zi(3);Xs(1),Oi("ngModel",t.settings.historyComparisionType),Xs(2),oo(t.translations.filter),Xs(2),oo(t.translations.allChanges),Xs(2),oo(t.translations.lineCoverageIncreaseOnly),Xs(2),oo(t.translations.lineCoverageDecreaseOnly),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable)}}function gh(t,e){if(1&t){const t=Ni();Di(0),Si(1,"div"),io(2),Si(3,"select",23),Ri("ngModelChange",function(e){return Ae(t),zi(2).settings.historyComparisionDate=e})("ngModelChange",function(){return Ae(t),zi(2).updateCurrentHistoricCoverage()}),Si(4,"option",24),io(5),Ti(),ki(6,uh,2,2,"option",25),Ti(),Ti(),ki(7,hh,1,0,"br",0),ki(8,ph,12,7,"div",0),Hi()}if(2&t){const t=zi(2);Xs(2),lo(" ",t.translations.compareHistory," "),Xs(1),Oi("ngModel",t.settings.historyComparisionDate),Xs(2),oo(t.translations.date),Xs(1),Oi("ngForOf",t.historicCoverageExecutionTimes),Xs(1),Oi("ngIf",""!==t.settings.historyComparisionDate),Xs(1),Oi("ngIf",""!==t.settings.historyComparisionDate)}}function vh(t,e){1&t&&Vi(0,"col",8)}function yh(t,e){1&t&&Vi(0,"col",11)}function _h(t,e){1&t&&Vi(0,"col",12)}function mh(t,e){1&t&&Vi(0,"col",13)}const bh=function(t,e,n){return{"icon-up-dir_active":t,"icon-down-dir_active":e,"icon-down-dir":n}};function Ch(t,e){if(1&t){const t=Ni();Si(0,"th",5),Si(1,"a",2),Ri("click",function(e){return Ae(t),zi(2).updateSorting("covered_branches",e)}),Vi(2,"i",18),io(3),Ti(),Ti()}if(2&t){const t=zi(2);Xs(2),Oi("ngClass",Ol(2,bh,"covered_branches"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"covered_branches"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"covered_branches"!==t.settings.sortBy)),Xs(1),oo(t.translations.covered)}}function wh(t,e){if(1&t){const t=Ni();Si(0,"th",5),Si(1,"a",2),Ri("click",function(e){return Ae(t),zi(2).updateSorting("total_branches",e)}),Vi(2,"i",18),io(3),Ti(),Ti()}if(2&t){const t=zi(2);Xs(2),Oi("ngClass",Ol(2,bh,"total_branches"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"total_branches"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"total_branches"!==t.settings.sortBy)),Xs(1),oo(t.translations.total)}}function Eh(t,e){if(1&t){const t=Ni();Si(0,"th",19),Si(1,"a",2),Ri("click",function(e){return Ae(t),zi(2).updateSorting("branchcoverage",e)}),Vi(2,"i",18),io(3),Ti(),Ti()}if(2&t){const t=zi(2);Xs(2),Oi("ngClass",Ol(2,bh,"branchcoverage"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"branchcoverage"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"branchcoverage"!==t.settings.sortBy)),Xs(1),oo(t.translations.branchCoverage)}}function xh(t,e){if(1&t&&Vi(0,"tr",35),2&t){const t=zi().$implicit,e=zi(2);Oi("element",t)("collapsed",t.collapsed)("branchCoverageAvailable",e.branchCoverageAvailable)}}function kh(t,e){if(1&t&&Vi(0,"tr",37),2&t){const t=zi().$implicit,e=zi(3);Oi("clazz",t)("translations",e.translations)("branchCoverageAvailable",e.branchCoverageAvailable)("historyComparisionDate",e.settings.historyComparisionDate)}}function Ah(t,e){if(1&t&&(Di(0),ki(1,kh,1,4,"tr",36),Hi()),2&t){const t=e.$implicit,n=zi().$implicit,s=zi(2);Xs(1),Oi("ngIf",!n.collapsed&&t.visible(s.settings.filter,s.settings.historyComparisionType))}}function Oh(t,e){if(1&t&&Vi(0,"tr",40),2&t){const t=zi().$implicit,e=zi(5);Oi("clazz",t)("translations",e.translations)("branchCoverageAvailable",e.branchCoverageAvailable)("historyComparisionDate",e.settings.historyComparisionDate)}}function Ih(t,e){if(1&t&&(Di(0),ki(1,Oh,1,4,"tr",39),Hi()),2&t){const t=e.$implicit,n=zi(2).$implicit,s=zi(3);Xs(1),Oi("ngIf",!n.collapsed&&t.visible(s.settings.filter,s.settings.historyComparisionType))}}function Sh(t,e){if(1&t&&(Di(0),Vi(1,"tr",38),ki(2,Ih,2,1,"ng-container",22),Hi()),2&t){const t=zi().$implicit,e=zi(3);Xs(1),Oi("element",t)("collapsed",t.collapsed)("branchCoverageAvailable",e.branchCoverageAvailable),Xs(1),Oi("ngForOf",t.classes)}}function Th(t,e){if(1&t&&(Di(0),ki(1,Sh,3,4,"ng-container",0),Hi()),2&t){const t=e.$implicit,n=zi().$implicit,s=zi(2);Xs(1),Oi("ngIf",!n.collapsed&&t.visible(s.settings.filter,s.settings.historyComparisionType))}}function Vh(t,e){if(1&t&&(Di(0),ki(1,xh,1,3,"tr",34),ki(2,Ah,2,1,"ng-container",22),ki(3,Th,2,1,"ng-container",22),Hi()),2&t){const t=e.$implicit,n=zi(2);Xs(1),Oi("ngIf",t.visible(n.settings.filter,n.settings.historyComparisionType)),Xs(1),Oi("ngForOf",t.classes),Xs(1),Oi("ngForOf",t.subElements)}}function Dh(t,e){if(1&t){const t=Ni();Si(0,"div"),Si(1,"div",1),Si(2,"div"),Si(3,"a",2),Ri("click",function(e){return Ae(t),zi().collapseAll(e)}),io(4),Ti(),io(5," | "),Si(6,"a",2),Ri("click",function(e){return Ae(t),zi().expandAll(e)}),io(7),Ti(),Ti(),Si(8,"div",3),ki(9,lh,2,1,"ng-container",0),ki(10,ah,2,1,"ng-container",0),ki(11,ch,2,1,"ng-container",0),Vi(12,"br"),io(13),Si(14,"input",4),Ri("ngModelChange",function(e){return Ae(t),zi().settings.grouping=e})("ngModelChange",function(){return Ae(t),zi().updateCoverageInfo()}),Ti(),Ti(),Si(15,"div",3),ki(16,gh,9,6,"ng-container",0),Ti(),Si(17,"div",5),Si(18,"span"),io(19),Ti(),Si(20,"input",6),Ri("ngModelChange",function(e){return Ae(t),zi().settings.filter=e}),Ti(),Ti(),Ti(),Si(21,"table",7),Si(22,"colgroup"),Vi(23,"col"),Vi(24,"col",8),Vi(25,"col",9),Vi(26,"col",10),Vi(27,"col",11),Vi(28,"col",12),Vi(29,"col",13),ki(30,vh,1,0,"col",14),ki(31,yh,1,0,"col",15),ki(32,_h,1,0,"col",16),ki(33,mh,1,0,"col",17),Ti(),Si(34,"thead"),Si(35,"tr"),Si(36,"th"),Si(37,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("name",e)}),Vi(38,"i",18),io(39),Ti(),Ti(),Si(40,"th",5),Si(41,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("covered",e)}),Vi(42,"i",18),io(43),Ti(),Ti(),Si(44,"th",5),Si(45,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("uncovered",e)}),Vi(46,"i",18),io(47),Ti(),Ti(),Si(48,"th",5),Si(49,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("coverable",e)}),Vi(50,"i",18),io(51),Ti(),Ti(),Si(52,"th",5),Si(53,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("total",e)}),Vi(54,"i",18),io(55),Ti(),Ti(),Si(56,"th",19),Si(57,"a",2),Ri("click",function(e){return Ae(t),zi().updateSorting("coverage",e)}),Vi(58,"i",18),io(59),Ti(),Ti(),ki(60,Ch,4,6,"th",20),ki(61,wh,4,6,"th",20),ki(62,Eh,4,6,"th",21),Ti(),Ti(),Si(63,"tbody"),ki(64,Vh,4,3,"ng-container",22),Ti(),Ti(),Ti()}if(2&t){const t=zi();Xs(4),oo(t.translations.collapseAll),Xs(3),oo(t.translations.expandAll),Xs(2),Oi("ngIf",-1===t.settings.grouping),Xs(1),Oi("ngIf",0===t.settings.grouping),Xs(1),Oi("ngIf",t.settings.grouping>0),Xs(2),lo(" ",t.translations.grouping," "),Xs(1),Oi("max",t.settings.groupingMaximum)("ngModel",t.settings.grouping),Xs(2),Oi("ngIf",t.historicCoverageExecutionTimes.length>0),Xs(3),lo("",t.translations.filter," "),Xs(1),Oi("ngModel",t.settings.filter),Xs(10),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(5),Oi("ngClass",Ol(31,bh,"name"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"name"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"name"!==t.settings.sortBy)),Xs(1),oo(t.translations.name),Xs(3),Oi("ngClass",Ol(35,bh,"covered"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"covered"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"covered"!==t.settings.sortBy)),Xs(1),oo(t.translations.covered),Xs(3),Oi("ngClass",Ol(39,bh,"uncovered"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"uncovered"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"uncovered"!==t.settings.sortBy)),Xs(1),oo(t.translations.uncovered),Xs(3),Oi("ngClass",Ol(43,bh,"coverable"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"coverable"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"coverable"!==t.settings.sortBy)),Xs(1),oo(t.translations.coverable),Xs(3),Oi("ngClass",Ol(47,bh,"total"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"total"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"total"!==t.settings.sortBy)),Xs(1),oo(t.translations.total),Xs(3),Oi("ngClass",Ol(51,bh,"coverage"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"coverage"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"coverage"!==t.settings.sortBy)),Xs(1),oo(t.translations.coverage),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(1),Oi("ngIf",t.branchCoverageAvailable),Xs(2),Oi("ngForOf",t.codeElements)}}let Hh=(()=>{class t{constructor(t){this.queryString="",this.historicCoverageExecutionTimes=[],this.branchCoverageAvailable=!1,this.codeElements=[],this.translations={},this.settings=new pu,this.window=t.nativeWindow}ngOnInit(){this.historicCoverageExecutionTimes=this.window.historicCoverageExecutionTimes,this.branchCoverageAvailable=this.window.branchCoverageAvailable,this.translations=this.window.translations;let t=!1;if(void 0!==this.window.history&&void 0!==this.window.history.replaceState&&null!==this.window.history.state&&null!=this.window.history.state.coverageInfoSettings)console.log("Coverage info: Restoring from history",this.window.history.state.coverageInfoSettings),t=!0,this.settings=JSON.parse(JSON.stringify(this.window.history.state.coverageInfoSettings));else{let t=0,e=this.window.assemblies;for(let n=0;n-1&&(this.queryString=window.location.href.substr(e)),this.updateCoverageInfo(),t&&this.restoreCollapseState()}onDonBeforeUnlodad(){if(this.saveCollapseState(),void 0!==this.window.history&&void 0!==this.window.history.replaceState){console.log("Coverage info: Updating history",this.settings);let t=new fu;null!==window.history.state&&(t=JSON.parse(JSON.stringify(this.window.history.state))),t.coverageInfoSettings=JSON.parse(JSON.stringify(this.settings)),window.history.replaceState(t,"")}}updateCoverageInfo(){let t=(new Date).getTime(),e=this.window.assemblies,n=[],s=0;if(0===this.settings.grouping)for(let o=0;o{for(let n=0;n{for(let s=0;st&&(n[s].collapsed=this.settings.collapseStates[t]),t++,e(n[s].subElements)};e(this.codeElements)}}return t.\u0275fac=function(e){return new(e||t)(Ai(bu))},t.\u0275cmp=jt({type:t,selectors:[["coverage-info"]],hostBindings:function(t,e){1&t&&Ri("beforeunload",function(){return e.onDonBeforeUnlodad()},!1,ps)},decls:1,vars:1,consts:[[4,"ngIf"],[1,"customizebox"],["href","#",3,"click"],[1,"center"],["type","range","step","1","min","-1",3,"max","ngModel","ngModelChange"],[1,"right"],["type","text",3,"ngModel","ngModelChange"],[1,"overview","table-fixed","stripped"],[1,"column90"],[1,"column105"],[1,"column100"],[1,"column70"],[1,"column98"],[1,"column112"],["class","column90",4,"ngIf"],["class","column70",4,"ngIf"],["class","column98",4,"ngIf"],["class","column112",4,"ngIf"],[1,"icon-down-dir",3,"ngClass"],["colspan","2",1,"center"],["class","right",4,"ngIf"],["class","center","colspan","2",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"ngModel","ngModelChange"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["value","allChanges"],["value","lineCoverageIncreaseOnly"],["value","lineCoverageDecreaseOnly"],["value","branchCoverageIncreaseOnly",4,"ngIf"],["value","branchCoverageDecreaseOnly",4,"ngIf"],["value","branchCoverageIncreaseOnly"],["value","branchCoverageDecreaseOnly"],["codeelement-row","",3,"element","collapsed","branchCoverageAvailable",4,"ngIf"],["codeelement-row","",3,"element","collapsed","branchCoverageAvailable"],["class-row","",3,"clazz","translations","branchCoverageAvailable","historyComparisionDate",4,"ngIf"],["class-row","",3,"clazz","translations","branchCoverageAvailable","historyComparisionDate"],["codeelement-row","",1,"namespace",3,"element","collapsed","branchCoverageAvailable"],["class","namespace","class-row","",3,"clazz","translations","branchCoverageAvailable","historyComparisionDate",4,"ngIf"],["class-row","",1,"namespace",3,"clazz","translations","branchCoverageAvailable","historyComparisionDate"]],template:function(t,e){1&t&&ki(0,Dh,65,55,"div",0),2&t&&Oi("ngIf",e.codeElements.length>0)},directives:[Ha,nu,bc,Nc,Xc,Sa,Va,iu,ou,uu,Vu,oh],encapsulation:2}),t})();class Nh{constructor(){this.assembly="",this.numberOfRiskHotspots=10,this.filter="",this.sortBy="",this.sortOrder="asc"}}function Mh(t,e){if(1&t&&(Si(0,"option",14),io(1),Ti()),2&t){const t=e.$implicit;Oi("value",t),Xs(1),oo(t)}}function Ph(t,e){1&t&&(Si(0,"option",21),io(1,"20"),Ti())}function Rh(t,e){1&t&&(Si(0,"option",22),io(1,"50"),Ti())}function jh(t,e){1&t&&(Si(0,"option",23),io(1,"100"),Ti())}function Fh(t,e){if(1&t&&(Si(0,"option",14),io(1),Ti()),2&t){const t=zi(3);Oi("value",t.totalNumberOfRiskHotspots),Xs(1),oo(t.translations.all)}}function zh(t,e){if(1&t){const t=Ni();Si(0,"select",15),Ri("ngModelChange",function(e){return Ae(t),zi(2).settings.numberOfRiskHotspots=e}),Si(1,"option",16),io(2,"10"),Ti(),ki(3,Ph,2,0,"option",17),ki(4,Rh,2,0,"option",18),ki(5,jh,2,0,"option",19),ki(6,Fh,2,2,"option",20),Ti()}if(2&t){const t=zi(2);Oi("ngModel",t.settings.numberOfRiskHotspots),Xs(3),Oi("ngIf",t.totalNumberOfRiskHotspots>10),Xs(1),Oi("ngIf",t.totalNumberOfRiskHotspots>20),Xs(1),Oi("ngIf",t.totalNumberOfRiskHotspots>50),Xs(1),Oi("ngIf",t.totalNumberOfRiskHotspots>100)}}function Lh(t,e){1&t&&Vi(0,"col",24)}const Bh=function(t,e,n){return{"icon-up-dir_active":t,"icon-down-dir_active":e,"icon-down-dir":n}};function $h(t,e){if(1&t){const t=Ni();Si(0,"th"),Si(1,"a",11),Ri("click",function(e){const n=Ae(t).index;return zi(2).updateSorting(""+n,e)}),Vi(2,"i",12),io(3),Ti(),Si(4,"a",25),Vi(5,"i",26),Ti(),Ti()}if(2&t){const t=e.$implicit,n=e.index,s=zi(2);Xs(2),Oi("ngClass",Ol(3,Bh,s.settings.sortBy===""+n&&"desc"===s.settings.sortOrder,s.settings.sortBy===""+n&&"asc"===s.settings.sortOrder,s.settings.sortBy!==""+n)),Xs(1),oo(t.name),Xs(1),Li("href",t.explanationUrl,os)}}const Uh=function(t,e){return{lightred:t,lightgreen:e}};function Zh(t,e){if(1&t&&(Si(0,"td",29),io(1),Ti()),2&t){const t=e.$implicit;Oi("ngClass",Al(2,Uh,t.exceeded,!t.exceeded)),Xs(1),oo(t.value)}}function qh(t,e){if(1&t&&(Si(0,"tr"),Si(1,"td"),io(2),Ti(),Si(3,"td"),Si(4,"a",25),io(5),Ti(),Ti(),Si(6,"td",27),Si(7,"a",25),io(8),Ti(),Ti(),ki(9,Zh,2,5,"td",28),Ti()),2&t){const t=e.$implicit,n=zi(2);Xs(2),oo(t.assembly),Xs(2),Oi("href",t.reportPath+n.queryString,os),Xs(1),oo(t.class),Xs(1),Oi("title",t.methodName),Xs(1),Oi("href",t.reportPath+n.queryString+"#file"+t.fileIndex+"_line"+t.line,os),Xs(1),lo(" ",t.methodShortName," "),Xs(1),Oi("ngForOf",t.metrics)}}function Wh(t,e){if(1&t){const t=Ni();Si(0,"div"),Si(1,"div",1),Si(2,"div"),Si(3,"select",2),Ri("ngModelChange",function(e){return Ae(t),zi().settings.assembly=e})("ngModelChange",function(){return Ae(t),zi().updateRiskHotpots()}),Si(4,"option",3),io(5),Ti(),ki(6,Mh,2,2,"option",4),Ti(),Ti(),Si(7,"div",5),Si(8,"span"),io(9),Ti(),ki(10,zh,7,5,"select",6),Ti(),Vi(11,"div",5),Si(12,"div",7),Si(13,"span"),io(14),Ti(),Si(15,"input",8),Ri("ngModelChange",function(e){return Ae(t),zi().settings.filter=e})("ngModelChange",function(){return Ae(t),zi().updateRiskHotpots()}),Ti(),Ti(),Ti(),Si(16,"table",9),Si(17,"colgroup"),Vi(18,"col"),Vi(19,"col"),Vi(20,"col"),ki(21,Lh,1,0,"col",10),Ti(),Si(22,"thead"),Si(23,"tr"),Si(24,"th"),Si(25,"a",11),Ri("click",function(e){return Ae(t),zi().updateSorting("assembly",e)}),Vi(26,"i",12),io(27),Ti(),Ti(),Si(28,"th"),Si(29,"a",11),Ri("click",function(e){return Ae(t),zi().updateSorting("class",e)}),Vi(30,"i",12),io(31),Ti(),Ti(),Si(32,"th"),Si(33,"a",11),Ri("click",function(e){return Ae(t),zi().updateSorting("method",e)}),Vi(34,"i",12),io(35),Ti(),Ti(),ki(36,$h,6,7,"th",13),Ti(),Ti(),Si(37,"tbody"),ki(38,qh,10,7,"tr",13),function(t,e){const n=ke();let s;n.firstCreatePass?(s=function(t,e){if(e)for(let n=e.length-1;n>=0;n--){const s=e[n];if(t===s.name)return s}throw new st("302","The pipe 'slice' could not be found!")}("slice",n.pipeRegistry),n.data[59]=s,s.onDestroy&&(n.destroyHooks||(n.destroyHooks=[])).push(59,s.onDestroy)):s=n.data[59];const r=s.factory||(s.factory=ne(s.type)),i=_t(Ai);try{const t=pn(!1),e=r();pn(t),function(t,e,n,s){59>=t.data.length&&(t.data[59]=null,t.blueprint[59]=null),e[59]=s}(n,xe(),0,e)}finally{_t(i)}}(),Ti(),Ti(),Ti()}if(2&t){const t=zi();Xs(3),Oi("ngModel",t.settings.assembly),Xs(2),oo(t.translations.assembly),Xs(1),Oi("ngForOf",t.assemblies),Xs(3),oo(t.translations.top),Xs(1),Oi("ngIf",t.totalNumberOfRiskHotspots>10),Xs(4),lo("",t.translations.filter," "),Xs(1),Oi("ngModel",t.settings.filter),Xs(6),Oi("ngForOf",t.riskHotspotMetrics),Xs(5),Oi("ngClass",Ol(20,Bh,"assembly"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"assembly"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"assembly"!==t.settings.sortBy)),Xs(1),oo(t.translations.assembly),Xs(3),Oi("ngClass",Ol(24,Bh,"class"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"class"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"class"!==t.settings.sortBy)),Xs(1),oo(t.translations.class),Xs(3),Oi("ngClass",Ol(28,Bh,"method"===t.settings.sortBy&&"desc"===t.settings.sortOrder,"method"===t.settings.sortBy&&"asc"===t.settings.sortOrder,"method"!==t.settings.sortBy)),Xs(1),oo(t.translations.method),Xs(1),Oi("ngForOf",t.riskHotspotMetrics),Xs(2),Oi("ngForOf",function(t,e,n,s,r){const i=t+Gt,o=xe(),l=function(t,e){return t[e]}(o,i);return function(t,e){return yi.isWrapped(e)&&(e=yi.unwrap(e),t[we.lFrame.bindingIndex]=Ys),e}(o,function(t,e){return t[1].data[e].pure}(o,i)?Sl(o,Ne(),e,l.transform,n,s,r,l):l.transform(n,s,r))}(39,16,t.riskHotspots,0,t.settings.numberOfRiskHotspots))}}let Gh=(()=>{class t{constructor(t){this.queryString="",this.riskHotspotMetrics=[],this.riskHotspots=[],this.totalNumberOfRiskHotspots=0,this.assemblies=[],this.translations={},this.settings=new Nh,this.window=t.nativeWindow}ngOnInit(){this.riskHotspotMetrics=this.window.riskHotspotMetrics,this.translations=this.window.translations,void 0!==this.window.history&&void 0!==this.window.history.replaceState&&null!==this.window.history.state&&null!=this.window.history.state.riskHotspotsSettings&&(console.log("Risk hotspots: Restoring from history",this.window.history.state.riskHotspotsSettings),this.settings=JSON.parse(JSON.stringify(this.window.history.state.riskHotspotsSettings)));const t=window.location.href.indexOf("?");t>-1&&(this.queryString=window.location.href.substr(t)),this.updateRiskHotpots()}onDonBeforeUnlodad(){if(void 0!==this.window.history&&void 0!==this.window.history.replaceState){console.log("Risk hotspots: Updating history",this.settings);let t=new fu;null!==window.history.state&&(t=JSON.parse(JSON.stringify(this.window.history.state))),t.riskHotspotsSettings=JSON.parse(JSON.stringify(this.settings)),window.history.replaceState(t,"")}}updateRiskHotpots(){const t=this.window.riskHotspots;if(this.totalNumberOfRiskHotspots=t.length,0===this.assemblies.length){let e=[];for(let n=0;n0)},directives:[Ha,iu,Nc,Xc,ou,uu,Va,bc,Sa],pipes:[Pa],encapsulation:2}),t})(),Qh=(()=>{class t{}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=Bt({type:t,bootstrap:[Gh,Hh]}),t.\u0275inj=at({providers:[bu],imports:[[fc,du]]}),t})();(function(){if(da)throw new Error("Cannot enable prod mode after platform setup.");ha=!1})(),hc().bootstrapModule(Qh).catch(t=>console.error(t))}},t=>{"use strict";t(t.s=520)}]); \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Report/report.css b/TestProject/Usd-Development/CodeCoverage/Report/report.css new file mode 100644 index 000000000..63b688246 --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Report/report.css @@ -0,0 +1,371 @@ +html { font-family: sans-serif; margin: 0; padding: 0; font-size: 0.9em; background-color: #d6d6d6; height: 100%; } +body { margin: 0; padding: 0; height: 100%; color: #000; } +h1 { font-family: 'Century Gothic', sans-serif; font-size: 1.2em; font-weight: normal; color: #fff; background-color: #6f6f6f; padding: 10px; margin: 20px -20px 20px -20px; } +h1:first-of-type { margin-top: 0; } +h2 { font-size: 1.0em; font-weight: bold; margin: 10px 0 15px 0; padding: 0; } +h3 { font-size: 1.0em; font-weight: bold; margin: 0 0 10px 0; padding: 0; display: inline-block; } +a { color: #c00; text-decoration: none; } +a:hover { color: #000; text-decoration: none; } +h1 a.back { color: #fff; background-color: #949494; display: inline-block; margin: -12px 5px -10px -10px; padding: 10px; border-right: 1px solid #fff; } +h1 a.back:hover { background-color: #ccc; } +h1 a.button { color: #000; background-color: #bebebe; margin: -5px 0 0 10px; padding: 5px 8px 5px 8px; border: 1px solid #fff; font-size: 0.9em; border-radius: 3px; float:right; } +h1 a.button:hover { background-color: #ccc; } +h1 a.button i { position: relative; top: 1px; } + +.container { margin: auto; max-width: 1650px; width: 90%; background-color: #fff; display: flex; box-shadow: 0 0 60px #7d7d7d; min-height: 100%; } +.containerleft { padding: 0 20px 20px 20px; flex: 1; } +.containerright { width: 340px; min-width: 340px; background-color: #e5e5e5; height: 100%; } +.containerrightfixed { position: fixed; padding: 0 20px 20px 20px; border-left: solid 1px #6f6f6f; width: 300px; overflow-y: auto; height: 100%; top: 0; bottom: 0; } +.containerrightfixed h1 { background-color: #c00; } +.containerrightfixed label, .containerright a { white-space: nowrap; overflow: hidden; display: inline-block; width: 100%; max-width: 300px; text-overflow: ellipsis; } +.containerright a { margin-bottom: 3px; } + +@media screen and (max-width:1200px){ + .container { box-shadow: none; width: 100%; } + .containerright { display: none; } +} + +.footer { font-size: 0.7em; text-align: center; margin-top: 35px; } + +th { text-align: left; } +.table-fixed { table-layout: fixed; } +.overview { border: solid 1px #c1c1c1; border-collapse: collapse; width: 100%; word-wrap: break-word; } +.overview th { border: solid 1px #c1c1c1; border-collapse: collapse; padding: 2px 4px 2px 4px; background-color: #ddd; } +.overview tr.namespace th { background-color: #dcdcdc; } +.overview thead th { background-color: #d1d1d1; } +.overview th a { color: #000; } +.overview tr.namespace a { margin-left: 15px; display: block; } +.overview td { border: solid 1px #c1c1c1; border-collapse: collapse; padding: 2px 5px 2px 5px; } +div.currenthistory { margin: -2px -5px 0 -5px; padding: 2px 5px 2px 5px; height: 16px; } +.coverage { border: solid 1px #c1c1c1; border-collapse: collapse; font-size: 5px; height: 10px; } +.coverage td { padding: 0; border: none; } +.stripped tr:nth-child(2n+1) { background-color: #F3F3F3; } + +.customizebox { font-size: 0.75em; margin-bottom: 7px; } +.customizebox>div { width: 25%; display: inline-block; } +.customizebox div.right input { font-size: 0.8em; width: 150px; } +#namespaceslider { width: 200px; display: inline-block; margin-left: 8px; } + +.percentagebar { + padding-left: 3px; +} +a.percentagebar { + padding-left: 6px; +} +.percentagebarundefined { + border-left: 2px solid #fff; +} +.percentagebar0 { + border-left: 2px solid #c10909; +} +.percentagebar10 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 90%, #0aad0a 90%, #0aad0a 100%) 1; +} +.percentagebar20 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 80%, #0aad0a 80%, #0aad0a 100%) 1; +} +.percentagebar30 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 70%, #0aad0a 70%, #0aad0a 100%) 1; +} +.percentagebar40 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 60%, #0aad0a 60%, #0aad0a 100%) 1; +} +.percentagebar50 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 50%, #0aad0a 50%, #0aad0a 100%) 1; +} +.percentagebar60 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 40%, #0aad0a 40%, #0aad0a 100%) 1; +} +.percentagebar70 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 30%, #0aad0a 30%, #0aad0a 100%) 1; +} +.percentagebar80 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 20%, #0aad0a 20%, #0aad0a 100%) 1; +} +.percentagebar90 { + border-left: 2px solid; + border-image: linear-gradient(to bottom, #c10909 10%, #0aad0a 10%, #0aad0a 100%) 1; +} +.percentagebar100 { + border-left: 2px solid #0aad0a; +} + +.hidden, .ng-hide { display: none; } +.right { text-align: right; } +.center { text-align: center; } +.rightmargin { padding-right: 8px; } +.leftmargin { padding-left: 5px; } +.green { background-color: #0aad0a; } +.lightgreen { background-color: #dcf4dc; } +.red { background-color: #c10909; } +.lightred { background-color: #f7dede; } +.orange { background-color: #FFA500; } +.lightorange { background-color: #FFEFD5; } +.gray { background-color: #dcdcdc; } +.lightgray { color: #888888; } +.lightgraybg { background-color: #dadada; } + +.toggleZoom { text-align:right; } + +.ct-chart { position: relative; } +.ct-chart .ct-line { stroke-width: 2px !important; } +.ct-chart .ct-point { stroke-width: 6px !important; transition: stroke-width .2s; } +.ct-chart .ct-point:hover { stroke-width: 10px !important; } +.ct-chart .ct-series.ct-series-a .ct-line, .ct-chart .ct-series.ct-series-a .ct-point { stroke: #c00 !important;} +.ct-chart .ct-series.ct-series-b .ct-line, .ct-chart .ct-series.ct-series-b .ct-point { stroke: #1c2298 !important;} + +.tinylinecoveragechart, .tinybranchcoveragechart { background-color: #fff; margin-left: -3px; float: left; border: solid 1px #c1c1c1; width: 30px; height: 18px; } +.historiccoverageoffset { margin-top: 7px; } + +.tinylinecoveragechart .ct-line, .tinybranchcoveragechart .ct-line { stroke-width: 1px !important; } +.tinybranchcoveragechart .ct-series.ct-series-a .ct-line { stroke: #1c2298 !important; } + +.linecoverage { background-color: #c00; width: 10px; height: 8px; border: 1px solid #000; display: inline-block; } +.branchcoverage { background-color: #1c2298; width: 10px; height: 8px; border: 1px solid #000; display: inline-block; } + +.tooltip { position: absolute; display: none; padding: 5px; background: #F4C63D; color: #453D3F; pointer-events: none; z-index: 1; min-width: 250px; } + +.column1324 { max-width: 1324px; } +.column674 { max-width: 674px; } +.column60 { width: 60px; } +.column70 { width: 70px; } +.column90 { width: 90px; } +.column98 { width: 98px; } +.column100 { width: 100px; } +.column105 { width: 105px; } +.column112 { width: 112px; } +.column135 { width: 135px; } +.column150 { width: 150px; } + +.covered0 { width: 0px; } +.covered1 { width: 1px; } +.covered2 { width: 2px; } +.covered3 { width: 3px; } +.covered4 { width: 4px; } +.covered5 { width: 5px; } +.covered6 { width: 6px; } +.covered7 { width: 7px; } +.covered8 { width: 8px; } +.covered9 { width: 9px; } +.covered10 { width: 10px; } +.covered11 { width: 11px; } +.covered12 { width: 12px; } +.covered13 { width: 13px; } +.covered14 { width: 14px; } +.covered15 { width: 15px; } +.covered16 { width: 16px; } +.covered17 { width: 17px; } +.covered18 { width: 18px; } +.covered19 { width: 19px; } +.covered20 { width: 20px; } +.covered21 { width: 21px; } +.covered22 { width: 22px; } +.covered23 { width: 23px; } +.covered24 { width: 24px; } +.covered25 { width: 25px; } +.covered26 { width: 26px; } +.covered27 { width: 27px; } +.covered28 { width: 28px; } +.covered29 { width: 29px; } +.covered30 { width: 30px; } +.covered31 { width: 31px; } +.covered32 { width: 32px; } +.covered33 { width: 33px; } +.covered34 { width: 34px; } +.covered35 { width: 35px; } +.covered36 { width: 36px; } +.covered37 { width: 37px; } +.covered38 { width: 38px; } +.covered39 { width: 39px; } +.covered40 { width: 40px; } +.covered41 { width: 41px; } +.covered42 { width: 42px; } +.covered43 { width: 43px; } +.covered44 { width: 44px; } +.covered45 { width: 45px; } +.covered46 { width: 46px; } +.covered47 { width: 47px; } +.covered48 { width: 48px; } +.covered49 { width: 49px; } +.covered50 { width: 50px; } +.covered51 { width: 51px; } +.covered52 { width: 52px; } +.covered53 { width: 53px; } +.covered54 { width: 54px; } +.covered55 { width: 55px; } +.covered56 { width: 56px; } +.covered57 { width: 57px; } +.covered58 { width: 58px; } +.covered59 { width: 59px; } +.covered60 { width: 60px; } +.covered61 { width: 61px; } +.covered62 { width: 62px; } +.covered63 { width: 63px; } +.covered64 { width: 64px; } +.covered65 { width: 65px; } +.covered66 { width: 66px; } +.covered67 { width: 67px; } +.covered68 { width: 68px; } +.covered69 { width: 69px; } +.covered70 { width: 70px; } +.covered71 { width: 71px; } +.covered72 { width: 72px; } +.covered73 { width: 73px; } +.covered74 { width: 74px; } +.covered75 { width: 75px; } +.covered76 { width: 76px; } +.covered77 { width: 77px; } +.covered78 { width: 78px; } +.covered79 { width: 79px; } +.covered80 { width: 80px; } +.covered81 { width: 81px; } +.covered82 { width: 82px; } +.covered83 { width: 83px; } +.covered84 { width: 84px; } +.covered85 { width: 85px; } +.covered86 { width: 86px; } +.covered87 { width: 87px; } +.covered88 { width: 88px; } +.covered89 { width: 89px; } +.covered90 { width: 90px; } +.covered91 { width: 91px; } +.covered92 { width: 92px; } +.covered93 { width: 93px; } +.covered94 { width: 94px; } +.covered95 { width: 95px; } +.covered96 { width: 96px; } +.covered97 { width: 97px; } +.covered98 { width: 98px; } +.covered99 { width: 99px; } +.covered100 { width: 100px; } + + @media print { + html, body { background-color: #fff; } + .container { max-width: 100%; width: 100%; padding: 0; } + .overview colgroup col:first-child { width: 300px; } +} + +.icon-up-dir_active { + background-image: url(icon_up-dir.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiNjMDAiIGQ9Ik0xNDA4IDEyMTZxMCAyNi0xOSA0NXQtNDUgMTloLTg5NnEtMjYgMC00NS0xOXQtMTktNDUgMTktNDVsNDQ4LTQ0OHExOS0xOSA0NS0xOXQ0NSAxOWw0NDggNDQ4cTE5IDE5IDE5IDQ1eiIvPjwvc3ZnPg==); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; + position: relative; + top: 3px; +} +.icon-down-dir_active { + background-image: url(icon_up-dir_active.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiNjMDAiIGQ9Ik0xNDA4IDcwNHEwIDI2LTE5IDQ1bC00NDggNDQ4cS0xOSAxOS00NSAxOXQtNDUtMTlsLTQ0OC00NDhxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5aDg5NnEyNiAwIDQ1IDE5dDE5IDQ1eiIvPjwvc3ZnPg==); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; + position: relative; + top: 3px; +} +.icon-down-dir { + background-image: url(icon_down-dir_active.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNDA4IDcwNHEwIDI2LTE5IDQ1bC00NDggNDQ4cS0xOSAxOS00NSAxOXQtNDUtMTlsLTQ0OC00NDhxLTE5LTE5LTE5LTQ1dDE5LTQ1IDQ1LTE5aDg5NnEyNiAwIDQ1IDE5dDE5IDQ1eiIvPjwvc3ZnPg==); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; + position: relative; + top: 3px; +} +.icon-info-circled { + background-image: url(icon_info-circled.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxjaXJjbGUgY3g9Ijg5NiIgY3k9Ijg5NiIgcj0iNzUwIiBmaWxsPSIjZmZmIiAvPjxwYXRoIGZpbGw9IiMyOEE1RkYiIGQ9Ik0xMTUyIDEzNzZ2LTE2MHEwLTE0LTktMjN0LTIzLTloLTk2di01MTJxMC0xNC05LTIzdC0yMy05aC0zMjBxLTE0IDAtMjMgOXQtOSAyM3YxNjBxMCAxNCA5IDIzdDIzIDloOTZ2MzIwaC05NnEtMTQgMC0yMyA5dC05IDIzdjE2MHEwIDE0IDkgMjN0MjMgOWg0NDhxMTQgMCAyMy05dDktMjN6bS0xMjgtODk2di0xNjBxMC0xNC05LTIzdC0yMy05aC0xOTJxLTE0IDAtMjMgOXQtOSAyM3YxNjBxMCAxNCA5IDIzdDIzIDloMTkycTE0IDAgMjMtOXQ5LTIzem02NDAgNDE2cTAgMjA5LTEwMyAzODUuNXQtMjc5LjUgMjc5LjUtMzg1LjUgMTAzLTM4NS41LTEwMy0yNzkuNS0yNzkuNS0xMDMtMzg1LjUgMTAzLTM4NS41IDI3OS41LTI3OS41IDM4NS41LTEwMyAzODUuNSAxMDMgMjc5LjUgMjc5LjUgMTAzIDM4NS41eiIvPjwvc3ZnPg==); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; +} +.icon-plus { + background-image: url(icon_plus.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjAwIDczNnYxOTJxMCA0MC0yOCA2OHQtNjggMjhoLTQxNnY0MTZxMCA0MC0yOCA2OHQtNjggMjhoLTE5MnEtNDAgMC02OC0yOHQtMjgtNjh2LTQxNmgtNDE2cS00MCAwLTY4LTI4dC0yOC02OHYtMTkycTAtNDAgMjgtNjh0NjgtMjhoNDE2di00MTZxMC00MCAyOC02OHQ2OC0yOGgxOTJxNDAgMCA2OCAyOHQyOCA2OHY0MTZoNDE2cTQwIDAgNjggMjh0MjggNjh6Ii8+PC9zdmc+); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; + position: relative; + top: 3px; +} +.icon-minus { + background-image: url(icon_minus.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiNjMDAiIGQ9Ik0xNjAwIDczNnYxOTJxMCA0MC0yOCA2OHQtNjggMjhoLTEyMTZxLTQwIDAtNjgtMjh0LTI4LTY4di0xOTJxMC00MCAyOC02OHQ2OC0yOGgxMjE2cTQwIDAgNjggMjh0MjggNjh6Ii8+PC9zdmc+); + background-repeat: no-repeat; + background-size: contain; + padding-left: 15px; + height: 0.9em; + display: inline-block; + position: relative; + top: 3px; +} +.icon-wrench { + background-image: url(icon_wrench.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00NDggMTQ3MnEwLTI2LTE5LTQ1dC00NS0xOS00NSAxOS0xOSA0NSAxOSA0NSA0NSAxOSA0NS0xOSAxOS00NXptNjQ0LTQyMGwtNjgyIDY4MnEtMzcgMzctOTAgMzctNTIgMC05MS0zN2wtMTA2LTEwOHEtMzgtMzYtMzgtOTAgMC01MyAzOC05MWw2ODEtNjgxcTM5IDk4IDExNC41IDE3My41dDE3My41IDExNC41em02MzQtNDM1cTAgMzktMjMgMTA2LTQ3IDEzNC0xNjQuNSAyMTcuNXQtMjU4LjUgODMuNXEtMTg1IDAtMzE2LjUtMTMxLjV0LTEzMS41LTMxNi41IDEzMS41LTMxNi41IDMxNi41LTEzMS41cTU4IDAgMTIxLjUgMTYuNXQxMDcuNSA0Ni41cTE2IDExIDE2IDI4dC0xNiAyOGwtMjkzIDE2OXYyMjRsMTkzIDEwN3E1LTMgNzktNDguNXQxMzUuNS04MSA3MC41LTM1LjVxMTUgMCAyMy41IDEwdDguNSAyNXoiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-fork { + background-image: url(icon_fork.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxNzkyIiBoZWlnaHQ9IjE3OTIiIHN0eWxlPSJmaWxsOiNmZmYiIC8+PHBhdGggZD0iTTY3MiAxNDcycTAtNDAtMjgtNjh0LTY4LTI4LTY4IDI4LTI4IDY4IDI4IDY4IDY4IDI4IDY4LTI4IDI4LTY4em0wLTExNTJxMC00MC0yOC02OHQtNjgtMjgtNjggMjgtMjggNjggMjggNjggNjggMjggNjgtMjggMjgtNjh6bTY0MCAxMjhxMC00MC0yOC02OHQtNjgtMjgtNjggMjgtMjggNjggMjggNjggNjggMjggNjgtMjggMjgtNjh6bTk2IDBxMCA1Mi0yNiA5Ni41dC03MCA2OS41cS0yIDI4Ny0yMjYgNDE0LTY3IDM4LTIwMyA4MS0xMjggNDAtMTY5LjUgNzF0LTQxLjUgMTAwdjI2cTQ0IDI1IDcwIDY5LjV0MjYgOTYuNXEwIDgwLTU2IDEzNnQtMTM2IDU2LTEzNi01Ni01Ni0xMzZxMC01MiAyNi05Ni41dDcwLTY5LjV2LTgyMHEtNDQtMjUtNzAtNjkuNXQtMjYtOTYuNXEwLTgwIDU2LTEzNnQxMzYtNTYgMTM2IDU2IDU2IDEzNnEwIDUyLTI2IDk2LjV0LTcwIDY5LjV2NDk3cTU0LTI2IDE1NC01NyA1NS0xNyA4Ny41LTI5LjV0NzAuNS0zMSA1OS0zOS41IDQwLjUtNTEgMjgtNjkuNSA4LjUtOTEuNXEtNDQtMjUtNzAtNjkuNXQtMjYtOTYuNXEwLTgwIDU2LTEzNnQxMzYtNTYgMTM2IDU2IDU2IDEzNnoiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-cube { + background-image: url(icon_cube.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik04OTYgMTYyOWw2NDAtMzQ5di02MzZsLTY0MCAyMzN2NzUyem0tNjQtODY1bDY5OC0yNTQtNjk4LTI1NC02OTggMjU0em04MzItMjUydjc2OHEwIDM1LTE4IDY1dC00OSA0N2wtNzA0IDM4NHEtMjggMTYtNjEgMTZ0LTYxLTE2bC03MDQtMzg0cS0zMS0xNy00OS00N3QtMTgtNjV2LTc2OHEwLTQwIDIzLTczdDYxLTQ3bDcwNC0yNTZxMjItOCA0NC04dDQ0IDhsNzA0IDI1NnEzOCAxNCA2MSA0N3QyMyA3M3oiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-search-plus { + background-image: url(icon_search-plus.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM2ZjZmNmYiIGQ9Ik0xMDg4IDgwMHY2NHEwIDEzLTkuNSAyMi41dC0yMi41IDkuNWgtMjI0djIyNHEwIDEzLTkuNSAyMi41dC0yMi41IDkuNWgtNjRxLTEzIDAtMjIuNS05LjV0LTkuNS0yMi41di0yMjRoLTIyNHEtMTMgMC0yMi41LTkuNXQtOS41LTIyLjV2LTY0cTAtMTMgOS41LTIyLjV0MjIuNS05LjVoMjI0di0yMjRxMC0xMyA5LjUtMjIuNXQyMi41LTkuNWg2NHExMyAwIDIyLjUgOS41dDkuNSAyMi41djIyNGgyMjRxMTMgMCAyMi41IDkuNXQ5LjUgMjIuNXptMTI4IDMycTAtMTg1LTEzMS41LTMxNi41dC0zMTYuNS0xMzEuNS0zMTYuNSAxMzEuNS0xMzEuNSAzMTYuNSAxMzEuNSAzMTYuNSAzMTYuNSAxMzEuNSAzMTYuNS0xMzEuNSAxMzEuNS0zMTYuNXptNTEyIDgzMnEwIDUzLTM3LjUgOTAuNXQtOTAuNSAzNy41cS01NCAwLTkwLTM4bC0zNDMtMzQycS0xNzkgMTI0LTM5OSAxMjQtMTQzIDAtMjczLjUtNTUuNXQtMjI1LTE1MC0xNTAtMjI1LTU1LjUtMjczLjUgNTUuNS0yNzMuNSAxNTAtMjI1IDIyNS0xNTAgMjczLjUtNTUuNSAyNzMuNSA1NS41IDIyNSAxNTAgMTUwIDIyNSA1NS41IDI3My41cTAgMjIwLTEyNCAzOTlsMzQzIDM0M3EzNyAzNyAzNyA5MHoiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-search-minus { + background-image: url(icon_search-minus.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGZpbGw9IiM2ZjZmNmYiIGQ9Ik0xMDg4IDgwMHY2NHEwIDEzLTkuNSAyMi41dC0yMi41IDkuNWgtNTc2cS0xMyAwLTIyLjUtOS41dC05LjUtMjIuNXYtNjRxMC0xMyA5LjUtMjIuNXQyMi41LTkuNWg1NzZxMTMgMCAyMi41IDkuNXQ5LjUgMjIuNXptMTI4IDMycTAtMTg1LTEzMS41LTMxNi41dC0zMTYuNS0xMzEuNS0zMTYuNSAxMzEuNS0xMzEuNSAzMTYuNSAxMzEuNSAzMTYuNSAzMTYuNSAxMzEuNSAzMTYuNS0xMzEuNSAxMzEuNS0zMTYuNXptNTEyIDgzMnEwIDUzLTM3LjUgOTAuNXQtOTAuNSAzNy41cS01NCAwLTkwLTM4bC0zNDMtMzQycS0xNzkgMTI0LTM5OSAxMjQtMTQzIDAtMjczLjUtNTUuNXQtMjI1LTE1MC0xNTAtMjI1LTU1LjUtMjczLjUgNTUuNS0yNzMuNSAxNTAtMjI1IDIyNS0xNTAgMjczLjUtNTUuNSAyNzMuNSA1NS41IDIyNSAxNTAgMTUwIDIyNSA1NS41IDI3My41cTAgMjIwLTEyNCAzOTlsMzQzIDM0M3EzNyAzNyAzNyA5MHoiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-star { + background-image: url(icon_star.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzI4IDY0N3EwIDIyLTI2IDQ4bC0zNjMgMzU0IDg2IDUwMHExIDcgMSAyMCAwIDIxLTEwLjUgMzUuNXQtMzAuNSAxNC41cS0xOSAwLTQwLTEybC00NDktMjM2LTQ0OSAyMzZxLTIyIDEyLTQwIDEyLTIxIDAtMzEuNS0xNC41dC0xMC41LTM1LjVxMC02IDItMjBsODYtNTAwLTM2NC0zNTRxLTI1LTI3LTI1LTQ4IDAtMzcgNTYtNDZsNTAyLTczIDIyNS00NTVxMTktNDEgNDktNDF0NDkgNDFsMjI1IDQ1NSA1MDIgNzNxNTYgOSA1NiA0NnoiIGZpbGw9IiMwMDAiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} +.icon-sponsor { + background-image: url(icon_sponsor.svg), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik04OTYgMTY2NHEtMjYgMC00NC0xOGwtNjI0LTYwMnEtMTAtOC0yNy41LTI2dC01NS41LTY1LjUtNjgtOTcuNS01My41LTEyMS0yMy41LTEzOHEwLTIyMCAxMjctMzQ0dDM1MS0xMjRxNjIgMCAxMjYuNSAyMS41dDEyMCA1OCA5NS41IDY4LjUgNzYgNjhxMzYtMzYgNzYtNjh0OTUuNS02OC41IDEyMC01OCAxMjYuNS0yMS41cTIyNCAwIDM1MSAxMjR0MTI3IDM0NHEwIDIyMS0yMjkgNDUwbC02MjMgNjAwcS0xOCAxOC00NCAxOHoiIGZpbGw9IiNlYTRhYWEiLz48L3N2Zz4=); + background-repeat: no-repeat; + background-size: contain; + padding-left: 20px; + height: 0.9em; + display: inline-block; +} + +.ct-double-octave:after,.ct-major-eleventh:after,.ct-major-second:after,.ct-major-seventh:after,.ct-major-sixth:after,.ct-major-tenth:after,.ct-major-third:after,.ct-major-twelfth:after,.ct-minor-second:after,.ct-minor-seventh:after,.ct-minor-sixth:after,.ct-minor-third:after,.ct-octave:after,.ct-perfect-fifth:after,.ct-perfect-fourth:after,.ct-square:after{content:"";clear:both}.ct-label{fill:rgba(0,0,0,.4);color:rgba(0,0,0,.4);font-size:.75rem;line-height:1}.ct-grid-background,.ct-line{fill:none}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:block;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-vertical.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-label.ct-vertical.ct-end{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(0,0,0,.2);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:10px;stroke-linecap:round}.ct-line{stroke-width:4px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-slice-donut{fill:none;stroke-width:60px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point,.ct-series-a .ct-slice-donut{stroke:#d70206}.ct-series-a .ct-area,.ct-series-a .ct-slice-donut-solid,.ct-series-a .ct-slice-pie{fill:#d70206}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point,.ct-series-b .ct-slice-donut{stroke:#f05b4f}.ct-series-b .ct-area,.ct-series-b .ct-slice-donut-solid,.ct-series-b .ct-slice-pie{fill:#f05b4f}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point,.ct-series-c .ct-slice-donut{stroke:#f4c63d}.ct-series-c .ct-area,.ct-series-c .ct-slice-donut-solid,.ct-series-c .ct-slice-pie{fill:#f4c63d}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point,.ct-series-d .ct-slice-donut{stroke:#d17905}.ct-series-d .ct-area,.ct-series-d .ct-slice-donut-solid,.ct-series-d .ct-slice-pie{fill:#d17905}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point,.ct-series-e .ct-slice-donut{stroke:#453d3f}.ct-series-e .ct-area,.ct-series-e .ct-slice-donut-solid,.ct-series-e .ct-slice-pie{fill:#453d3f}.ct-series-f .ct-bar,.ct-series-f .ct-line,.ct-series-f .ct-point,.ct-series-f .ct-slice-donut{stroke:#59922b}.ct-series-f .ct-area,.ct-series-f .ct-slice-donut-solid,.ct-series-f .ct-slice-pie{fill:#59922b}.ct-series-g .ct-bar,.ct-series-g .ct-line,.ct-series-g .ct-point,.ct-series-g .ct-slice-donut{stroke:#0544d3}.ct-series-g .ct-area,.ct-series-g .ct-slice-donut-solid,.ct-series-g .ct-slice-pie{fill:#0544d3}.ct-series-h .ct-bar,.ct-series-h .ct-line,.ct-series-h .ct-point,.ct-series-h .ct-slice-donut{stroke:#6b0392}.ct-series-h .ct-area,.ct-series-h .ct-slice-donut-solid,.ct-series-h .ct-slice-pie{fill:#6b0392}.ct-series-i .ct-bar,.ct-series-i .ct-line,.ct-series-i .ct-point,.ct-series-i .ct-slice-donut{stroke:#f05b4f}.ct-series-i .ct-area,.ct-series-i .ct-slice-donut-solid,.ct-series-i .ct-slice-pie{fill:#f05b4f}.ct-series-j .ct-bar,.ct-series-j .ct-line,.ct-series-j .ct-point,.ct-series-j .ct-slice-donut{stroke:#dda458}.ct-series-j .ct-area,.ct-series-j .ct-slice-donut-solid,.ct-series-j .ct-slice-pie{fill:#dda458}.ct-series-k .ct-bar,.ct-series-k .ct-line,.ct-series-k .ct-point,.ct-series-k .ct-slice-donut{stroke:#eacf7d}.ct-series-k .ct-area,.ct-series-k .ct-slice-donut-solid,.ct-series-k .ct-slice-pie{fill:#eacf7d}.ct-series-l .ct-bar,.ct-series-l .ct-line,.ct-series-l .ct-point,.ct-series-l .ct-slice-donut{stroke:#86797d}.ct-series-l .ct-area,.ct-series-l .ct-slice-donut-solid,.ct-series-l .ct-slice-pie{fill:#86797d}.ct-series-m .ct-bar,.ct-series-m .ct-line,.ct-series-m .ct-point,.ct-series-m .ct-slice-donut{stroke:#b2c326}.ct-series-m .ct-area,.ct-series-m .ct-slice-donut-solid,.ct-series-m .ct-slice-pie{fill:#b2c326}.ct-series-n .ct-bar,.ct-series-n .ct-line,.ct-series-n .ct-point,.ct-series-n .ct-slice-donut{stroke:#6188e2}.ct-series-n .ct-area,.ct-series-n .ct-slice-donut-solid,.ct-series-n .ct-slice-pie{fill:#6188e2}.ct-series-o .ct-bar,.ct-series-o .ct-line,.ct-series-o .ct-point,.ct-series-o .ct-slice-donut{stroke:#a748ca}.ct-series-o .ct-area,.ct-series-o .ct-slice-donut-solid,.ct-series-o .ct-slice-pie{fill:#a748ca}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:100%}.ct-square:after{display:table}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-minor-second{display:block;position:relative;width:100%}.ct-minor-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:93.75%}.ct-minor-second:after{display:table}.ct-minor-second>svg{display:block;position:absolute;top:0;left:0}.ct-major-second{display:block;position:relative;width:100%}.ct-major-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:88.8888888889%}.ct-major-second:after{display:table}.ct-major-second>svg{display:block;position:absolute;top:0;left:0}.ct-minor-third{display:block;position:relative;width:100%}.ct-minor-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:83.3333333333%}.ct-minor-third:after{display:table}.ct-minor-third>svg{display:block;position:absolute;top:0;left:0}.ct-major-third{display:block;position:relative;width:100%}.ct-major-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:80%}.ct-major-third:after{display:table}.ct-major-third>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{display:table}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fifth{display:block;position:relative;width:100%}.ct-perfect-fifth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-perfect-fifth:after{display:table}.ct-perfect-fifth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-sixth{display:block;position:relative;width:100%}.ct-minor-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-minor-sixth:after{display:table}.ct-minor-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-golden-section{display:block;position:relative;width:100%}.ct-golden-section:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:61.804697157%}.ct-golden-section:after{content:"";display:table;clear:both}.ct-golden-section>svg{display:block;position:absolute;top:0;left:0}.ct-major-sixth{display:block;position:relative;width:100%}.ct-major-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:60%}.ct-major-sixth:after{display:table}.ct-major-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-seventh{display:block;position:relative;width:100%}.ct-minor-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-minor-seventh:after{display:table}.ct-minor-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-seventh{display:block;position:relative;width:100%}.ct-major-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:53.3333333333%}.ct-major-seventh:after{display:table}.ct-major-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-octave{display:block;position:relative;width:100%}.ct-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:50%}.ct-octave:after{display:table}.ct-octave>svg{display:block;position:absolute;top:0;left:0}.ct-major-tenth{display:block;position:relative;width:100%}.ct-major-tenth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:40%}.ct-major-tenth:after{display:table}.ct-major-tenth>svg{display:block;position:absolute;top:0;left:0}.ct-major-eleventh{display:block;position:relative;width:100%}.ct-major-eleventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:37.5%}.ct-major-eleventh:after{display:table}.ct-major-eleventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-twelfth{display:block;position:relative;width:100%}.ct-major-twelfth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:33.3333333333%}.ct-major-twelfth:after{display:table}.ct-major-twelfth>svg{display:block;position:absolute;top:0;left:0}.ct-double-octave{display:block;position:relative;width:100%}.ct-double-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:25%}.ct-double-octave:after{display:table}.ct-double-octave>svg{display:block;position:absolute;top:0;left:0} \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/EditMode/TestCoverageResults_0000.xml b/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/EditMode/TestCoverageResults_0000.xml new file mode 100644 index 000000000..e0fd057ec --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/EditMode/TestCoverageResults_0000.xml @@ -0,0 +1,13585 @@ + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.Editor + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdAssetEditor + + + + 100663297 + System.Void Unity.Formats.USD.UsdAssetEditor::OnEnable() + + + + + + + + + + + + + + + + + + + + + 100663298 + UnityEngine.GameObject Unity.Formats.USD.UsdAssetEditor::GetPrefabObject(UnityEngine.GameObject) + + + + + + + + + + + 100663299 + System.Boolean Unity.Formats.USD.UsdAssetEditor::IsPrefabInstance(UnityEngine.GameObject) + + + + + + + + + + + 100663300 + System.Void Unity.Formats.USD.UsdAssetEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663301 + System.Void Unity.Formats.USD.UsdAssetEditor::DrawSimpleInspector(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.UsdAssetEditor::ReloadFromUsd(Unity.Formats.USD.UsdAsset, System.Boolean) + + + + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.UsdAssetEditor::DestroyAllImportedObjects(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.UsdAssetEditor::DetachFromUsd(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.UsdAssetEditor::ReloadFromUsdAsCoroutine(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + + + + 100663306 + Unity.Formats.USD.UsdAssetEditor::UsdAssetEditor() + + + + + + + + + + + Unity.Formats.USD.UsdLayerStackEditor + + + + 100663307 + System.Void Unity.Formats.USD.UsdLayerStackEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdMenu + + + + 100663309 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportSelectedWithChildren() + + + + + + + + + + + 100663310 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportSelectedWithChildren() + + + + + + + + + + + + + + 100663311 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportTransforms() + + + + + + + + + + + 100663312 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportTransforms() + + + + + + + + + + + + + + 100663313 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportSelectedAsUsdz() + + + + + + + + + + + 100663314 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportSelectedAsUsdz() + + + + + + + + + + + + + + + + + + + + + + + + + 100663315 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsGameObjects() + + + + + + + + + + + + + + + + 100663316 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsPrefab() + + + + + + + + + + + + + + + 100663317 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsTimelineClip() + + + + + + + + + + + + + + + 100663318 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuUnloadSubtree() + + + + + + + + + + + 100663319 + static System.Void Unity.Formats.USD.UsdMenu::MenuUnloadSubtree() + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663320 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuLoadSubtree() + + + + + + + + + + + 100663321 + static System.Void Unity.Formats.USD.UsdMenu::MenuLoadSubtree() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPrimSourceEditor + + + + 100663322 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663323 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DrawAttributeInfo(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663324 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::WalkNodes(pxr.PcpNodeRef) + + + + + + + + + + + + + + + + + + + + + 100663325 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::WalkLayers(pxr.PcpNodeRef, pxr.SdfLayerTreeHandle, System.Int32) + + + + + + + + + + + + + + + + + + + + + 100663326 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DrawAttributeGui(pxr.UsdPrim, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663327 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DebugPrintAttr(USD.NET.Scene, pxr.UsdAttribute, pxr.UsdTimeCode) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663328 + System.Object Unity.Formats.USD.UsdPrimSourceEditor::GetCSharpValue(pxr.UsdAttribute, pxr.UsdTimeCode) + + + + + + + + + + + + + + 100663329 + Unity.Formats.USD.UsdPrimSourceEditor::UsdPrimSourceEditor() + + + + + + + + + + + Unity.Formats.USD.UsdVariantSetEditor + + + + 100663330 + System.Void Unity.Formats.USD.UsdVariantSetEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdBuildPostProcess + + + + 100663332 + static System.Void Unity.Formats.USD.UsdBuildPostProcess::OnPostprocessBuild(UnityEditor.BuildTarget, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663333 + static System.String Unity.Formats.USD.UsdBuildPostProcess::GetCurrentDir(System.String) + + + + + + + + + + + + + + Unity.Formats.USD.PackageUtils + + + + 100663335 + static System.String Unity.Formats.USD.PackageUtils::GetRelativeFolderPath(System.String, System.String) + + + + + + + + + + + + + + + + + + + + + 100663336 + static System.String Unity.Formats.USD.PackageUtils::GetCallerRelativeToProjectFolderPath(System.String) + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T] + + + + 100663337 + System.Void UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]::Initialize(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + 100663338 + static System.Reflection.FieldInfo UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]::GetSerializedField(System.Object, System.String) + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer + + + + 100663340 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer::OnGUI(UnityEngine.Rect, UnityEditor.SerializedProperty, UnityEngine.GUIContent) + + + + + + + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor + + + + 100663342 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor::FileTypeAndFormatGUI() + + + + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorder + + + + 100663344 + UnityEditor.Formats.USD.Recorder.UsdRecorderInput UnityEditor.Formats.USD.Recorder.UsdRecorder::get_Input() + + + + + + + + + 100663345 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::SessionCreated(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663346 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::EndRecording(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663347 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::RecordFrame(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInput + + + + 100663349 + Unity.Formats.USD.ExportContext UnityEditor.Formats.USD.Recorder.UsdRecorderInput::get_Context() + + + + + + + + + 100663350 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::set_Context(Unity.Formats.USD.ExportContext) + + + + + + + + + 100663351 + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings UnityEditor.Formats.USD.Recorder.UsdRecorderInput::get_Settings() + + + + + + + + + 100663352 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::BeginRecording(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + 100663353 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::NewFrameReady(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings + + + + 100663355 + UnityEngine.GameObject UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::get_GameObject() + + + + + + + + + + + + + + 100663356 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::set_GameObject(UnityEngine.GameObject) + + + + + + + + + + + + + + + 100663357 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::ValidityCheck(System.Collections.Generic.List[String]) + + + + + + + + + + + + + + + 100663358 + System.Type UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::get_InputType() + + + + + + + + + 100663359 + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::UsdRecorderInputSettings() + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings + + + + 100663361 + pxr.UsdInterpolationType UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_InterpolationType() + + + + + + + + + 100663362 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_InterpolationType(pxr.UsdInterpolationType) + + + + + + + + + 100663363 + System.Single UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_Scale() + + + + + + + + + 100663364 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_Scale(System.Single) + + + + + + + + + 100663365 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ExportMaterials() + + + + + + + + + 100663366 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_ExportMaterials(System.Boolean) + + + + + + + + + 100663367 + Unity.Formats.USD.ActiveExportPolicy UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ActivePolicy() + + + + + + + + + 100663368 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_ActivePolicy(Unity.Formats.USD.ActiveExportPolicy) + + + + + + + + + 100663369 + Unity.Formats.USD.BasisTransformation UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_BasisTransformation() + + + + + + + + + 100663370 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_BasisTransformation(Unity.Formats.USD.BasisTransformation) + + + + + + + + + 100663371 + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/Format UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ExportFormat() + + + + + + + + + 100663372 + System.String UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_Extension() + + + + + + + + + + + + + + + 100663360 + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::UsdRecorderSettings() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPrimSourceEditor/<>c + + + + 100663376 + System.String Unity.Formats.USD.UsdPrimSourceEditor/<>c::<DrawAttributeInfo>b__3_0(System.Double) + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/<get_InputsSettings>d__29 + + + + 100663379 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/<get_InputsSettings>d__29::MoveNext() + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportMesh + + + + + + + + Unity.Formats.USD.Examples.UsdImportMeshEditor + + + + 100663297 + System.String Unity.Formats.USD.Examples.UsdImportMeshEditor::MakeOversPath(System.String) + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.UsdImportMeshEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ImportMeshExample + + + + 100663300 + USD.NET.Scene Unity.Formats.USD.Examples.ImportMeshExample::get_UsdScene() + + + + + + + + + + + 100663301 + Unity.Formats.USD.PrimMap Unity.Formats.USD.Examples.ImportMeshExample::get_PrimMap() + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::Start() + + + + + + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::Update() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::OnValidate() + + + + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::UnloadGameObjects() + + + + + + + + + + + + + + 100663306 + Unity.Formats.USD.Examples.ImportMeshExample::ImportMeshExample() + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ExportMesh + + + + + + + + + USD.NET.Examples.Explode + + + + 100663297 + System.Void USD.NET.Examples.Explode::Start() + + + + + + + + + + 100663298 + System.Void USD.NET.Examples.Explode::Update() + + + + + + + + + + + + + + + + + + + + + + + + 100663299 + USD.NET.Examples.Explode::Explode() + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ExportMeshExampleEditor + + + + 100663300 + System.Void Unity.Formats.USD.Examples.ExportMeshExampleEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ExportMeshExample + + + + 100663302 + System.Boolean Unity.Formats.USD.Examples.ExportMeshExample::get_IsRecording() + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::set_IsRecording(System.Boolean) + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::StartRecording() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::StopRecording() + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::Awake() + + + + + + + + + + + 100663307 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::LateUpdate() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663308 + static System.Void Unity.Formats.USD.Examples.ExportMeshExample::Export(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.BasisTransformation) + + + + + + + + + + + 100663309 + Unity.Formats.USD.Examples.ExportMeshExample::ExportMeshExample() + + + + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.HelloUsd + + + + + + + Unity.Formats.USD.Examples.HelloUsdExample + + + + 100663297 + System.Void Unity.Formats.USD.Examples.HelloUsdExample::Start() + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.HelloUsdExample::Test() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.Runtime + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.InitUsd + + + + 100663297 + static System.Boolean Unity.Formats.USD.InitUsd::Initialize() + + + + + + + + + + + + + + + + + + + + + + + + 100663298 + static System.Void Unity.Formats.USD.InitUsd::SetupUsdPath(System.String) + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdAsset + + + + 100663300 + System.Double Unity.Formats.USD.UsdAsset::get_Length() + + + + + + + + + + + 100663301 + System.String Unity.Formats.USD.UsdAsset::get_usdFullPath() + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.UsdAsset::set_usdFullPath(System.String) + + + + + + + + + + + 100663303 + UnityEngine.GameObject Unity.Formats.USD.UsdAsset::GetPrefabObject(UnityEngine.GameObject) + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.UsdAsset::OnDestroy() + + + + + + + + + + + + + + + 100663305 + System.String Unity.Formats.USD.UsdAsset::GetPrefabAssetPath(UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.UsdAsset::OptionsToState(Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663307 + System.Void Unity.Formats.USD.UsdAsset::StateToOptions(Unity.Formats.USD.SceneImportOptions&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663308 + System.Boolean Unity.Formats.USD.UsdAsset::SceneFileChanged() + + + + + + + + + + + + + + 100663309 + USD.NET.Scene Unity.Formats.USD.UsdAsset::GetScene() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663310 + System.Void Unity.Formats.USD.UsdAsset::OnReload() + + + + + + + + + + + + + + + + + 100663311 + System.Void Unity.Formats.USD.UsdAsset::DestroyComponent(UnityEngine.Component) + + + + + + + + + + + + + + 100663312 + System.Void Unity.Formats.USD.UsdAsset::ClearLastData() + + + + + + + + + + + + + 100663313 + System.Void Unity.Formats.USD.UsdAsset::RemoveAllUsdComponents() + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663314 + System.Void Unity.Formats.USD.UsdAsset::DestroyAllImportedObjects() + + + + + + + + + + + + + + + + + + + + 100663315 + System.Void Unity.Formats.USD.UsdAsset::Reload(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663316 + pxr.UsdPrim Unity.Formats.USD.UsdAsset::GetFirstPrim(USD.NET.Scene) + + + + + + + + + + + + + + + 100663317 + System.Void Unity.Formats.USD.UsdAsset::ExportOverrides(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663318 + System.Double Unity.Formats.USD.UsdAsset::ComputeLength() + + + + + + + + + + + + + + + 100663319 + System.Void Unity.Formats.USD.UsdAsset::SetTime(System.Double, Unity.Formats.USD.UsdAsset, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663320 + System.Void Unity.Formats.USD.UsdAsset::Update() + + + + + + + + + + + + + + + 100663321 + static System.Void Unity.Formats.USD.UsdAsset::PrepOptionsForTimeChange(Unity.Formats.USD.SceneImportOptions&) + + + + + + + + + + + + + + + + + 100663322 + System.Void Unity.Formats.USD.UsdAsset::ImportUsdAsCoroutine(UnityEngine.GameObject, System.String, System.Double, Unity.Formats.USD.SceneImportOptions, System.Single) + + + + + + + + + + + + + + + + + + + + + + + 100663323 + System.Void Unity.Formats.USD.UsdAsset::SetPayloadState(UnityEngine.GameObject, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663324 + System.Void Unity.Formats.USD.UsdAsset::ApplyVariantSelectionState(USD.NET.Scene, Unity.Formats.USD.UsdVariantSet) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663325 + System.Void Unity.Formats.USD.UsdAsset::SetVariantSelection(UnityEngine.GameObject, System.String, System.Collections.Generic.Dictionary[String,String]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663326 + Unity.Formats.USD.UsdAsset::UsdAsset() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdLayerStack + + + + 100663327 + System.Void Unity.Formats.USD.UsdLayerStack::SetupNewSubLayer(USD.NET.Scene, USD.NET.Scene) + + + + + + + + + + + + + + + 100663328 + System.Void Unity.Formats.USD.UsdLayerStack::SaveLayerStack(USD.NET.Scene, System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663329 + System.Void Unity.Formats.USD.UsdLayerStack::SaveToLayer() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPayload + + + + 100663332 + System.Boolean Unity.Formats.USD.UsdPayload::get_IsLoaded() + + + + + + + + + + + 100663333 + System.Void Unity.Formats.USD.UsdPayload::Load() + + + + + + + + + + + 100663334 + System.Void Unity.Formats.USD.UsdPayload::Unload() + + + + + + + + + + + 100663335 + System.Void Unity.Formats.USD.UsdPayload::SetInitialState(System.Boolean) + + + + + + + + + + + + 100663336 + System.Void Unity.Formats.USD.UsdPayload::Update() + + + + + + + + + + + + + + + + + 100663337 + Unity.Formats.USD.UsdPayload::UsdPayload() + + + + + + + + + + + + Unity.Formats.USD.UsdVariantSet + + + + 100663339 + System.Void Unity.Formats.USD.UsdVariantSet::LoadFromUsd(pxr.UsdPrim) + + + + + + + + + + + + + + + + + 100663340 + System.Void Unity.Formats.USD.UsdVariantSet::ApplyVariantSelections() + + + + + + + + + + + + 100663341 + System.Collections.Generic.Dictionary[String,String] Unity.Formats.USD.UsdVariantSet::GetVariantSelections() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkinnedMeshUnityDiff + + + + 100663343 + System.Void Unity.Formats.USD.SkinnedMeshUnityDiff::OnEnable() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663344 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::Approximately(UnityEngine.Matrix4x4, UnityEngine.Matrix4x4) + + + + + + + + + + + + + + + + + + + 100663345 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::WeightsMatch(UnityEngine.BoneWeight, UnityEngine.BoneWeight) + + + + + + + + + + + 100663346 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::IndicesMatch(UnityEngine.BoneWeight, UnityEngine.BoneWeight) + + + + + + + + + + + 100663347 + System.Void Unity.Formats.USD.SkinnedMeshUnityDiff::Update() + + + + + + + + + + + + Unity.Formats.USD.SkinnedMeshUsdDiff + + + + 100663349 + System.Void Unity.Formats.USD.SkinnedMeshUsdDiff::OnEnable() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663350 + System.String Unity.Formats.USD.SkinnedMeshUsdDiff::GetUsdBoneData[T](System.Int32, System.Int32, USD.NET.Primvar[T[]]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663351 + USD.NET.Scene Unity.Formats.USD.SkinnedMeshUsdDiff::GetScene() + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663352 + Unity.Formats.USD.SkelBindingSample Unity.Formats.USD.SkinnedMeshUsdDiff::ReadUsdWeights(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + 100663353 + Unity.Formats.USD.SkeletonSample Unity.Formats.USD.SkinnedMeshUsdDiff::ReadUsdSkeleton(USD.NET.Scene, System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663354 + System.Void Unity.Formats.USD.SkinnedMeshUsdDiff::Update() + + + + + + + + + + + + Unity.Formats.USD.CameraExporter + + + + 100663356 + static System.Void Unity.Formats.USD.CameraExporter::ExportCamera(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.CameraImporter + + + + 100663357 + static System.Void Unity.Formats.USD.CameraImporter::BuildCamera(USD.NET.Unity.CameraSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + Unity.Formats.USD.CubeImporter + + + + 100663358 + static System.Void Unity.Formats.USD.CubeImporter::BuildCube(USD.NET.Unity.CubeSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663359 + static System.Boolean Unity.Formats.USD.CubeImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663360 + static System.Boolean Unity.Formats.USD.CubeImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + + + Unity.Formats.USD.InstanceImporter + + + + 100663361 + static System.Void Unity.Formats.USD.InstanceImporter::BuildSceneInstances(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663362 + static System.Void Unity.Formats.USD.InstanceImporter::BuildPointInstances(USD.NET.Scene, Unity.Formats.USD.PrimMap, System.String, USD.NET.Unity.PointInstancerSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663363 + static System.Void Unity.Formats.USD.InstanceImporter::EnableGpuInstancing(UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MeshExporter + + + + 100663364 + static System.Void Unity.Formats.USD.MeshExporter::ExportSkinnedMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + 100663365 + static System.Void Unity.Formats.USD.MeshExporter::ExportSkelWeights(USD.NET.Scene, System.String, UnityEngine.Mesh, UnityEngine.Transform, UnityEngine.Transform[], System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663366 + static System.Boolean Unity.Formats.USD.MeshExporter::CanReadMesh(UnityEngine.Mesh) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663367 + static System.Void Unity.Formats.USD.MeshExporter::ExportMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + 100663368 + static System.Void Unity.Formats.USD.MeshExporter::ExportMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Material[], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663369 + static Unity.Formats.USD.MeshExporter::MeshExporter() + + + + + + + + + + + + Unity.Formats.USD.MeshImportStrategy + + + + 100663375 + System.Void Unity.Formats.USD.MeshImportStrategy::BeginReading(USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + 100663374 + Unity.Formats.USD.MeshImportStrategy::MeshImportStrategy(Unity.Formats.USD.MeshImportFunction[SanitizedMeshSample], Unity.Formats.USD.MeshImportFunction[SanitizedMeshSample]) + + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter + + + + 100663377 + static Unity.Formats.USD.MeshImporter/GeometrySubsets Unity.Formats.USD.MeshImporter::ReadGeomSubsets(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663378 + static System.Void Unity.Formats.USD.MeshImporter::BuildSkinnedMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + + + + 100663379 + static System.Void Unity.Formats.USD.MeshImporter::ImportSkinning(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663380 + static System.Void Unity.Formats.USD.MeshImporter::BuildMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + 100663381 + static System.Void Unity.Formats.USD.MeshImporter::BuildMesh_(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, UnityEngine.Renderer, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663382 + static System.Void Unity.Formats.USD.MeshImporter::LoadPrimvars(USD.NET.Scene, UnityEngine.Mesh, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663383 + static System.Void Unity.Formats.USD.MeshImporter::BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + 100663384 + static System.Void Unity.Formats.USD.MeshImporter::BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.Int32, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + + + 100663385 + static Unity.Formats.USD.MeshImporter::TryGetPrimvarValue[T](USD.NET.Primvar[Object]) + + + + + + + + + + + + + 100663386 + static System.Void Unity.Formats.USD.MeshImporter::ImportUv(UnityEngine.Mesh, System.Int32, USD.NET.Primvar[Object]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663387 + static System.Boolean Unity.Formats.USD.MeshImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663388 + static System.Boolean Unity.Formats.USD.MeshImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663389 + static System.String Unity.Formats.USD.MeshImporter::UniqueMeshName(System.String) + + + + + + + + + + + + + + Unity.Formats.USD.MeshImportOptions + + + + 100663390 + Unity.Formats.USD.MeshImportOptions::MeshImportOptions() + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SphereImporter + + + + 100663391 + static System.Void Unity.Formats.USD.SphereImporter::BuildSphere(USD.NET.Unity.SphereSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663392 + static System.Boolean Unity.Formats.USD.SphereImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663393 + static System.Boolean Unity.Formats.USD.SphereImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + + + Unity.Formats.USD.XformExporter + + + + 100663394 + static System.Void Unity.Formats.USD.XformExporter::ExportXform(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + 100663395 + static System.Void Unity.Formats.USD.XformExporter::WriteSparseOverrides(USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.BasisTransformation, System.Single) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663396 + static UnityEngine.Matrix4x4 Unity.Formats.USD.XformExporter::GetLocalTransformMatrix(UnityEngine.Transform, System.Boolean, System.Boolean, Unity.Formats.USD.BasisTransformation) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.XformImporter + + + + 100663397 + static System.Void Unity.Formats.USD.XformImporter::BuildXform(pxr.SdfPath, USD.NET.Unity.XformableSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + 100663398 + static System.Void Unity.Formats.USD.XformImporter::BuildXform(UnityEngine.Matrix4x4, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + 100663399 + static System.Void Unity.Formats.USD.XformImporter::ImportXform(UnityEngine.Matrix4x4&, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + 100663400 + static System.Void Unity.Formats.USD.XformImporter::BuildSceneRoot(USD.NET.Scene, UnityEngine.Transform, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663401 + static System.Void Unity.Formats.USD.XformImporter::UndoRootTransform(USD.NET.Scene, Unity.Formats.USD.UsdAsset, UnityEngine.Vector3&, UnityEngine.Quaternion&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ImporterBase + + + + 100663402 + static System.String Unity.Formats.USD.ImporterBase::MakeRelativePath(System.String, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663403 + static System.Boolean Unity.Formats.USD.ImporterBase::ApproximatelyEqual(UnityEngine.Matrix4x4, UnityEngine.Matrix4x4) + + + + + + + + + + + + + + + + + + 100663404 + static System.Void Unity.Formats.USD.ImporterBase::MoveComponentFirst(UnityEngine.Component) + + + + + + + + + + + + + 100663405 + static System.Void Unity.Formats.USD.ImporterBase::MoveComponentLast(UnityEngine.Component) + + + + + + + + + + + + + 100663406 + static T Unity.Formats.USD.ImporterBase::GetOrAddComponent[T](UnityEngine.GameObject, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HdrpShaderExporter + + + + 100663407 + static System.Void Unity.Formats.USD.HdrpShaderExporter::ExportLit(USD.NET.Scene, System.String, UnityEngine.Material, USD.NET.Unity.PreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HdrpShaderImporter + + + + 100663410 + System.Void Unity.Formats.USD.HdrpShaderImporter::ImportFromUsd() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663411 + static UnityEngine.Texture2D Unity.Formats.USD.HdrpShaderImporter::BuildMaskMap(UnityEngine.Texture2D, UnityEngine.Texture2D, UnityEngine.Texture2D, UnityEngine.Texture2D) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663409 + Unity.Formats.USD.HdrpShaderImporter::HdrpShaderImporter(UnityEngine.Material) + + + + + + + + + + + + + Unity.Formats.USD.MaterialExporter + + + + 100663413 + static System.Void Unity.Formats.USD.MaterialExporter::ExportMaterial(USD.NET.Scene, UnityEngine.Material, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663412 + static Unity.Formats.USD.MaterialExporter::MaterialExporter() + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MaterialImporter + + + + 100663414 + static System.Void Unity.Formats.USD.MaterialImporter::ProcessMaterialBindings(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663415 + static UnityEngine.Material Unity.Formats.USD.MaterialImporter::BuildMaterial(USD.NET.Scene, System.String, USD.NET.Unity.MaterialSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663416 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::ImportConnectedTexture[T](USD.NET.Scene, USD.NET.Connectable[T], System.Boolean, Unity.Formats.USD.SceneImportOptions, System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663417 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::DefaultTextureResolver(pxr.SdfAssetPath, System.Boolean, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663418 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::CombineRoughness(UnityEngine.Texture2D, UnityEngine.Texture2D, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663419 + static Unity.Formats.USD.UnityPreviewSurfaceSample Unity.Formats.USD.MaterialImporter::GetSurfaceShaderPrim(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + 100663420 + static Unity.Formats.USD.MaterialImporter::MaterialImporter() + + + + + + + + + + + Unity.Formats.USD.MaterialMap + + + + 100663421 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_DisplayColorMaterial() + + + + + + + + + + + + + 100663422 + System.Void Unity.Formats.USD.MaterialMap::set_DisplayColorMaterial(UnityEngine.Material) + + + + + + + + + + + 100663423 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_SpecularWorkflowMaterial() + + + + + + + + + + + + + 100663424 + System.Void Unity.Formats.USD.MaterialMap::set_SpecularWorkflowMaterial(UnityEngine.Material) + + + + + + + + + + + 100663425 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_MetallicWorkflowMaterial() + + + + + + + + + + + + + 100663426 + System.Void Unity.Formats.USD.MaterialMap::set_MetallicWorkflowMaterial(UnityEngine.Material) + + + + + + + + + + + 100663427 + System.Void Unity.Formats.USD.MaterialMap::InstantiateMaterials() + + + + + + + + + + + + + + + + + + + + + + 100663428 + System.Collections.Generic.Dictionary[String,MaterialBinder] Unity.Formats.USD.MaterialMap::ClearRequestedBindings() + + + + + + + + + + + + + 100663429 + System.Void Unity.Formats.USD.MaterialMap::RequestBinding(System.String, Unity.Formats.USD.MaterialMap/MaterialBinder) + + + + + + + + + + + 100663430 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_Item(System.String) + + + + + + + + + + + + + + 100663431 + System.Void Unity.Formats.USD.MaterialMap::set_Item(System.String, UnityEngine.Material) + + + + + + + + + + + 100663432 + System.Collections.Generic.List[String] Unity.Formats.USD.MaterialMap::GetPrimvars(System.String) + + + + + + + + + + + + 100663433 + System.Void Unity.Formats.USD.MaterialMap::SetPrimvars(System.String, System.Collections.Generic.List[String]) + + + + + + + + + + + 100663434 + UnityEngine.Material Unity.Formats.USD.MaterialMap::InstantiateSolidColor(UnityEngine.Color) + + + + + + + + + + + + + + + + + 100663435 + static System.Void Unity.Formats.USD.MaterialMap::AssignColor(UnityEngine.Material, UnityEngine.Color) + + + + + + + + + + + + + + + + + + 100663436 + System.Collections.IEnumerator Unity.Formats.USD.MaterialMap::GetEnumerator() + + + + + + + + + + + 100663437 + System.Collections.Generic.IEnumerator[KeyValuePair`2] Unity.Formats.USD.MaterialMap::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,UnityEngine.Material>>.GetEnumerator() + + + + + + + + + + + 100663438 + Unity.Formats.USD.MaterialMap::MaterialMap() + + + + + + + + + + + + + + Unity.Formats.USD.ShaderExporterBase + + + + 100663439 + static System.String Unity.Formats.USD.ShaderExporterBase::SetupTexture(USD.NET.Scene, System.String, UnityEngine.Material, USD.NET.Unity.PreviewSurfaceSample, UnityEngine.Vector4, System.String, System.String, System.String, Unity.Formats.USD.ShaderExporterBase/ConversionType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ShaderImporterBase + + + + 100663441 + UnityEngine.Material Unity.Formats.USD.ShaderImporterBase::get_Material() + + + + + + + + + 100663442 + System.Void Unity.Formats.USD.ShaderImporterBase::set_Material(UnityEngine.Material) + + + + + + + + + 100663443 + System.Boolean Unity.Formats.USD.ShaderImporterBase::get_IsSpecularWorkflow() + + + + + + + + + 100663444 + System.Void Unity.Formats.USD.ShaderImporterBase::set_IsSpecularWorkflow(System.Boolean) + + + + + + + + + 100663447 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportColorOrMap(USD.NET.Scene, USD.NET.Connectable[Vector3], System.Boolean, Unity.Formats.USD.SceneImportOptions, UnityEngine.Texture2D&, System.Nullable`1[[UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, System.String&) + + + + + + + + + + + + + + + + + + + 100663448 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportValueOrMap[T](USD.NET.Scene, USD.NET.Connectable[T], System.Boolean, Unity.Formats.USD.SceneImportOptions, UnityEngine.Texture2D&, , System.String&) + + + + + + + + + + + + + + + + + + 100663449 + System.Void Unity.Formats.USD.ShaderImporterBase::MergePrimvars(System.String, System.Collections.Generic.List[String]) + + + + + + + + + + + + + + + + + + 100663450 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportParametersFromUsd(USD.NET.Scene, System.String, USD.NET.Unity.MaterialSample, USD.NET.Unity.PreviewSurfaceSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663445 + Unity.Formats.USD.ShaderImporterBase::ShaderImporterBase(UnityEngine.Material) + + + + + + + + + + + + + + Unity.Formats.USD.StandardShaderExporter + + + + 100663451 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardSpecular(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663452 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardRoughness(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663453 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandard(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663454 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportGeneric(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663455 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardCommon(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.StandardShaderImporter + + + + 100663458 + System.Void Unity.Formats.USD.StandardShaderImporter::ImportFromUsd() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663457 + Unity.Formats.USD.StandardShaderImporter::StandardShaderImporter(UnityEngine.Material) + + + + + + + + + + + + + Unity.Formats.USD.UnityMaterialData + + + + 100663459 + Unity.Formats.USD.UnityMaterialData::UnityMaterialData() + + + + + + + + + + + + + Unity.Formats.USD.UnityPreviewSurfaceSample + + + + 100663460 + Unity.Formats.USD.UnityPreviewSurfaceSample::UnityPreviewSurfaceSample() + + + + + + + + + + + Unity.Formats.USD.ReadAllJob[T] + + + + 100663461 + USD.NET.SampleHolder Unity.Formats.USD.ReadAllJob[T]::get_Current() + + + + + + + + + + + 100663462 + System.Object Unity.Formats.USD.ReadAllJob[T].System.Collections.IEnumerator::get_Current() + + + + + + + + + + + 100663464 + System.Boolean Unity.Formats.USD.ReadAllJob[T]::ShouldReadPath(USD.NET.Scene, pxr.SdfPath) + + + + + + + + + + + 100663465 + System.Void Unity.Formats.USD.ReadAllJob[T]::Run() + + + + + + + + + + + + + + + + 100663466 + System.Void Unity.Formats.USD.ReadAllJob[T]::Execute(System.Int32) + + + + + + + + + + + + + + + + + + + + + + 100663467 + System.Boolean Unity.Formats.USD.ReadAllJob[T]::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663468 + System.Void Unity.Formats.USD.ReadAllJob[T]::Reset() + + + + + + + + + + + + + + + + 100663469 + System.Void Unity.Formats.USD.ReadAllJob[T]::Dispose() + + + + + + + + + + + 100663470 + System.Collections.Generic.IEnumerator[SampleHolder] Unity.Formats.USD.ReadAllJob[T]::GetEnumerator() + + + + + + + + + + + 100663471 + System.Collections.IEnumerator Unity.Formats.USD.ReadAllJob[T].System.Collections.IEnumerable::GetEnumerator() + + + + + + + + + + + 100663463 + Unity.Formats.USD.ReadAllJob[T]::ReadAllJob(USD.NET.Scene, pxr.SdfPath[], Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedXformSample + + + + 100663473 + System.Void Unity.Formats.USD.SanitizedXformSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedCameraSample + + + + 100663475 + System.Void Unity.Formats.USD.SanitizedCameraSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedMeshSample + + + + 100663477 + System.Void Unity.Formats.USD.SanitizedMeshSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663478 + System.Void Unity.Formats.USD.SanitizedMeshSample::Triangulate(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663479 + System.Boolean Unity.Formats.USD.SanitizedMeshSample::ShouldUnweldVertices(System.Boolean) + + + + + + + + + + + 100663480 + static System.Void Unity.Formats.USD.SanitizedMeshSample::Flatten[T](, System.Int32[]) + + + + + + + + + + + + + + + + + + + + 100663481 + System.Void Unity.Formats.USD.SanitizedMeshSample::UnweldUVs(USD.NET.Primvar[Object], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663482 + static System.Void Unity.Formats.USD.SanitizedMeshSample::FlattenUVs(USD.NET.Primvar[Object]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663483 + static System.Void Unity.Formats.USD.SanitizedMeshSample::TriangulateAttributes[T](, System.Int32[], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663484 + System.Void Unity.Formats.USD.SanitizedMeshSample::ConvertInterpolationToFaceVarying[T](, System.Int32[], System.Boolean, pxr.TfToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663485 + pxr.TfToken Unity.Formats.USD.SanitizedMeshSample::GuessInterpolation(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + 100663486 + System.Void Unity.Formats.USD.SanitizedMeshSample::UniformToFaceVarying[T](, System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663487 + static System.Void Unity.Formats.USD.SanitizedMeshSample::ComputeNormals(UnityEngine.Vector3[], System.Int32[], UnityEngine.Vector3[]&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663488 + System.Boolean Unity.Formats.USD.SanitizedMeshSample::ShouldUnwindVertices(System.Boolean) + + + + + + + + + + + + + Unity.Formats.USD.ExportHelpers + + + + 100663490 + static USD.NET.Scene Unity.Formats.USD.ExportHelpers::InitForSave(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663491 + static System.Void Unity.Formats.USD.ExportHelpers::ExportGameObjects(UnityEngine.GameObject[], USD.NET.Scene, Unity.Formats.USD.BasisTransformation, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder + + + + 100663492 + static Unity.Jobs.JobHandle Unity.Formats.USD.HierarchyBuilder::BeginReading(USD.NET.Scene, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663493 + static Unity.Formats.USD.HierarchyBuilder/HierInfo[] Unity.Formats.USD.HierarchyBuilder::BuildObjectLists(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + 100663494 + static Unity.Formats.USD.PrimMap Unity.Formats.USD.HierarchyBuilder::BuildGameObjects(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, System.Collections.Generic.IEnumerable[SdfPath], Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663495 + static System.Boolean Unity.Formats.USD.HierarchyBuilder::IsVisible(pxr.UsdPrim) + + + + + + + + + + + + + + + + + + + + + + 100663496 + static System.Void Unity.Formats.USD.HierarchyBuilder::ApplySelfVisibility(UnityEngine.GameObject, pxr.UsdPrim) + + + + + + + + + + + + + + + + + 100663497 + static System.Void Unity.Formats.USD.HierarchyBuilder::CreateAncestors(pxr.SdfPath, Unity.Formats.USD.PrimMap, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.SceneImportOptions, UnityEngine.GameObject&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663498 + static System.Void Unity.Formats.USD.HierarchyBuilder::ProcessPaths(Unity.Formats.USD.HierarchyBuilder/HierInfo[], USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663499 + static System.Void Unity.Formats.USD.HierarchyBuilder::PopulateSkelCache(Unity.Formats.USD.HierarchyBuilder/HierInfo&, pxr.UsdSkelCache) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663500 + static System.Void Unity.Formats.USD.HierarchyBuilder::ReadSkeletonJoints(Unity.Formats.USD.HierarchyBuilder/HierInfo&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663501 + static System.Void Unity.Formats.USD.HierarchyBuilder::ExpandSkeleton(Unity.Formats.USD.HierarchyBuilder/HierInfo, UnityEngine.GameObject, pxr.SdfPath, pxr.UsdPrim, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663502 + static System.Void Unity.Formats.USD.HierarchyBuilder::ReadModelInfo(Unity.Formats.USD.HierarchyBuilder/HierInfo&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663503 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddModelRoot(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663504 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddPayload(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + 100663505 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddVariantSet(UnityEngine.GameObject, pxr.UsdPrim) + + + + + + + + + + + + + + + + + + + + + + + + 100663506 + static UnityEngine.GameObject Unity.Formats.USD.HierarchyBuilder::FindOrCreateGameObject(UnityEngine.Transform, pxr.SdfPath, UnityEngine.Transform, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663507 + static Unity.Formats.USD.HierarchyBuilder::HierarchyBuilder() + + + + + + + + + + + Unity.Formats.USD.ImportHelpers + + + + 100663508 + static UnityEngine.GameObject Unity.Formats.USD.ImportHelpers::ImportSceneAsGameObject(USD.NET.Scene, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663509 + static System.String Unity.Formats.USD.ImportHelpers::ImportAsPrefab(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663510 + static System.String Unity.Formats.USD.ImportHelpers::ImportAsTimelineClip(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663511 + static System.String Unity.Formats.USD.ImportHelpers::GetSelectedAssetPath() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663512 + static USD.NET.Scene Unity.Formats.USD.ImportHelpers::InitForOpen(System.String, pxr.UsdStage/InitialLoadSet) + + + + + + + + + + + + + + + + + 100663513 + static pxr.SdfPath Unity.Formats.USD.ImportHelpers::GetDefaultRoot(USD.NET.Scene) + + + + + + + + + + + + + + + 100663514 + static UnityEngine.GameObject Unity.Formats.USD.ImportHelpers::UsdToGameObject(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + 100663515 + static System.String Unity.Formats.USD.ImportHelpers::GetObjectName(pxr.SdfPath, System.String) + + + + + + + + + + + 100663516 + static System.String Unity.Formats.USD.ImportHelpers::GetObjectName(System.String) + + + + + + + + + + + 100663517 + static System.String Unity.Formats.USD.ImportHelpers::GetPrefabName(System.String) + + + + + + + + + + + + 100663518 + static System.String Unity.Formats.USD.ImportHelpers::GetPrefabPath(System.String, System.String) + + + + + + + + + + + + + + + + + Unity.Formats.USD.PrimMap + + + + 100663522 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Cameras() + + + + + + + + + 100663523 + System.Void Unity.Formats.USD.PrimMap::set_Cameras(pxr.SdfPath[]) + + + + + + + + + 100663524 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Meshes() + + + + + + + + + 100663525 + System.Void Unity.Formats.USD.PrimMap::set_Meshes(pxr.SdfPath[]) + + + + + + + + + 100663526 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Cubes() + + + + + + + + + 100663527 + System.Void Unity.Formats.USD.PrimMap::set_Cubes(pxr.SdfPath[]) + + + + + + + + + 100663528 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Spheres() + + + + + + + + + 100663529 + System.Void Unity.Formats.USD.PrimMap::set_Spheres(pxr.SdfPath[]) + + + + + + + + + 100663530 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Xforms() + + + + + + + + + 100663531 + System.Void Unity.Formats.USD.PrimMap::set_Xforms(pxr.SdfPath[]) + + + + + + + + + 100663532 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_SkelRoots() + + + + + + + + + 100663533 + System.Void Unity.Formats.USD.PrimMap::set_SkelRoots(pxr.SdfPath[]) + + + + + + + + + 100663534 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Skeletons() + + + + + + + + + 100663535 + System.Void Unity.Formats.USD.PrimMap::set_Skeletons(pxr.SdfPath[]) + + + + + + + + + 100663536 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Materials() + + + + + + + + + 100663537 + System.Void Unity.Formats.USD.PrimMap::set_Materials(pxr.SdfPath[]) + + + + + + + + + 100663539 + UnityEngine.GameObject Unity.Formats.USD.PrimMap::get_Item(pxr.SdfPath) + + + + + + + + + + + + + + 100663540 + System.Void Unity.Formats.USD.PrimMap::set_Item(pxr.SdfPath, UnityEngine.GameObject) + + + + + + + + + + + 100663541 + System.Boolean Unity.Formats.USD.PrimMap::TryGetValue(pxr.SdfPath, UnityEngine.GameObject&) + + + + + + + + + + + 100663542 + System.Collections.IEnumerator Unity.Formats.USD.PrimMap::GetEnumerator() + + + + + + + + + + + 100663543 + System.Collections.Generic.IEnumerator[KeyValuePair`2] Unity.Formats.USD.PrimMap::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<pxr.SdfPath,UnityEngine.GameObject>>.GetEnumerator() + + + + + + + + + + + 100663544 + System.Void Unity.Formats.USD.PrimMap::AddInstance(UnityEngine.GameObject) + + + + + + + + + + + 100663545 + System.Void Unity.Formats.USD.PrimMap::AddMasterRoot(pxr.SdfPath, UnityEngine.GameObject) + + + + + + + + + + + + 100663546 + System.Void Unity.Formats.USD.PrimMap::AddInstanceRoot(pxr.SdfPath, UnityEngine.GameObject, pxr.SdfPath) + + + + + + + + + + + 100663547 + System.Collections.Generic.KeyCollection Unity.Formats.USD.PrimMap::GetMasterRootPaths() + + + + + + + + + + + 100663548 + System.Collections.Generic.ValueCollection Unity.Formats.USD.PrimMap::GetInstanceRoots() + + + + + + + + + + + 100663549 + System.Void Unity.Formats.USD.PrimMap::DestroyAll() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663550 + System.Void Unity.Formats.USD.PrimMap::Clear() + + + + + + + + + + + + + + + + + + + + + + 100663538 + Unity.Formats.USD.PrimMap::PrimMap() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ExportContext + + + + 100663559 + Unity.Formats.USD.ExportContext::ExportContext() + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ExportPlan + + + + 100663561 + Unity.Formats.USD.ExportPlan::ExportPlan() + + + + + + + + + + + Unity.Formats.USD.SceneExporter + + + + 100663562 + static System.Void Unity.Formats.USD.SceneExporter::Export(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.BasisTransformation, System.Boolean, System.Boolean, System.Boolean, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + 100663563 + static System.Void Unity.Formats.USD.SceneExporter::Export(UnityEngine.GameObject, Unity.Formats.USD.ExportContext, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663564 + static System.Void Unity.Formats.USD.SceneExporter::ExportImpl(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663565 + static System.Void Unity.Formats.USD.SceneExporter::Traverse(UnityEngine.GameObject, Unity.Formats.USD.ObjectProcessor, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + 100663566 + static System.Void Unity.Formats.USD.SceneExporter::AccumNestedBones(UnityEngine.Transform, System.Collections.Generic.List[Transform], Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + 100663567 + static T Unity.Formats.USD.SceneExporter::CreateSample[T](Unity.Formats.USD.ExportContext) + + + + + + + + + + + 100663568 + static System.Void Unity.Formats.USD.SceneExporter::SyncExportContext(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663569 + static System.Void Unity.Formats.USD.SceneExporter::InitExportableObjects(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663570 + static UnityEngine.Transform Unity.Formats.USD.SceneExporter::MergeBonesBelowAnimator(UnityEngine.Transform, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663571 + static System.Void Unity.Formats.USD.SceneExporter::MergeBonesSimple(UnityEngine.Transform, UnityEngine.Transform, UnityEngine.Transform[], UnityEngine.Matrix4x4[], Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663572 + static System.Void Unity.Formats.USD.SceneExporter::CreateExportPlan(UnityEngine.GameObject, USD.NET.SampleBase, Unity.Formats.USD.ExportFunction, Unity.Formats.USD.ExportContext, System.String, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663573 + static UnityEngine.Matrix4x4 Unity.Formats.USD.SceneExporter::ComputeWorldXf(UnityEngine.Transform, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + Unity.Formats.USD.SceneImporter + + + + 100663577 + static System.Void Unity.Formats.USD.SceneImporter::SavePrefab(UnityEngine.GameObject, System.String, System.String, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663578 + static System.Void Unity.Formats.USD.SceneImporter::AddObjectsToAsset(UnityEngine.GameObject, UnityEngine.Object, Unity.Formats.USD.SceneImportOptions, System.Collections.Generic.HashSet`1[[UnityEngine.Mesh, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, System.Collections.Generic.HashSet`1[[UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663579 + static System.Void Unity.Formats.USD.SceneImporter::ImportUsd(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + 100663580 + static System.Void Unity.Formats.USD.SceneImporter::ImportUsd(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.PrimMap, System.Boolean, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + 100663581 + static Unity.Formats.USD.PrimMap Unity.Formats.USD.SceneImporter::BuildScene(USD.NET.Scene, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, Unity.Formats.USD.PrimMap, System.Boolean) + + + + + + + + + + + + + + + + + + + + 100663582 + static System.Void Unity.Formats.USD.SceneImporter::RemoveComponent[T](UnityEngine.GameObject) + + + + + + + + + + + + + + + 100663584 + static System.Boolean Unity.Formats.USD.SceneImporter::ShouldYield(System.Single, System.Diagnostics.Stopwatch) + + + + + + + + + + + 100663585 + static System.Void Unity.Formats.USD.SceneImporter::ResetTimer(System.Diagnostics.Stopwatch) + + + + + + + + + + + + + 100663586 + static System.Boolean Unity.Formats.USD.SceneImporter::IsSkinnedMesh(pxr.UsdPrim, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + 100663576 + static Unity.Formats.USD.SceneImporter::SceneImporter() + + + + + + + + + + + + + Unity.Formats.USD.SceneImportOptions + + + + 100663587 + System.Boolean Unity.Formats.USD.SceneImportOptions::get_ShouldBindMaterials() + + + + + + + + + + + 100663588 + Unity.Formats.USD.SceneImportOptions::SceneImportOptions() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdzExporter + + + + 100663589 + static System.Void Unity.Formats.USD.UsdzExporter::ExportUsdz(System.String, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkeletonExporter + + + + 100663591 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkeleton(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663592 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkelRoot(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663593 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkelAnimation(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkeletonImporter + + + + 100663594 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildSkeletonBone(System.String, UnityEngine.GameObject, UnityEngine.Matrix4x4, pxr.VtTokenArray, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663595 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildDebugBindTransforms(Unity.Formats.USD.SkeletonSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663596 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildBindTransforms(System.String, Unity.Formats.USD.SkeletonSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + 100663597 + static System.Boolean Unity.Formats.USD.SkeletonImporter::JointsMatch(System.String[], System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663598 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildSkinnedMesh(System.String, System.String, Unity.Formats.USD.SkeletonSample, pxr.UsdSkelSkinningQuery, UnityEngine.GameObject, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkelBindingSample + + + + 100663600 + Unity.Formats.USD.SkelBindingSample::SkelBindingSample() + + + + + + + + + + + + + + + + Unity.Formats.USD.SkelRootSample + + + + 100663601 + Unity.Formats.USD.SkelRootSample::SkelRootSample() + + + + + + + + + + + + Unity.Formats.USD.SkeletonIo + + + + 100663605 + UnityEngine.Transform[] Unity.Formats.USD.SkeletonIo::GetBones(UnityEngine.Transform) + + + + + + + + + + + 100663606 + System.Void Unity.Formats.USD.SkeletonIo::RegisterSkeleton(UnityEngine.Transform, UnityEngine.Transform[]) + + + + + + + + + + + 100663607 + Unity.Formats.USD.SkeletonIo::SkeletonIo() + + + + + + + + + + + Unity.Formats.USD.NativeExporter + + + + 100663608 + static System.Void Unity.Formats.USD.NativeExporter::ExportObject(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + 100663609 + static System.Void Unity.Formats.USD.NativeExporter::ObjectToUsd(UnityEngine.GameObject, pxr.UsdPrim, USD.NET.Scene) + + + + + + + + + + + + + + + + + + 100663610 + static System.Void Unity.Formats.USD.NativeExporter::ComponentToUsd(UnityEngine.Component, System.String, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + 100663611 + static System.Void Unity.Formats.USD.NativeExporter::PropertyToUsd(System.String, System.String, USD.NET.Scene, UnityEditor.SerializedProperty, System.Text.StringBuilder) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.NativeImporter + + + + 100663613 + static System.Void Unity.Formats.USD.NativeImporter::ImportObject(USD.NET.Scene, UnityEngine.GameObject, pxr.UsdPrim, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663614 + static System.Void Unity.Formats.USD.NativeImporter::PropertyFromUsd(pxr.UsdPrim, UnityEditor.SerializedProperty, System.Text.StringBuilder, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.NativeSerialization + + + + 100663616 + static System.String Unity.Formats.USD.NativeSerialization::ValueToString(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663617 + static pxr.VtValue Unity.Formats.USD.NativeSerialization::PropToVtValue(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663618 + static System.Void Unity.Formats.USD.NativeSerialization::VtValueToProp(UnityEditor.SerializedProperty, pxr.VtValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663619 + static pxr.SdfValueTypeName Unity.Formats.USD.NativeSerialization::GetSdfType(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPlayableAsset + + + + 100663620 + UnityEngine.Timeline.ClipCaps Unity.Formats.USD.UsdPlayableAsset::get_clipCaps() + + + + + + + + + + + 100663621 + Unity.Formats.USD.UsdAsset Unity.Formats.USD.UsdPlayableAsset::GetUsdAsset(System.String) + + + + + + + + + + + + 100663622 + UnityEngine.Playables.Playable Unity.Formats.USD.UsdPlayableAsset::CreatePlayable(UnityEngine.Playables.PlayableGraph, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + 100663623 + System.Double Unity.Formats.USD.UsdPlayableAsset::get_duration() + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPlayableBehaviour + + + + 100663625 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnGraphStart(UnityEngine.Playables.Playable) + + + + + + + + + + + 100663626 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnGraphStop(UnityEngine.Playables.Playable) + + + + + + + + + + 100663627 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnBehaviourPlay(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663628 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnBehaviourPause(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663629 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::PrepareFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663630 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::ProcessFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663631 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::PrepareData(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663632 + Unity.Formats.USD.UsdPlayableBehaviour::UsdPlayableBehaviour() + + + + + + + + + + + Unity.Formats.USD.UsdPlayableTrack + + + + 100663633 + System.Void Unity.Formats.USD.UsdPlayableTrack::OnCreateClip(UnityEngine.Timeline.TimelineClip) + + + + + + + + + + + + + + Unity.Formats.USD.UsdRecorderBehaviour + + + + 100663635 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::BeginRecording(System.Double, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663636 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::StopRecording(System.Double) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663637 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::ProcessRecording(System.Double, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + 100663638 + System.Boolean Unity.Formats.USD.UsdRecorderBehaviour::IsPlaying() + + + + + + + + + + + 100663639 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnPlayableCreate(UnityEngine.Playables.Playable) + + + + + + + + + + 100663640 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnPlayableDestroy(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663641 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnGraphStart(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663642 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnGraphStop(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663643 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::ProcessFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + + + + + + 100663644 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnBehaviourPlay(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + + 100663645 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnBehaviourPause(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + + 100663646 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnFrameEnd(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + 100663647 + Unity.Formats.USD.UsdRecorderBehaviour::UsdRecorderBehaviour() + + + + + + + + + + + Unity.Formats.USD.UsdRecorderClip + + + + 100663648 + USD.NET.Scene Unity.Formats.USD.UsdRecorderClip::get_UsdScene() + + + + + + + + + 100663649 + System.Void Unity.Formats.USD.UsdRecorderClip::set_UsdScene(USD.NET.Scene) + + + + + + + + + 100663650 + Unity.Formats.USD.ExportContext Unity.Formats.USD.UsdRecorderClip::get_Context() + + + + + + + + + + + 100663651 + System.Void Unity.Formats.USD.UsdRecorderClip::set_Context(Unity.Formats.USD.ExportContext) + + + + + + + + + + + 100663652 + UnityEngine.GameObject Unity.Formats.USD.UsdRecorderClip::GetExportRoot(UnityEngine.Playables.PlayableGraph) + + + + + + + + + + + 100663653 + UnityEngine.Timeline.ClipCaps Unity.Formats.USD.UsdRecorderClip::get_clipCaps() + + + + + + + + + + + 100663654 + System.Boolean Unity.Formats.USD.UsdRecorderClip::get_IsUSDZ() + + + + + + + + + 100663655 + UnityEngine.Playables.Playable Unity.Formats.USD.UsdRecorderClip::CreatePlayable(UnityEngine.Playables.PlayableGraph, UnityEngine.GameObject) + + + + + + + + + + + + + + 100663656 + System.Void Unity.Formats.USD.UsdRecorderClip::OnDestroy() + + + + + + + + + + 100663657 + Unity.Formats.USD.UsdRecorderClip::UsdRecorderClip() + + + + + + + + + + + + + + + Unity.Formats.USD.UsdWaitForEndOfFrame + + + + 100663659 + static Unity.Formats.USD.UsdWaitForEndOfFrame Unity.Formats.USD.UsdWaitForEndOfFrame::GetInstance() + + + + + + + + + + + + + + + + + + + + + + 100663660 + static System.Void Unity.Formats.USD.UsdWaitForEndOfFrame::Add(System.Action) + + + + + + + + + + + 100663662 + System.Void Unity.Formats.USD.UsdWaitForEndOfFrame::LateUpdate() + + + + + + + + + + + 100663663 + Unity.Formats.USD.UsdWaitForEndOfFrame::UsdWaitForEndOfFrame() + + + + + + + + + + + Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0 + + + + 100663665 + System.String Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__0(System.String) + + + + + + + + + 100663666 + System.Collections.Generic.IEnumerable[String] Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__1(System.String) + + + + + + + + + 100663667 + System.Int32 Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__2(System.String) + + + + + + + + + + + Unity.Formats.USD.MeshImportStrategy/<Import>d__5 + + + + 100663670 + System.Boolean Unity.Formats.USD.MeshImportStrategy/<Import>d__5::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter/GeometrySubsets + + + + 100663675 + System.Collections.Generic.Dictionary[String,Int32[]] Unity.Formats.USD.MeshImporter/GeometrySubsets::get_Subsets() + + + + + + + + + 100663676 + System.Void Unity.Formats.USD.MeshImporter/GeometrySubsets::set_Subsets(System.Collections.Generic.Dictionary[String,Int32[]]) + + + + + + + + + 100663677 + Unity.Formats.USD.MeshImporter/GeometrySubsets::GeometrySubsets() + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_0 + + + + 100663679 + System.Void Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_0::<BuildMesh_>b__0(USD.NET.Scene, UnityEngine.Material, System.Collections.Generic.List[String]) + + + + + + + + + + + Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_1 + + + + 100663681 + System.Void Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_1::<BuildMesh_>b__1(USD.NET.Scene, UnityEngine.Material, System.Collections.Generic.List[String]) + + + + + + + + + + + Unity.Formats.USD.ShaderImporterBase/<>c__DisplayClass31_0 + + + + 100663695 + System.Boolean Unity.Formats.USD.ShaderImporterBase/<>c__DisplayClass31_0::<MergePrimvars>b__0(System.String) + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/ReadHierJob + + + + 100663696 + System.Void Unity.Formats.USD.HierarchyBuilder/ReadHierJob::Run() + + + + + + + + + + + + + + + + 100663697 + System.Void Unity.Formats.USD.HierarchyBuilder/ReadHierJob::Execute(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/FindPathsJob + + + + 100663698 + System.Void Unity.Formats.USD.HierarchyBuilder/FindPathsJob::Run() + + + + + + + + + + + + + + + + 100663699 + System.Void Unity.Formats.USD.HierarchyBuilder/FindPathsJob::Execute(System.Int32) + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/<>c + + + + 100663702 + System.Boolean Unity.Formats.USD.HierarchyBuilder/<>c::<BeginReading>b__4_0(pxr.SdfPath[]) + + + + + + + + + 100663703 + System.Collections.Generic.IEnumerable[SdfPath] Unity.Formats.USD.HierarchyBuilder/<>c::<BeginReading>b__4_1(pxr.SdfPath[]) + + + + + + + + + + + Unity.Formats.USD.SceneExporter/<>c + + + + 100663706 + System.String Unity.Formats.USD.SceneExporter/<>c::<MergeBonesBelowAnimator>b__8_0(UnityEngine.Transform) + + + + + + + + + 100663707 + System.String Unity.Formats.USD.SceneExporter/<>c::<MergeBonesBelowAnimator>b__8_1(System.String) + + + + + + + + + + + Unity.Formats.USD.SceneImporter/ImportException + + + + 100663708 + Unity.Formats.USD.SceneImporter/ImportException::ImportException() + + + + + + + + + + + 100663709 + Unity.Formats.USD.SceneImporter/ImportException::ImportException(System.String) + + + + + + + + + + + 100663710 + Unity.Formats.USD.SceneImporter/ImportException::ImportException(System.String, System.Exception) + + + + + + + + + + + + + Unity.Formats.USD.SceneImporter/<BuildScene>d__9 + + + + 100663713 + System.Boolean Unity.Formats.USD.SceneImporter/<BuildScene>d__9::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdRecorderBehaviour/<>c__DisplayClass17_0 + + + + 100663728 + System.Void Unity.Formats.USD.UsdRecorderBehaviour/<>c__DisplayClass17_0::<ProcessFrame>b__0() + + + + + + + + + + + Unity.Formats.USD.UsdWaitForEndOfFrame/<WaitForEndOfFrame>d__4 + + + + 100663731 + System.Boolean Unity.Formats.USD.UsdWaitForEndOfFrame/<WaitForEndOfFrame>d__4::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T] + + + + 100663736 + pxr.SdfPath[] Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]::Find(USD.NET.Scene, pxr.SdfPath) + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportMaterials + + + + + + + Unity.Formats.USD.Examples.ImportMaterialsExample + + + + 100663297 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Update() + + + + + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Awake() + + + + + + + + + + + + + 100663299 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Start() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663300 + System.Boolean Unity.Formats.USD.Examples.ImportMaterialsExample::SetMaterialParameter(UnityEngine.Material, System.String, System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663301 + static USD.NET.Scene Unity.Formats.USD.Examples.ImportMaterialsExample::CreateSceneWithShading() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ImportMaterialsExample/ShaderPair + + + + 100663303 + Unity.Formats.USD.Examples.ImportMaterialsExample/ShaderPair::ShaderPair(UnityEngine.Shader, USD.NET.Unity.ShaderSample) + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportProcessor + + + + + + + + + Unity.Formats.USD.Examples.CombineMeshes + + + + 100663297 + System.Void Unity.Formats.USD.Examples.CombineMeshes::PostProcessComponents(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.CombineMeshes::Reset() + + + + + + + + + + + + + + 100663299 + System.Void Unity.Formats.USD.Examples.CombineMeshes::DoCombineMeshes(UnityEngine.Transform) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.RegexImportProcessor + + + + 100663301 + System.Boolean Unity.Formats.USD.Examples.RegexImportProcessor::IsMatch(pxr.SdfPath) + + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.Examples.RegexImportProcessor::InitRegex() + + + + + + + + + + + + + + + 100663303 + static System.String Unity.Formats.USD.Examples.RegexImportProcessor::WildcardToRegex(System.String) + + + + + + + + + + + 100663304 + Unity.Formats.USD.Examples.RegexImportProcessor::RegexImportProcessor() + + + + + + + + + + + + Unity.Formats.USD.Examples.SetHideFlags + + + + 100663305 + System.Void Unity.Formats.USD.Examples.SetHideFlags::PostProcessHierarchy(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.Examples.SetHideFlags::Reset() + + + + + + + + + + + + + + 100663307 + Unity.Formats.USD.Examples.SetHideFlags::SetHideFlags() + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.UsdTimelinePlayable + + + + + + + Unity.Formats.USD.Examples.SetDefaultUSDMesh + + + + 100663297 + System.Void Unity.Formats.USD.Examples.SetDefaultUSDMesh::Start() + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/PlayMode/TestCoverageResults_0000.xml b/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/PlayMode/TestCoverageResults_0000.xml new file mode 100644 index 000000000..4b8025a1a --- /dev/null +++ b/TestProject/Usd-Development/CodeCoverage/Usd-Development-opencov/PlayMode/TestCoverageResults_0000.xml @@ -0,0 +1,13585 @@ + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.Editor + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdAssetEditor + + + + 100663297 + System.Void Unity.Formats.USD.UsdAssetEditor::OnEnable() + + + + + + + + + + + + + + + + + + + + + 100663298 + UnityEngine.GameObject Unity.Formats.USD.UsdAssetEditor::GetPrefabObject(UnityEngine.GameObject) + + + + + + + + + + + 100663299 + System.Boolean Unity.Formats.USD.UsdAssetEditor::IsPrefabInstance(UnityEngine.GameObject) + + + + + + + + + + + 100663300 + System.Void Unity.Formats.USD.UsdAssetEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663301 + System.Void Unity.Formats.USD.UsdAssetEditor::DrawSimpleInspector(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.UsdAssetEditor::ReloadFromUsd(Unity.Formats.USD.UsdAsset, System.Boolean) + + + + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.UsdAssetEditor::DestroyAllImportedObjects(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.UsdAssetEditor::DetachFromUsd(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.UsdAssetEditor::ReloadFromUsdAsCoroutine(Unity.Formats.USD.UsdAsset) + + + + + + + + + + + + + + + 100663306 + Unity.Formats.USD.UsdAssetEditor::UsdAssetEditor() + + + + + + + + + + + Unity.Formats.USD.UsdLayerStackEditor + + + + 100663307 + System.Void Unity.Formats.USD.UsdLayerStackEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdMenu + + + + 100663309 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportSelectedWithChildren() + + + + + + + + + + + 100663310 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportSelectedWithChildren() + + + + + + + + + + + + + + 100663311 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportTransforms() + + + + + + + + + + + 100663312 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportTransforms() + + + + + + + + + + + + + + 100663313 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuExportSelectedAsUsdz() + + + + + + + + + + + 100663314 + static System.Void Unity.Formats.USD.UsdMenu::MenuExportSelectedAsUsdz() + + + + + + + + + + + + + + + + + + + + + + + + + 100663315 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsGameObjects() + + + + + + + + + + + + + + + + 100663316 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsPrefab() + + + + + + + + + + + + + + + 100663317 + static System.Void Unity.Formats.USD.UsdMenu::MenuImportAsTimelineClip() + + + + + + + + + + + + + + + 100663318 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuUnloadSubtree() + + + + + + + + + + + 100663319 + static System.Void Unity.Formats.USD.UsdMenu::MenuUnloadSubtree() + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663320 + static System.Boolean Unity.Formats.USD.UsdMenu::EnableMenuLoadSubtree() + + + + + + + + + + + 100663321 + static System.Void Unity.Formats.USD.UsdMenu::MenuLoadSubtree() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPrimSourceEditor + + + + 100663322 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663323 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DrawAttributeInfo(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663324 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::WalkNodes(pxr.PcpNodeRef) + + + + + + + + + + + + + + + + + + + + + 100663325 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::WalkLayers(pxr.PcpNodeRef, pxr.SdfLayerTreeHandle, System.Int32) + + + + + + + + + + + + + + + + + + + + + 100663326 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DrawAttributeGui(pxr.UsdPrim, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663327 + System.Void Unity.Formats.USD.UsdPrimSourceEditor::DebugPrintAttr(USD.NET.Scene, pxr.UsdAttribute, pxr.UsdTimeCode) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663328 + System.Object Unity.Formats.USD.UsdPrimSourceEditor::GetCSharpValue(pxr.UsdAttribute, pxr.UsdTimeCode) + + + + + + + + + + + + + + 100663329 + Unity.Formats.USD.UsdPrimSourceEditor::UsdPrimSourceEditor() + + + + + + + + + + + Unity.Formats.USD.UsdVariantSetEditor + + + + 100663330 + System.Void Unity.Formats.USD.UsdVariantSetEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdBuildPostProcess + + + + 100663332 + static System.Void Unity.Formats.USD.UsdBuildPostProcess::OnPostprocessBuild(UnityEditor.BuildTarget, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663333 + static System.String Unity.Formats.USD.UsdBuildPostProcess::GetCurrentDir(System.String) + + + + + + + + + + + + + + Unity.Formats.USD.PackageUtils + + + + 100663335 + static System.String Unity.Formats.USD.PackageUtils::GetRelativeFolderPath(System.String, System.String) + + + + + + + + + + + + + + + + + + + + + 100663336 + static System.String Unity.Formats.USD.PackageUtils::GetCallerRelativeToProjectFolderPath(System.String) + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T] + + + + 100663337 + System.Void UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]::Initialize(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + 100663338 + static System.Reflection.FieldInfo UnityEditor.Formats.USD.Recorder.TargetedPropertyDrawer[T]::GetSerializedField(System.Object, System.String) + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer + + + + 100663340 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettingsPropertyDrawer::OnGUI(UnityEngine.Rect, UnityEditor.SerializedProperty, UnityEngine.GUIContent) + + + + + + + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor + + + + 100663342 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettingsEditor::FileTypeAndFormatGUI() + + + + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorder + + + + 100663344 + UnityEditor.Formats.USD.Recorder.UsdRecorderInput UnityEditor.Formats.USD.Recorder.UsdRecorder::get_Input() + + + + + + + + + 100663345 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::SessionCreated(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663346 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::EndRecording(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663347 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorder::RecordFrame(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInput + + + + 100663349 + Unity.Formats.USD.ExportContext UnityEditor.Formats.USD.Recorder.UsdRecorderInput::get_Context() + + + + + + + + + 100663350 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::set_Context(Unity.Formats.USD.ExportContext) + + + + + + + + + 100663351 + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings UnityEditor.Formats.USD.Recorder.UsdRecorderInput::get_Settings() + + + + + + + + + 100663352 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::BeginRecording(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + 100663353 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInput::NewFrameReady(UnityEditor.Recorder.RecordingSession) + + + + + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings + + + + 100663355 + UnityEngine.GameObject UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::get_GameObject() + + + + + + + + + + + + + + 100663356 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::set_GameObject(UnityEngine.GameObject) + + + + + + + + + + + + + + + 100663357 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::ValidityCheck(System.Collections.Generic.List[String]) + + + + + + + + + + + + + + + 100663358 + System.Type UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::get_InputType() + + + + + + + + + 100663359 + UnityEditor.Formats.USD.Recorder.UsdRecorderInputSettings::UsdRecorderInputSettings() + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings + + + + 100663361 + pxr.UsdInterpolationType UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_InterpolationType() + + + + + + + + + 100663362 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_InterpolationType(pxr.UsdInterpolationType) + + + + + + + + + 100663363 + System.Single UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_Scale() + + + + + + + + + 100663364 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_Scale(System.Single) + + + + + + + + + 100663365 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ExportMaterials() + + + + + + + + + 100663366 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_ExportMaterials(System.Boolean) + + + + + + + + + 100663367 + Unity.Formats.USD.ActiveExportPolicy UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ActivePolicy() + + + + + + + + + 100663368 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_ActivePolicy(Unity.Formats.USD.ActiveExportPolicy) + + + + + + + + + 100663369 + Unity.Formats.USD.BasisTransformation UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_BasisTransformation() + + + + + + + + + 100663370 + System.Void UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::set_BasisTransformation(Unity.Formats.USD.BasisTransformation) + + + + + + + + + 100663371 + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/Format UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_ExportFormat() + + + + + + + + + 100663372 + System.String UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::get_Extension() + + + + + + + + + + + + + + + 100663360 + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings::UsdRecorderSettings() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPrimSourceEditor/<>c + + + + 100663376 + System.String Unity.Formats.USD.UsdPrimSourceEditor/<>c::<DrawAttributeInfo>b__3_0(System.Double) + + + + + + + + + + + UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/<get_InputsSettings>d__29 + + + + 100663379 + System.Boolean UnityEditor.Formats.USD.Recorder.UsdRecorderSettings/<get_InputsSettings>d__29::MoveNext() + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportMesh + + + + + + + + Unity.Formats.USD.Examples.UsdImportMeshEditor + + + + 100663297 + System.String Unity.Formats.USD.Examples.UsdImportMeshEditor::MakeOversPath(System.String) + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.UsdImportMeshEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ImportMeshExample + + + + 100663300 + USD.NET.Scene Unity.Formats.USD.Examples.ImportMeshExample::get_UsdScene() + + + + + + + + + + + 100663301 + Unity.Formats.USD.PrimMap Unity.Formats.USD.Examples.ImportMeshExample::get_PrimMap() + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::Start() + + + + + + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::Update() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::OnValidate() + + + + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.Examples.ImportMeshExample::UnloadGameObjects() + + + + + + + + + + + + + + 100663306 + Unity.Formats.USD.Examples.ImportMeshExample::ImportMeshExample() + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ExportMesh + + + + + + + + + USD.NET.Examples.Explode + + + + 100663297 + System.Void USD.NET.Examples.Explode::Start() + + + + + + + + + + 100663298 + System.Void USD.NET.Examples.Explode::Update() + + + + + + + + + + + + + + + + + + + + + + + + 100663299 + USD.NET.Examples.Explode::Explode() + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ExportMeshExampleEditor + + + + 100663300 + System.Void Unity.Formats.USD.Examples.ExportMeshExampleEditor::OnInspectorGUI() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ExportMeshExample + + + + 100663302 + System.Boolean Unity.Formats.USD.Examples.ExportMeshExample::get_IsRecording() + + + + + + + + + 100663303 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::set_IsRecording(System.Boolean) + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::StartRecording() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663305 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::StopRecording() + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::Awake() + + + + + + + + + + + 100663307 + System.Void Unity.Formats.USD.Examples.ExportMeshExample::LateUpdate() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663308 + static System.Void Unity.Formats.USD.Examples.ExportMeshExample::Export(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.BasisTransformation) + + + + + + + + + + + 100663309 + Unity.Formats.USD.Examples.ExportMeshExample::ExportMeshExample() + + + + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.HelloUsd + + + + + + + Unity.Formats.USD.Examples.HelloUsdExample + + + + 100663297 + System.Void Unity.Formats.USD.Examples.HelloUsdExample::Start() + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.HelloUsdExample::Test() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.Runtime + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.InitUsd + + + + 100663297 + static System.Boolean Unity.Formats.USD.InitUsd::Initialize() + + + + + + + + + + + + + + + + + + + + + + + + 100663298 + static System.Void Unity.Formats.USD.InitUsd::SetupUsdPath(System.String) + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdAsset + + + + 100663300 + System.Double Unity.Formats.USD.UsdAsset::get_Length() + + + + + + + + + + + 100663301 + System.String Unity.Formats.USD.UsdAsset::get_usdFullPath() + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.UsdAsset::set_usdFullPath(System.String) + + + + + + + + + + + 100663303 + UnityEngine.GameObject Unity.Formats.USD.UsdAsset::GetPrefabObject(UnityEngine.GameObject) + + + + + + + + + + + 100663304 + System.Void Unity.Formats.USD.UsdAsset::OnDestroy() + + + + + + + + + + + + + + + 100663305 + System.String Unity.Formats.USD.UsdAsset::GetPrefabAssetPath(UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.UsdAsset::OptionsToState(Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663307 + System.Void Unity.Formats.USD.UsdAsset::StateToOptions(Unity.Formats.USD.SceneImportOptions&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663308 + System.Boolean Unity.Formats.USD.UsdAsset::SceneFileChanged() + + + + + + + + + + + + + + 100663309 + USD.NET.Scene Unity.Formats.USD.UsdAsset::GetScene() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663310 + System.Void Unity.Formats.USD.UsdAsset::OnReload() + + + + + + + + + + + + + + + + + 100663311 + System.Void Unity.Formats.USD.UsdAsset::DestroyComponent(UnityEngine.Component) + + + + + + + + + + + + + + 100663312 + System.Void Unity.Formats.USD.UsdAsset::ClearLastData() + + + + + + + + + + + + + 100663313 + System.Void Unity.Formats.USD.UsdAsset::RemoveAllUsdComponents() + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663314 + System.Void Unity.Formats.USD.UsdAsset::DestroyAllImportedObjects() + + + + + + + + + + + + + + + + + + + + 100663315 + System.Void Unity.Formats.USD.UsdAsset::Reload(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663316 + pxr.UsdPrim Unity.Formats.USD.UsdAsset::GetFirstPrim(USD.NET.Scene) + + + + + + + + + + + + + + + 100663317 + System.Void Unity.Formats.USD.UsdAsset::ExportOverrides(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663318 + System.Double Unity.Formats.USD.UsdAsset::ComputeLength() + + + + + + + + + + + + + + + 100663319 + System.Void Unity.Formats.USD.UsdAsset::SetTime(System.Double, Unity.Formats.USD.UsdAsset, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663320 + System.Void Unity.Formats.USD.UsdAsset::Update() + + + + + + + + + + + + + + + 100663321 + static System.Void Unity.Formats.USD.UsdAsset::PrepOptionsForTimeChange(Unity.Formats.USD.SceneImportOptions&) + + + + + + + + + + + + + + + + + 100663322 + System.Void Unity.Formats.USD.UsdAsset::ImportUsdAsCoroutine(UnityEngine.GameObject, System.String, System.Double, Unity.Formats.USD.SceneImportOptions, System.Single) + + + + + + + + + + + + + + + + + + + + + + + 100663323 + System.Void Unity.Formats.USD.UsdAsset::SetPayloadState(UnityEngine.GameObject, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663324 + System.Void Unity.Formats.USD.UsdAsset::ApplyVariantSelectionState(USD.NET.Scene, Unity.Formats.USD.UsdVariantSet) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663325 + System.Void Unity.Formats.USD.UsdAsset::SetVariantSelection(UnityEngine.GameObject, System.String, System.Collections.Generic.Dictionary[String,String]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663326 + Unity.Formats.USD.UsdAsset::UsdAsset() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdLayerStack + + + + 100663327 + System.Void Unity.Formats.USD.UsdLayerStack::SetupNewSubLayer(USD.NET.Scene, USD.NET.Scene) + + + + + + + + + + + + + + + 100663328 + System.Void Unity.Formats.USD.UsdLayerStack::SaveLayerStack(USD.NET.Scene, System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663329 + System.Void Unity.Formats.USD.UsdLayerStack::SaveToLayer() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPayload + + + + 100663332 + System.Boolean Unity.Formats.USD.UsdPayload::get_IsLoaded() + + + + + + + + + + + 100663333 + System.Void Unity.Formats.USD.UsdPayload::Load() + + + + + + + + + + + 100663334 + System.Void Unity.Formats.USD.UsdPayload::Unload() + + + + + + + + + + + 100663335 + System.Void Unity.Formats.USD.UsdPayload::SetInitialState(System.Boolean) + + + + + + + + + + + + 100663336 + System.Void Unity.Formats.USD.UsdPayload::Update() + + + + + + + + + + + + + + + + + 100663337 + Unity.Formats.USD.UsdPayload::UsdPayload() + + + + + + + + + + + + Unity.Formats.USD.UsdVariantSet + + + + 100663339 + System.Void Unity.Formats.USD.UsdVariantSet::LoadFromUsd(pxr.UsdPrim) + + + + + + + + + + + + + + + + + 100663340 + System.Void Unity.Formats.USD.UsdVariantSet::ApplyVariantSelections() + + + + + + + + + + + + 100663341 + System.Collections.Generic.Dictionary[String,String] Unity.Formats.USD.UsdVariantSet::GetVariantSelections() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkinnedMeshUnityDiff + + + + 100663343 + System.Void Unity.Formats.USD.SkinnedMeshUnityDiff::OnEnable() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663344 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::Approximately(UnityEngine.Matrix4x4, UnityEngine.Matrix4x4) + + + + + + + + + + + + + + + + + + + 100663345 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::WeightsMatch(UnityEngine.BoneWeight, UnityEngine.BoneWeight) + + + + + + + + + + + 100663346 + System.Boolean Unity.Formats.USD.SkinnedMeshUnityDiff::IndicesMatch(UnityEngine.BoneWeight, UnityEngine.BoneWeight) + + + + + + + + + + + 100663347 + System.Void Unity.Formats.USD.SkinnedMeshUnityDiff::Update() + + + + + + + + + + + + Unity.Formats.USD.SkinnedMeshUsdDiff + + + + 100663349 + System.Void Unity.Formats.USD.SkinnedMeshUsdDiff::OnEnable() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663350 + System.String Unity.Formats.USD.SkinnedMeshUsdDiff::GetUsdBoneData[T](System.Int32, System.Int32, USD.NET.Primvar[T[]]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663351 + USD.NET.Scene Unity.Formats.USD.SkinnedMeshUsdDiff::GetScene() + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663352 + Unity.Formats.USD.SkelBindingSample Unity.Formats.USD.SkinnedMeshUsdDiff::ReadUsdWeights(USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + 100663353 + Unity.Formats.USD.SkeletonSample Unity.Formats.USD.SkinnedMeshUsdDiff::ReadUsdSkeleton(USD.NET.Scene, System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663354 + System.Void Unity.Formats.USD.SkinnedMeshUsdDiff::Update() + + + + + + + + + + + + Unity.Formats.USD.CameraExporter + + + + 100663356 + static System.Void Unity.Formats.USD.CameraExporter::ExportCamera(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.CameraImporter + + + + 100663357 + static System.Void Unity.Formats.USD.CameraImporter::BuildCamera(USD.NET.Unity.CameraSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + Unity.Formats.USD.CubeImporter + + + + 100663358 + static System.Void Unity.Formats.USD.CubeImporter::BuildCube(USD.NET.Unity.CubeSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663359 + static System.Boolean Unity.Formats.USD.CubeImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663360 + static System.Boolean Unity.Formats.USD.CubeImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + + + Unity.Formats.USD.InstanceImporter + + + + 100663361 + static System.Void Unity.Formats.USD.InstanceImporter::BuildSceneInstances(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663362 + static System.Void Unity.Formats.USD.InstanceImporter::BuildPointInstances(USD.NET.Scene, Unity.Formats.USD.PrimMap, System.String, USD.NET.Unity.PointInstancerSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663363 + static System.Void Unity.Formats.USD.InstanceImporter::EnableGpuInstancing(UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MeshExporter + + + + 100663364 + static System.Void Unity.Formats.USD.MeshExporter::ExportSkinnedMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + 100663365 + static System.Void Unity.Formats.USD.MeshExporter::ExportSkelWeights(USD.NET.Scene, System.String, UnityEngine.Mesh, UnityEngine.Transform, UnityEngine.Transform[], System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663366 + static System.Boolean Unity.Formats.USD.MeshExporter::CanReadMesh(UnityEngine.Mesh) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663367 + static System.Void Unity.Formats.USD.MeshExporter::ExportMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + 100663368 + static System.Void Unity.Formats.USD.MeshExporter::ExportMesh(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Material[], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663369 + static Unity.Formats.USD.MeshExporter::MeshExporter() + + + + + + + + + + + + Unity.Formats.USD.MeshImportStrategy + + + + 100663375 + System.Void Unity.Formats.USD.MeshImportStrategy::BeginReading(USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + 100663374 + Unity.Formats.USD.MeshImportStrategy::MeshImportStrategy(Unity.Formats.USD.MeshImportFunction[SanitizedMeshSample], Unity.Formats.USD.MeshImportFunction[SanitizedMeshSample]) + + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter + + + + 100663377 + static Unity.Formats.USD.MeshImporter/GeometrySubsets Unity.Formats.USD.MeshImporter::ReadGeomSubsets(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663378 + static System.Void Unity.Formats.USD.MeshImporter::BuildSkinnedMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + + + + 100663379 + static System.Void Unity.Formats.USD.MeshImporter::ImportSkinning(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663380 + static System.Void Unity.Formats.USD.MeshImporter::BuildMesh(System.String, Unity.Formats.USD.SanitizedMeshSample, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean, pxr.UsdSkelSkinningQuery) + + + + + + + + + + + + + + + + + + + + + 100663381 + static System.Void Unity.Formats.USD.MeshImporter::BuildMesh_(System.String, Unity.Formats.USD.SanitizedMeshSample, UnityEngine.Mesh, Unity.Formats.USD.MeshImporter/GeometrySubsets, UnityEngine.GameObject, UnityEngine.Renderer, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663382 + static System.Void Unity.Formats.USD.MeshImporter::LoadPrimvars(USD.NET.Scene, UnityEngine.Mesh, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663383 + static System.Void Unity.Formats.USD.MeshImporter::BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + 100663384 + static System.Void Unity.Formats.USD.MeshImporter::BindMat(USD.NET.Scene, UnityEngine.Mesh, UnityEngine.Material, UnityEngine.Renderer, System.Int32, System.String, System.Collections.Generic.List[String], USD.NET.Unity.MeshSample) + + + + + + + + + + + + + + 100663385 + static Unity.Formats.USD.MeshImporter::TryGetPrimvarValue[T](USD.NET.Primvar[Object]) + + + + + + + + + + + + + 100663386 + static System.Void Unity.Formats.USD.MeshImporter::ImportUv(UnityEngine.Mesh, System.Int32, USD.NET.Primvar[Object]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663387 + static System.Boolean Unity.Formats.USD.MeshImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663388 + static System.Boolean Unity.Formats.USD.MeshImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663389 + static System.String Unity.Formats.USD.MeshImporter::UniqueMeshName(System.String) + + + + + + + + + + + + + + Unity.Formats.USD.MeshImportOptions + + + + 100663390 + Unity.Formats.USD.MeshImportOptions::MeshImportOptions() + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SphereImporter + + + + 100663391 + static System.Void Unity.Formats.USD.SphereImporter::BuildSphere(USD.NET.Unity.SphereSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663392 + static System.Boolean Unity.Formats.USD.SphereImporter::ShouldImport(Unity.Formats.USD.ImportMode) + + + + + + + + + + + 100663393 + static System.Boolean Unity.Formats.USD.SphereImporter::ShouldCompute(Unity.Formats.USD.ImportMode) + + + + + + + + + + + + + Unity.Formats.USD.XformExporter + + + + 100663394 + static System.Void Unity.Formats.USD.XformExporter::ExportXform(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + 100663395 + static System.Void Unity.Formats.USD.XformExporter::WriteSparseOverrides(USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.BasisTransformation, System.Single) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663396 + static UnityEngine.Matrix4x4 Unity.Formats.USD.XformExporter::GetLocalTransformMatrix(UnityEngine.Transform, System.Boolean, System.Boolean, Unity.Formats.USD.BasisTransformation) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.XformImporter + + + + 100663397 + static System.Void Unity.Formats.USD.XformImporter::BuildXform(pxr.SdfPath, USD.NET.Unity.XformableSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + 100663398 + static System.Void Unity.Formats.USD.XformImporter::BuildXform(UnityEngine.Matrix4x4, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + 100663399 + static System.Void Unity.Formats.USD.XformImporter::ImportXform(UnityEngine.Matrix4x4&, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + 100663400 + static System.Void Unity.Formats.USD.XformImporter::BuildSceneRoot(USD.NET.Scene, UnityEngine.Transform, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663401 + static System.Void Unity.Formats.USD.XformImporter::UndoRootTransform(USD.NET.Scene, Unity.Formats.USD.UsdAsset, UnityEngine.Vector3&, UnityEngine.Quaternion&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ImporterBase + + + + 100663402 + static System.String Unity.Formats.USD.ImporterBase::MakeRelativePath(System.String, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663403 + static System.Boolean Unity.Formats.USD.ImporterBase::ApproximatelyEqual(UnityEngine.Matrix4x4, UnityEngine.Matrix4x4) + + + + + + + + + + + + + + + + + + 100663404 + static System.Void Unity.Formats.USD.ImporterBase::MoveComponentFirst(UnityEngine.Component) + + + + + + + + + + + + + 100663405 + static System.Void Unity.Formats.USD.ImporterBase::MoveComponentLast(UnityEngine.Component) + + + + + + + + + + + + + 100663406 + static T Unity.Formats.USD.ImporterBase::GetOrAddComponent[T](UnityEngine.GameObject, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HdrpShaderExporter + + + + 100663407 + static System.Void Unity.Formats.USD.HdrpShaderExporter::ExportLit(USD.NET.Scene, System.String, UnityEngine.Material, USD.NET.Unity.PreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HdrpShaderImporter + + + + 100663410 + System.Void Unity.Formats.USD.HdrpShaderImporter::ImportFromUsd() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663411 + static UnityEngine.Texture2D Unity.Formats.USD.HdrpShaderImporter::BuildMaskMap(UnityEngine.Texture2D, UnityEngine.Texture2D, UnityEngine.Texture2D, UnityEngine.Texture2D) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663409 + Unity.Formats.USD.HdrpShaderImporter::HdrpShaderImporter(UnityEngine.Material) + + + + + + + + + + + + + Unity.Formats.USD.MaterialExporter + + + + 100663413 + static System.Void Unity.Formats.USD.MaterialExporter::ExportMaterial(USD.NET.Scene, UnityEngine.Material, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663412 + static Unity.Formats.USD.MaterialExporter::MaterialExporter() + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MaterialImporter + + + + 100663414 + static System.Void Unity.Formats.USD.MaterialImporter::ProcessMaterialBindings(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663415 + static UnityEngine.Material Unity.Formats.USD.MaterialImporter::BuildMaterial(USD.NET.Scene, System.String, USD.NET.Unity.MaterialSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663416 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::ImportConnectedTexture[T](USD.NET.Scene, USD.NET.Connectable[T], System.Boolean, Unity.Formats.USD.SceneImportOptions, System.String&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663417 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::DefaultTextureResolver(pxr.SdfAssetPath, System.Boolean, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663418 + static UnityEngine.Texture2D Unity.Formats.USD.MaterialImporter::CombineRoughness(UnityEngine.Texture2D, UnityEngine.Texture2D, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663419 + static Unity.Formats.USD.UnityPreviewSurfaceSample Unity.Formats.USD.MaterialImporter::GetSurfaceShaderPrim(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + 100663420 + static Unity.Formats.USD.MaterialImporter::MaterialImporter() + + + + + + + + + + + Unity.Formats.USD.MaterialMap + + + + 100663421 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_DisplayColorMaterial() + + + + + + + + + + + + + 100663422 + System.Void Unity.Formats.USD.MaterialMap::set_DisplayColorMaterial(UnityEngine.Material) + + + + + + + + + + + 100663423 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_SpecularWorkflowMaterial() + + + + + + + + + + + + + 100663424 + System.Void Unity.Formats.USD.MaterialMap::set_SpecularWorkflowMaterial(UnityEngine.Material) + + + + + + + + + + + 100663425 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_MetallicWorkflowMaterial() + + + + + + + + + + + + + 100663426 + System.Void Unity.Formats.USD.MaterialMap::set_MetallicWorkflowMaterial(UnityEngine.Material) + + + + + + + + + + + 100663427 + System.Void Unity.Formats.USD.MaterialMap::InstantiateMaterials() + + + + + + + + + + + + + + + + + + + + + + 100663428 + System.Collections.Generic.Dictionary[String,MaterialBinder] Unity.Formats.USD.MaterialMap::ClearRequestedBindings() + + + + + + + + + + + + + 100663429 + System.Void Unity.Formats.USD.MaterialMap::RequestBinding(System.String, Unity.Formats.USD.MaterialMap/MaterialBinder) + + + + + + + + + + + 100663430 + UnityEngine.Material Unity.Formats.USD.MaterialMap::get_Item(System.String) + + + + + + + + + + + + + + 100663431 + System.Void Unity.Formats.USD.MaterialMap::set_Item(System.String, UnityEngine.Material) + + + + + + + + + + + 100663432 + System.Collections.Generic.List[String] Unity.Formats.USD.MaterialMap::GetPrimvars(System.String) + + + + + + + + + + + + 100663433 + System.Void Unity.Formats.USD.MaterialMap::SetPrimvars(System.String, System.Collections.Generic.List[String]) + + + + + + + + + + + 100663434 + UnityEngine.Material Unity.Formats.USD.MaterialMap::InstantiateSolidColor(UnityEngine.Color) + + + + + + + + + + + + + + + + + 100663435 + static System.Void Unity.Formats.USD.MaterialMap::AssignColor(UnityEngine.Material, UnityEngine.Color) + + + + + + + + + + + + + + + + + + 100663436 + System.Collections.IEnumerator Unity.Formats.USD.MaterialMap::GetEnumerator() + + + + + + + + + + + 100663437 + System.Collections.Generic.IEnumerator[KeyValuePair`2] Unity.Formats.USD.MaterialMap::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,UnityEngine.Material>>.GetEnumerator() + + + + + + + + + + + 100663438 + Unity.Formats.USD.MaterialMap::MaterialMap() + + + + + + + + + + + + + + Unity.Formats.USD.ShaderExporterBase + + + + 100663439 + static System.String Unity.Formats.USD.ShaderExporterBase::SetupTexture(USD.NET.Scene, System.String, UnityEngine.Material, USD.NET.Unity.PreviewSurfaceSample, UnityEngine.Vector4, System.String, System.String, System.String, Unity.Formats.USD.ShaderExporterBase/ConversionType) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ShaderImporterBase + + + + 100663441 + UnityEngine.Material Unity.Formats.USD.ShaderImporterBase::get_Material() + + + + + + + + + 100663442 + System.Void Unity.Formats.USD.ShaderImporterBase::set_Material(UnityEngine.Material) + + + + + + + + + 100663443 + System.Boolean Unity.Formats.USD.ShaderImporterBase::get_IsSpecularWorkflow() + + + + + + + + + 100663444 + System.Void Unity.Formats.USD.ShaderImporterBase::set_IsSpecularWorkflow(System.Boolean) + + + + + + + + + 100663447 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportColorOrMap(USD.NET.Scene, USD.NET.Connectable[Vector3], System.Boolean, Unity.Formats.USD.SceneImportOptions, UnityEngine.Texture2D&, System.Nullable`1[[UnityEngine.Color, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, System.String&) + + + + + + + + + + + + + + + + + + + 100663448 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportValueOrMap[T](USD.NET.Scene, USD.NET.Connectable[T], System.Boolean, Unity.Formats.USD.SceneImportOptions, UnityEngine.Texture2D&, , System.String&) + + + + + + + + + + + + + + + + + + 100663449 + System.Void Unity.Formats.USD.ShaderImporterBase::MergePrimvars(System.String, System.Collections.Generic.List[String]) + + + + + + + + + + + + + + + + + + 100663450 + System.Void Unity.Formats.USD.ShaderImporterBase::ImportParametersFromUsd(USD.NET.Scene, System.String, USD.NET.Unity.MaterialSample, USD.NET.Unity.PreviewSurfaceSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663445 + Unity.Formats.USD.ShaderImporterBase::ShaderImporterBase(UnityEngine.Material) + + + + + + + + + + + + + + Unity.Formats.USD.StandardShaderExporter + + + + 100663451 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardSpecular(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663452 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardRoughness(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663453 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandard(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663454 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportGeneric(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663455 + static System.Void Unity.Formats.USD.StandardShaderExporter::ExportStandardCommon(USD.NET.Scene, System.String, UnityEngine.Material, Unity.Formats.USD.UnityPreviewSurfaceSample, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.StandardShaderImporter + + + + 100663458 + System.Void Unity.Formats.USD.StandardShaderImporter::ImportFromUsd() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663457 + Unity.Formats.USD.StandardShaderImporter::StandardShaderImporter(UnityEngine.Material) + + + + + + + + + + + + + Unity.Formats.USD.UnityMaterialData + + + + 100663459 + Unity.Formats.USD.UnityMaterialData::UnityMaterialData() + + + + + + + + + + + + + Unity.Formats.USD.UnityPreviewSurfaceSample + + + + 100663460 + Unity.Formats.USD.UnityPreviewSurfaceSample::UnityPreviewSurfaceSample() + + + + + + + + + + + Unity.Formats.USD.ReadAllJob[T] + + + + 100663461 + USD.NET.SampleHolder Unity.Formats.USD.ReadAllJob[T]::get_Current() + + + + + + + + + + + 100663462 + System.Object Unity.Formats.USD.ReadAllJob[T].System.Collections.IEnumerator::get_Current() + + + + + + + + + + + 100663464 + System.Boolean Unity.Formats.USD.ReadAllJob[T]::ShouldReadPath(USD.NET.Scene, pxr.SdfPath) + + + + + + + + + + + 100663465 + System.Void Unity.Formats.USD.ReadAllJob[T]::Run() + + + + + + + + + + + + + + + + 100663466 + System.Void Unity.Formats.USD.ReadAllJob[T]::Execute(System.Int32) + + + + + + + + + + + + + + + + + + + + + + 100663467 + System.Boolean Unity.Formats.USD.ReadAllJob[T]::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663468 + System.Void Unity.Formats.USD.ReadAllJob[T]::Reset() + + + + + + + + + + + + + + + + 100663469 + System.Void Unity.Formats.USD.ReadAllJob[T]::Dispose() + + + + + + + + + + + 100663470 + System.Collections.Generic.IEnumerator[SampleHolder] Unity.Formats.USD.ReadAllJob[T]::GetEnumerator() + + + + + + + + + + + 100663471 + System.Collections.IEnumerator Unity.Formats.USD.ReadAllJob[T].System.Collections.IEnumerable::GetEnumerator() + + + + + + + + + + + 100663463 + Unity.Formats.USD.ReadAllJob[T]::ReadAllJob(USD.NET.Scene, pxr.SdfPath[], Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedXformSample + + + + 100663473 + System.Void Unity.Formats.USD.SanitizedXformSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedCameraSample + + + + 100663475 + System.Void Unity.Formats.USD.SanitizedCameraSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + Unity.Formats.USD.SanitizedMeshSample + + + + 100663477 + System.Void Unity.Formats.USD.SanitizedMeshSample::Sanitize(USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663478 + System.Void Unity.Formats.USD.SanitizedMeshSample::Triangulate(System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663479 + System.Boolean Unity.Formats.USD.SanitizedMeshSample::ShouldUnweldVertices(System.Boolean) + + + + + + + + + + + 100663480 + static System.Void Unity.Formats.USD.SanitizedMeshSample::Flatten[T](, System.Int32[]) + + + + + + + + + + + + + + + + + + + + 100663481 + System.Void Unity.Formats.USD.SanitizedMeshSample::UnweldUVs(USD.NET.Primvar[Object], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663482 + static System.Void Unity.Formats.USD.SanitizedMeshSample::FlattenUVs(USD.NET.Primvar[Object]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663483 + static System.Void Unity.Formats.USD.SanitizedMeshSample::TriangulateAttributes[T](, System.Int32[], System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663484 + System.Void Unity.Formats.USD.SanitizedMeshSample::ConvertInterpolationToFaceVarying[T](, System.Int32[], System.Boolean, pxr.TfToken) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663485 + pxr.TfToken Unity.Formats.USD.SanitizedMeshSample::GuessInterpolation(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + 100663486 + System.Void Unity.Formats.USD.SanitizedMeshSample::UniformToFaceVarying[T](, System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663487 + static System.Void Unity.Formats.USD.SanitizedMeshSample::ComputeNormals(UnityEngine.Vector3[], System.Int32[], UnityEngine.Vector3[]&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663488 + System.Boolean Unity.Formats.USD.SanitizedMeshSample::ShouldUnwindVertices(System.Boolean) + + + + + + + + + + + + + Unity.Formats.USD.ExportHelpers + + + + 100663490 + static USD.NET.Scene Unity.Formats.USD.ExportHelpers::InitForSave(System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663491 + static System.Void Unity.Formats.USD.ExportHelpers::ExportGameObjects(UnityEngine.GameObject[], USD.NET.Scene, Unity.Formats.USD.BasisTransformation, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder + + + + 100663492 + static Unity.Jobs.JobHandle Unity.Formats.USD.HierarchyBuilder::BeginReading(USD.NET.Scene, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663493 + static Unity.Formats.USD.HierarchyBuilder/HierInfo[] Unity.Formats.USD.HierarchyBuilder::BuildObjectLists(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + 100663494 + static Unity.Formats.USD.PrimMap Unity.Formats.USD.HierarchyBuilder::BuildGameObjects(USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, System.Collections.Generic.IEnumerable[SdfPath], Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663495 + static System.Boolean Unity.Formats.USD.HierarchyBuilder::IsVisible(pxr.UsdPrim) + + + + + + + + + + + + + + + + + + + + + + 100663496 + static System.Void Unity.Formats.USD.HierarchyBuilder::ApplySelfVisibility(UnityEngine.GameObject, pxr.UsdPrim) + + + + + + + + + + + + + + + + + 100663497 + static System.Void Unity.Formats.USD.HierarchyBuilder::CreateAncestors(pxr.SdfPath, Unity.Formats.USD.PrimMap, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.SceneImportOptions, UnityEngine.GameObject&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663498 + static System.Void Unity.Formats.USD.HierarchyBuilder::ProcessPaths(Unity.Formats.USD.HierarchyBuilder/HierInfo[], USD.NET.Scene, UnityEngine.GameObject, pxr.SdfPath, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663499 + static System.Void Unity.Formats.USD.HierarchyBuilder::PopulateSkelCache(Unity.Formats.USD.HierarchyBuilder/HierInfo&, pxr.UsdSkelCache) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663500 + static System.Void Unity.Formats.USD.HierarchyBuilder::ReadSkeletonJoints(Unity.Formats.USD.HierarchyBuilder/HierInfo&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663501 + static System.Void Unity.Formats.USD.HierarchyBuilder::ExpandSkeleton(Unity.Formats.USD.HierarchyBuilder/HierInfo, UnityEngine.GameObject, pxr.SdfPath, pxr.UsdPrim, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663502 + static System.Void Unity.Formats.USD.HierarchyBuilder::ReadModelInfo(Unity.Formats.USD.HierarchyBuilder/HierInfo&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663503 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddModelRoot(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663504 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddPayload(UnityEngine.GameObject, Unity.Formats.USD.HierarchyBuilder/HierInfo, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + 100663505 + static System.Void Unity.Formats.USD.HierarchyBuilder::AddVariantSet(UnityEngine.GameObject, pxr.UsdPrim) + + + + + + + + + + + + + + + + + + + + + + + + 100663506 + static UnityEngine.GameObject Unity.Formats.USD.HierarchyBuilder::FindOrCreateGameObject(UnityEngine.Transform, pxr.SdfPath, UnityEngine.Transform, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663507 + static Unity.Formats.USD.HierarchyBuilder::HierarchyBuilder() + + + + + + + + + + + Unity.Formats.USD.ImportHelpers + + + + 100663508 + static UnityEngine.GameObject Unity.Formats.USD.ImportHelpers::ImportSceneAsGameObject(USD.NET.Scene, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663509 + static System.String Unity.Formats.USD.ImportHelpers::ImportAsPrefab(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663510 + static System.String Unity.Formats.USD.ImportHelpers::ImportAsTimelineClip(USD.NET.Scene, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663511 + static System.String Unity.Formats.USD.ImportHelpers::GetSelectedAssetPath() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663512 + static USD.NET.Scene Unity.Formats.USD.ImportHelpers::InitForOpen(System.String, pxr.UsdStage/InitialLoadSet) + + + + + + + + + + + + + + + + + 100663513 + static pxr.SdfPath Unity.Formats.USD.ImportHelpers::GetDefaultRoot(USD.NET.Scene) + + + + + + + + + + + + + + + 100663514 + static UnityEngine.GameObject Unity.Formats.USD.ImportHelpers::UsdToGameObject(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + 100663515 + static System.String Unity.Formats.USD.ImportHelpers::GetObjectName(pxr.SdfPath, System.String) + + + + + + + + + + + 100663516 + static System.String Unity.Formats.USD.ImportHelpers::GetObjectName(System.String) + + + + + + + + + + + 100663517 + static System.String Unity.Formats.USD.ImportHelpers::GetPrefabName(System.String) + + + + + + + + + + + + 100663518 + static System.String Unity.Formats.USD.ImportHelpers::GetPrefabPath(System.String, System.String) + + + + + + + + + + + + + + + + + Unity.Formats.USD.PrimMap + + + + 100663522 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Cameras() + + + + + + + + + 100663523 + System.Void Unity.Formats.USD.PrimMap::set_Cameras(pxr.SdfPath[]) + + + + + + + + + 100663524 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Meshes() + + + + + + + + + 100663525 + System.Void Unity.Formats.USD.PrimMap::set_Meshes(pxr.SdfPath[]) + + + + + + + + + 100663526 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Cubes() + + + + + + + + + 100663527 + System.Void Unity.Formats.USD.PrimMap::set_Cubes(pxr.SdfPath[]) + + + + + + + + + 100663528 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Spheres() + + + + + + + + + 100663529 + System.Void Unity.Formats.USD.PrimMap::set_Spheres(pxr.SdfPath[]) + + + + + + + + + 100663530 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Xforms() + + + + + + + + + 100663531 + System.Void Unity.Formats.USD.PrimMap::set_Xforms(pxr.SdfPath[]) + + + + + + + + + 100663532 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_SkelRoots() + + + + + + + + + 100663533 + System.Void Unity.Formats.USD.PrimMap::set_SkelRoots(pxr.SdfPath[]) + + + + + + + + + 100663534 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Skeletons() + + + + + + + + + 100663535 + System.Void Unity.Formats.USD.PrimMap::set_Skeletons(pxr.SdfPath[]) + + + + + + + + + 100663536 + pxr.SdfPath[] Unity.Formats.USD.PrimMap::get_Materials() + + + + + + + + + 100663537 + System.Void Unity.Formats.USD.PrimMap::set_Materials(pxr.SdfPath[]) + + + + + + + + + 100663539 + UnityEngine.GameObject Unity.Formats.USD.PrimMap::get_Item(pxr.SdfPath) + + + + + + + + + + + + + + 100663540 + System.Void Unity.Formats.USD.PrimMap::set_Item(pxr.SdfPath, UnityEngine.GameObject) + + + + + + + + + + + 100663541 + System.Boolean Unity.Formats.USD.PrimMap::TryGetValue(pxr.SdfPath, UnityEngine.GameObject&) + + + + + + + + + + + 100663542 + System.Collections.IEnumerator Unity.Formats.USD.PrimMap::GetEnumerator() + + + + + + + + + + + 100663543 + System.Collections.Generic.IEnumerator[KeyValuePair`2] Unity.Formats.USD.PrimMap::System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<pxr.SdfPath,UnityEngine.GameObject>>.GetEnumerator() + + + + + + + + + + + 100663544 + System.Void Unity.Formats.USD.PrimMap::AddInstance(UnityEngine.GameObject) + + + + + + + + + + + 100663545 + System.Void Unity.Formats.USD.PrimMap::AddMasterRoot(pxr.SdfPath, UnityEngine.GameObject) + + + + + + + + + + + + 100663546 + System.Void Unity.Formats.USD.PrimMap::AddInstanceRoot(pxr.SdfPath, UnityEngine.GameObject, pxr.SdfPath) + + + + + + + + + + + 100663547 + System.Collections.Generic.KeyCollection Unity.Formats.USD.PrimMap::GetMasterRootPaths() + + + + + + + + + + + 100663548 + System.Collections.Generic.ValueCollection Unity.Formats.USD.PrimMap::GetInstanceRoots() + + + + + + + + + + + 100663549 + System.Void Unity.Formats.USD.PrimMap::DestroyAll() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663550 + System.Void Unity.Formats.USD.PrimMap::Clear() + + + + + + + + + + + + + + + + + + + + + + 100663538 + Unity.Formats.USD.PrimMap::PrimMap() + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ExportContext + + + + 100663559 + Unity.Formats.USD.ExportContext::ExportContext() + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.ExportPlan + + + + 100663561 + Unity.Formats.USD.ExportPlan::ExportPlan() + + + + + + + + + + + Unity.Formats.USD.SceneExporter + + + + 100663562 + static System.Void Unity.Formats.USD.SceneExporter::Export(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.BasisTransformation, System.Boolean, System.Boolean, System.Boolean, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + 100663563 + static System.Void Unity.Formats.USD.SceneExporter::Export(UnityEngine.GameObject, Unity.Formats.USD.ExportContext, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663564 + static System.Void Unity.Formats.USD.SceneExporter::ExportImpl(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663565 + static System.Void Unity.Formats.USD.SceneExporter::Traverse(UnityEngine.GameObject, Unity.Formats.USD.ObjectProcessor, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + 100663566 + static System.Void Unity.Formats.USD.SceneExporter::AccumNestedBones(UnityEngine.Transform, System.Collections.Generic.List[Transform], Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + 100663567 + static T Unity.Formats.USD.SceneExporter::CreateSample[T](Unity.Formats.USD.ExportContext) + + + + + + + + + + + 100663568 + static System.Void Unity.Formats.USD.SceneExporter::SyncExportContext(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663569 + static System.Void Unity.Formats.USD.SceneExporter::InitExportableObjects(UnityEngine.GameObject, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663570 + static UnityEngine.Transform Unity.Formats.USD.SceneExporter::MergeBonesBelowAnimator(UnityEngine.Transform, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663571 + static System.Void Unity.Formats.USD.SceneExporter::MergeBonesSimple(UnityEngine.Transform, UnityEngine.Transform, UnityEngine.Transform[], UnityEngine.Matrix4x4[], Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663572 + static System.Void Unity.Formats.USD.SceneExporter::CreateExportPlan(UnityEngine.GameObject, USD.NET.SampleBase, Unity.Formats.USD.ExportFunction, Unity.Formats.USD.ExportContext, System.String, System.Boolean) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663573 + static UnityEngine.Matrix4x4 Unity.Formats.USD.SceneExporter::ComputeWorldXf(UnityEngine.Transform, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + Unity.Formats.USD.SceneImporter + + + + 100663577 + static System.Void Unity.Formats.USD.SceneImporter::SavePrefab(UnityEngine.GameObject, System.String, System.String, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663578 + static System.Void Unity.Formats.USD.SceneImporter::AddObjectsToAsset(UnityEngine.GameObject, UnityEngine.Object, Unity.Formats.USD.SceneImportOptions, System.Collections.Generic.HashSet`1[[UnityEngine.Mesh, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, System.Collections.Generic.HashSet`1[[UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663579 + static System.Void Unity.Formats.USD.SceneImporter::ImportUsd(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + 100663580 + static System.Void Unity.Formats.USD.SceneImporter::ImportUsd(UnityEngine.GameObject, USD.NET.Scene, Unity.Formats.USD.PrimMap, System.Boolean, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + 100663581 + static Unity.Formats.USD.PrimMap Unity.Formats.USD.SceneImporter::BuildScene(USD.NET.Scene, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions, Unity.Formats.USD.PrimMap, System.Boolean) + + + + + + + + + + + + + + + + + + + + 100663582 + static System.Void Unity.Formats.USD.SceneImporter::RemoveComponent[T](UnityEngine.GameObject) + + + + + + + + + + + + + + + 100663584 + static System.Boolean Unity.Formats.USD.SceneImporter::ShouldYield(System.Single, System.Diagnostics.Stopwatch) + + + + + + + + + + + 100663585 + static System.Void Unity.Formats.USD.SceneImporter::ResetTimer(System.Diagnostics.Stopwatch) + + + + + + + + + + + + + 100663586 + static System.Boolean Unity.Formats.USD.SceneImporter::IsSkinnedMesh(pxr.UsdPrim, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + 100663576 + static Unity.Formats.USD.SceneImporter::SceneImporter() + + + + + + + + + + + + + Unity.Formats.USD.SceneImportOptions + + + + 100663587 + System.Boolean Unity.Formats.USD.SceneImportOptions::get_ShouldBindMaterials() + + + + + + + + + + + 100663588 + Unity.Formats.USD.SceneImportOptions::SceneImportOptions() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdzExporter + + + + 100663589 + static System.Void Unity.Formats.USD.UsdzExporter::ExportUsdz(System.String, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkeletonExporter + + + + 100663591 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkeleton(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663592 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkelRoot(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663593 + static System.Void Unity.Formats.USD.SkeletonExporter::ExportSkelAnimation(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkeletonImporter + + + + 100663594 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildSkeletonBone(System.String, UnityEngine.GameObject, UnityEngine.Matrix4x4, pxr.VtTokenArray, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663595 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildDebugBindTransforms(Unity.Formats.USD.SkeletonSample, UnityEngine.GameObject, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663596 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildBindTransforms(System.String, Unity.Formats.USD.SkeletonSample, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + 100663597 + static System.Boolean Unity.Formats.USD.SkeletonImporter::JointsMatch(System.String[], System.String[]) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663598 + static System.Void Unity.Formats.USD.SkeletonImporter::BuildSkinnedMesh(System.String, System.String, Unity.Formats.USD.SkeletonSample, pxr.UsdSkelSkinningQuery, UnityEngine.GameObject, Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.SkelBindingSample + + + + 100663600 + Unity.Formats.USD.SkelBindingSample::SkelBindingSample() + + + + + + + + + + + + + + + + Unity.Formats.USD.SkelRootSample + + + + 100663601 + Unity.Formats.USD.SkelRootSample::SkelRootSample() + + + + + + + + + + + + Unity.Formats.USD.SkeletonIo + + + + 100663605 + UnityEngine.Transform[] Unity.Formats.USD.SkeletonIo::GetBones(UnityEngine.Transform) + + + + + + + + + + + 100663606 + System.Void Unity.Formats.USD.SkeletonIo::RegisterSkeleton(UnityEngine.Transform, UnityEngine.Transform[]) + + + + + + + + + + + 100663607 + Unity.Formats.USD.SkeletonIo::SkeletonIo() + + + + + + + + + + + Unity.Formats.USD.NativeExporter + + + + 100663608 + static System.Void Unity.Formats.USD.NativeExporter::ExportObject(Unity.Formats.USD.ObjectContext, Unity.Formats.USD.ExportContext) + + + + + + + + + + + + + + + + + + + + + + 100663609 + static System.Void Unity.Formats.USD.NativeExporter::ObjectToUsd(UnityEngine.GameObject, pxr.UsdPrim, USD.NET.Scene) + + + + + + + + + + + + + + + + + + 100663610 + static System.Void Unity.Formats.USD.NativeExporter::ComponentToUsd(UnityEngine.Component, System.String, USD.NET.Scene) + + + + + + + + + + + + + + + + + + + + + 100663611 + static System.Void Unity.Formats.USD.NativeExporter::PropertyToUsd(System.String, System.String, USD.NET.Scene, UnityEditor.SerializedProperty, System.Text.StringBuilder) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.NativeImporter + + + + 100663613 + static System.Void Unity.Formats.USD.NativeImporter::ImportObject(USD.NET.Scene, UnityEngine.GameObject, pxr.UsdPrim, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663614 + static System.Void Unity.Formats.USD.NativeImporter::PropertyFromUsd(pxr.UsdPrim, UnityEditor.SerializedProperty, System.Text.StringBuilder, System.String) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.NativeSerialization + + + + 100663616 + static System.String Unity.Formats.USD.NativeSerialization::ValueToString(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663617 + static pxr.VtValue Unity.Formats.USD.NativeSerialization::PropToVtValue(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663618 + static System.Void Unity.Formats.USD.NativeSerialization::VtValueToProp(UnityEditor.SerializedProperty, pxr.VtValue) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663619 + static pxr.SdfValueTypeName Unity.Formats.USD.NativeSerialization::GetSdfType(UnityEditor.SerializedProperty) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPlayableAsset + + + + 100663620 + UnityEngine.Timeline.ClipCaps Unity.Formats.USD.UsdPlayableAsset::get_clipCaps() + + + + + + + + + + + 100663621 + Unity.Formats.USD.UsdAsset Unity.Formats.USD.UsdPlayableAsset::GetUsdAsset(System.String) + + + + + + + + + + + + 100663622 + UnityEngine.Playables.Playable Unity.Formats.USD.UsdPlayableAsset::CreatePlayable(UnityEngine.Playables.PlayableGraph, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + 100663623 + System.Double Unity.Formats.USD.UsdPlayableAsset::get_duration() + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdPlayableBehaviour + + + + 100663625 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnGraphStart(UnityEngine.Playables.Playable) + + + + + + + + + + + 100663626 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnGraphStop(UnityEngine.Playables.Playable) + + + + + + + + + + 100663627 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnBehaviourPlay(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663628 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::OnBehaviourPause(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663629 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::PrepareFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663630 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::ProcessFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663631 + System.Void Unity.Formats.USD.UsdPlayableBehaviour::PrepareData(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + 100663632 + Unity.Formats.USD.UsdPlayableBehaviour::UsdPlayableBehaviour() + + + + + + + + + + + Unity.Formats.USD.UsdPlayableTrack + + + + 100663633 + System.Void Unity.Formats.USD.UsdPlayableTrack::OnCreateClip(UnityEngine.Timeline.TimelineClip) + + + + + + + + + + + + + + Unity.Formats.USD.UsdRecorderBehaviour + + + + 100663635 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::BeginRecording(System.Double, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663636 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::StopRecording(System.Double) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663637 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::ProcessRecording(System.Double, UnityEngine.GameObject) + + + + + + + + + + + + + + + + + + + + + + + + 100663638 + System.Boolean Unity.Formats.USD.UsdRecorderBehaviour::IsPlaying() + + + + + + + + + + + 100663639 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnPlayableCreate(UnityEngine.Playables.Playable) + + + + + + + + + + 100663640 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnPlayableDestroy(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663641 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnGraphStart(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663642 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnGraphStop(UnityEngine.Playables.Playable) + + + + + + + + + + + + + + 100663643 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::ProcessFrame(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + + + + + + 100663644 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnBehaviourPlay(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + + 100663645 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnBehaviourPause(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData) + + + + + + + + + + + 100663646 + System.Void Unity.Formats.USD.UsdRecorderBehaviour::OnFrameEnd(UnityEngine.Playables.Playable, UnityEngine.Playables.FrameData, System.Object) + + + + + + + + + + + + + + 100663647 + Unity.Formats.USD.UsdRecorderBehaviour::UsdRecorderBehaviour() + + + + + + + + + + + Unity.Formats.USD.UsdRecorderClip + + + + 100663648 + USD.NET.Scene Unity.Formats.USD.UsdRecorderClip::get_UsdScene() + + + + + + + + + 100663649 + System.Void Unity.Formats.USD.UsdRecorderClip::set_UsdScene(USD.NET.Scene) + + + + + + + + + 100663650 + Unity.Formats.USD.ExportContext Unity.Formats.USD.UsdRecorderClip::get_Context() + + + + + + + + + + + 100663651 + System.Void Unity.Formats.USD.UsdRecorderClip::set_Context(Unity.Formats.USD.ExportContext) + + + + + + + + + + + 100663652 + UnityEngine.GameObject Unity.Formats.USD.UsdRecorderClip::GetExportRoot(UnityEngine.Playables.PlayableGraph) + + + + + + + + + + + 100663653 + UnityEngine.Timeline.ClipCaps Unity.Formats.USD.UsdRecorderClip::get_clipCaps() + + + + + + + + + + + 100663654 + System.Boolean Unity.Formats.USD.UsdRecorderClip::get_IsUSDZ() + + + + + + + + + 100663655 + UnityEngine.Playables.Playable Unity.Formats.USD.UsdRecorderClip::CreatePlayable(UnityEngine.Playables.PlayableGraph, UnityEngine.GameObject) + + + + + + + + + + + + + + 100663656 + System.Void Unity.Formats.USD.UsdRecorderClip::OnDestroy() + + + + + + + + + + 100663657 + Unity.Formats.USD.UsdRecorderClip::UsdRecorderClip() + + + + + + + + + + + + + + + Unity.Formats.USD.UsdWaitForEndOfFrame + + + + 100663659 + static Unity.Formats.USD.UsdWaitForEndOfFrame Unity.Formats.USD.UsdWaitForEndOfFrame::GetInstance() + + + + + + + + + + + + + + + + + + + + + + 100663660 + static System.Void Unity.Formats.USD.UsdWaitForEndOfFrame::Add(System.Action) + + + + + + + + + + + 100663662 + System.Void Unity.Formats.USD.UsdWaitForEndOfFrame::LateUpdate() + + + + + + + + + + + 100663663 + Unity.Formats.USD.UsdWaitForEndOfFrame::UsdWaitForEndOfFrame() + + + + + + + + + + + Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0 + + + + 100663665 + System.String Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__0(System.String) + + + + + + + + + 100663666 + System.Collections.Generic.IEnumerable[String] Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__1(System.String) + + + + + + + + + 100663667 + System.Int32 Unity.Formats.USD.UsdVariantSet/<>c__DisplayClass5_0::<LoadFromUsd>b__2(System.String) + + + + + + + + + + + Unity.Formats.USD.MeshImportStrategy/<Import>d__5 + + + + 100663670 + System.Boolean Unity.Formats.USD.MeshImportStrategy/<Import>d__5::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter/GeometrySubsets + + + + 100663675 + System.Collections.Generic.Dictionary[String,Int32[]] Unity.Formats.USD.MeshImporter/GeometrySubsets::get_Subsets() + + + + + + + + + 100663676 + System.Void Unity.Formats.USD.MeshImporter/GeometrySubsets::set_Subsets(System.Collections.Generic.Dictionary[String,Int32[]]) + + + + + + + + + 100663677 + Unity.Formats.USD.MeshImporter/GeometrySubsets::GeometrySubsets() + + + + + + + + + + + + + + Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_0 + + + + 100663679 + System.Void Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_0::<BuildMesh_>b__0(USD.NET.Scene, UnityEngine.Material, System.Collections.Generic.List[String]) + + + + + + + + + + + Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_1 + + + + 100663681 + System.Void Unity.Formats.USD.MeshImporter/<>c__DisplayClass5_1::<BuildMesh_>b__1(USD.NET.Scene, UnityEngine.Material, System.Collections.Generic.List[String]) + + + + + + + + + + + Unity.Formats.USD.ShaderImporterBase/<>c__DisplayClass31_0 + + + + 100663695 + System.Boolean Unity.Formats.USD.ShaderImporterBase/<>c__DisplayClass31_0::<MergePrimvars>b__0(System.String) + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/ReadHierJob + + + + 100663696 + System.Void Unity.Formats.USD.HierarchyBuilder/ReadHierJob::Run() + + + + + + + + + + + + + + + + 100663697 + System.Void Unity.Formats.USD.HierarchyBuilder/ReadHierJob::Execute(System.Int32) + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/FindPathsJob + + + + 100663698 + System.Void Unity.Formats.USD.HierarchyBuilder/FindPathsJob::Run() + + + + + + + + + + + + + + + + 100663699 + System.Void Unity.Formats.USD.HierarchyBuilder/FindPathsJob::Execute(System.Int32) + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilder/<>c + + + + 100663702 + System.Boolean Unity.Formats.USD.HierarchyBuilder/<>c::<BeginReading>b__4_0(pxr.SdfPath[]) + + + + + + + + + 100663703 + System.Collections.Generic.IEnumerable[SdfPath] Unity.Formats.USD.HierarchyBuilder/<>c::<BeginReading>b__4_1(pxr.SdfPath[]) + + + + + + + + + + + Unity.Formats.USD.SceneExporter/<>c + + + + 100663706 + System.String Unity.Formats.USD.SceneExporter/<>c::<MergeBonesBelowAnimator>b__8_0(UnityEngine.Transform) + + + + + + + + + 100663707 + System.String Unity.Formats.USD.SceneExporter/<>c::<MergeBonesBelowAnimator>b__8_1(System.String) + + + + + + + + + + + Unity.Formats.USD.SceneImporter/ImportException + + + + 100663708 + Unity.Formats.USD.SceneImporter/ImportException::ImportException() + + + + + + + + + + + 100663709 + Unity.Formats.USD.SceneImporter/ImportException::ImportException(System.String) + + + + + + + + + + + 100663710 + Unity.Formats.USD.SceneImporter/ImportException::ImportException(System.String, System.Exception) + + + + + + + + + + + + + Unity.Formats.USD.SceneImporter/<BuildScene>d__9 + + + + 100663713 + System.Boolean Unity.Formats.USD.SceneImporter/<BuildScene>d__9::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.UsdRecorderBehaviour/<>c__DisplayClass17_0 + + + + 100663728 + System.Void Unity.Formats.USD.UsdRecorderBehaviour/<>c__DisplayClass17_0::<ProcessFrame>b__0() + + + + + + + + + + + Unity.Formats.USD.UsdWaitForEndOfFrame/<WaitForEndOfFrame>d__4 + + + + 100663731 + System.Boolean Unity.Formats.USD.UsdWaitForEndOfFrame/<WaitForEndOfFrame>d__4::MoveNext() + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T] + + + + 100663736 + pxr.SdfPath[] Unity.Formats.USD.HierarchyBuilderFindPathsJobQuery[T]::Find(USD.NET.Scene, pxr.SdfPath) + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportMaterials + + + + + + + Unity.Formats.USD.Examples.ImportMaterialsExample + + + + 100663297 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Update() + + + + + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Awake() + + + + + + + + + + + + + 100663299 + System.Void Unity.Formats.USD.Examples.ImportMaterialsExample::Start() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663300 + System.Boolean Unity.Formats.USD.Examples.ImportMaterialsExample::SetMaterialParameter(UnityEngine.Material, System.String, System.Object) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663301 + static USD.NET.Scene Unity.Formats.USD.Examples.ImportMaterialsExample::CreateSceneWithShading() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.ImportMaterialsExample/ShaderPair + + + + 100663303 + Unity.Formats.USD.Examples.ImportMaterialsExample/ShaderPair::ShaderPair(UnityEngine.Shader, USD.NET.Unity.ShaderSample) + + + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.ImportProcessor + + + + + + + + + Unity.Formats.USD.Examples.CombineMeshes + + + + 100663297 + System.Void Unity.Formats.USD.Examples.CombineMeshes::PostProcessComponents(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + 100663298 + System.Void Unity.Formats.USD.Examples.CombineMeshes::Reset() + + + + + + + + + + + + + + 100663299 + System.Void Unity.Formats.USD.Examples.CombineMeshes::DoCombineMeshes(UnityEngine.Transform) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unity.Formats.USD.Examples.RegexImportProcessor + + + + 100663301 + System.Boolean Unity.Formats.USD.Examples.RegexImportProcessor::IsMatch(pxr.SdfPath) + + + + + + + + + + + + 100663302 + System.Void Unity.Formats.USD.Examples.RegexImportProcessor::InitRegex() + + + + + + + + + + + + + + + 100663303 + static System.String Unity.Formats.USD.Examples.RegexImportProcessor::WildcardToRegex(System.String) + + + + + + + + + + + 100663304 + Unity.Formats.USD.Examples.RegexImportProcessor::RegexImportProcessor() + + + + + + + + + + + + Unity.Formats.USD.Examples.SetHideFlags + + + + 100663305 + System.Void Unity.Formats.USD.Examples.SetHideFlags::PostProcessHierarchy(Unity.Formats.USD.PrimMap, Unity.Formats.USD.SceneImportOptions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100663306 + System.Void Unity.Formats.USD.Examples.SetHideFlags::Reset() + + + + + + + + + + + + + + 100663307 + Unity.Formats.USD.Examples.SetHideFlags::SetHideFlags() + + + + + + + + + + + + + + 0001-01-01T00:00:00 + Unity.Formats.USD.UsdTimelinePlayable + + + + + + + Unity.Formats.USD.Examples.SetDefaultUSDMesh + + + + 100663297 + System.Void Unity.Formats.USD.Examples.SetDefaultUSDMesh::Start() + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TestProject/Usd-Development/Packages/manifest.json b/TestProject/Usd-Development/Packages/manifest.json index 3f4d15fd5..3d33943e6 100644 --- a/TestProject/Usd-Development/Packages/manifest.json +++ b/TestProject/Usd-Development/Packages/manifest.json @@ -1,12 +1,14 @@ { "dependencies": { - "com.unity.analytics": "3.5.3", + "com.unity.analytics": "3.6.12", "com.unity.coding": "0.1.0-preview.20", "com.unity.ext.nunit": "1.0.6", "com.unity.formats.usd": "file:../../../package/com.unity.formats.usd/", - "com.unity.ide.rider": "1.1.4", - "com.unity.recorder": "2.5.5", - "com.unity.test-framework": "1.1.24", + "com.unity.ide.rider": "3.0.16", + "com.unity.ide.visualstudio": "2.0.16", + "com.unity.recorder": "3.0.3", + "com.unity.test-framework": "1.1.31", + "com.unity.testtools.codecoverage": "1.0.1", "com.unity.modules.ai": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", diff --git a/TestProject/Usd-Development/Packages/packages-lock.json b/TestProject/Usd-Development/Packages/packages-lock.json index c2ba41b2e..eb736f882 100644 --- a/TestProject/Usd-Development/Packages/packages-lock.json +++ b/TestProject/Usd-Development/Packages/packages-lock.json @@ -1,7 +1,7 @@ { "dependencies": { "com.unity.analytics": { - "version": "3.5.3", + "version": "3.6.12", "depth": 0, "source": "registry", "dependencies": { @@ -32,20 +32,30 @@ "dependencies": { "com.unity.timeline": "1.0.0", "com.unity.modules.screencapture": "1.0.0", - "com.unity.modules.physics": "1.0.0" + "com.unity.modules.physics": "1.0.0", + "com.unity.test-framework.performance": "2.8.1-preview" } }, "com.unity.ide.rider": { - "version": "1.1.4", + "version": "3.0.16", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.com" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.16", "depth": 0, "source": "registry", "dependencies": { - "com.unity.test-framework": "1.1.1" + "com.unity.test-framework": "1.1.9" }, "url": "https://packages.unity.com" }, "com.unity.recorder": { - "version": "2.5.5", + "version": "3.0.3", "depth": 0, "source": "registry", "dependencies": { @@ -53,8 +63,15 @@ }, "url": "https://packages.unity.com" }, + "com.unity.settings-manager": { + "version": "1.0.3", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.test-framework": { - "version": "1.1.24", + "version": "1.1.31", "depth": 0, "source": "registry", "dependencies": { @@ -64,8 +81,18 @@ }, "url": "https://packages.unity.com" }, + "com.unity.testtools.codecoverage": { + "version": "1.0.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.0.16", + "com.unity.settings-manager": "1.0.1" + }, + "url": "https://packages.unity.com" + }, "com.unity.timeline": { - "version": "1.5.4", + "version": "1.6.4", "depth": 1, "source": "registry", "dependencies": { diff --git a/TestProject/Usd-Development/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/TestProject/Usd-Development/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json new file mode 100644 index 000000000..9c702b9ab --- /dev/null +++ b/TestProject/Usd-Development/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -0,0 +1,28 @@ +{ + "m_Name": "Settings", + "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", + "m_Dictionary": { + "m_DictionaryValues": [ + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "Path", + "value": "{\"m_Value\":\"{ProjectPath}\"}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "HistoryPath", + "value": "{\"m_Value\":\"{ProjectPath}\"}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "IncludeAssemblies", + "value": "{\"m_Value\":\"Unity.Formats.USD.Editor,Unity.Formats.USD.ExportMesh,Unity.Formats.USD.HelloUsd,Unity.Formats.USD.ImportMaterials,Unity.Formats.USD.ImportMesh,Unity.Formats.USD.ImportProcessor,Unity.Formats.USD.Runtime,Unity.Formats.USD.UsdTimelinePlayable\"}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "EnableCodeCoverage", + "value": "{\"m_Value\":true}" + } + ] + } +} \ No newline at end of file diff --git a/package/com.unity.formats.usd/Dependencies/USD.NET.Unity/UnityTypeConverter.cs b/package/com.unity.formats.usd/Dependencies/USD.NET.Unity/UnityTypeConverter.cs index 9f183b676..50c799bfe 100644 --- a/package/com.unity.formats.usd/Dependencies/USD.NET.Unity/UnityTypeConverter.cs +++ b/package/com.unity.formats.usd/Dependencies/USD.NET.Unity/UnityTypeConverter.cs @@ -556,7 +556,7 @@ static public VtVec4fArray ToVtArray(UnityEngine.Color[] input) var output = new VtVec4fArray((uint)input.Length); unsafe { - fixed (UnityEngine.Color* p = input) + fixed(UnityEngine.Color* p = input) { output.CopyFromArray((IntPtr)p); } @@ -581,7 +581,7 @@ static public UnityEngine.Color[] ColorFromVtArray(VtVec4fArray input, } unsafe { - fixed (UnityEngine.Color* p = output) + fixed(UnityEngine.Color* p = output) { input.CopyToArray((IntPtr)p); } @@ -745,7 +745,7 @@ static public VtQuatfArray ToVtArray(UnityEngine.Quaternion[] input) unsafe { // Copy to USD/C++ - fixed (UnityEngine.Quaternion* p = input) + fixed(UnityEngine.Quaternion* p = input) { output.CopyFromArray((IntPtr)p); } @@ -763,7 +763,7 @@ static public UnityEngine.Quaternion[] FromVtArray(VtQuatfArray input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Quaternion* p = output) + fixed(UnityEngine.Quaternion* p = output) { input.CopyToArray((IntPtr)p); } @@ -785,7 +785,7 @@ static public VtQuatfArray ListToVtArray(List input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Quaternion* p = output) + fixed(UnityEngine.Quaternion* p = output) { input.CopyToArray((IntPtr)p); } @@ -804,7 +804,7 @@ static public VtVec4fArray ToVtArray(UnityEngine.Vector4[] input) var output = new VtVec4fArray((uint)input.Length); unsafe { - fixed (UnityEngine.Vector4* p = input) + fixed(UnityEngine.Vector4* p = input) { output.CopyFromArray((IntPtr)p); } @@ -818,7 +818,7 @@ static public UnityEngine.Vector4[] FromVtArray(VtVec4fArray input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Vector4* p = output) + fixed(UnityEngine.Vector4* p = output) { input.CopyToArray((IntPtr)p); } @@ -838,7 +838,7 @@ static public VtVec4fArray ListToVtArray(List input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Vector4* p = output) + fixed(UnityEngine.Vector4* p = output) { input.CopyToArray((IntPtr)p); } @@ -895,7 +895,7 @@ static public VtVec3fArray ToVtArray(UnityEngine.Vector3[] input) var output = new VtVec3fArray((uint)input.Length); unsafe { - fixed (UnityEngine.Vector3* p = input) + fixed(UnityEngine.Vector3* p = input) { output.CopyFromArray((IntPtr)p); } @@ -921,7 +921,7 @@ static public void FromVtArray(VtVec3fArray input, ref UnityEngine.Vector3[] out } unsafe { - fixed (UnityEngine.Vector3* p = output) + fixed(UnityEngine.Vector3* p = output) { input.CopyToArray((IntPtr)p); } @@ -940,7 +940,7 @@ static public VtVec3fArray ListToVtArray(List input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Vector3* p = output) + fixed(UnityEngine.Vector3* p = output) { input.CopyToArray((IntPtr)p); } @@ -957,7 +957,7 @@ static public VtVec2fArray ToVtArray(UnityEngine.Vector2[] input) var output = new VtVec2fArray((uint)input.Length); unsafe { - fixed (UnityEngine.Vector2* p = input) + fixed(UnityEngine.Vector2* p = input) { output.CopyFromArray((IntPtr)p); } @@ -971,7 +971,7 @@ static public UnityEngine.Vector2[] FromVtArray(VtVec2fArray input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Vector2* p = output) + fixed(UnityEngine.Vector2* p = output) { input.CopyToArray((IntPtr)p); } @@ -991,7 +991,7 @@ static public VtVec2fArray ListToVtArray(List input) var output = UsdIo.ArrayAllocator.Malloc(input.size()); unsafe { - fixed (UnityEngine.Vector2* p = output) + fixed(UnityEngine.Vector2* p = output) { input.CopyToArray((IntPtr)p); }