GetImportSettings() public static method

Gets the import settings for the current settings.
public static GetImportSettings ( ) : TressFXLib.HairImportSettings
return TressFXLib.HairImportSettings
Example #1
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();
        }
Example #2
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();
        }