public static void Open(UsdStream stream)
        {
            var window = (UsdPrecomputeNormalsWindow)EditorWindow.GetWindow(typeof(UsdPrecomputeNormalsWindow));

            window.titleContent = new GUIContent("Precompute");
            window.m_stream     = stream;
            window.m_mesh       = null;
            window.Show();
        }
        void Generate()
        {
            UsdStream stream = null;

            int ndone = 0;

            if (m_stream != null)
            {
                stream = m_stream;
                var meshes  = new List <usdi.Mesh>();
                var results = new List <bool>();
                usdi.usdiPreComputeNormalsAll(m_stream.usdiContext, s_genTangents, s_overwrite, (usdi.Mesh mesh, Bool done) => {
                    meshes.Add(mesh);
                    results.Add(done);
                    if (done)
                    {
                        ++ndone;
                    }
                });
                for (int i = 0; i < meshes.Count; ++i)
                {
                    var mesh = meshes[i];
                    if (results[i])
                    {
                        Debug.Log("Precompute done: " + usdi.usdiPrimGetPathS(mesh));
                    }
                    else
                    {
                        Debug.Log("Precompute skipped: " + usdi.usdiPrimGetPathS(mesh));
                    }
                }
            }
            else if (m_mesh != null)
            {
                stream = m_mesh.stream;
                var mesh = m_mesh.nativeMeshPtr;
                var ret  = usdi.usdiMeshPreComputeNormals(mesh, s_genTangents, s_overwrite);
                if (ret)
                {
                    Debug.Log("Precompute done: " + usdi.usdiPrimGetPathS(mesh));
                    ++ndone;
                }
                else
                {
                    Debug.Log("Precompute skipped: " + usdi.usdiPrimGetPathS(mesh));
                }
            }

            if (stream != null && ndone > 0)
            {
                stream.usdiSave();
                stream.usdiReload();
            }
        }
Пример #3
0
 public usdiStreamUpdater(usdi.Context usd, UsdStream stream)
 {
     m_rep = _Ctor(usd, stream);
 }
Пример #4
0
 private static extern IntPtr _Ctor(usdi.Context usd, UsdStream stream);
Пример #5
0
 public usdiStreamUpdaterM(usdi.Context usd, UsdStream stream)
 {
     m_trans = stream.GetComponent <Transform>();
 }