Example #1
0
        public static bool Initialize()
        {
            if (m_usdInitialized)
            {
                return(true);
            }

            m_usdInitialized = true;

            try {
                // Initializes native USD plugins and ensures plugins are discoverable on the system path.
                SetupUsdPath();

                // Type registration enables automatic conversion from Unity-native types to USD types (e.g.
                // Vector3[] -> VtVec3fArray).
                UnityTypeBindings.RegisterTypes();

                // The DiagnosticHandler propagates USD native errors, warnings and info up to C# exceptions
                // and Debug.Log[Warning] respectively.
                DiagnosticHandler.Register();
            } catch (System.Exception ex) {
                Debug.LogException(ex);
                return(false);
            }
            return(true);
        }