Tress FX settings editor window.
Inheritance: EditorWindow
Ejemplo n.º 1
0
        static void Init()
        {
            // Get existing open window or if none, make a new one:
            TressFXEditorWindow window = (TressFXEditorWindow)EditorWindow.GetWindow(typeof(TressFXEditorWindow));

            window.Show();
        }
Ejemplo n.º 2
0
        public static void CreateAssetTFXB()
        {
            string hairfilePath = EditorUtility.OpenFilePanel("Open TressFX Hair data", "", "tfxb");
            string hairfileName = System.IO.Path.GetFileNameWithoutExtension(hairfilePath);

            // Create new hair asset
            TressFXHair newHairData = ScriptableObjectUtility.CreateAsset <TressFXHair> (hairfileName);

            // Open hair data
            Hair hair = Hair.Import(HairFormat.TFXB, hairfilePath, TressFXEditorWindow.GetImportSettings());

            hair.CreateUVs();
            newHairData.LoadHairData(hair);

            EditorUtility.SetDirty(newHairData);
            AssetDatabase.SaveAssets();
        }
Ejemplo n.º 3
0
        public static void CreateAssetOBJ()
        {
            string hairfilePath = EditorUtility.OpenFilePanel("Open OBJ Hair data", "", "obj");
            string hairfileName = System.IO.Path.GetFileNameWithoutExtension(hairfilePath);

            // Create new hair asset
            TressFXHair newHairData = ScriptableObjectUtility.CreateAsset <TressFXHair>(hairfileName);

            // Open hair data
            Hair hair = Hair.Import(HairFormat.OBJ, hairfilePath, TressFXEditorWindow.GetImportSettings());

            if (TressFXEditorWindow.normalizeVertexCountActive && TressFXEditorWindow.normalizeVertexCount > 2)
            {
                hair.NormalizeStrands(TressFXEditorWindow.normalizeVertexCount);
            }

            hair = hair.PrepareSimulationParamatersAssetConverter(TressFXEditorWindow.followHairCount, TressFXEditorWindow.maxRadiusAroundGuideHair, Application.dataPath + "/" + EditorPrefs.GetString("TressFXAssetConverterPath"));
            hair.CreateUVs();

            newHairData.LoadHairData(hair);

            EditorUtility.SetDirty(newHairData);
            AssetDatabase.SaveAssets();
        }